Skip to content

Commit

Permalink
feat: stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 16, 2025
1 parent 921032f commit d8766f8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 2 deletions.
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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
public class ReduxFoods {

public static final FoodProperties WYND_OATS = new FoodProperties.Builder().fast().nutrition(1).saturationModifier(0F).build();
public static final FoodProperties GUMMY_SWET_NERF = (new FoodProperties.Builder()).fast().nutrition(7).saturationModifier(0.6F).build();

}
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) {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ private void placeSpine(LevelSimulatedReader level, FoliageSetter setter, Random
boolean extendAbove = false;

// Place inner spine part
for (int i = -1; i < 7; i++) {
boolean isHighest = i == 6;
for (int i = -1; i < 8; i++) {
boolean isHighest = i == 7;
boolean isLowest = i == -1;
boolean place = (!isLowest && !isHighest) || rand.nextBoolean();
if (place) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/aether_redux.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"common.entity.ai.SliderBackOffMixin",
"common.entity.ai.SliderUpDownMixin",
"common.item.DiggerItemMixin",
"common.item.ItemMixin",
"common.item.PickaxeItemMixin",
"common.world.structure.AetherTemplateStructurePieceMixin",
"common.world.structure.BronzeBossMixin",
Expand Down

0 comments on commit d8766f8

Please sign in to comment.