Slider now ACTUALLY doesn't get stuck.

This commit is contained in:
KingPhygieBoo 2017-12-26 03:14:37 -06:00
parent ce4cfedbf3
commit 9d61b6ecb0

View file

@ -26,6 +26,7 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -142,13 +143,16 @@ public class EntitySlider extends EntityFlying implements IAetherBoss
@Override @Override
public void onUpdate() public void onUpdate()
{ {
//heck
IBlockState state = this.worldObj.getBlockState(this.getPosition().add(1F, 0F, 1F)); int i1 = MathHelper.floor_double(this.posX);
int j1 = MathHelper.floor_double(this.getEntityBoundingBox().minY);
if (this.isCollidedHorizontally && state.getBlock() instanceof BlockDungeonBase) int k1 = MathHelper.floor_double(this.posZ);
BlockPos position = new BlockPos(i1, j1, k1);
if (this.isCollidedHorizontally && !this.isMoving && !this.worldObj.isAirBlock(position.down()) && !this.crushedBlock)
{ {
this.motionY = 1F; this.motionY = 1.2F;
} }
if(this.hurtAngle > 0.01F) if(this.hurtAngle > 0.01F)
{ {
this.hurtAngle *= 0.8F; this.hurtAngle *= 0.8F;