diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ef2ed4..a3b40af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - Goat drops wool and mutton. - Shear can be used on `Saplings`, `Bamboo`, `Vine` and `Sugar cane` to prevent it from growing. -- Use the clock will show current time. +- Using the clock will show current time. - Reverse phantom spawn condition. - Slime chunk detector: Holding a `Slime Ball`, `Slime Block`, or items with the `diversity:slime_detector` tag will emit @@ -19,10 +19,11 @@ - `Bonemeal small flower` now requires dirt with tag `diversity:rich_soil`to be bonemealed. Default contains `Mycelium`. - `Torch lights target on fire` now use the tag `diversity:flame_weapon`, default list contains `torch` and `soul_torch`. -- Added swing animation for some feature use the right-click event. +- Added swing animation for some feature uses the right-click event. - Rework Bone meal coral, small flower to prevent hard conflict. - `Fox buries Item` now buries item from its mouth, if not then use loot table (bury random items). - `Bigger bookshelf radius for enchanting table` feature now toggleable. +- `Egg auto hatch` now only hatch on blocks have the tag `diversity:egg_hatchable`, default list contains `hay_block`. ### Removed @@ -32,4 +33,5 @@ - Fixed issue with `Easy Shulkerboxes` compatibility. - Duplicate Text Display on named Shulker. +- `No anvil xp limit` crash. - Missing command in forge/neoforge. \ No newline at end of file diff --git a/common/src/main/java/xyz/faewulf/diversity/mixin/onGroundEggAutoHatch.java b/common/src/main/java/xyz/faewulf/diversity/mixin/onGroundEggAutoHatch.java index 3898589..03e0322 100644 --- a/common/src/main/java/xyz/faewulf/diversity/mixin/onGroundEggAutoHatch.java +++ b/common/src/main/java/xyz/faewulf/diversity/mixin/onGroundEggAutoHatch.java @@ -11,13 +11,13 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import xyz.faewulf.diversity.util.compare; import xyz.faewulf.diversity.util.config.ModConfigs; @Mixin(ItemEntity.class) @@ -29,7 +29,7 @@ public onGroundEggAutoHatch(EntityType type, Level world) { super(type, world); } - @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/item/ItemEntity;discard()V", ordinal = 1, shift = At.Shift.BEFORE)) + @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/item/ItemEntity;discard()V", ordinal = 1)) private void tickInject(CallbackInfo ci) { if (!ModConfigs.chicken_egg_despawn_tryhatch) @@ -43,7 +43,7 @@ private void tickInject(CallbackInfo ci) { BlockState blockState = this.level().getBlockState(this.blockPosition().below()); //hatch on haybale only - if (blockState.getBlock() != Blocks.HAY_BLOCK) + if (!compare.isHasTag(blockState.getBlock(), "diversity:egg_hatchable")) return; int count = this.getItem().getCount(); diff --git a/common/src/main/resources/data/diversity/tags/blocks/egg_hatchable.json b/common/src/main/resources/data/diversity/tags/blocks/egg_hatchable.json new file mode 100644 index 0000000..3393303 --- /dev/null +++ b/common/src/main/resources/data/diversity/tags/blocks/egg_hatchable.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:hay_block" + ] +} \ No newline at end of file