-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
921032f
commit d8766f8
Showing
5 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/net/zepalesque/redux/event/listener/RegistryListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.zepalesque.redux.event.listener; | ||
|
||
import com.aetherteam.aether.item.food.GummySwetItem; | ||
import net.minecraft.core.component.DataComponents; | ||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.EventBusSubscriber; | ||
import net.neoforged.neoforge.event.ModifyDefaultComponentsEvent; | ||
import net.zepalesque.redux.Redux; | ||
import net.zepalesque.redux.item.property.ReduxFoods; | ||
|
||
@EventBusSubscriber(modid = Redux.MODID, bus = EventBusSubscriber.Bus.MOD) | ||
public class RegistryListener { | ||
|
||
@SubscribeEvent | ||
public static void modifyComponents(ModifyDefaultComponentsEvent event) { | ||
if (true) // TODO: Config | ||
event.modifyMatching(item -> item instanceof GummySwetItem, builder -> builder.set(DataComponents.FOOD, ReduxFoods.GUMMY_SWET_NERF)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/net/zepalesque/redux/mixin/mixins/common/item/ItemMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.zepalesque.redux.mixin.mixins.common.item; | ||
|
||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.food.FoodProperties; | ||
import net.minecraft.world.inventory.ClickAction; | ||
import net.minecraft.world.inventory.Slot; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(Item.class) | ||
public class ItemMixin { | ||
|
||
@Inject(method = "getFood", at = @At("RETURN"), cancellable = true) | ||
public void getFoodProperties(CallbackInfoReturnable<FoodProperties> cir) { | ||
} | ||
|
||
|
||
@Inject(method = "overrideStackedOnOther", at = @At("RETURN"), cancellable = true) | ||
protected void overrideStackedOnOther(ItemStack stack, Slot slot, ClickAction action, Player player, CallbackInfoReturnable<Boolean> cir) { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters