Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
4104545b11
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
32 Zeilen
1.6 KiB
Diff
32 Zeilen
1.6 KiB
Diff
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
|
|
index 6557ae8a996ddb227a9fadd4ac30d44b1c5e47b2..a57bdc69d56c0a0ff510f4103745b18ca7ff863e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -538,6 +538,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
}
|
|
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.world.item.ItemStack item = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(firework);
|
|
+ net.minecraft.world.level.Level world = ((CraftWorld) getWorld()).getHandle();
|
|
+ net.minecraft.world.entity.projectile.FireworkRocketEntity entity = new net.minecraft.world.entity.projectile.FireworkRocketEntity(world, item, getHandle());
|
|
+ return world.addFreshEntity(entity)
|
|
+ ? (org.bukkit.entity.Firework) entity.getBukkitEntity()
|
|
+ : null;
|
|
+ }
|
|
// Paper end
|
|
|
|
@Override
|