mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
Trodden Dirt now expands to a full block if there's a block above it.
This commit is contained in:
1 parent
f1323a32f2
commit
ba16c817ac
1 file changed
+19
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -52,6 +53,24 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
|
||||
entity.motionZ *= speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
Block blockAbove = world.getBlock(x, y + 1, z);
|
||||
if(blockAbove.isSideSolid(world, x, y + 1, z, ForgeDirection.DOWN))
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 1, 1F);
|
||||
else setBlockBounds(0F, 0F, 0F, 1F, 15F / 16F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
setBlockBoundsBasedOnState(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
|
||||
|
||||
Reference in new issue
Block a user