Skip to content

Commit

Permalink
Fix muddy mangrove roots not supporting plants it should
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Jun 16, 2024
1 parent 8c52c3a commit 4f5d012
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockMud.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.client.sound.ModSounds;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
Expand All @@ -22,12 +23,12 @@ public BlockMud() {
}

@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
return direction == ForgeDirection.UP && plantable.getPlantType(world, x, y, z) == EnumPlantType.Plains;
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant) {
return Blocks.dirt.canSustainPlant(world, x, y, z, direction, plant);
}

public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
float f = 0.125F;
return AxisAlignedBB.getBoundingBox(p_149668_2_, p_149668_3_, p_149668_4_, p_149668_2_ + 1, p_149668_3_ + 1 - f, p_149668_4_ + 1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.EnumPlantType;
Expand All @@ -28,8 +29,8 @@ public BlockMuddyMangroveRoots() {
}

@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
return direction == ForgeDirection.UP && plantable.getPlantType(world, x, y, z) == EnumPlantType.Plains;
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant) {
return Blocks.dirt.canSustainPlant(world, x, y, z, direction, plant);
}

@Override
Expand All @@ -44,4 +45,4 @@ public void registerBlockIcons(IIconRegister reg) {
blockIcon = reg.registerIcon(this.getTextureName() + "_side");
field_150164_N = reg.registerIcon(getTextureName() + "_top");
}
}
}

0 comments on commit 4f5d012

Please sign in to comment.