-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXCEntityThrowableMagic.java
More file actions
138 lines (120 loc) · 4.42 KB
/
Copy pathXCEntityThrowableMagic.java
File metadata and controls
138 lines (120 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package net.minecraft.src;
public class XCEntityThrowableMagic extends EntityThrowable
{
int type = 0;
public XCEntityThrowableMagic(World var1)
{
super(var1);
}
public XCEntityThrowableMagic(World var1, EntityLivingBase var2, int var3)
{
super(var1, var2);
this.type = var3;
}
public XCEntityThrowableMagic(World var1, double var2, double var4, double var6)
{
super(var1, var2, var4, var6);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition var1)
{
if (this.type == 0)
{
Minecraft.getMinecraft().theWorld.spawnEntityInWorld(new EntityLightningBolt(this.worldObj, this.posX, this.posY, this.posZ));
if (!this.worldObj.isRemote && var1.entityHit != null && !var1.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this.getThrower()), 5))
{
;
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
int var2;
int var3;
int var4;
if (this.type == 1)
{
if (!this.worldObj.isRemote)
{
if (var1.entityHit != null && !var1.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this.getThrower()), 5))
{
;
}
for (var2 = -1; var2 < 2; ++var2)
{
for (var3 = -1; var3 < 2; ++var3)
{
for (var4 = -1; var4 < 2; ++var4)
{
if (this.worldObj.getBlockId((int)this.posX + var3, (int)this.posY + var2, (int)this.posZ + var4) == 0 && (var3 != 0 || var4 != 0))
{
this.worldObj.setBlock((int)this.posX + var3, (int)this.posY + var2, (int)this.posZ + var4, Block.thinGlass.blockID);
this.setDead();
}
}
}
}
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
if (this.type == 2)
{
if (!this.worldObj.isRemote)
{
if (var1.entityHit != null && !var1.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this.getThrower()), 5))
{
;
}
for (var2 = 0; var2 < 3; ++var2)
{
for (var3 = 0; var3 < 3; ++var3)
{
for (var4 = 0; var4 < 3; ++var4)
{
if (this.worldObj.getBlockId((int)this.posX + var3, (int)this.posY + var2, (int)this.posZ + var4) == 0)
{
this.worldObj.setBlock((int)this.posX + var3, (int)this.posY + var2, (int)this.posZ + var4, Block.leaves.blockID);
this.setDead();
}
}
}
}
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
if (this.type == 3)
{
if (!this.worldObj.isRemote)
{
if (var1.entityHit != null && !var1.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this.getThrower()), 5))
{
;
}
for (var2 = 0; var2 < 4; ++var2)
{
for (var3 = 0; var3 < 4; ++var3)
{
if (this.worldObj.getBlockId((int)this.posX + var2, (int)this.posY, (int)this.posZ + var3) == 0)
{
this.worldObj.setBlock((int)this.posX + var2, (int)this.posY, (int)this.posZ + var3, Block.fire.blockID);
this.setDead();
}
}
}
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}
}