Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item Also aliased isHandsRaised for isChargingAttack in RangedEntity
Dieser Commit ist enthalten in:
Ursprung
7abf2eeeac
Commit
98555e9b90
50
Spigot-API-Patches/0119-LivingEntity-Hand-Raised-Item-Use-API.patch
Normale Datei
50
Spigot-API-Patches/0119-LivingEntity-Hand-Raised-Item-Use-API.patch
Normale Datei
@ -0,0 +1,50 @@
|
|||||||
|
From d76f522b7f164a56a7f9651170e439739ef6e015 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aikar <aikar@aikar.co>
|
||||||
|
Date: Fri, 29 Jun 2018 00:19:19 -0400
|
||||||
|
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
|
||||||
|
|
||||||
|
How long an entity has raised hands to charge an attack or use an item
|
||||||
|
|
||||||
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
index 5921c952..5ccb8ef3 100644
|
||||||
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||||
|
@@ -10,6 +10,7 @@ import org.bukkit.Material;
|
||||||
|
import org.bukkit.attribute.Attributable;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.inventory.EntityEquipment;
|
||||||
|
+import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.projectiles.ProjectileSource;
|
||||||
|
@@ -399,5 +400,27 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
|
||||||
|
* @param delay Delay in ticks
|
||||||
|
*/
|
||||||
|
void setShieldBlockingDelay(int delay);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get's the item being actively "used" or consumed.
|
||||||
|
+ * @return The item. Will be null if no active item.
|
||||||
|
+ */
|
||||||
|
+ ItemStack getActiveItem();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get's remaining time a player needs to keep hands raised with an item to finish using it.
|
||||||
|
+ * @return Remaining ticks to use the item
|
||||||
|
+ */
|
||||||
|
+ int getItemUseRemainingTime();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
|
||||||
|
+ */
|
||||||
|
+ int getHandRaisedTime();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
|
||||||
|
+ */
|
||||||
|
+ boolean isHandRaised();
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.18.0
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
From d22cc23fcedf807711836fcaedd9d7fd95f47f2d Mon Sep 17 00:00:00 2001
|
From d2a1657e1c25dc241d143ee6486513c024a5695b Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Tue, 26 Jun 2018 21:34:40 -0400
|
Date: Tue, 26 Jun 2018 21:34:40 -0400
|
||||||
Subject: [PATCH] RangedEntity API
|
Subject: [PATCH] RangedEntity API
|
||||||
@ -8,10 +8,10 @@ and to perform an attack.
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..5153efab
|
index 00000000..7b07f10c
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||||
@@ -0,0 +1,19 @@
|
@@ -0,0 +1,28 @@
|
||||||
+package com.destroystokyo.paper.entity;
|
+package com.destroystokyo.paper.entity;
|
||||||
+
|
+
|
||||||
+import org.bukkit.entity.LivingEntity;
|
+import org.bukkit.entity.LivingEntity;
|
||||||
@ -26,10 +26,19 @@ index 00000000..5153efab
|
|||||||
+ void rangedAttack(LivingEntity target, float charge);
|
+ void rangedAttack(LivingEntity target, float charge);
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Sets that the Entity is "charging" up an attack, by raising its arms
|
+ * Sets that the Entity is "charging" up an attack, by raising its hands
|
||||||
+ * @param charging Whether the entities arms are raised to charge attack
|
+ *
|
||||||
|
+ * @param raiseHands Whether the entities hands are raised to charge attack
|
||||||
+ */
|
+ */
|
||||||
+ void setChargingAttack(boolean charging);
|
+ void setChargingAttack(boolean raiseHands);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Alias to {@link LivingEntity#isHandRaised()}, if the entity is charging an attack
|
||||||
|
+ * @return If entities hands are raised
|
||||||
|
+ */
|
||||||
|
+ default boolean isChargingAttack() {
|
||||||
|
+ return isHandRaised();
|
||||||
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java
|
diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java
|
||||||
index 7c92c431..14e6c5ee 100644
|
index 7c92c431..14e6c5ee 100644
|
@ -1,4 +1,4 @@
|
|||||||
From 657fd80d2b490c68d3d640f155f8ea627edca61f Mon Sep 17 00:00:00 2001
|
From 7d617689162687744920577469a5bda672cd0e99 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Mon, 28 Mar 2016 20:55:47 -0400
|
Date: Mon, 28 Mar 2016 20:55:47 -0400
|
||||||
Subject: [PATCH] MC Utils
|
Subject: [PATCH] MC Utils
|
||||||
@ -76,6 +76,36 @@ index ba461ad48..2359b31f4 100644
|
|||||||
|
|
||||||
while (EntityTypes.g.size() <= i) {
|
while (EntityTypes.g.size() <= i) {
|
||||||
EntityTypes.g.add(null); // Paper - Decompile fix
|
EntityTypes.g.add(null); // Paper - Decompile fix
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
|
index 76bfbaa81..82d72ea15 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
|
@@ -14,6 +14,7 @@ import org.bukkit.Location;
|
||||||
|
import org.bukkit.TreeType;
|
||||||
|
import org.bukkit.block.BlockState;
|
||||||
|
import org.bukkit.craftbukkit.block.CraftBlockState;
|
||||||
|
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
|
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.world.StructureGrowEvent;
|
||||||
|
@@ -583,6 +584,17 @@ public final class ItemStack {
|
||||||
|
return this.tag != null ? this.tag.getList("ench", 10) : new NBTTagList();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // Paper start - (this is just a good no conflict location)
|
||||||
|
+ public org.bukkit.inventory.ItemStack asBukkitMirror() {
|
||||||
|
+ return CraftItemStack.asCraftMirror(this);
|
||||||
|
+ }
|
||||||
|
+ public org.bukkit.inventory.ItemStack asBukkitCopy() {
|
||||||
|
+ return CraftItemStack.asCraftMirror(this.cloneItemStack());
|
||||||
|
+ }
|
||||||
|
+ public static ItemStack fromBukkitCopy(org.bukkit.inventory.ItemStack itemstack) {
|
||||||
|
+ return CraftItemStack.asNMSCopy(itemstack);
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
||||||
|
this.tag = nbttagcompound;
|
||||||
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000..a4b0901cf
|
index 000000000..a4b0901cf
|
||||||
@ -349,5 +379,5 @@ index 8cede938a..cd2d58bfb 100644
|
|||||||
return System.nanoTime() / 1000000L;
|
return System.nanoTime() / 1000000L;
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.17.1
|
2.18.0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 41148ad75dcb5ba9bfbff7a6bfa03d861f50cf03 Mon Sep 17 00:00:00 2001
|
From cc98c3d6d2a78be363dccfc73b395cc82d52810d Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Thu, 28 May 2015 23:00:19 -0400
|
Date: Thu, 28 May 2015 23:00:19 -0400
|
||||||
Subject: [PATCH] Handle Item Meta Inconsistencies
|
Subject: [PATCH] Handle Item Meta Inconsistencies
|
||||||
@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the
|
|||||||
ItemMeta API equivalents, and should deprecate the old API's.
|
ItemMeta API equivalents, and should deprecate the old API's.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index 0dcea61d..a8f7ff98 100644
|
index 82d72ea15..5047a57e9 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -56,6 +56,22 @@ public final class ItemStack {
|
@@ -57,6 +57,22 @@ public final class ItemStack {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
@ -44,7 +44,7 @@ index 0dcea61d..a8f7ff98 100644
|
|||||||
public ItemStack(Item item, int i, int j) {
|
public ItemStack(Item item, int i, int j) {
|
||||||
this(item, i, j, true);
|
this(item, i, j, true);
|
||||||
}
|
}
|
||||||
@@ -113,6 +129,7 @@ public final class ItemStack {
|
@@ -114,6 +130,7 @@ public final class ItemStack {
|
||||||
if (nbttagcompound.hasKeyOfType("tag", 10)) {
|
if (nbttagcompound.hasKeyOfType("tag", 10)) {
|
||||||
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
|
// CraftBukkit start - make defensive copy as this data may be coming from the save thread
|
||||||
this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone();
|
this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").clone();
|
||||||
@ -52,15 +52,15 @@ index 0dcea61d..a8f7ff98 100644
|
|||||||
if (this.item != null) {
|
if (this.item != null) {
|
||||||
this.item.a(this.tag);
|
this.item.a(this.tag);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -585,6 +602,7 @@ public final class ItemStack {
|
@@ -597,6 +614,7 @@ public final class ItemStack {
|
||||||
|
// Paper end
|
||||||
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
public void setTag(@Nullable NBTTagCompound nbttagcompound) {
|
||||||
this.tag = nbttagcompound;
|
this.tag = nbttagcompound;
|
||||||
+ processEnchantOrder(this.tag); // Paper
|
+ processEnchantOrder(this.tag); // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -658,6 +676,7 @@ public final class ItemStack {
|
@@ -670,6 +688,7 @@ public final class ItemStack {
|
||||||
nbttagcompound.setShort("id", (short) Enchantment.getId(enchantment));
|
nbttagcompound.setShort("id", (short) Enchantment.getId(enchantment));
|
||||||
nbttagcompound.setShort("lvl", (short) ((byte) i));
|
nbttagcompound.setShort("lvl", (short) ((byte) i));
|
||||||
nbttaglist.add(nbttagcompound);
|
nbttaglist.add(nbttagcompound);
|
||||||
@ -69,7 +69,7 @@ index 0dcea61d..a8f7ff98 100644
|
|||||||
|
|
||||||
public boolean hasEnchantments() {
|
public boolean hasEnchantments() {
|
||||||
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||||
index ca9eb2f3..576c3b71 100644
|
index ca9eb2f3b..576c3b714 100644
|
||||||
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
--- a/src/main/java/net/minecraft/server/NBTTagList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
|
+++ b/src/main/java/net/minecraft/server/NBTTagList.java
|
||||||
@@ -14,6 +14,12 @@ public class NBTTagList extends NBTBase {
|
@@ -14,6 +14,12 @@ public class NBTTagList extends NBTBase {
|
||||||
@ -86,7 +86,7 @@ index ca9eb2f3..576c3b71 100644
|
|||||||
|
|
||||||
public NBTTagList() {}
|
public NBTTagList() {}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||||
index fb1dc542..cdf16e15 100644
|
index fb1dc542d..cdf16e15a 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||||
@@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS;
|
@@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS;
|
||||||
@ -212,7 +212,7 @@ index fb1dc542..cdf16e15 100644
|
|||||||
|
|
||||||
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
|
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
index c743ae06..0cdc8007 100644
|
index c743ae066..0cdc8007a 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||||
@@ -6,13 +6,8 @@ import java.lang.annotation.RetentionPolicy;
|
@@ -6,13 +6,8 @@ import java.lang.annotation.RetentionPolicy;
|
||||||
@ -358,5 +358,5 @@ index c743ae06..0cdc8007 100644
|
|||||||
private final Spigot spigot = new Spigot()
|
private final Spigot spigot = new Spigot()
|
||||||
{
|
{
|
||||||
--
|
--
|
||||||
2.14.3
|
2.18.0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 928399a231691ca924638613a15cbebaa634a4af Mon Sep 17 00:00:00 2001
|
From b70ebdb4c08ced933b85774c1a3a4955a976059a Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Wed, 21 Dec 2016 03:48:29 -0500
|
Date: Wed, 21 Dec 2016 03:48:29 -0500
|
||||||
Subject: [PATCH] Optimize ItemStack.isEmpty()
|
Subject: [PATCH] Optimize ItemStack.isEmpty()
|
||||||
@ -6,10 +6,10 @@ Subject: [PATCH] Optimize ItemStack.isEmpty()
|
|||||||
Remove hashMap lookup every check, simplify code to remove ternary
|
Remove hashMap lookup every check, simplify code to remove ternary
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index a8f7ff98..9465f4c1 100644
|
index 5047a57e9..736686bed 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -143,9 +143,15 @@ public final class ItemStack {
|
@@ -144,9 +144,15 @@ public final class ItemStack {
|
||||||
this.F();
|
this.F();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,5 +27,5 @@ index a8f7ff98..9465f4c1 100644
|
|||||||
public static void a(DataConverterManager dataconvertermanager) {
|
public static void a(DataConverterManager dataconvertermanager) {
|
||||||
dataconvertermanager.a(DataConverterTypes.ITEM_INSTANCE, (DataInspector) (new DataInspectorBlockEntity()));
|
dataconvertermanager.a(DataConverterTypes.ITEM_INSTANCE, (DataInspector) (new DataInspectorBlockEntity()));
|
||||||
--
|
--
|
||||||
2.16.2
|
2.18.0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 48ad7625f43d7fd2a6856e321c5ae439372a2d9c Mon Sep 17 00:00:00 2001
|
From 27b11fe499c79cd2a1fefa1139f9e17ba852facd Mon Sep 17 00:00:00 2001
|
||||||
From: kashike <kashike@vq.lc>
|
From: kashike <kashike@vq.lc>
|
||||||
Date: Sun, 9 Apr 2017 23:50:15 -0700
|
Date: Sun, 9 Apr 2017 23:50:15 -0700
|
||||||
Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack
|
Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack
|
||||||
@ -6,10 +6,10 @@ Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack
|
|||||||
Thanks @gabizou
|
Thanks @gabizou
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index 9465f4c1..52cb34ab 100644
|
index 736686bed..d666088f2 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -119,7 +119,7 @@ public final class ItemStack {
|
@@ -120,7 +120,7 @@ public final class ItemStack {
|
||||||
|
|
||||||
// CraftBukkit - break into own method
|
// CraftBukkit - break into own method
|
||||||
public void load(NBTTagCompound nbttagcompound) {
|
public void load(NBTTagCompound nbttagcompound) {
|
||||||
@ -19,5 +19,5 @@ index 9465f4c1..52cb34ab 100644
|
|||||||
// CraftBukkit start - Route through setData for filtering
|
// CraftBukkit start - Route through setData for filtering
|
||||||
// this.damage = Math.max(0, nbttagcompound.getShort("Damage"));
|
// this.damage = Math.max(0, nbttagcompound.getShort("Damage"));
|
||||||
--
|
--
|
||||||
2.14.3
|
2.18.0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 596b1db6a5e10475c0bc5c0f0d91fa43821c1d6e Mon Sep 17 00:00:00 2001
|
From a8a128697eaaacb25e8e8fa9ac38f1dd0c2a892d Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Wed, 20 Dec 2017 17:36:49 -0500
|
Date: Wed, 20 Dec 2017 17:36:49 -0500
|
||||||
Subject: [PATCH] Ability to apply mending to XP API
|
Subject: [PATCH] Ability to apply mending to XP API
|
||||||
@ -10,7 +10,7 @@ of giving the player experience points.
|
|||||||
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
|
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||||
index 98300d0a..f714dc32 100644
|
index 98300d0a2..f714dc326 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
|
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||||
@@ -226,6 +226,7 @@ public class EnchantmentManager {
|
@@ -226,6 +226,7 @@ public class EnchantmentManager {
|
||||||
@ -22,7 +22,7 @@ index 98300d0a..f714dc32 100644
|
|||||||
List list = enchantment.a(entityliving);
|
List list = enchantment.a(entityliving);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java
|
diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java
|
||||||
index 35e87eb1..74a6a4f6 100644
|
index 35e87eb1c..74a6a4f60 100644
|
||||||
--- a/src/main/java/net/minecraft/server/Enchantments.java
|
--- a/src/main/java/net/minecraft/server/Enchantments.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Enchantments.java
|
+++ b/src/main/java/net/minecraft/server/Enchantments.java
|
||||||
@@ -32,7 +32,7 @@ public class Enchantments {
|
@@ -32,7 +32,7 @@ public class Enchantments {
|
||||||
@ -35,7 +35,7 @@ index 35e87eb1..74a6a4f6 100644
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||||
index ff5cc74b..1c59fd96 100644
|
index ff5cc74ba..1c59fd966 100644
|
||||||
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||||
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||||
@@ -234,10 +234,12 @@ public class EntityExperienceOrb extends Entity {
|
@@ -234,10 +234,12 @@ public class EntityExperienceOrb extends Entity {
|
||||||
@ -52,10 +52,10 @@ index ff5cc74b..1c59fd96 100644
|
|||||||
return i * 2;
|
return i * 2;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index 52cb34ab..d1ff97a9 100644
|
index d666088f2..f6b802dc8 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -28,7 +28,7 @@ public final class ItemStack {
|
@@ -29,7 +29,7 @@ public final class ItemStack {
|
||||||
private Item item;
|
private Item item;
|
||||||
private NBTTagCompound tag;
|
private NBTTagCompound tag;
|
||||||
private boolean g;
|
private boolean g;
|
||||||
@ -64,7 +64,7 @@ index 52cb34ab..d1ff97a9 100644
|
|||||||
private EntityItemFrame i;
|
private EntityItemFrame i;
|
||||||
private Block j;
|
private Block j;
|
||||||
private boolean k;
|
private boolean k;
|
||||||
@@ -349,10 +349,12 @@ public final class ItemStack {
|
@@ -350,10 +350,12 @@ public final class ItemStack {
|
||||||
return this.getItem().k();
|
return this.getItem().k();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ index 52cb34ab..d1ff97a9 100644
|
|||||||
return this.damage;
|
return this.damage;
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 428b208a..21631c58 100644
|
index 428b208ae..21631c588 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -923,8 +923,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
@@ -923,8 +923,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
@ -123,5 +123,5 @@ index 428b208a..21631c58 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
2.14.3
|
2.18.0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 3b7b48e9015f695e3e59130a51a7a06dae7cbc11 Mon Sep 17 00:00:00 2001
|
From f0635a630823c63d00fc43a9acf99936959670fc Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Tue, 5 Jun 2018 23:00:29 -0400
|
Date: Tue, 5 Jun 2018 23:00:29 -0400
|
||||||
Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
||||||
@ -6,10 +6,10 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
|
|||||||
Allows you to determine how long it takes to use a usable/consumable item
|
Allows you to determine how long it takes to use a usable/consumable item
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
index 985237d86..908fb280a 100644
|
index f6b802dc8..6521bb508 100644
|
||||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||||
@@ -560,6 +560,7 @@ public final class ItemStack {
|
@@ -561,6 +561,7 @@ public final class ItemStack {
|
||||||
this.getItem().b(this, world, entityhuman);
|
this.getItem().b(this, world, entityhuman);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,5 +36,5 @@ index aa99254ff..be6589dbf 100644
|
|||||||
public void addUnsafeEnchantment(Enchantment ench, int level) {
|
public void addUnsafeEnchantment(Enchantment ench, int level) {
|
||||||
Validate.notNull(ench, "Cannot add null enchantment");
|
Validate.notNull(ench, "Cannot add null enchantment");
|
||||||
--
|
--
|
||||||
2.17.1
|
2.18.0
|
||||||
|
|
||||||
|
@ -0,0 +1,62 @@
|
|||||||
|
From 55c6db5585ba2644c39b0d11995fb17862c5bd3f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aikar <aikar@aikar.co>
|
||||||
|
Date: Fri, 29 Jun 2018 00:21:28 -0400
|
||||||
|
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
|
||||||
|
|
||||||
|
How long an entity has raised hands to charge an attack or use an item
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
index 156bf8ee0..14637be49 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||||
|
@@ -2466,14 +2466,17 @@ public abstract class EntityLiving extends Entity {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public ItemStack getActiveItem() { return cJ(); } // Paper - OBFHELPER
|
||||||
|
public ItemStack cJ() {
|
||||||
|
return this.activeItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public int getItemUseRemainingTime() { return cK(); } // Paper - OBFHELPER
|
||||||
|
public int cK() {
|
||||||
|
return this.bp;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public int getHandRaisedTime() { return cL(); } // Paper - OBFHELPER
|
||||||
|
public int cL() {
|
||||||
|
return this.isHandRaised() ? this.activeItem.m() - this.cK() : 0;
|
||||||
|
}
|
||||||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
index 14fb474f7..9c750efc7 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||||
|
@@ -525,5 +525,25 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
|
public void setShieldBlockingDelay(int delay) {
|
||||||
|
getHandle().setShieldBlockingDelay(delay);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public ItemStack getActiveItem() {
|
||||||
|
+ return getHandle().getActiveItem().asBukkitMirror();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getItemUseRemainingTime() {
|
||||||
|
+ return getHandle().getItemUseRemainingTime();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public int getHandRaisedTime() {
|
||||||
|
+ return getHandle().getHandRaisedTime();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean isHandRaised() {
|
||||||
|
+ return getHandle().isHandRaised();
|
||||||
|
+ }
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.18.0
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
From eeefed6577e1b6946c4197d382d605f085e69b8f Mon Sep 17 00:00:00 2001
|
From 83f3723c5549505c1a6070099dc36512eb01a87e Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Tue, 26 Jun 2018 22:00:49 -0400
|
Date: Tue, 26 Jun 2018 22:00:49 -0400
|
||||||
Subject: [PATCH] RangedEntity API
|
Subject: [PATCH] RangedEntity API
|
||||||
@ -8,7 +8,7 @@ and to perform an attack.
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java
|
diff --git a/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000..d85e4a203
|
index 000000000..696660b08
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java
|
+++ b/src/main/java/com/destroystokyo/paper/entity/CraftRangedEntity.java
|
||||||
@@ -0,0 +1,19 @@
|
@@ -0,0 +1,19 @@
|
||||||
@ -27,8 +27,8 @@ index 000000000..d85e4a203
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ @Override
|
+ @Override
|
||||||
+ default void setChargingAttack(boolean charging) {
|
+ default void setChargingAttack(boolean raiseHands) {
|
||||||
+ getHandle().setChargingAttack(charging);
|
+ getHandle().setChargingAttack(raiseHands);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/net/minecraft/server/IRangedEntity.java b/src/main/java/net/minecraft/server/IRangedEntity.java
|
diff --git a/src/main/java/net/minecraft/server/IRangedEntity.java b/src/main/java/net/minecraft/server/IRangedEntity.java
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren