diff --git a/src/main/java/jiink/smeltinginapinch/BlazeFurnaceBlockEntity.java b/src/main/java/jiink/smeltinginapinch/BlazeFurnaceBlockEntity.java index 6fe338f..5b90046 100644 --- a/src/main/java/jiink/smeltinginapinch/BlazeFurnaceBlockEntity.java +++ b/src/main/java/jiink/smeltinginapinch/BlazeFurnaceBlockEntity.java @@ -1,5 +1,6 @@ package jiink.smeltinginapinch; +import jiink.smeltinginapinch.config.MyConfig; import net.minecraft.block.AbstractFireBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -29,8 +30,13 @@ protected void burnoutDestroy(World world, BlockPos pos, BlockState state) { 1f, 1f ); + world.setBlockState(pos, net.minecraft.block.Blocks.FIRE.getDefaultState()); // explode - world.createExplosion(null, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), 4.0f, true, World.ExplosionSourceType.MOB); + if (MyConfig.HANDLER.instance().furnaceGriefing) { + world.createExplosion(null, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), 1.0f, true, World.ExplosionSourceType.MOB); + } else { + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); + } } @Override diff --git a/src/main/java/jiink/smeltinginapinch/GunpowderFurnaceBlockEntity.java b/src/main/java/jiink/smeltinginapinch/GunpowderFurnaceBlockEntity.java index 7feb2f4..680d1b6 100644 --- a/src/main/java/jiink/smeltinginapinch/GunpowderFurnaceBlockEntity.java +++ b/src/main/java/jiink/smeltinginapinch/GunpowderFurnaceBlockEntity.java @@ -1,5 +1,6 @@ package jiink.smeltinginapinch; +import jiink.smeltinginapinch.config.MyConfig; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; @@ -16,7 +17,12 @@ public GunpowderFurnaceBlockEntity(BlockPos pos, BlockState state) { @Override protected void burnoutDestroy(World world, BlockPos pos, BlockState state) { + world.setBlockState(pos, net.minecraft.block.Blocks.FIRE.getDefaultState()); // explode - world.createExplosion(null, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), 4.0f, true, World.ExplosionSourceType.BLOCK); + if (MyConfig.HANDLER.instance().furnaceGriefing) { + world.createExplosion(null, (double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), 4.0f, false, World.ExplosionSourceType.BLOCK); + } else { + world.syncWorldEvent(WorldEvents.BLOCK_BROKEN, pos, Block.getRawIdFromState(state)); + } } } diff --git a/src/main/java/jiink/smeltinginapinch/config/MyConfig.java b/src/main/java/jiink/smeltinginapinch/config/MyConfig.java index 8875fda..b1dbadc 100644 --- a/src/main/java/jiink/smeltinginapinch/config/MyConfig.java +++ b/src/main/java/jiink/smeltinginapinch/config/MyConfig.java @@ -18,6 +18,9 @@ public class MyConfig { .build()) .build(); + @SerialEntry (comment = "Disable explosions from certain powerful furnaces. May cause the mod to become unbalanced.") + public boolean furnaceGriefing = true; + @SerialEntry public int numItemsCanSmeltWooden = 8; @SerialEntry