2021-06-11 14:02:28 +02: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
|
2023-06-21 15:36:14 +02:00
|
|
|
index 18c5ea78a4a985ba328cdc62df4b99a6d3d1ccd5..82ce5f37538d9e3dfb64d7e41f28eeddaf76bfe4 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2023-06-16 12:28:31 +02:00
|
|
|
@@ -617,6 +617,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
throw new RuntimeException("Unknown settings type");
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public org.bukkit.entity.Firework boostElytra(ItemStack firework) {
|
2023-06-13 01:51:45 +02:00
|
|
|
+ Preconditions.checkState(this.isGliding(), "Player must be gliding");
|
|
|
|
+ Preconditions.checkArgument(firework != null, "firework == null");
|
|
|
|
+ Preconditions.checkArgument(firework.getType() == Material.FIREWORK_ROCKET, "Firework must be Material.FIREWORK_ROCKET");
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
+ net.minecraft.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework);
|
|
|
|
+ net.minecraft.world.level.Level world = ((CraftWorld) getWorld()).getHandle();
|
2021-06-14 18:58:00 +02:00
|
|
|
+ net.minecraft.world.entity.projectile.FireworkRocketEntity entity = new net.minecraft.world.entity.projectile.FireworkRocketEntity(world, item, getHandle());
|
2021-06-11 14:02:28 +02:00
|
|
|
+ return world.addFreshEntity(entity)
|
|
|
|
+ ? (org.bukkit.entity.Firework) entity.getBukkitEntity()
|
|
|
|
+ : null;
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
2021-06-14 18:58:00 +02:00
|
|
|
@Override
|