Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onUpdate() {
- if (age >= 6000)
- setDead();
- if (delayBeforeCanPickup > 0)
- delayBeforeCanPickup--;
- if (motionX != 0 || motionY != 0 || motionZ != 0 || motionX != -0 || motionY != -0 || motionZ != -0) {
- super.onUpdate();
- age = ticksExisted;
- if ((Math.abs(motionX) + Math.abs(motionY) + Math.abs(motionZ)) <= 0.001)
- motionX = motionY = motionZ = 0;
- if (onGround)
- motionY = 0;
- motionY -= 0.04D;
- if (worldObj.getBlockMaterial(MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)) == Material.lava) {
- motionY = 0.2D;
- motionX = (rand.nextFloat() - rand.nextFloat()) * 0.2F;
- motionZ = (rand.nextFloat() - rand.nextFloat()) * 0.2F;
- worldObj.playSoundAtEntity(this, "random.fizz", 0.4F, 2.0F + rand.nextFloat() * 0.4F);
- }
- pushOutOfBlocks(posX, (boundingBox.minY + boundingBox.maxY) / 2D, posZ);
- moveEntity(motionX, motionY, motionZ);
- float f = 0.98F;
- if (onGround) {
- f = 0.588F;
- int i = worldObj.getBlockId(MathHelper.floor_double(posX), MathHelper.floor_double(boundingBox.minY) - 1, MathHelper.floor_double(posZ));
- if (i > 0)
- f = Block.blocksList[i].slipperiness * 0.98F;
- }
- motionX *= f;
- motionY *= 0.98D;
- motionZ *= f;
- } else {
- ticksExisted = ++age;
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- prevRotationPitch = rotationPitch;
- prevRotationYaw = rotationYaw;
- int x = MathHelper.floor_double(posX);
- int y = MathHelper.floor_double((boundingBox.minY + boundingBox.maxY) / 2D);
- int z = MathHelper.floor_double(posZ);
- int id = worldObj.getBlockId(x, y, z);
- if (worldObj.getBlockId(x, y - 1, z) == 0 || (id != 0 && (Block.blocksList[id] != null && Block.blocksList[id].isOpaqueCube())))
- motionY = -0.01;
- }
- }
Advertisement