SHOW:
|
|
- or go back to the newest paste.
1 | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. | |
2 | // Jad home page: http://www.kpdus.com/jad.html | |
3 | // Decompiler options: packimports(3) braces deadcode fieldsfirst | |
4 | ||
5 | package net.minecraft.src; | |
6 | ||
7 | ||
8 | // Referenced classes of package net.minecraft.src: | |
9 | // Entity, MathHelper, World, Block, | |
10 | // BlockPistonMoving, BlockSand, NBTTagCompound | |
11 | ||
12 | - | public class ExplosivesPlusEntityFallingBlocks extends Entity |
12 | + | public class ExplosivesPlusFallingBlock //extends Entity // Nope, this is our custom class. |
13 | { | |
14 | ||
15 | public int blockID; | |
16 | - | public int fallTime; |
16 | + | // public int fallTime; |
17 | public Entity nova; | |
18 | public double posX, posY, posZ; | |
19 | - | public ExplosivesPlusEntityFallingBlocks(World world) |
19 | + | public double prevPosX, prevPosY, prevPosZ; |
20 | public short failed; // If it failed somehow, or has deposited | |
21 | // 0 = still going | |
22 | // 1 = deposited block | |
23 | // 2 = block destroyed | |
24 | public boolean canDrop; // If it is allowed to deposit block | |
25 | - | public ExplosivesPlusEntityFallingBlocks(World world, Entity bomb, double d, double d1, double d2) |
25 | + | |
26 | /* public ExplosivesPlusEntityFallingBlocks(World world) | |
27 | { | |
28 | super(world); | |
29 | - | preventEntitySpawning = true; |
29 | + | |
30 | } */ // Will never use | |
31 | ||
32 | - | setPosition(d + 0.5, d1, d2 + 0.5); |
32 | + | public ExplosivesPlusEntityFallingBlocks(World world, Entity bomb, double x, double y, double z, int blockid) |
33 | { | |
34 | if (blockid == 0) | |
35 | { | |
36 | - | prevPosX = d; |
36 | + | throw new IllegalArgumentException("Block holder created with id = air!"); |
37 | - | prevPosY = d1; |
37 | + | |
38 | - | prevPosZ = d2; |
38 | + | //super(world); // NOTE: check if Entity does anything you e |
39 | // fallTime = 0; | |
40 | setSize(0.98F, 0.98F); | |
41 | yOffset = height / 2.0F; | |
42 | - | protected boolean canTriggerWalking() |
42 | + | // setPosition(d + 0.5, d1, d2 + 0.5); |
43 | posX = x+0.5; posY = y; posZ = z+0.5; | |
44 | - | return false; |
44 | + | |
45 | motionY = 0.0D; | |
46 | motionZ = 0.0D; | |
47 | - | protected void entityInit() |
47 | + | prevPosX = x; |
48 | prevPosY = y; // may want to check this.. | |
49 | prevPosZ = z; | |
50 | nova = bomb; | |
51 | - | public boolean canBeCollidedWith() |
51 | + | failed = 0; |
52 | blockID = blockid; | |
53 | - | return false; |
53 | + | canDrop = false; |
54 | } | |
55 | ||
56 | public void setCanDrop(boolean HighYield, Random rand) | |
57 | { | |
58 | - | if(blockID == 0) |
58 | + | if(!HighYield) |
59 | { | |
60 | - | setDead(); |
60 | + | if (rand.random() > mod_ExplosivesPlus.lowYieldReturnRate) |
61 | - | System.out.println("Fail Type 2"); |
61 | + | |
62 | - | return; |
62 | + | System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield"); |
63 | failed = 2; | |
64 | } | |
65 | } | |
66 | canDrop = true; | |
67 | - | fallTime++; |
67 | + | |
68 | ||
69 | - | moveEntity(motionX, motionY, motionZ); |
69 | + | |
70 | { | |
71 | if (failed != 0) return; | |
72 | // if(blockID == 0) | |
73 | // { | |
74 | // setDead(); | |
75 | // System.out.println("Fail Type 2"); | |
76 | - | if(fallTime == 1 && worldObj.getBlockId(i, j, k) == blockID) |
76 | + | // return; |
77 | // } | |
78 | - | //worldObj.setBlockWithNotify(i, j, k, 0); |
78 | + | |
79 | - | } else |
79 | + | |
80 | prevPosZ = posZ; | |
81 | - | if(fallTime == 1 && !mod_ExplosivesPlus.HighYieldNova) |
81 | + | // fallTime++; |
82 | motionY -= mod_ExplosivesPlus.FallingBlockSpeed; // motionY -= 0.009999999105930328D; | |
83 | - | setDead(); |
83 | + | // !!!!!!!!!!!!! moveEntity(motionX, motionY, motionZ); |
84 | - | System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield"); |
84 | + | |
85 | motionY *= 0.98000001907348633D; | |
86 | motionZ *= 0.98000001907348633D; | |
87 | int i = MathHelper.floor_double(posX); | |
88 | - | if(onGround) |
88 | + | |
89 | int k = MathHelper.floor_double(posZ); | |
90 | // if(fallTime == 1 && worldObj.getBlockId(i, j, k) == blockID) | |
91 | // { | |
92 | - | motionX *= 0.69999998807907104D; |
92 | + | // worldObj.setBlockWithNotify(i, j, k, 0); |
93 | - | motionZ *= 0.69999998807907104D; |
93 | + | // } else |
94 | - | motionY *= -0.5D; |
94 | + | |
95 | - | |
95 | + | // if(fallTime == 1 && !mod_ExplosivesPlus.HighYieldNova) |
96 | // { | |
97 | // setDead(); | |
98 | // System.out.println("Falling Block Entity Failed to Survive: Enable High Yield Novas for a Higher Yield"); | |
99 | - | setDead(); |
99 | + | |
100 | // } | |
101 | - | |
101 | + | |
102 | - | |
102 | + | if(onGround && canDrop) //!!!!!!!! Need to set onGround |
103 | { | |
104 | if(worldObj.getBlockId(i, j, k) != Block.pistonMoving.blockID) | |
105 | - | |
105 | + | |
106 | setPosition(i, j, k); | |
107 | worldObj.setBlockWithNotify(i, j, k, blockID); | |
108 | failed = 1; | |
109 | } | |
110 | } | |
111 | } | |
112 | ||
113 | protected void writeEntityToNBT(NBTTagCompound nbttagcompound) | |
114 | { | |
115 | nbttagcompound.setByte("Tile", (byte)blockID); | |
116 | } | |
117 | ||
118 | protected void readEntityFromNBT(NBTTagCompound nbttagcompound) | |
119 | - | public float getShadowSize() |
119 | + | |
120 | blockID = nbttagcompound.getByte("Tile") & 0xff; | |
121 | - | return 0.0F; |
121 | + | |
122 | ||
123 | public World getWorld() | |
124 | { | |
125 | return worldObj; | |
126 | } | |
127 | } |