From dfc7acb5c4626728b0a03fabc8e6237502db37c6 Mon Sep 17 00:00:00 2001 From: The_Fireplace Date: Mon, 3 Feb 2020 22:49:26 -0600 Subject: [PATCH] #10 mark Sponge as a risky block --- changelog.txt | 1 + .../java/the_fireplace/wgblockreplacer/WGBlockReplacer.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 6bbdf89..3c6c00f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1 +1,2 @@ Added a config option for delayed replacement. This should help with issues replacing some blocks. +Sponge is now considered a risky block due to the tendency to crash worlds when mass sponges get put near water diff --git a/src/main/java/the_fireplace/wgblockreplacer/WGBlockReplacer.java b/src/main/java/the_fireplace/wgblockreplacer/WGBlockReplacer.java index 4ab3f10..982efe2 100644 --- a/src/main/java/the_fireplace/wgblockreplacer/WGBlockReplacer.java +++ b/src/main/java/the_fireplace/wgblockreplacer/WGBlockReplacer.java @@ -2,6 +2,7 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockAir; +import net.minecraft.block.BlockSponge; import net.minecraft.nbt.NBTBase; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; @@ -94,7 +95,7 @@ public T getCapability(@Nonnull Capability capability, @Nullable EnumFaci } public static boolean isBlockRisky(Block block) { - return !(block instanceof BlockAir) && (!block.getDefaultState().isOpaqueCube() || !block.getDefaultState().isFullCube() || !block.isCollidable() || block.hasTileEntity(block.getDefaultState())); + return !(block instanceof BlockAir) && (!block.getDefaultState().isOpaqueCube() || !block.getDefaultState().isFullCube() || !block.isCollidable() || block.hasTileEntity(block.getDefaultState())) || block instanceof BlockSponge; } @Config(modid = MODID)