mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 21:17:00 +01:00
SPIGOT-5231: ShotAtAngle API for Fireworks
This commit is contained in:
parent
7881d2ae15
commit
803eaa3169
2 changed files with 18 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
--- a/net/minecraft/server/EntityFireworks.java
|
||||
+++ b/net/minecraft/server/EntityFireworks.java
|
||||
@@ -3,6 +3,7 @@
|
||||
@@ -3,12 +3,13 @@
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.OptionalInt;
|
||||
|
@ -8,6 +8,13 @@
|
|||
|
||||
public class EntityFireworks extends Entity implements IProjectile {
|
||||
|
||||
public static final DataWatcherObject<ItemStack> FIREWORK_ITEM = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.g);
|
||||
private static final DataWatcherObject<OptionalInt> c = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.r);
|
||||
- private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.i);
|
||||
+ public static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityFireworks.class, DataWatcherRegistry.i); // PAIL
|
||||
private int ticksFlown;
|
||||
public int expectedLifespan;
|
||||
private EntityLiving ridingEntity;
|
||||
@@ -133,7 +134,11 @@
|
||||
}
|
||||
|
||||
|
|
|
@ -68,4 +68,14 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||
public void detonate() {
|
||||
getHandle().expectedLifespan = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShotAtAngle() {
|
||||
return getHandle().i();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShotAtAngle(boolean shotAtAngle) {
|
||||
getHandle().getDataWatcher().set(EntityFireworks.d, shotAtAngle);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue