-
Notifications
You must be signed in to change notification settings - Fork 5
/
ThxEntityRocketBase.java
61 lines (49 loc) · 1.31 KB
/
ThxEntityRocketBase.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
59
60
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public abstract class ThxEntityRocketBase extends ThxEntityProjectile
{
public ThxEntityRocketBase(World world)
{
super(world);
}
public ThxEntityRocketBase(Entity owner, double x, double y, double z, double dx, double dy, double dz, float yaw, float pitch)
{
super(owner, x, y, z, dx, dy, dz, yaw, pitch);
}
@Override
public int getPacketTypeId()
{
return 76;
}
@Override
void strikeEntity(Entity entity)
{
int attackStrength = 6;
entity.attackEntityFrom(new EntityDamageSource("player", owner), attackStrength);
}
@Override
void createParticles()
{
worldObj.spawnParticle("smoke", posX, posY, posZ, 0.0, 0.0, 0.0);
}
@Override
void onLaunch()
{
worldObj.playSoundAtEntity(this, "random.fizz", 1f, 1f);
}
@Override
float getAcceleration()
{
//return 1.2f;
return 1.2f;
}
@Override
void detonate()
{
doSplashDamage(1.0, 2); // very small splash damage
// no explosion, just the sound
worldObj.playSoundAtEntity(this, "random.explode", .7f, .5f + (float) Math.random() * .2f);
setDead();
}
}