Skip to content

Commit

Permalink
#10 mark Sponge as a risky block
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Feb 4, 2020
1 parent b0c8fc0 commit dfc7acb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -94,7 +95,7 @@ public <T> T getCapability(@Nonnull Capability<T> 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)
Expand Down

0 comments on commit dfc7acb

Please sign in to comment.