forked from mchorse/metamorph
-
Notifications
You must be signed in to change notification settings - Fork 2
/
IronGolemMorph.java
58 lines (48 loc) · 1.31 KB
/
IronGolemMorph.java
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
package mchorse.vanilla_pack.morphs;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.EntityMorph;
import mchorse.metamorph.capabilities.morphing.IMorphing;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
/**
* Iron golem morph
*
* This morph is responsible for making IronGolem morph great again! This morph
* is very powerful. I should make him much slower.
*/
public class IronGolemMorph extends EntityMorph
{
@Override
public void update(EntityLivingBase target, IMorphing cap)
{
if (target.motionY > 0)
{
target.motionY *= 0.9;
}
else
{
target.motionX *= 0.5;
target.motionZ *= 0.5;
target.motionY *= 1.3;
}
super.update(target, cap);
}
@Override
public void attack(Entity target, EntityLivingBase source)
{
if (this.entity != null)
{
this.entity.attackEntityAsMob(target);
}
super.attack(target, source);
}
@Override
public AbstractMorph clone()
{
IronGolemMorph morph = new IronGolemMorph();
morph.name = this.name;
morph.settings = this.settings;
morph.entityData = this.entityData.copy();
return morph;
}
}