mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-25 14:34:28 +00:00
Fix dark steel ladder not working at all
This commit is contained in:
1 parent
229ad8b538
commit
1cce9c47d9
1 file changed
+11
-3
@@ -6,6 +6,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import codechicken.lib.math.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
@@ -42,13 +43,20 @@ public class BlockDarkSteelLadder extends BlockLadder implements IResourceToolti
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (entity.onGround || entity.isCollidedVertically) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(entity.motionY >= 0.1) {
|
||||
entity.setPosition(entity.posX, entity.posY + Config.darkSteelLadderSpeedBoost, entity.posZ);
|
||||
} else if (entity.motionY <= 0.1) {
|
||||
entity.setPosition(entity.posX, entity.posY - Config.darkSteelLadderSpeedBoost, entity.posZ);
|
||||
} else if(entity.motionY <= -0.1) {
|
||||
Block blockUnder = entity.worldObj.getBlock(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) - 3, MathHelper.floor_double(entity.posZ));
|
||||
if (blockUnder == null || blockUnder == this) { // prevent clipping into block
|
||||
entity.setPosition(entity.posX, entity.posY - Config.darkSteelLadderSpeedBoost, entity.posZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
|
||||
Reference in new issue
Block a user