Skip to content

Commit

Permalink
fix seagrass cannot collide
Browse files Browse the repository at this point in the history
  • Loading branch information
baguchi committed Nov 13, 2023
1 parent e95b834 commit 0036645
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

import java.util.Random;

public class BlockFluidWithSeagrass extends BlockFluidStill {
public BlockFluidWithSeagrass(String name, int openIds, Material water) {
public class BlockWaterPlant extends BlockFluidStill {
public BlockWaterPlant(String name, int openIds, Material water) {
super(name, openIds, water);
float f = 0.4f;
this.setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, 0.8f, 0.5f + f);
Expand Down Expand Up @@ -121,6 +121,13 @@ protected final void func_268_h(World world, int i, int j, int k) {
}
}

@Override
public void onBlockRemoval(World world, int x, int y, int z) {
super.onBlockRemoval(world, x, y, z);
world.setBlockAndMetadataWithNotify(x, y, z, fluidWaterStill.id, world.getBlockMetadata(x, y, z));

}

public boolean canCollideCheck(int meta, boolean shouldCollideWithFluids) {
return this.isCollidable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ public class ModBlocks {


public static final Block sea_grass = new BlockBuilder(BetterWithAquatic.MOD_ID)
.setHardness(100.0f)
.setHardness(0.0f)
.setResistance(100F)
.setLightOpacity(1)
.setTextures("sea_grass.png")
.setTags(BlockTags.IS_WATER, BlockTags.PLACE_OVERWRITES, BlockTags.SHEARS_DO_SILK_TOUCH)
.setBlockSound(BlockSounds.GRASS)
.build(new BlockFluidWithSeagrass("sea_grass", findOpenIds(IDUtils.getCurrBlockId()), Material.water));
.build(new BlockWaterPlant("sea_grass", findOpenIds(IDUtils.getCurrBlockId()), Material.water));
public static final Block coral_blue = new BlockBuilder(BetterWithAquatic.MOD_ID)
.setHardness(0.6f)
.setResistance(0.65F)
Expand Down

0 comments on commit 0036645

Please sign in to comment.