diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27112c6c..6ec2e42b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,11 +8,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up JDK 17 + - name: set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: grant execute permission for gradlew run: chmod +x gradlew - name: build with gradle diff --git a/build.gradle b/build.gradle index 5910d829..ecbe33b0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "fabric-loom" version "1.2.4" + id "fabric-loom" version "1.6.+" id "io.github.juuxel.loom-quiltflower" version "1.10.0" id "com.github.johnrengelman.shadow" version "7.1.2" id "java-library" @@ -11,6 +11,14 @@ int javaVersion = Integer.parseInt(project.java_version) sourceCompatibility = javaVersion targetCompatibility = javaVersion +loom { + runs { + client { + vmArgs "-Dfabric-tag-conventions-v1.legacyTagWarning=DEV_VERBOSE" + } + } +} + repositories { maven { url = "https://maven.gegy.dev/" } maven { url = "https://maven.terraformersmc.com/releases/" } @@ -39,7 +47,6 @@ dependencies { // dependencies for config shadow("com.electronwill.night-config:core:${project.night_config_version}") shadow("com.electronwill.night-config:toml:${project.night_config_version}") - include(modImplementation("dev.lambdaurora:spruceui:${project.spruceui_version}")) modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}") { transitive = false } // fabric api diff --git a/gradle.properties b/gradle.properties index 68bf53b6..9efd22e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,21 +3,20 @@ org.gradle.jvmargs=-Xmx1G # fabric properties # check these on https://fabricmc.net/versions.html -minecraft_version=1.20.2 -quilt_mappings=1 -loader_version=0.14.22 +minecraft_version=1.20.6 +quilt_mappings=3 +loader_version=0.15.10 # mod properties -java_version = 17 -mod_version = 2.1.1+mc1.20.2 +java_version = 21 +mod_version = 2.1.1+mc1.20.6 maven_group = io.ix0rai.bodacious_berries archives_base_name = bodacious_berries # mod dependencies -fabric_api_version=0.89.3+1.20.2 -emi_version=1.0.21+1.20.2 -spruceui_version=5.0.3+1.20.2 -mod_menu_version=8.0.0 +fabric_api_version=0.97.8+1.20.6 +emi_version=1.1.6+1.20.6 +mod_menu_version=10.0.0-beta.1 # other dependencies night_config_version=3.6.6 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79..e6441136 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c85a1f7..b82aa23a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb..1aa94a42 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..25da30db 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail 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 926d31ef..72c6b9dd 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 @@ -92,7 +84,7 @@ public boolean hasRandomTicks(BlockState state) { public void randomTick(BlockState state, ServerWorld world, BlockPos pos, RandomGenerator random) { int age = state.get(getAge()); // if the age isn't maximum and the light level is high enough grow the bush - if (age <= maxAge && random.nextInt(GROW_CHANCE) == 0 && world.getBaseLightLevel(pos.up(), 0) >= 9) { + if (age < maxAge && random.nextInt(GROW_CHANCE) == 0 && world.getBaseLightLevel(pos.up(), 0) >= 9) { grow(world, pos, state, age + 1); } } @@ -103,11 +95,22 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random */ @Override public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { - if (entity instanceof LivingEntity && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) < sizeChangeAge) { + if (entity instanceof LivingEntity && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) >= sizeChangeAge) { entity.setMovementMultiplier(state, BERRY_BUSH_SLOWING_VECTOR); } } + @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); } } @@ -155,14 +156,12 @@ 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.get(getAge()) < getMaxAge(); } @Override public boolean canFertilize(World world, RandomGenerator random, BlockPos pos, BlockState state) { - // hasRandomTicks checks the same thing as this method - return hasRandomTicks(state); + return isFertilizable(world, pos, state); } @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 1c5bac48..a943b041 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 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 a3924597..ef8a7799 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/BerryVine.java @@ -13,14 +13,13 @@ 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; -import net.minecraft.world.BlockView; 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 +33,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(); } @@ -43,11 +42,6 @@ protected void appendProperties(StateManager.Builder builder) builder.add(AGE, UP, NORTH, EAST, SOUTH, WEST); } - @Override - public boolean hasRandomTicks(BlockState state) { - return state.get(AGE) < MAX_AGE; - } - @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, RandomGenerator random) { super.randomTick(state, world, pos, random); @@ -60,13 +54,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); } } @@ -97,12 +98,12 @@ public int getMaxBerryAmount() { @Override public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) { - return this.hasRandomTicks(state); + return state.get(getAge()) < MAX_AGE; } @Override public boolean canFertilize(World world, RandomGenerator random, BlockPos pos, BlockState state) { - return this.hasRandomTicks(state); + return isFertilizable(world, pos, state); } @Override 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 836e7ef3..9ff1d160 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/CloudberryBush.java @@ -9,7 +9,6 @@ import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.random.RandomGenerator; @@ -30,11 +29,6 @@ protected void appendProperties(StateManager.Builder builder) super.appendProperties(builder); } - @Override - public boolean hasRandomTicks(BlockState state) { - return true; - } - @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, RandomGenerator random) { if (Boolean.TRUE.equals(state.get(DYING))) { @@ -52,9 +46,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 642bc4d0..ba43f8f9 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/DoubleBerryBush.java @@ -16,15 +16,14 @@ 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; import net.minecraft.util.random.RandomGenerator; -import net.minecraft.world.BlockView; 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 +39,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(); } @@ -56,11 +55,6 @@ protected void appendProperties(StateManager.Builder builder) builder.add(getAge()).add(HALF); } - @Override - public boolean hasRandomTicks(BlockState state) { - return state.get(getAge()) < MAX_AGE; - } - @Override public void randomTick(BlockState state, ServerWorld world, BlockPos pos, RandomGenerator random) { int age = state.get(getAge()); @@ -72,12 +66,12 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random @Override public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state) { - return hasRandomTicks(state); + return state.get(getAge()) < MAX_AGE; } @Override public boolean canFertilize(World world, RandomGenerator random, BlockPos pos, BlockState state) { - return hasRandomTicks(state); + return isFertilizable(world, pos, state); } @Override @@ -91,13 +85,20 @@ 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) { - if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) { - return ActionResult.PASS; - } else if (state.get(getAge()) == 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 player, BlockHitResult hitResult) { + 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 750195a4..3e5e79d6 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,13 @@ 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 +34,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,19 +43,22 @@ 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) { - // a GrowingBerryBush cannot produce berries until it grows to its double bush state - if (hasRandomTicks(state) && player.getStackInHand(hand).isOf(Items.BONE_MEAL)) { + 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 == getMaxAge(); + if (isMaxAge && stack.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) { TallPlantBlock.placeAt(world, futureBush.getDefaultState(), pos, Block.NOTIFY_LISTENERS); } - return ActionResult.PASS; + return ItemInteractionResult.CONSUME; } - return ActionResult.FAIL; + return super.onInteract(stack, state, world, pos, entity, hand, hitResult); } @Override 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 cd94730c..b4655957 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/JuicerBlock.java @@ -1,5 +1,6 @@ package io.ix0rai.bodacious_berries.block; +import com.mojang.serialization.MapCodec; import io.ix0rai.bodacious_berries.block.entity.JuicerBlockEntity; import io.ix0rai.bodacious_berries.registry.BodaciousBlocks; import net.minecraft.block.Block; @@ -14,20 +15,25 @@ import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; import net.minecraft.util.ItemScatterer; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -@SuppressWarnings("deprecation") public class JuicerBlock extends BlockWithEntity { public static final BooleanProperty RUNNING = BooleanProperty.of("running"); + public static final MapCodec CODEC = createCodec(JuicerBlock::new); + public JuicerBlock(Settings settings) { super(settings); this.setDefaultState(this.getDefaultState().with(RUNNING, false)); } + @Override + protected MapCodec getCodec() { + return CODEC; + } + @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new JuicerBlockEntity(pos, state); @@ -44,7 +50,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 player, BlockHitResult hitResult) { if (!world.isClient) { // create screen NamedScreenHandlerFactory screenHandlerFactory = state.createScreenHandlerFactory(world, pos); diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java b/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java index f71a34f0..1f587a73 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/SpikedBerryBush.java @@ -32,8 +32,11 @@ public SpikedBerryBush(Berry berry, int maxAge, VoxelShape smallShape, VoxelShap public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { super.onEntityCollision(state, world, pos, entity); - if (!(world.isClient) && movedMinDistance(entity) && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) < sizeChangeAge) { - entity.damage(world.getDamageSources().sweetBerryBush(), damage); + if (!(world.isClient) && !UNSLOWED_ENTITIES.contains(entity.getType()) && state.get(getAge()) >= sizeChangeAge) { + boolean movedMinDistance = movedMinDistance(entity); + if (movedMinDistance) { + entity.damage(world.getDamageSources().sweetBerryBush(), damage); + } } } diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/entity/BerryHarvesterBlockEntity.java b/src/main/java/io/ix0rai/bodacious_berries/block/entity/BerryHarvesterBlockEntity.java index 376cd41f..d814ad52 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/entity/BerryHarvesterBlockEntity.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/entity/BerryHarvesterBlockEntity.java @@ -20,6 +20,7 @@ import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; +import net.minecraft.registry.HolderLookup; import net.minecraft.screen.NamedScreenHandlerFactory; import net.minecraft.screen.ScreenHandler; import net.minecraft.sound.SoundCategory; @@ -40,14 +41,13 @@ public BerryHarvesterBlockEntity(BlockPos pos, BlockState state) { } @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); - Inventories.readNbt(nbt, inventory); + public void method_11014(NbtCompound nbt, HolderLookup.Provider lookupProvider) { + Inventories.readNbt(nbt, inventory, lookupProvider); } @Override - public void writeNbt(NbtCompound nbt) { - Inventories.writeNbt(nbt, inventory); + public void writeNbt(NbtCompound nbt, HolderLookup.Provider lookupProvider) { + Inventories.writeNbt(nbt, inventory, lookupProvider); } @Override @@ -56,8 +56,8 @@ public Packet toUpdatePacket() { } @Override - public NbtCompound toSyncedNbt() { - return toNbt(); + public NbtCompound toSyncedNbt(HolderLookup.Provider lookupProvider) { + return toNbt(lookupProvider); } public static void tick(World world, BlockPos pos, BlockState state, BerryHarvesterBlockEntity harvester) { diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerBlockEntity.java b/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerBlockEntity.java index 80b6d8b2..a588e8e2 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerBlockEntity.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerBlockEntity.java @@ -18,6 +18,7 @@ import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.RecipeHolder; +import net.minecraft.registry.HolderLookup; import net.minecraft.screen.ArrayPropertyDelegate; import net.minecraft.screen.NamedScreenHandlerFactory; import net.minecraft.screen.PropertyDelegate; @@ -66,14 +67,13 @@ public JuicerBlockEntity(BlockPos pos, BlockState state) { } @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); - Inventories.readNbt(nbt, inventory); + public void method_11014(NbtCompound nbt, HolderLookup.Provider lookupProvider) { + Inventories.readNbt(nbt, inventory, lookupProvider); } @Override - public void writeNbt(NbtCompound nbt) { - Inventories.writeNbt(nbt, inventory); + public void writeNbt(NbtCompound nbt, HolderLookup.Provider lookupProvider) { + Inventories.writeNbt(nbt, inventory, lookupProvider); } @Override diff --git a/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerRecipe.java b/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerRecipe.java index 8cc40138..c408449d 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerRecipe.java +++ b/src/main/java/io/ix0rai/bodacious_berries/block/entity/JuicerRecipe.java @@ -4,17 +4,19 @@ import com.mojang.datafixers.util.Either; import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import io.ix0rai.bodacious_berries.BodaciousBerries; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; -import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.RegistryByteBuf; +import net.minecraft.network.codec.PacketCodec; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeHolder; import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.RecipeType; -import net.minecraft.registry.DynamicRegistryManager; +import net.minecraft.registry.HolderLookup; import net.minecraft.registry.Registries; import net.minecraft.server.MinecraftServer; import net.minecraft.util.collection.DefaultedList; @@ -77,8 +79,8 @@ public boolean matches(Inventory inv, World world) { } @Override - public ItemStack craft(Inventory inventory, DynamicRegistryManager registryManager) { - return getResult(registryManager).copy(); + public ItemStack craft(Inventory inventory, HolderLookup.Provider provider) { + return getResult(provider).copy(); } @Override @@ -87,7 +89,7 @@ public boolean fits(int width, int height) { } @Override - public ItemStack getResult(DynamicRegistryManager registryManager) { + public ItemStack getResult(HolderLookup.Provider provider) { return this.result; } @@ -162,15 +164,15 @@ private static boolean check(Predicate function) { */ public record IngredientSet(Ingredient ingredient0, Ingredient ingredient1, Ingredient ingredient2, Ingredient receptacle) { private static final Codec ALL_CODEC = RecordCodecBuilder.create((instance) -> instance.group( - Ingredient.field_46095.fieldOf("all").forGetter((set) -> set.ingredient0), - Ingredient.field_46095.fieldOf("receptacle").forGetter((set) -> set.receptacle) + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("all").forGetter((set) -> set.ingredient0), + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("receptacle").forGetter((set) -> set.receptacle) ).apply(instance, (ingredient, receptacle) -> new IngredientSet(ingredient, ingredient, ingredient, receptacle))); private static final Codec INDIVIDUAL_CODEC = RecordCodecBuilder.create((instance) -> instance.group( - Ingredient.field_46095.fieldOf("0").forGetter((set) -> set.ingredient0), - Ingredient.field_46095.fieldOf("1").forGetter((set) -> set.ingredient1), - Ingredient.field_46095.fieldOf("2").forGetter((set) -> set.ingredient2), - Ingredient.field_46095.fieldOf("receptacle").forGetter((set) -> set.receptacle) + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("0").forGetter((set) -> set.ingredient0), + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("1").forGetter((set) -> set.ingredient1), + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("2").forGetter((set) -> set.ingredient2), + Ingredient.DISALLOW_EMPTY_CODEC.fieldOf("receptacle").forGetter((set) -> set.receptacle) ).apply(instance, IngredientSet::new)); private static final Codec> EITHER_CODEC = Codec.either( @@ -194,32 +196,53 @@ private boolean ingredientsMatch() { } public static class Serializer implements RecipeSerializer { - private static final Codec CODEC = RecordCodecBuilder.create((instance) -> instance.group( - IngredientSet.CODEC.fieldOf("ingredients").forGetter((recipe) -> new IngredientSet(recipe.ingredient0, recipe.ingredient1, recipe.ingredient2, recipe.receptacle)), - Registries.ITEM.getCodec().xmap(ItemStack::new, ItemStack::getItem).fieldOf("result").forGetter((recipe) -> recipe.result) + private static final MapCodec CODEC = RecordCodecBuilder.mapCodec((instance) -> instance.group( + IngredientSet.CODEC.fieldOf("ingredients").forGetter((recipe) -> { + if (recipe instanceof JuicerRecipe juicerRecipe) { + return new IngredientSet(juicerRecipe.ingredient0, juicerRecipe.ingredient1, juicerRecipe.ingredient2, juicerRecipe.receptacle); + } else { + throw new RuntimeException("recipe error"); + } + }), + Registries.ITEM.getCodec().xmap(ItemStack::new, ItemStack::getItem).fieldOf("result").forGetter((recipe) -> { + if (recipe instanceof JuicerRecipe juicerRecipe) { + return juicerRecipe.result; + } else { + throw new RuntimeException("recipe error"); + } + }) ).apply(instance, (set, result) -> new JuicerRecipe(set.ingredient0(), set.ingredient1(), set.ingredient2(), set.receptacle(), result))); + private final PacketCodec packetCodec; + + public Serializer() { + packetCodec = PacketCodec.create(this::write, this::read); + } + + public JuicerRecipe read(RegistryByteBuf buf) { + Ingredient input1 = Ingredient.PACKET_CODEC.decode(buf); + Ingredient input2 = Ingredient.PACKET_CODEC.decode(buf); + Ingredient input3 = Ingredient.PACKET_CODEC.decode(buf); + Ingredient receptacle = Ingredient.PACKET_CODEC.decode(buf); + ItemStack result = ItemStack.PACKET_CODEC.decode(buf); + return new JuicerRecipe(input1, input2, input3, receptacle, result); + } - @Override - public JuicerRecipe read(PacketByteBuf buf) { - Ingredient input1 = Ingredient.fromPacket(buf); - Ingredient input2 = Ingredient.fromPacket(buf); - Ingredient input3 = Ingredient.fromPacket(buf); - Ingredient receptacle = Ingredient.fromPacket(buf); - return new JuicerRecipe(input1, input2, input3, receptacle, buf.readItemStack()); + public void write(RegistryByteBuf packetData, JuicerRecipe recipe) { + Ingredient.PACKET_CODEC.encode(packetData, recipe.ingredient0()); + Ingredient.PACKET_CODEC.encode(packetData, recipe.ingredient1()); + Ingredient.PACKET_CODEC.encode(packetData, recipe.ingredient2()); + Ingredient.PACKET_CODEC.encode(packetData, recipe.receptacle()); + ItemStack.PACKET_CODEC.encode(packetData, recipe.getResult()); } @Override - public Codec method_53736() { + public MapCodec getCodec() { return CODEC; } @Override - public void write(PacketByteBuf packetData, JuicerRecipe recipe) { - recipe.ingredient0().write(packetData); - recipe.ingredient1().write(packetData); - recipe.ingredient2().write(packetData); - recipe.receptacle().write(packetData); - packetData.writeItemStack(recipe.getResult()); + public PacketCodec getPacketCodec() { + return packetCodec; } } } 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 870a38f3..e435dad6 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java +++ b/src/main/java/io/ix0rai/bodacious_berries/config/BodaciousConfigScreen.java @@ -1,24 +1,18 @@ package io.ix0rai.bodacious_berries.config; -import dev.lambdaurora.spruceui.Position; -import dev.lambdaurora.spruceui.SpruceTexts; -import dev.lambdaurora.spruceui.option.SpruceBooleanOption; -import dev.lambdaurora.spruceui.option.SpruceOption; -import dev.lambdaurora.spruceui.option.SpruceSimpleActionOption; -import dev.lambdaurora.spruceui.screen.SpruceScreen; -import dev.lambdaurora.spruceui.widget.SpruceButtonWidget; -import dev.lambdaurora.spruceui.widget.container.SpruceOptionListWidget; import io.ix0rai.bodacious_berries.BodaciousBerries; import io.ix0rai.bodacious_berries.registry.Berry; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.GuiGraphics; 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.List; import java.util.function.Consumer; -import java.util.function.Supplier; import static io.ix0rai.bodacious_berries.BodaciousBerries.CONFIG; @@ -26,73 +20,25 @@ * based on the configuration screen for lambdabettergrass by lambdaurora */ @Environment(EnvType.CLIENT) -public class BodaciousConfigScreen extends SpruceScreen { - private final Screen parent; - - private final SpruceOption resetOption; - private final SpruceOption[] generationOptions = new SpruceOption[Berry.values().length]; +public class BodaciousConfigScreen extends SimpleOptionsScreen { public BodaciousConfigScreen(@Nullable Screen parent) { - super(BodaciousBerries.translatableText("config.title")); - this.parent = parent; + super(parent, MinecraftClient.getInstance().options, BodaciousBerries.translatableText("config.title"), createOptions()); + } + @SuppressWarnings("unchecked") + private static Option[] createOptions() { + List> 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 - ); - } - - @Override - public void closeScreen() { - if (this.client != null) { - this.client.setScreen(this.parent); - } else { - super.closeScreen(); - } - } - - @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())); + return options.toArray(Option[]::new); } - @Override - public void renderTitle(GuiGraphics graphics, int mouseX, int mouseY, float delta) { - graphics.drawCenteredShadowedText(this.textRenderer, this.title, this.width / 2, 8, 16777215); + 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 ed410081..e516cb2b 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/Juice.java b/src/main/java/io/ix0rai/bodacious_berries/item/Juice.java index d95f132b..91bca945 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/item/Juice.java +++ b/src/main/java/io/ix0rai/bodacious_berries/item/Juice.java @@ -1,15 +1,14 @@ package io.ix0rai.bodacious_berries.item; import io.ix0rai.bodacious_berries.registry.BodaciousJuices; -import net.minecraft.client.item.TooltipContext; +import net.minecraft.client.item.TooltipConfig; +import net.minecraft.component.DataComponentTypes; import net.minecraft.item.FoodComponent; import net.minecraft.item.HoneyBottleItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.text.MutableText; import net.minecraft.util.Formatting; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import java.security.InvalidParameterException; import java.util.List; @@ -45,17 +44,17 @@ public Juice(FoodComponent component) { } public static Settings settings(Item berry, FoodComponent.Builder builder) { - FoodComponent foodComponent = berry.getFoodComponent(); + FoodComponent foodComponent = berry.getComponents().get(DataComponentTypes.FOOD); if (foodComponent != null) { - return BodaciousJuices.JUICE_SETTINGS.food(builder.hunger(foodComponent.getHunger() * 2).saturationModifier(foodComponent.getSaturationModifier() * 1.5f).build()); + return BodaciousJuices.JUICE_SETTINGS.food(builder.hunger(foodComponent.nutrition() * 2).saturation(foodComponent.saturation() * 1.5f).build()); } throw new InvalidParameterException("item: " + berry + " does not have a food component"); } @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - super.appendTooltip(stack, world, tooltip, context); + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipConfig config) { + super.appendTooltip(stack, context, tooltip, config); if (hintTooltip != null) { tooltip.add(hintTooltip.formatted(Formatting.DARK_PURPLE, Formatting.ITALIC)); } 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 22eb9a6f..9cd1c310 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/BodaciousBlocks.java b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousBlocks.java index 80f92e8a..780f6a6f 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousBlocks.java +++ b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousBlocks.java @@ -8,8 +8,7 @@ import io.ix0rai.bodacious_berries.block.entity.JuicerBlockEntity; import io.ix0rai.bodacious_berries.block.entity.JuicerScreenHandler; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; +import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.feature_flags.FeatureFlags; @@ -27,13 +26,13 @@ public class BodaciousBlocks { public static final Identifier BERRY_HARVESTER = BodaciousBerries.id("berry_harvester"); - public static final BerryHarvesterBlock BERRY_HARVESTER_BLOCK = new BerryHarvesterBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.COPPER).strength(4.0f)); - public static final BlockEntityType BERRY_HARVESTER_ENTITY = FabricBlockEntityTypeBuilder.create(BerryHarvesterBlockEntity::new, BERRY_HARVESTER_BLOCK).build(null); + public static final BerryHarvesterBlock BERRY_HARVESTER_BLOCK = new BerryHarvesterBlock(AbstractBlock.Settings.create().sounds(BlockSoundGroup.COPPER).strength(4.0f)); + public static final BlockEntityType BERRY_HARVESTER_ENTITY = BlockEntityType.Builder.create(BerryHarvesterBlockEntity::new, BERRY_HARVESTER_BLOCK).build(null); public static final ScreenHandlerType BERRY_HARVESTER_SCREEN_HANDLER = new ScreenHandlerType<>(BerryHarvesterScreenHandler::new, FeatureFlags.DEFAULT_SET); public static final Identifier JUICER = BodaciousBerries.id("juicer"); - public static final JuicerBlock JUICER_BLOCK = new JuicerBlock(FabricBlockSettings.create().sounds(BlockSoundGroup.COPPER).strength(4.0f)); - public static final BlockEntityType JUICER_ENTITY = FabricBlockEntityTypeBuilder.create(JuicerBlockEntity::new, JUICER_BLOCK).build(null); + public static final JuicerBlock JUICER_BLOCK = new JuicerBlock(AbstractBlock.Settings.create().sounds(BlockSoundGroup.COPPER).strength(4.0f)); + public static final BlockEntityType JUICER_ENTITY = BlockEntityType.Builder.create(JuicerBlockEntity::new, JUICER_BLOCK).build(null); public static final ScreenHandlerType JUICER_SCREEN_HANDLER = new ScreenHandlerType<>(JuicerScreenHandler::new, FeatureFlags.DEFAULT_SET); public static void register() { 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 638e89a2..97cde60a 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/BodaciousJuices.java b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousJuices.java index 7478ef52..b8704270 100644 --- a/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousJuices.java +++ b/src/main/java/io/ix0rai/bodacious_berries/registry/BodaciousJuices.java @@ -22,7 +22,7 @@ public class BodaciousJuices { public static final Item JUICE_RECEPTACLE = Items.GLASS_BOTTLE; public static final Item.Settings JUICE_SETTINGS = new Item.Settings().recipeRemainder(JUICE_RECEPTACLE).maxCount(16); - public static final Juice DUBIOUS_JUICE = new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(2).saturationModifier(2F).build())); + public static final Juice DUBIOUS_JUICE = new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(2).saturation(2F).build())); public static void register() { register(BodaciousBerries.id("dubious_juice"), DUBIOUS_JUICE); @@ -62,15 +62,15 @@ private static void createBiomeChorusJuice() { } private static void registerBlends() { - register("goji_berry_blend", new GojiBerryBlend(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturationModifier(1.8F).statusEffect(new StatusEffectInstance(StatusEffects.GLOWING, 800, 1), 1.0F).build()))); - register("opposite_juice", new Juice(new FoodComponent.Builder().hunger(4).saturationModifier(1.2F).build())); - register("rainberry_blend", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(6).saturationModifier(1.6F).build()))); - register("gooseberry_rum", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(7).saturationModifier(1.0f).build()))); - register("red_juice", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturationModifier(1.3F).build()))); - register("end_blend", new EndBlend(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(3).saturationModifier(3.3F).build()))); - register("purple_delight", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(6).saturationModifier(1.6F).build()))); - register("traffic_light_juice", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturationModifier(1.4F).build()))); - register("vanilla_delight", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(4).saturationModifier(2.0F).build()))); + register("goji_berry_blend", new GojiBerryBlend(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturation(1.8F).statusEffect(new StatusEffectInstance(StatusEffects.GLOWING, 800, 1), 1.0F).build()))); + register("opposite_juice", new Juice(new FoodComponent.Builder().hunger(4).saturation(1.2F).build())); + register("rainberry_blend", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(6).saturation(1.6F).build()))); + register("gooseberry_rum", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(7).saturation(1.0f).build()))); + register("red_juice", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturation(1.3F).build()))); + register("end_blend", new EndBlend(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(3).saturation(3.3F).build()))); + register("purple_delight", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(6).saturation(1.6F).build()))); + register("traffic_light_juice", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(5).saturation(1.4F).build()))); + register("vanilla_delight", new Juice(JUICE_SETTINGS.food(new FoodComponent.Builder().hunger(4).saturation(2.0F).build()))); } private static void register(String name, Juice juice) { 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 719360a8..0c572aae 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); diff --git a/src/main/resources/data/bodacious_berries/recipes/berry_harvester.json b/src/main/resources/data/bodacious_berries/recipes/berry_harvester.json index b849416a..406796d1 100644 --- a/src/main/resources/data/bodacious_berries/recipes/berry_harvester.json +++ b/src/main/resources/data/bodacious_berries/recipes/berry_harvester.json @@ -20,7 +20,7 @@ } }, "result": { - "item": "bodacious_berries:berry_harvester", + "id": "bodacious_berries:berry_harvester", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/badlands.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/badlands.json index ab86a700..90fcb219 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/badlands.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/badlands.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_badlands", + "id": "bodacious_berries:chorus_berry_juice_badlands", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/birch_forest.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/birch_forest.json index a48956b8..5f4603e0 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/birch_forest.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/birch_forest.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_birch_forest", + "id": "bodacious_berries:chorus_berry_juice_birch_forest", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dark_forest.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dark_forest.json index 5ca8e05f..d73f24cb 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dark_forest.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dark_forest.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_dark_forest", + "id": "bodacious_berries:chorus_berry_juice_dark_forest", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/desert.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/desert.json index dcb848d3..a7a94eb4 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/desert.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/desert.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_desert", + "id": "bodacious_berries:chorus_berry_juice_desert", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dripstone_caves.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dripstone_caves.json index 03de339e..c0329db6 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dripstone_caves.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/dripstone_caves.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_dripstone_caves", + "id": "bodacious_berries:chorus_berry_juice_dripstone_caves", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/flower_forest.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/flower_forest.json index 9a8c48e6..4e7b09d6 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/flower_forest.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/flower_forest.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_flower_forest", + "id": "bodacious_berries:chorus_berry_juice_flower_forest", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/forest.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/forest.json index 02f01555..3afa093e 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/forest.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/forest.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_forest", + "id": "bodacious_berries:chorus_berry_juice_forest", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/jungle.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/jungle.json index ba4f566b..c46d8221 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/jungle.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/jungle.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_jungle", + "id": "bodacious_berries:chorus_berry_juice_jungle", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/lush_caves.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/lush_caves.json index d56a18a4..2e2bd7af 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/lush_caves.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/lush_caves.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_lush_caves", + "id": "bodacious_berries:chorus_berry_juice_lush_caves", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/meadow.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/meadow.json index d660214f..46debf5d 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/meadow.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/meadow.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_meadow", + "id": "bodacious_berries:chorus_berry_juice_meadow", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/mushroom_fields.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/mushroom_fields.json index 5ecae782..549a4019 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/mushroom_fields.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/mushroom_fields.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_mushroom_fields", + "id": "bodacious_berries:chorus_berry_juice_mushroom_fields", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/ocean.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/ocean.json index 76877b2d..dd9bebd0 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/ocean.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/ocean.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_ocean", + "id": "bodacious_berries:chorus_berry_juice_ocean", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/plains.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/plains.json index 5cd1d44e..8ed54ed5 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/plains.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/plains.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_plains", + "id": "bodacious_berries:chorus_berry_juice_plains", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/savanna.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/savanna.json index 78bcbcf4..5b894b27 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/savanna.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/savanna.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_savanna", + "id": "bodacious_berries:chorus_berry_juice_savanna", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/snowy_slopes.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/snowy_slopes.json index 28242cf4..61d7425a 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/snowy_slopes.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/snowy_slopes.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_snowy_slopes", + "id": "bodacious_berries:chorus_berry_juice_snowy_slopes", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/sunflower_plains.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/sunflower_plains.json index fff0707f..a7213a05 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/sunflower_plains.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/sunflower_plains.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_sunflower_plains", + "id": "bodacious_berries:chorus_berry_juice_sunflower_plains", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/swamp.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/swamp.json index 4fc5138e..96aca222 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/swamp.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/swamp.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_swamp", + "id": "bodacious_berries:chorus_berry_juice_swamp", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/taiga.json b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/taiga.json index d4d8f407..09fa3400 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juice/chorus/taiga.json +++ b/src/main/resources/data/bodacious_berries/recipes/juice/chorus/taiga.json @@ -9,7 +9,7 @@ } ], "result": { - "item": "bodacious_berries:chorus_berry_juice_taiga", + "id": "bodacious_berries:chorus_berry_juice_taiga", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/bodacious_berries/recipes/juicer.json b/src/main/resources/data/bodacious_berries/recipes/juicer.json index 9321f4cd..645ef34e 100644 --- a/src/main/resources/data/bodacious_berries/recipes/juicer.json +++ b/src/main/resources/data/bodacious_berries/recipes/juicer.json @@ -23,7 +23,7 @@ } }, "result": { - "item": "bodacious_berries:juicer", + "id": "bodacious_berries:juicer", "count": 1 } } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/berry_bushes.json b/src/main/resources/data/c/tags/blocks/berry_bushes.json index cd5f0792..0bae2cc5 100644 --- a/src/main/resources/data/c/tags/blocks/berry_bushes.json +++ b/src/main/resources/data/c/tags/blocks/berry_bushes.json @@ -1,5 +1,5 @@ { - "replace": "false", + "replace": false, "values": [ "minecraft:sweet_berry_bush", "bodacious_berries:strawberry_bush", diff --git a/src/main/resources/data/c/tags/items/berries.json b/src/main/resources/data/c/tags/items/berries.json deleted file mode 100644 index 189c057f..00000000 --- a/src/main/resources/data/c/tags/items/berries.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "replace": false, - "values": [ - "#c:sweet_berries", - "#c:glow_berries", - "#c:saskatoon_berries", - "#c:raspberries", - "#c:strawberries", - "#c:blackberries", - "#c:chorus_berries", - "#c:rainberries", - "#c:lingonberries", - "#c:grapes", - "#c:goji_berries", - "#c:gooseberries", - "#c:cloudberries", - "#c:blueberries", - "#c:elderberries", - "#c:salmonberries", - "#c:yellow_berries", - "#c:green_berries", - "#c:purple_berries", - "#c:orange_berries", - "#c:green_berries" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/foods/berries.json b/src/main/resources/data/c/tags/items/foods/berries.json new file mode 100644 index 00000000..69a27766 --- /dev/null +++ b/src/main/resources/data/c/tags/items/foods/berries.json @@ -0,0 +1,26 @@ +{ + "replace": false, + "values": [ + "#c:foods/sweet_berries", + "#c:foods/glow_berries", + "#c:foods/saskatoon_berries", + "#c:foods/raspberries", + "#c:foods/strawberries", + "#c:foods/blackberries", + "#c:foods/chorus_berries", + "#c:foods/rainberries", + "#c:foods/lingonberries", + "#c:foods/grapes", + "#c:foods/goji_berries", + "#c:foods/gooseberries", + "#c:foods/cloudberries", + "#c:foods/blueberries", + "#c:foods/elderberries", + "#c:foods/salmonberries", + "#c:foods/yellow_berries", + "#c:foods/green_berries", + "#c:foods/purple_berries", + "#c:foods/orange_berries", + "#c:foods/green_berries" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/blackberries.json b/src/main/resources/data/c/tags/items/foods/blackberries.json similarity index 90% rename from src/main/resources/data/c/tags/items/blackberries.json rename to src/main/resources/data/c/tags/items/foods/blackberries.json index f4138170..be680e78 100644 --- a/src/main/resources/data/c/tags/items/blackberries.json +++ b/src/main/resources/data/c/tags/items/foods/blackberries.json @@ -1,5 +1,5 @@ { - "replace": "false", + "replace": false, "values": [ "bodacious_berries:blackberries", { diff --git a/src/main/resources/data/c/tags/items/blueberries.json b/src/main/resources/data/c/tags/items/foods/blueberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/blueberries.json rename to src/main/resources/data/c/tags/items/foods/blueberries.json diff --git a/src/main/resources/data/c/tags/items/cherries.json b/src/main/resources/data/c/tags/items/foods/cherries.json similarity index 100% rename from src/main/resources/data/c/tags/items/cherries.json rename to src/main/resources/data/c/tags/items/foods/cherries.json diff --git a/src/main/resources/data/c/tags/items/chorus_berries.json b/src/main/resources/data/c/tags/items/foods/chorus_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/chorus_berries.json rename to src/main/resources/data/c/tags/items/foods/chorus_berries.json diff --git a/src/main/resources/data/c/tags/items/cloudberries.json b/src/main/resources/data/c/tags/items/foods/cloudberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/cloudberries.json rename to src/main/resources/data/c/tags/items/foods/cloudberries.json diff --git a/src/main/resources/data/c/tags/items/cranberries.json b/src/main/resources/data/c/tags/items/foods/cranberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/cranberries.json rename to src/main/resources/data/c/tags/items/foods/cranberries.json diff --git a/src/main/resources/data/c/tags/items/elderberries.json b/src/main/resources/data/c/tags/items/foods/elderberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/elderberries.json rename to src/main/resources/data/c/tags/items/foods/elderberries.json diff --git a/src/main/resources/data/c/tags/items/fruits.json b/src/main/resources/data/c/tags/items/foods/fruits.json similarity index 64% rename from src/main/resources/data/c/tags/items/fruits.json rename to src/main/resources/data/c/tags/items/foods/fruits.json index 0697ef11..e3ad2aee 100644 --- a/src/main/resources/data/c/tags/items/fruits.json +++ b/src/main/resources/data/c/tags/items/foods/fruits.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "#c:berries" + "#c:foods/berries" ] } \ No newline at end of file diff --git a/src/main/resources/data/c/tags/items/glow_berries.json b/src/main/resources/data/c/tags/items/foods/glow_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/glow_berries.json rename to src/main/resources/data/c/tags/items/foods/glow_berries.json diff --git a/src/main/resources/data/c/tags/items/goji_berries.json b/src/main/resources/data/c/tags/items/foods/goji_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/goji_berries.json rename to src/main/resources/data/c/tags/items/foods/goji_berries.json diff --git a/src/main/resources/data/c/tags/items/gooseberries.json b/src/main/resources/data/c/tags/items/foods/gooseberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/gooseberries.json rename to src/main/resources/data/c/tags/items/foods/gooseberries.json diff --git a/src/main/resources/data/c/tags/items/grapes.json b/src/main/resources/data/c/tags/items/foods/grapes.json similarity index 100% rename from src/main/resources/data/c/tags/items/grapes.json rename to src/main/resources/data/c/tags/items/foods/grapes.json diff --git a/src/main/resources/data/c/tags/items/green_berries.json b/src/main/resources/data/c/tags/items/foods/green_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/green_berries.json rename to src/main/resources/data/c/tags/items/foods/green_berries.json diff --git a/src/main/resources/data/c/tags/items/juices.json b/src/main/resources/data/c/tags/items/foods/juices.json similarity index 100% rename from src/main/resources/data/c/tags/items/juices.json rename to src/main/resources/data/c/tags/items/foods/juices.json diff --git a/src/main/resources/data/c/tags/items/lingonberries.json b/src/main/resources/data/c/tags/items/foods/lingonberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/lingonberries.json rename to src/main/resources/data/c/tags/items/foods/lingonberries.json diff --git a/src/main/resources/data/c/tags/items/orange_berries.json b/src/main/resources/data/c/tags/items/foods/orange_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/orange_berries.json rename to src/main/resources/data/c/tags/items/foods/orange_berries.json diff --git a/src/main/resources/data/c/tags/items/purple_berries.json b/src/main/resources/data/c/tags/items/foods/purple_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/purple_berries.json rename to src/main/resources/data/c/tags/items/foods/purple_berries.json diff --git a/src/main/resources/data/c/tags/items/rainberries.json b/src/main/resources/data/c/tags/items/foods/rainberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/rainberries.json rename to src/main/resources/data/c/tags/items/foods/rainberries.json diff --git a/src/main/resources/data/c/tags/items/raspberries.json b/src/main/resources/data/c/tags/items/foods/raspberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/raspberries.json rename to src/main/resources/data/c/tags/items/foods/raspberries.json diff --git a/src/main/resources/data/c/tags/items/salmonberries.json b/src/main/resources/data/c/tags/items/foods/salmonberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/salmonberries.json rename to src/main/resources/data/c/tags/items/foods/salmonberries.json diff --git a/src/main/resources/data/c/tags/items/saskatoon_berries.json b/src/main/resources/data/c/tags/items/foods/saskatoon_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/saskatoon_berries.json rename to src/main/resources/data/c/tags/items/foods/saskatoon_berries.json diff --git a/src/main/resources/data/c/tags/items/strawberries.json b/src/main/resources/data/c/tags/items/foods/strawberries.json similarity index 100% rename from src/main/resources/data/c/tags/items/strawberries.json rename to src/main/resources/data/c/tags/items/foods/strawberries.json diff --git a/src/main/resources/data/c/tags/items/sweet_berries.json b/src/main/resources/data/c/tags/items/foods/sweet_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/sweet_berries.json rename to src/main/resources/data/c/tags/items/foods/sweet_berries.json diff --git a/src/main/resources/data/c/tags/items/yellow_berries.json b/src/main/resources/data/c/tags/items/foods/yellow_berries.json similarity index 100% rename from src/main/resources/data/c/tags/items/yellow_berries.json rename to src/main/resources/data/c/tags/items/foods/yellow_berries.json diff --git a/src/main/resources/data/dehydration/tags/items/hydrating_drinks.json b/src/main/resources/data/dehydration/tags/items/hydrating_drinks.json index 361fa813..86301d6a 100644 --- a/src/main/resources/data/dehydration/tags/items/hydrating_drinks.json +++ b/src/main/resources/data/dehydration/tags/items/hydrating_drinks.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "#c:juices" + "#c:foods/juices" ] } \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/bee_growables.json b/src/main/resources/data/minecraft/tags/blocks/bee_growables.json index aa29ab8e..859c63a3 100644 --- a/src/main/resources/data/minecraft/tags/blocks/bee_growables.json +++ b/src/main/resources/data/minecraft/tags/blocks/bee_growables.json @@ -1,5 +1,5 @@ { - "replace": "false", + "replace": false, "values": [ "#c:berry_bushes" ] diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json index a645d72e..1eafd570 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json @@ -1,5 +1,5 @@ { - "replace": "false", + "replace": false, "values": [ "#c:berry_bushes", "bodacious_berries:berry_harvester" diff --git a/src/main/resources/data/minecraft/tags/items/fox_food.json b/src/main/resources/data/minecraft/tags/items/fox_food.json index 0697ef11..e3ad2aee 100644 --- a/src/main/resources/data/minecraft/tags/items/fox_food.json +++ b/src/main/resources/data/minecraft/tags/items/fox_food.json @@ -1,6 +1,6 @@ { "replace": false, "values": [ - "#c:berries" + "#c:foods/berries" ] } \ No newline at end of file