2020-04-14 10:11:25 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Trigary <trigary0@gmail.com>
|
|
|
|
Date: Tue, 14 Apr 2020 12:05:22 +0200
|
|
|
|
Subject: [PATCH] Player elytra boost API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-03-16 13:04:28 +00:00
|
|
|
index d75bf9ecb70224f5e9772f98ac5633244828202e..69f2f575eb8ea91a5f5ce0115286d6ea741e89ff 100644
|
2020-04-14 10:11:25 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-03-09 18:03:27 +00:00
|
|
|
@@ -2274,6 +2274,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2020-04-14 10:11:25 +00:00
|
|
|
}
|
|
|
|
throw new RuntimeException("Unknown settings type");
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public org.bukkit.entity.Firework boostElytra(ItemStack firework) {
|
|
|
|
+ Validate.isTrue(isGliding(), "Player must be gliding");
|
|
|
|
+ Validate.isTrue(firework != null, "firework == null");
|
|
|
|
+ Validate.isTrue(firework.getType() == Material.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET");
|
|
|
|
+
|
|
|
|
+ net.minecraft.server.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework);
|
|
|
|
+ net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle();
|
|
|
|
+ net.minecraft.server.EntityFireworks entity = new net.minecraft.server.EntityFireworks(world, item, getHandle());
|
|
|
|
+ return world.addEntity(entity)
|
|
|
|
+ ? (org.bukkit.entity.Firework) entity.getBukkitEntity()
|
|
|
|
+ : null;
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
// Spigot start
|