Slider isn't pushed by water anymore.
This commit is contained in:
parent
2513507818
commit
ef4e60489d
1 changed files with 40 additions and 0 deletions
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockTrapDoor;
|
import net.minecraft.block.BlockTrapDoor;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityFlying;
|
import net.minecraft.entity.EntityFlying;
|
||||||
|
@ -92,6 +93,19 @@ public class EntitySlider extends EntityFlying implements IAetherBoss
|
||||||
this.dataManager.register(SLIDER_NAME, String.valueOf(AetherNameGen.gen()));
|
this.dataManager.register(SLIDER_NAME, String.valueOf(AetherNameGen.gen()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void moveEntity(double x, double y, double z)
|
||||||
|
{
|
||||||
|
if (this.isAwake())
|
||||||
|
{
|
||||||
|
super.moveEntity(x, y, z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
super.moveEntity(0, y, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SoundEvent getAmbientSound()
|
protected SoundEvent getAmbientSound()
|
||||||
{
|
{
|
||||||
|
@ -153,6 +167,8 @@ public class EntitySlider extends EntityFlying implements IAetherBoss
|
||||||
this.motionY = 1.2F;
|
this.motionY = 1.2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.evapWater();
|
||||||
|
|
||||||
if(this.hurtAngle > 0.01F)
|
if(this.hurtAngle > 0.01F)
|
||||||
{
|
{
|
||||||
this.hurtAngle *= 0.8F;
|
this.hurtAngle *= 0.8F;
|
||||||
|
@ -386,6 +402,30 @@ public class EntitySlider extends EntityFlying implements IAetherBoss
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void evapWater()
|
||||||
|
{
|
||||||
|
int var1 = MathHelper.floor_double(this.getEntityBoundingBox().minX + (this.getEntityBoundingBox().maxX - this.getEntityBoundingBox().minX) / 2.0D);
|
||||||
|
int var2 = MathHelper.floor_double(this.getEntityBoundingBox().minZ + (this.getEntityBoundingBox().maxZ - this.getEntityBoundingBox().minZ) / 2.0D);
|
||||||
|
|
||||||
|
byte radius = 2;
|
||||||
|
|
||||||
|
for (int var4 = var1 - radius; var4 <= var1 + radius; ++var4)
|
||||||
|
{
|
||||||
|
for (int var5 = var2 - radius; var5 <= var2 + radius; ++var5)
|
||||||
|
{
|
||||||
|
for (int var6 = 0 + rand.nextInt(2); var6 < 8; ++var6)
|
||||||
|
{
|
||||||
|
double var7 = posY + var6;
|
||||||
|
|
||||||
|
if (this.worldObj.getBlockState(new BlockPos(var4, var7, var5)).getMaterial() == Material.WATER)
|
||||||
|
{
|
||||||
|
this.worldObj.setBlockState(new BlockPos(var4, var7, var5), Blocks.AIR.getDefaultState());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void destroyBlock(BlockPos pos)
|
private void destroyBlock(BlockPos pos)
|
||||||
{
|
{
|
||||||
IBlockState state = this.worldObj.getBlockState(pos);
|
IBlockState state = this.worldObj.getBlockState(pos);
|
||||||
|
|
Loading…
Reference in a new issue