diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java
index 926d31e..adc8938 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/BasicBerryBush.java
@@ -20,6 +20,7 @@
import net.minecraft.state.property.Properties;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
+import net.minecraft.util.ItemInteractionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@@ -29,7 +30,6 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
-@SuppressWarnings("deprecation")
public class BasicBerryBush extends PlantBlock implements BerryBush {
protected static final Vec3d BERRY_BUSH_SLOWING_VECTOR = new Vec3d(0.5D, 0.25D, 0.5D);
protected static final int GROW_CHANCE = 5;
@@ -63,7 +63,7 @@ public BasicBerryBush(Berry berry, int maxAge, VoxelShape smallShape, VoxelShape
* @return what kind of berries this block grows
*/
@Override
- public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
+ public ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state) {
return this.getBerryItem().getDefaultStack();
}
@@ -76,14 +76,6 @@ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos po
return state.get(getAge()) < sizeChangeAge ? smallShape : largeShape;
}
- /**
- * determines whether this block still needs to be random ticked - i.e. whether it can still grow or not
- */
- @Override
- public boolean hasRandomTicks(BlockState state) {
- return state.get(getAge()) < maxAge;
- }
-
/**
* runs when this bush is ticked
* grows the bush if it can, a random throw is met, and light level is high enough
@@ -108,6 +100,17 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
}
}
+ @Override
+ protected ItemInteractionResult onInteract(
+ ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity entity, Hand hand, BlockHitResult hitResult
+ ) {
+ int age = state.get(getAge());
+ boolean isMaxAge = age == getMaxAge();
+ return !isMaxAge && stack.isOf(Items.BONE_MEAL)
+ ? ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION
+ : super.onInteract(stack, state, world, pos, entity, hand, hitResult);
+ }
+
/**
* handles when our berry bush is right-clicked
*
if the player clicking has bone meal, grow the plant if possible or pick berries if fully grown
@@ -115,17 +118,15 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
* @return whether the action fails or passes
*/
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
final int currentAge = state.get(getAge());
// if bone meal is allowed to be used, pass action
- if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) {
- return ActionResult.PASS;
- } else if (currentAge == maxAge) {
+ if (currentAge == maxAge) {
// otherwise, give berries/unripe berries
return pickBerries(pos, world, state, this.getBerryItem());
} else {
// otherwise, do default use action from superclass
- return super.onUse(state, world, pos, player, hand, hit);
+ return super.onUse(state, world, pos, entity, hitResult);
}
}
@@ -156,13 +157,13 @@ protected void appendProperties(StateManager.Builder builder)
@Override
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) {
// hasRandomTicks checks the same thing as this method
- return hasRandomTicks(state);
+ return state.hasRandomTicks();
}
@Override
public boolean canFertilize(World world, RandomGenerator random, BlockPos pos, BlockState state) {
// hasRandomTicks checks the same thing as this method
- return hasRandomTicks(state);
+ return state.hasRandomTicks();
}
@Override
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/BerryHarvesterBlock.java b/src/main/java/io/ix0rai/bodacious_berries/block/BerryHarvesterBlock.java
index 1c5bac4..a943b04 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/BerryHarvesterBlock.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/BerryHarvesterBlock.java
@@ -1,5 +1,6 @@
package io.ix0rai.bodacious_berries.block;
+import com.mojang.serialization.MapCodec;
import io.ix0rai.bodacious_berries.block.entity.BerryHarvesterBlockEntity;
import io.ix0rai.bodacious_berries.registry.BodaciousBlocks;
import net.minecraft.block.Block;
@@ -33,6 +34,12 @@ public BerryHarvesterBlock(Settings settings) {
this.setDefaultState(this.getStateManager().getDefaultState().with(FACING, Direction.NORTH));
}
+ @Override
+ protected MapCodec extends BlockWithEntity> getCodec() {
+ // todo
+ return null;
+ }
+
@Override
protected void appendProperties(StateManager.Builder builder) {
builder.add(FACING);
@@ -62,12 +69,12 @@ public BlockRenderType getRenderType(BlockState state) {
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
if (!world.isClient) {
// create screen
NamedScreenHandlerFactory screenHandlerFactory = state.createScreenHandlerFactory(world, pos);
if (screenHandlerFactory != null) {
- player.openHandledScreen(screenHandlerFactory);
+ entity.openHandledScreen(screenHandlerFactory);
}
}
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java b/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java
index a392459..d2e83b5 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java
@@ -13,6 +13,7 @@
import net.minecraft.state.property.IntProperty;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
+import net.minecraft.util.ItemInteractionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.random.RandomGenerator;
@@ -20,7 +21,6 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
-@SuppressWarnings("deprecation")
public class BerryVine extends VineBlock implements BerryBush {
protected static final int MAX_AGE = 3;
protected static final int MAX_BERRY_AMOUNT = 3;
@@ -34,7 +34,7 @@ public BerryVine(Berry berry) {
}
@Override
- public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
+ public ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state) {
return this.getBerryItem().getDefaultStack();
}
@@ -60,13 +60,20 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
- if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) {
- return ActionResult.PASS;
- } else if (state.get(AGE) == MAX_AGE) {
+ protected ItemInteractionResult onInteract(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity entity, Hand hand, BlockHitResult hitResult) {
+ int age = state.get(AGE);
+ boolean isMaxAge = age == MAX_AGE;
+ return !isMaxAge && stack.isOf(Items.BONE_MEAL)
+ ? ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION
+ : super.onInteract(stack, state, world, pos, entity, hand, hitResult);
+ }
+
+ @Override
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
+ if (state.get(AGE) == MAX_AGE) {
return BasicBerryBush.pickBerries(pos, world, state, this.getBerryItem());
} else {
- return super.onUse(state, world, pos, player, hand, hit);
+ return super.onUse(state, world, pos, entity, hitResult);
}
}
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java
index 836e7ef..386612a 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java
@@ -52,9 +52,9 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
if (Boolean.FALSE.equals(state.get(DYING))) {
- super.onUse(state, world, pos, player, hand, hit);
+ super.onUse(state, world, pos, entity, hitResult);
}
return ActionResult.FAIL;
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java
index 642bc4d..a4f2e69 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java
@@ -16,6 +16,7 @@
import net.minecraft.state.property.Properties;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
+import net.minecraft.util.ItemInteractionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@@ -24,7 +25,6 @@
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
-@SuppressWarnings("deprecation")
public class DoubleBerryBush extends TallPlantBlock implements BerryBush {
public static final int MAX_AGE = 3;
public static final IntProperty AGE = Properties.AGE_3;
@@ -40,7 +40,7 @@ public DoubleBerryBush(Berry berry) {
}
@Override
- public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
+ public ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state) {
return this.getBerryItem().getDefaultStack();
}
@@ -91,13 +91,22 @@ public void grow(ServerWorld world, BlockPos pos, BlockState state, int newAge)
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ protected ItemInteractionResult onInteract(ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity entity, Hand hand, BlockHitResult hitResult) {
+ int age = state.get(AGE);
+ boolean isMaxAge = age == MAX_AGE;
+ return !isMaxAge && stack.isOf(Items.BONE_MEAL)
+ ? ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION
+ : super.onInteract(stack, state, world, pos, entity, hand, hitResult);
+ }
+
+ @Override
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hitResult) {
if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) {
return ActionResult.PASS;
} else if (state.get(getAge()) == MAX_AGE) {
return BasicBerryBush.pickBerries(pos, world, state, this.getBerryItem());
} else {
- return super.onUse(state, world, pos, player, hand, hit);
+ return super.onUse(state, world, pos, player, hitResult);
}
}
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/GrowingBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/GrowingBerryBush.java
index 750195a..bcd0f31 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/GrowingBerryBush.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/GrowingBerryBush.java
@@ -4,12 +4,14 @@
import net.minecraft.block.BlockState;
import net.minecraft.block.TallPlantBlock;
import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.property.IntProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
+import net.minecraft.util.ItemInteractionResult;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.random.RandomGenerator;
@@ -33,11 +35,6 @@ public void grow(ServerWorld world, BlockPos pos, BlockState state, int newAge)
}
}
- @Override
- public boolean hasRandomTicks(BlockState state) {
- return state.get(getAge()) <= maxAge;
- }
-
@Override
public void randomTick(BlockState state, ServerWorld world, BlockPos pos, RandomGenerator random) {
int age = state.get(getAge());
@@ -47,9 +44,20 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ protected ItemInteractionResult onInteract(
+ ItemStack stack, BlockState state, World world, BlockPos pos, PlayerEntity entity, Hand hand, BlockHitResult hitResult
+ ) {
+ int i = state.get(getAge());
+ boolean isMaxAge = i == 3;
+ return !isMaxAge && stack.isOf(Items.BONE_MEAL)
+ ? ItemInteractionResult.SKIP_DEFAULT_BLOCK_INTERACTION
+ : super.onInteract(stack, state, world, pos, entity, hand, hitResult);
+ }
+
+ @Override
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
// a GrowingBerryBush cannot produce berries until it grows to its double bush state
- if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) {
+ if (state.hasRandomTicks() && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) {
final int newAge = Math.min(maxAge, state.get(getAge()) + 1);
// grow to a double bush if new age exceeds maximum
if (newAge > maxAge) {
diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java b/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java
index cd94730..dc8f5c2 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java
@@ -44,7 +44,7 @@ public BlockRenderType getRenderType(BlockState state) {
}
@Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity entity, BlockHitResult hitResult) {
if (!world.isClient) {
// create screen
NamedScreenHandlerFactory screenHandlerFactory = state.createScreenHandlerFactory(world, pos);
diff --git a/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java b/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java
index a1b65d3..6189279 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java
@@ -7,10 +7,11 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.SimpleOptionsScreen;
+import net.minecraft.client.option.Option;
import org.jetbrains.annotations.Nullable;
+import java.util.ArrayList;
import java.util.function.Consumer;
-import java.util.function.Supplier;
import static io.ix0rai.bodacious_berries.BodaciousBerries.CONFIG;
@@ -19,55 +20,23 @@
*/
@Environment(EnvType.CLIENT)
public class BodaciousConfigScreen extends SimpleOptionsScreen {
- private final SpruceOption resetOption;
- private final SpruceOption[] generationOptions = new SpruceOption[Berry.values().length];
public BodaciousConfigScreen(@Nullable Screen parent) {
- super(BodaciousBerries.translatableText("config.title"));
+ super(parent, MinecraftClient.getInstance().options, BodaciousBerries.translatableText("config.title"), createOptions());
+ }
+ private static Option[] createOptions() {
+ var options = new ArrayList<>();
for (Berry berry : Berry.values()) {
- generationOptions[berry.ordinal()] = createGenOption(berry.toString(),
- () -> CONFIG.isGenerating(berry),
+ options.add(createGenOption(berry.toString(),
value -> CONFIG.setGenerating(berry, value)
- );
+ ));
}
- this.resetOption = SpruceSimpleActionOption.reset(btn -> {
- CONFIG.reset();
- MinecraftClient client = MinecraftClient.getInstance();
- this.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
- });
- }
-
- private SpruceBooleanOption createGenOption(String key, Supplier getter, Consumer setter) {
- return new SpruceBooleanOption(BodaciousBerries.translatableTextKey("config." + "generate_" + key),
- getter,
- setter,
- null
- );
+ return options.stream().toArray(Option[]::new);
}
- @Override
- protected void init() {
- super.init();
-
- int buttonHeight = 20;
-
- SpruceOptionListWidget options = new SpruceOptionListWidget(Position.of(0, 22), this.width, this.height - (35 + 22));
- for (int i = 0; i < Berry.values().length; i += 2) {
- SpruceOption secondToggle = null;
- if (i + 1 < Berry.values().length) {
- secondToggle = generationOptions[i + 1];
- }
- options.addOptionEntry(generationOptions[i], secondToggle);
- }
- this.addDrawableChild(options);
-
- // reset button
- this.addDrawableChild(this.resetOption.createWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150));
- // done button
- this.addDrawableChild(new SpruceButtonWidget(Position.of(this, this.width / 2 - 155 + 160, this.height - 29), 150,
- buttonHeight, SpruceTexts.GUI_DONE,
- buttonWidget -> this.closeScreen()));
+ private static Option createGenOption(String key, Consumer setter) {
+ return Option.ofBoolean(BodaciousBerries.translatableTextKey("config." + "generate_" + key), true, setter);
}
}
\ No newline at end of file
diff --git a/src/main/java/io/ix0rai/bodacious_berries/item/GojiBerryBlend.java b/src/main/java/io/ix0rai/bodacious_berries/item/GojiBerryBlend.java
index ed41008..e516cb2 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/item/GojiBerryBlend.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/item/GojiBerryBlend.java
@@ -20,7 +20,7 @@ public ItemStack finishUsing(ItemStack stack, World world, LivingEntity user) {
Iterator iterator = user.getStatusEffects().iterator();
do {
StatusEffectInstance instance = iterator.next();
- if (instance.getEffectType().getType().equals(StatusEffectType.HARMFUL)) {
+ if (instance.getEffectType().value().getType().equals(StatusEffectType.HARMFUL)) {
user.removeStatusEffect(instance.getEffectType());
}
} while (iterator.hasNext());
diff --git a/src/main/java/io/ix0rai/bodacious_berries/item/Rainberries.java b/src/main/java/io/ix0rai/bodacious_berries/item/Rainberries.java
index 22eb9a6..9cd1c31 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/item/Rainberries.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/item/Rainberries.java
@@ -14,7 +14,6 @@
import net.minecraft.world.World;
public class Rainberries extends AliasedBlockItem {
- private final FoodComponent foodComponent = new FoodComponent.Builder().hunger(3).saturationModifier(1.0F).build();
public Rainberries(Block block, Settings settings) {
super(block, settings);
}
@@ -34,9 +33,4 @@ public TypedActionResult use(World world, PlayerEntity user, Hand han
return TypedActionResult.success(stack);
}
-
- @Override
- public FoodComponent getFoodComponent() {
- return foodComponent;
- }
}
diff --git a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousItems.java b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousItems.java
index 638e89a..97cde60 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousItems.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousItems.java
@@ -26,12 +26,12 @@ public class BodaciousItems {
public static final AliasedBlockItem RASPBERRIES = new AliasedBlockItem(BodaciousBushes.RASPBERRY_BUSH, settings(3, 0.5f));
public static final AliasedBlockItem BLACKBERRIES = new AliasedBlockItem(BodaciousBushes.BLACKBERRY_BUSH, settings(1, 1.5f));
public static final AliasedBlockItem CHORUS_BERRIES = new ChorusBerries(BodaciousBushes.CHORUS_BERRY_BUSH, settings(2, 1.6f));
- public static final AliasedBlockItem RAINBERRIES = new Rainberries(BodaciousBushes.RAINBERRY_BUSH, new Item.Settings());
+ public static final AliasedBlockItem RAINBERRIES = new Rainberries(BodaciousBushes.RAINBERRY_BUSH, settings(3, 1.0f));
public static final AliasedBlockItem LINGONBERRIES = new AliasedBlockItem(BodaciousBushes.LINGONBERRY_BUSH, settings(2, 0.5f));
public static final AliasedBlockItem GRAPES = new AliasedBlockItem(BodaciousBushes.GRAPEVINE, settings(2, 1f));
public static final AliasedBlockItem GOJI_BERRIES = new GojiBerries(BodaciousBushes.GOJI_BERRY_BUSH, settings(1, 2.2f));
public static final AliasedBlockItem GOOSEBERRIES = new AliasedBlockItem(BodaciousBushes.GOOSEBERRY_BUSH, settings(2, 0.5f));
- public static final AliasedBlockItem CLOUDBERRIES = new AliasedBlockItem(BodaciousBushes.CLOUDBERRY_BUSH, new Item.Settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(1f).statusEffect(new StatusEffectInstance(StatusEffects.SLOW_FALLING, 600, 1), 1).snack().build()));
+ public static final AliasedBlockItem CLOUDBERRIES = new AliasedBlockItem(BodaciousBushes.CLOUDBERRY_BUSH, new Item.Settings().food(new FoodComponent.Builder().hunger(2).saturation(1f).statusEffect(new StatusEffectInstance(StatusEffects.SLOW_FALLING, 600, 1), 1).snack().build()));
public static void register() {
register(SASKATOON_BERRIES, Berry.SASKATOON_BERRIES);
@@ -62,6 +62,6 @@ private static void register(Item item, Berry id) {
}
private static Item.Settings settings(int hunger, float saturation) {
- return new Item.Settings().food(new FoodComponent.Builder().hunger(hunger).saturationModifier(saturation).snack().build());
+ return new Item.Settings().food(new FoodComponent.Builder().hunger(hunger).saturation(saturation).snack().build());
}
}
diff --git a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousStatusEffects.java b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousStatusEffects.java
index 719360a..0c572aa 100644
--- a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousStatusEffects.java
+++ b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousStatusEffects.java
@@ -10,8 +10,8 @@
public class BodaciousStatusEffects {
public static final StatusEffect REFRESHED = new RefreshedStatusEffect(StatusEffectType.BENEFICIAL, 0xFF0066)
- .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, "91AEAA56-9090-4498-935B-2F7F68170635", 0.015, EntityAttributeModifier.Operation.ADDITION)
- .addAttributeModifier(EntityAttributes.GENERIC_ATTACK_DAMAGE, "CE8BEBC6-9090-4864-B372-C8C36A054156", 0.5, EntityAttributeModifier.Operation.ADDITION);
+ .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, "91AEAA56-9090-4498-935B-2F7F68170635", 0.015, EntityAttributeModifier.Operation.ADD_VALUE)
+ .addAttributeModifier(EntityAttributes.GENERIC_ATTACK_DAMAGE, "CE8BEBC6-9090-4864-B372-C8C36A054156", 0.5, EntityAttributeModifier.Operation.ADD_VALUE);
public static void register() {
Registry.register(Registries.STATUS_EFFECT, BodaciousBerries.id("refreshed"), REFRESHED);