-
Notifications
You must be signed in to change notification settings - Fork 754
/
ShurikenEntity.java
65 lines (53 loc) · 1.8 KB
/
ShurikenEntity.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
61
62
63
64
65
package tconstruct.weaponry.entity;
import tconstruct.library.entity.ProjectileBase;
import tconstruct.weaponry.TinkerWeaponry;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ShurikenEntity extends ProjectileBase {
public int spin = 0;
public int rollAngle = 0;
public ShurikenEntity(World world) {
super(world);
setSize(0.3f, 0.1f);
this.bounceOnNoDamage = false;
}
public ShurikenEntity(World world, double d, double d1, double d2) {
super(world, d, d1, d2);
setSize(0.3f, 0.1f);
this.bounceOnNoDamage = false;
}
public ShurikenEntity(World world, EntityPlayer player, float speed, float accuracy, ItemStack stack) {
super(world, player, speed, accuracy, stack);
setSize(0.3f, 0.1f);
this.bounceOnNoDamage = false;
}
@Override
public void onUpdate() {
// you turn me right round baby
if(this.ticksInGround == 0)
spin = (spin + 33) % 360;
super.onUpdate();
}
@Override
public void readSpawnData(ByteBuf data) {
super.readSpawnData(data);
// this is only relevant clientside only, so we don't actually have it on the server
//rollAngle = (TinkerWeaponry.random.nextInt(3)-1)*45 + TinkerWeaponry.random.nextInt(30)-15;
spin = TinkerWeaponry.random.nextInt(360);
}
@Override
protected double getGravity() {
return 0;
//return (this.ticksExisted/8) * 0.018d; // integer division. so the first 20 ticks it will have no gravity at all.
}
@Override
protected double getSlowdown() {
return 0.15f;
}
@Override
protected double getStuckDepth() {
return 0.8d;
}
}