blob: f40c00d7d0f7c2b1ab253cf2c6cd1506995b06d7 (
plain)
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
|
package gtPlusPlus.core.entity.monster;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.village.Village;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
public class EntityStaballoyConstruct extends EntityIronGolem {
public EntityStaballoyConstruct(World world) {
super(world);
this.experienceValue = 250;
this.getNavigator()
.setBreakDoors(true);
this.getNavigator()
.setCanSwim(false);
this.getNavigator()
.setAvoidSun(false);
}
@Override
protected void applyEntityAttributes() {
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth)
.setBaseValue(500.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed)
.setBaseValue(0.5D);
}
@Override
public boolean canAttackClass(Class<? extends Entity> clazz) {
return !this.getClass()
.equals(clazz);
}
@Override
@SideOnly(Side.CLIENT)
public void handleHealthUpdate(byte p_70103_1_) {
if (p_70103_1_ == 11) {
return;
}
super.handleHealthUpdate(p_70103_1_);
}
@Override
public Village getVillage() {
return null;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
@Override
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) {
int lootingChance = p_70628_2_ + 1;
int j = this.rand.nextInt(3);
int k;
for (k = 0; k < j; ++k) {
this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("blockStaballoy", 1), 0f);
}
k = 3 + this.rand.nextInt(3);
for (int l = 0; l < k; ++l) {
this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("ingotStaballoy", lootingChance), 0f);
if (MathUtils.randInt(0, 2) == 0) {
this.entityDropItem(ItemUtils.getItemStackOfAmountFromOreDict("plateStaballoy", lootingChance), 0f);
}
}
}
@Override
public boolean isPlayerCreated() {
return false;
}
@Override
public void setPlayerCreated(boolean p_70849_1_) {}
@Override
protected boolean canDespawn() {
return true;
}
@Override
public void onEntityUpdate() {
if (!this.isImmuneToFire) {
this.isImmuneToFire = true;
}
super.onEntityUpdate();
}
@Override
public int getMaxSpawnedInChunk() {
return 1;
}
@Override
public boolean canBreatheUnderwater() {
return true;
}
@Override
public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_) {}
@Override
protected void setOnFireFromLava() {
extinguish();
}
@Override
public void setFire(int p_70015_1_) {
extinguish();
}
@Override
protected void dealFireDamage(int p_70081_1_) {}
@Override
public boolean canRenderOnFire() {
return false;
}
@Override
public boolean isPushedByWater() {
return false;
}
}
|