Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.kpdus.com/jad.html
- // Decompiler options: packimports(3) braces deadcode fieldsfirst
- package net.minecraft.src;
- // Referenced classes of package net.minecraft.src:
- // Entity, MathHelper, World, Block,
- // BlockPistonMoving, BlockSand, NBTTagCompound
- public class ExplosivesPlusFallingBlock //extends Entity // Nope, this is our custom class.
- {
- public int blockID;
- // public int fallTime;
- public Entity nova;
- public double posX, posY, posZ;
- public double prevPosX, prevPosY, prevPosZ;
- public short failed; // If it failed somehow, or has deposited
- // 0 = still going
- // 1 = deposited block
- // 2 = block destroyed
- public boolean canDrop; // If it is allowed to deposit block
- /* public ExplosivesPlusEntityFallingBlocks(World world)
- {
- super(world);
- fallTime = 0;
- } */ // Will never use
- public ExplosivesPlusEntityFallingBlocks(World world, Entity bomb, double x, double y, double z, int blockid)
- {
- if (blockid == 0)
- {
- throw new IllegalArgumentException("Block holder created with id = air!");
- }
- //super(world); // NOTE: check if Entity does anything you e
- // fallTime = 0;
- setSize(0.98F, 0.98F);
- yOffset = height / 2.0F;
- // setPosition(d + 0.5, d1, d2 + 0.5);
- posX = x+0.5; posY = y; posZ = z+0.5;
- motionX = 0.0D;
- motionY = 0.0D;
- motionZ = 0.0D;
- prevPosX = x;
- prevPosY = y; // may want to check this..
- prevPosZ = z;
- nova = bomb;
- failed = 0;
- blockID = blockid;
- canDrop = false;
- }
- public void setCanDrop(boolean HighYield, Random rand)
- {
- if(!HighYield)
- {
- if (rand.random() > mod_ExplosivesPlus.lowYieldReturnRate)
- {
- System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield");
- failed = 2;
- }
- }
- canDrop = true;
- }
- public void onUpdate()
- {
- if (failed != 0) return;
- // if(blockID == 0)
- // {
- // setDead();
- // System.out.println("Fail Type 2");
- // return;
- // }
- prevPosX = posX;
- prevPosY = posY;
- prevPosZ = posZ;
- // fallTime++;
- motionY -= mod_ExplosivesPlus.FallingBlockSpeed; // motionY -= 0.009999999105930328D;
- // !!!!!!!!!!!!! moveEntity(motionX, motionY, motionZ);
- motionX *= 0.98000001907348633D;
- motionY *= 0.98000001907348633D;
- motionZ *= 0.98000001907348633D;
- int i = MathHelper.floor_double(posX);
- int j = MathHelper.floor_double(posY);
- int k = MathHelper.floor_double(posZ);
- // if(fallTime == 1 && worldObj.getBlockId(i, j, k) == blockID)
- // {
- // worldObj.setBlockWithNotify(i, j, k, 0);
- // } else
- // if(fallTime == 1 && !mod_ExplosivesPlus.HighYieldNova)
- // {
- // setDead();
- // System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield");
- // }
- if(onGround && canDrop) //!!!!!!!! Need to set onGround
- {
- if(worldObj.getBlockId(i, j, k) != Block.pistonMoving.blockID)
- {
- setPosition(i, j, k);
- worldObj.setBlockWithNotify(i, j, k, blockID);
- failed = 1;
- }
- }
- }
- protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
- {
- nbttagcompound.setByte("Tile", (byte)blockID);
- }
- protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
- {
- blockID = nbttagcompound.getByte("Tile") & 0xff;
- }
- public World getWorld()
- {
- return worldObj;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement