mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Updated Upstream (Bukkit/CraftBukkit) (#8832)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 37262de8 PR-812: Add Registry#match(String) d6b40162 SPIGOT-4569: Add more BlockData API f9691891 PR-809: Throw a more clear error for BlockIterators with zero direction, add Vector#isZero() 91e79e19 PR-804: Added methods to get translation keys for materials, itemstacks and more 426b00d3 PR-795: Add new BiomeParameterPoint passed to BiomeProvider#getBiome 0e91ea52 SPIGOT-7224: Add events for brewing stands and campfires starting their actions CraftBukkit Changes: a50301aa5 Fix issues with fluid tag conversion and fluid #isTagged 6aeb5e4c3 SPIGOT-4569: Implement more BlockData API 7dbf862c2 PR-1131: Added methods to get translation keys for materials, itemstacks and more 7167588b1 PR-1117: Add new BiomeParameterPoint passed to BiomeProvider#getBiome 7c44152eb SPIGOT-7224: Add events for brewing stands and campfires starting their actions
This commit is contained in:
parent
bd166747a6
commit
f9e1ad2c2d
46 changed files with 278 additions and 320 deletions
|
@ -12,7 +12,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
|
||||
@NotNull
|
||||
BlockState getState();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
public static int getBlockKeyZ(long packed) {
|
||||
return (int) ((packed << 10) >> 37);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
|
||||
* @return <code>true</code> if the block data can be placed here
|
||||
*/
|
||||
boolean canPlace(@NotNull BlockData data);
|
||||
|
|
|
@ -9,9 +9,9 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@Deprecated(forRemoval = true)
|
||||
String getTranslationKey();
|
||||
+
|
||||
+ /**
|
||||
|
|
|
@ -21,8 +21,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ org.bukkit.entity.Entity deserializeEntity(byte[] data, World world, boolean preserveUUID);
|
||||
+
|
||||
/**
|
||||
* Return the translation key for the Material, so the client can translate it into the active
|
||||
* locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.
|
||||
* Creates and returns the next EntityId available.
|
||||
* <p>
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
|
|
|
@ -23,7 +23,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return Bukkit.getServer().getItemFactory().ensureServerConversions(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
}
|
||||
|
||||
// Paper start
|
||||
|
|
|
@ -54,7 +54,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
* Returns the biome that this block resides in
|
||||
*
|
||||
* @return Biome type containing this block
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MelnCat <melncatuwu@gmail.com>
|
||||
Date: Fri, 12 Aug 2022 23:24:53 -0700
|
||||
Subject: [PATCH] Add getDrops to BlockState and isPreferredTool to BlockData
|
||||
Subject: [PATCH] Add getDrops to BlockState
|
||||
|
||||
Originally added isPreferredTool to BlockData but
|
||||
upstream added that.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -43,24 +45,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ java.util.@org.jetbrains.annotations.Unmodifiable Collection<org.bukkit.inventory.ItemStack> getDrops(@NotNull org.bukkit.inventory.ItemStack tool, @Nullable org.bukkit.entity.Entity entity);
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
+++ b/src/main/java/org/bukkit/block/data/BlockData.java
|
||||
@@ -0,0 +0,0 @@ public interface BlockData extends Cloneable {
|
||||
* @return is ticked randomly
|
||||
*/
|
||||
boolean isRandomlyTicked();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns if the given item is a preferred choice to break this block.
|
||||
+ *
|
||||
+ * In some cases this determines if a block will drop anything or extra
|
||||
+ * loot.
|
||||
+ *
|
||||
+ * @param tool The tool or item used for breaking this block
|
||||
+ * @return true if the tool is preferred for breaking this block
|
||||
+ */
|
||||
+ boolean isPreferredTool(@NotNull org.bukkit.inventory.ItemStack tool);
|
||||
// Paper end
|
||||
}
|
|
@ -35,7 +35,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public @NotNull net.kyori.adventure.text.Component displayName() {
|
||||
return Bukkit.getServer().getItemFactory().displayName(this);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public Multimap<Attribute, AttributeModifier> getItemAttributes(@NotNull EquipmentSlot equipmentSlot) {
|
||||
return Bukkit.getUnsafe().getItemAttributes(this, equipmentSlot);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
* @return true if block is solid
|
||||
*/
|
||||
boolean isSolid();
|
||||
|
|
|
@ -151,73 +151,61 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* An enum of all material IDs accepted by the official server and client
|
||||
*/
|
||||
@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper
|
||||
-public enum Material implements Keyed {
|
||||
+public enum Material implements Keyed, net.kyori.adventure.translation.Translatable { // Paper
|
||||
-public enum Material implements Keyed, Translatable {
|
||||
+public enum Material implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper
|
||||
//<editor-fold desc="Materials" defaultstate="collapsed">
|
||||
AIR(9648, 0),
|
||||
STONE(22948),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed {
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the Material, so the client can translate it into the active
|
||||
+ * locale when using a TranslatableComponent.
|
||||
+ * @return the translation key
|
||||
+ * @deprecated use {@link #translationKey()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ public String getTranslationKey() {
|
||||
+ return this.translationKey();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull String translationKey() {
|
||||
+ return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ if (this.isItem()) {
|
||||
+ return Bukkit.getUnsafe().getItemTranslationKey(this);
|
||||
+ } else {
|
||||
+ return Bukkit.getUnsafe().getBlockTranslationKey(this);
|
||||
+ }
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable {
|
||||
* material
|
||||
* @see #getBlockTranslationKey()
|
||||
* @see #getItemTranslationKey()
|
||||
+ * @deprecated use {@link #translationKey()}
|
||||
*/
|
||||
@Override
|
||||
@NotNull
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
public String getTranslationKey() {
|
||||
if (this.isItem()) {
|
||||
return Bukkit.getUnsafe().getItemTranslationKey(this);
|
||||
diff --git a/src/main/java/org/bukkit/Translatable.java b/src/main/java/org/bukkit/Translatable.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||
byte[] serializeItem(ItemStack item);
|
||||
--- a/src/main/java/org/bukkit/Translatable.java
|
||||
+++ b/src/main/java/org/bukkit/Translatable.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Represents an object with a text representation that can be translated by the
|
||||
* Minecraft client.
|
||||
+ * @deprecated use {@link net.kyori.adventure.translation.Translatable}
|
||||
*/
|
||||
+@Deprecated(forRemoval = true) // Paper
|
||||
public interface Translatable {
|
||||
|
||||
ItemStack deserializeItem(byte[] data);
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the Material, so the client can translate it into the active
|
||||
+ * locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.
|
||||
+ * @return the translation key
|
||||
+ */
|
||||
+ String getTranslationKey(Material mat);
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the Block, so the client can translate it into the active
|
||||
+ * locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.
|
||||
+ * @return the translation key
|
||||
+ */
|
||||
+ String getTranslationKey(org.bukkit.block.Block block);
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the EntityType, so the client can translate it into the active
|
||||
+ * locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.<br>
|
||||
+ * This is <code>null</code>, when the EntityType isn't known to NMS (custom entities)
|
||||
+ * @return the translation key
|
||||
+ */
|
||||
+ String getTranslationKey(org.bukkit.entity.EntityType type);
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the ItemStack, so the client can translate it into the active
|
||||
+ * locale when using a {@link net.kyori.adventure.text.TranslatableComponent}.<br>
|
||||
+ * @return the translation key
|
||||
+ */
|
||||
+ String getTranslationKey(ItemStack itemStack);
|
||||
// Paper end
|
||||
/**
|
||||
* Get the translation key, suitable for use in a translation component.
|
||||
*
|
||||
* @return the translation key
|
||||
+ * @deprecated look for a {@code translationKey()} method instead
|
||||
*/
|
||||
@NotNull
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
String getTranslationKey();
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -276,24 +264,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* (i.e. lighting and power) may not be able to be safely accessed during world
|
||||
* generation when used in cases like BlockPhysicsEvent!!!!
|
||||
*/
|
||||
-public interface Block extends Metadatable {
|
||||
+public interface Block extends Metadatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
-public interface Block extends Metadatable, Translatable {
|
||||
+public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
|
||||
* @return the sound group for this block
|
||||
*/
|
||||
@NotNull org.bukkit.SoundGroup getBlockSoundGroup();
|
||||
+
|
||||
+ /**
|
||||
+ * Return the translation key for the Block, so the client can translate it into the active
|
||||
+ * locale when using a TranslatableComponent.
|
||||
+ * @return the translation key
|
||||
+ * @deprecated use {@link #translationKey()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ @Deprecated(forRemoval = true)
|
||||
+ String getTranslationKey();
|
||||
// Paper end
|
||||
}
|
||||
|
@ -333,29 +318,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
-public enum EntityType implements Keyed {
|
||||
+public enum EntityType implements Keyed, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
-public enum EntityType implements Keyed, Translatable {
|
||||
+public enum EntityType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
|
||||
// These strings MUST match the strings in nms.EntityTypes and are case sensitive.
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed {
|
||||
public boolean isAlive() {
|
||||
return living;
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed, Translatable {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
public String getTranslationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Return the translation key for the EntityType, so the client can translate it into the active
|
||||
+ * locale when using a TranslatableComponent.<br>
|
||||
+ * This is <code>null</code>, when the EntityType isn't known to NMS (custom entities)
|
||||
+ * @return the translation key
|
||||
+ * @deprecated use {@link #translationKey()}
|
||||
+ */
|
||||
+ @Deprecated
|
||||
+ @Nullable
|
||||
+ public String getTranslationKey() {
|
||||
+ return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity)
|
||||
+ */
|
||||
|
@ -480,31 +457,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* use this class to encapsulate Materials for which {@link Material#isItem()}
|
||||
* returns false.</b>
|
||||
*/
|
||||
-public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper
|
||||
+public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem>, net.kyori.adventure.translation.Translatable { // Paper
|
||||
-public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper
|
||||
+public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem>, net.kyori.adventure.translation.Translatable { // Paper
|
||||
private Material type = Material.AIR;
|
||||
private int amount = 0;
|
||||
private MaterialData data = null;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
public String getTranslationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
ItemMeta itemMeta = getItemMeta();
|
||||
return itemMeta != null && itemMeta.hasItemFlag(flag);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the translation key for this itemstack.
|
||||
+ * This is not the same as getting the translation key
|
||||
+ * for the material of this itemstack.
|
||||
+ *
|
||||
+ * @return the translation key
|
||||
+ * @deprecated use {@link #translationKey()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ public String getTranslationKey() {
|
||||
+ return this.translationKey();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * {@inheritDoc}
|
||||
+ * <p>
|
||||
+ * This is not the same as getting the translation key
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case ACACIA_DOOR:
|
||||
case ACACIA_FENCE:
|
||||
case ACACIA_FENCE_GATE:
|
||||
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case ACACIA_LOG:
|
||||
case ACACIA_PLANKS:
|
||||
case ACACIA_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case ACACIA_WOOD:
|
||||
case AZALEA:
|
||||
case BAMBOO:
|
||||
|
@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case BARREL:
|
||||
case BIRCH_BOAT:
|
||||
case BIRCH_BUTTON:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case BIRCH_DOOR:
|
||||
case BIRCH_FENCE:
|
||||
case BIRCH_FENCE_GATE:
|
||||
|
@ -52,7 +52,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case BIRCH_LOG:
|
||||
case BIRCH_PLANKS:
|
||||
case BIRCH_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case DARK_OAK_DOOR:
|
||||
case DARK_OAK_FENCE:
|
||||
case DARK_OAK_FENCE_GATE:
|
||||
|
@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case DARK_OAK_LOG:
|
||||
case DARK_OAK_PLANKS:
|
||||
case DARK_OAK_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case JUNGLE_DOOR:
|
||||
case JUNGLE_FENCE:
|
||||
case JUNGLE_FENCE_GATE:
|
||||
|
@ -68,7 +68,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case JUNGLE_LOG:
|
||||
case JUNGLE_PLANKS:
|
||||
case JUNGLE_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case MANGROVE_DOOR:
|
||||
case MANGROVE_FENCE:
|
||||
case MANGROVE_FENCE_GATE:
|
||||
|
@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case MANGROVE_LOG:
|
||||
case MANGROVE_PLANKS:
|
||||
case MANGROVE_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case OAK_DOOR:
|
||||
case OAK_FENCE:
|
||||
case OAK_FENCE_GATE:
|
||||
|
@ -84,7 +84,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case OAK_LOG:
|
||||
case OAK_PLANKS:
|
||||
case OAK_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case SPRUCE_DOOR:
|
||||
case SPRUCE_FENCE:
|
||||
case SPRUCE_FENCE_GATE:
|
||||
|
@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
case SPRUCE_LOG:
|
||||
case SPRUCE_PLANKS:
|
||||
case SPRUCE_PRESSURE_PLATE:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
case STICK:
|
||||
case STRIPPED_ACACIA_LOG:
|
||||
case STRIPPED_ACACIA_WOOD:
|
||||
|
|
|
@ -12,7 +12,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
*/
|
||||
boolean isLiquid();
|
||||
|
||||
|
|
|
@ -3712,14 +3712,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* use this class to encapsulate Materials for which {@link Material#isItem()}
|
||||
* returns false.</b>
|
||||
*/
|
||||
-public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
+public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper
|
||||
-public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable {
|
||||
+public class ItemStack implements Cloneable, ConfigurationSerializable, Translatable, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowItem> { // Paper
|
||||
private Material type = Material.AIR;
|
||||
private int amount = 0;
|
||||
private MaterialData data = null;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
|
||||
return true;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public String getTranslationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
|
|
|
@ -98,7 +98,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
|
||||
*/
|
||||
int getZ();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public io.papermc.paper.inventory.ItemRarity getItemRarity() {
|
||||
return Bukkit.getUnsafe().getItemRarity(this);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
|
||||
* @return true if the block was destroyed
|
||||
*/
|
||||
boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience);
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
public final Class<?> data;
|
||||
private final boolean legacy;
|
||||
private final NamespacedKey key;
|
||||
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
private Material(final int id) {
|
||||
this(id, 64);
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
* @return true if this material is a block
|
||||
*/
|
||||
public boolean isBlock() {
|
||||
|
@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isBlock">
|
||||
case ACACIA_BUTTON:
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
static {
|
||||
for (Material material : values()) {
|
||||
BY_NAME.put(material.name(), material);
|
||||
|
|
|
@ -10,9 +10,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||
* @return the translation key
|
||||
*/
|
||||
String getTranslationKey(ItemStack itemStack);
|
||||
byte[] serializeItem(ItemStack item);
|
||||
|
||||
ItemStack deserializeItem(byte[] data);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates and returns the next EntityId available.
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Tue, 7 Feb 2023 08:20:27 -0800
|
||||
Subject: [PATCH] Fix HandlerList for InventoryBlockStartEvent subclasses
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BrewingStartEvent.java b/src/main/java/org/bukkit/event/block/BrewingStartEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BrewingStartEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/BrewingStartEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class BrewingStartEvent extends InventoryBlockStartEvent {
|
||||
|
||||
- private static final HandlerList handlers = new HandlerList();
|
||||
+ // Paper - remove HandlerList
|
||||
private int brewingTime;
|
||||
|
||||
public BrewingStartEvent(@NotNull final Block furnace, @NotNull ItemStack source, int brewingTime) {
|
||||
@@ -0,0 +0,0 @@ public class BrewingStartEvent extends InventoryBlockStartEvent {
|
||||
this.brewingTime = brewTime;
|
||||
}
|
||||
|
||||
- @NotNull
|
||||
- @Override
|
||||
- public HandlerList getHandlers() {
|
||||
- return handlers;
|
||||
- }
|
||||
-
|
||||
- @NotNull
|
||||
- public static HandlerList getHandlerList() {
|
||||
- return handlers;
|
||||
- }
|
||||
+ // Paper - remove HandlerList
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/event/block/CampfireStartEvent.java b/src/main/java/org/bukkit/event/block/CampfireStartEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/CampfireStartEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/CampfireStartEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class CampfireStartEvent extends InventoryBlockStartEvent {
|
||||
|
||||
- private static final HandlerList handlers = new HandlerList();
|
||||
+ // Paper - remove HandlerList
|
||||
private int cookingTime;
|
||||
private CampfireRecipe campfireRecipe;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class CampfireStartEvent extends InventoryBlockStartEvent {
|
||||
this.cookingTime = cookTime;
|
||||
}
|
||||
|
||||
- @NotNull
|
||||
- @Override
|
||||
- public HandlerList getHandlers() {
|
||||
- return handlers;
|
||||
- }
|
||||
-
|
||||
- @NotNull
|
||||
- public static HandlerList getHandlerList() {
|
||||
- return handlers;
|
||||
- }
|
||||
+ // Paper - remove HandlerList
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Called when a Furnace starts smelting.
|
||||
*/
|
||||
public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
- private static final HandlerList handlers = new HandlerList();
|
||||
+ // Paper - remove HandlerList
|
||||
private final CookingRecipe<?> recipe;
|
||||
private int totalCookTime;
|
||||
|
||||
@@ -0,0 +0,0 @@ public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
this.totalCookTime = cookTime;
|
||||
}
|
||||
|
||||
- @NotNull
|
||||
- @Override
|
||||
- public HandlerList getHandlers() {
|
||||
- return handlers;
|
||||
- }
|
||||
-
|
||||
- @NotNull
|
||||
- public static HandlerList getHandlerList() {
|
||||
- return handlers;
|
||||
- }
|
||||
+ // Paper - remove HandlerList
|
||||
}
|
|
@ -82,7 +82,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed {
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public boolean isLegacy() {
|
||||
return legacy;
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed {
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable {
|
||||
* Gets the MaterialData class associated with this Material
|
||||
*
|
||||
* @return MaterialData associated with this Material
|
||||
|
@ -144,6 +144,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public enum NetherWartsState {
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Registry.java
|
||||
+++ b/src/main/java/org/bukkit/Registry.java
|
||||
@@ -0,0 +0,0 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
|
||||
*
|
||||
* @param input non-null input
|
||||
* @return registered object or null if does not exist
|
||||
+ * @deprecated this method's behavior is broken and not useful. If you want to get an object
|
||||
+ * based on its vanilla name, or a key, wrap it in a {@link NamespacedKey} object and use {@link #get(NamespacedKey)}
|
||||
*/
|
||||
@Nullable
|
||||
+ @Deprecated(forRemoval = true) // Paper
|
||||
default T match(@NotNull String input) {
|
||||
Preconditions.checkArgument(input != null, "input must not be null");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/SandstoneType.java b/src/main/java/org/bukkit/SandstoneType.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/SandstoneType.java
|
||||
|
@ -674,15 +690,15 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ import java.util.List; // Paper
|
||||
import java.util.Map;
|
||||
@@ -0,0 +0,0 @@ import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Translatable;
|
||||
+import org.bukkit.UndefinedNullability;
|
||||
import org.bukkit.Utility;
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
* @param damage durability / damage
|
||||
* @deprecated see {@link #setDurability(short)}
|
||||
*/
|
||||
|
@ -690,7 +706,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public ItemStack(@NotNull final Material type, final int amount, final short damage) {
|
||||
this(type, amount, damage, null);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
* Gets the MaterialData for this stack of items
|
||||
*
|
||||
* @return MaterialData for this item
|
||||
|
@ -701,7 +717,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public MaterialData getData() {
|
||||
Material mat = Bukkit.getUnsafe().toLegacy(getType());
|
||||
if (data == null && mat != null && mat.getData() != null) {
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
* Sets the MaterialData for this stack of items
|
||||
*
|
||||
* @param data New MaterialData for this item
|
||||
|
@ -711,7 +727,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public void setData(@Nullable MaterialData data) {
|
||||
if (data == null) {
|
||||
this.data = data;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
*
|
||||
* @return a copy of the current ItemStack's ItemData
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed, net.kyori.adventure.translation.Transla
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
Preconditions.checkArgument(this != UNKNOWN, "UNKNOWN entities do not have translation keys");
|
||||
return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
|
|
|
@ -40,20 +40,19 @@ diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
|
||||
@@ -0,0 +0,0 @@ public class FurnaceStartSmeltEvent extends BlockEvent {
|
||||
@@ -0,0 +0,0 @@ public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
|
||||
private final CookingRecipe<?> recipe;
|
||||
private int totalCookTime;
|
||||
|
||||
+ @Deprecated // Paper - furnace cook speed multiplier
|
||||
public FurnaceStartSmeltEvent(@NotNull final Block furnace, @NotNull ItemStack source, @NotNull final CookingRecipe<?> recipe) {
|
||||
+ // Paper start - furnace cook speed multiplier
|
||||
+ // Paper start
|
||||
+ this(furnace, source, recipe, recipe.getCookingTime());
|
||||
+ }
|
||||
+
|
||||
+ public FurnaceStartSmeltEvent(@NotNull final Block furnace, @NotNull ItemStack source, @NotNull CookingRecipe<?> recipe, int cookingTime) {
|
||||
+ public FurnaceStartSmeltEvent(final @NotNull Block furnace, final @NotNull ItemStack source, final @NotNull CookingRecipe<?> recipe, final int cookingTime) {
|
||||
+ // Paper end
|
||||
super(furnace);
|
||||
this.source = source;
|
||||
super(furnace, source);
|
||||
this.recipe = recipe;
|
||||
- this.totalCookTime = recipe.getCookingTime();
|
||||
+ this.totalCookTime = cookingTime; // Paper - furnace cook speed multiplier
|
||||
|
|
|
@ -13,7 +13,7 @@ diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukki
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable {
|
||||
@@ -0,0 +0,0 @@ public interface Block extends Metadatable, Translatable {
|
||||
*/
|
||||
boolean breakNaturally(@Nullable ItemStack tool);
|
||||
|
||||
|
|
|
@ -42,9 +42,9 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
public @NotNull String translationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
return Bukkit.getUnsafe().getBlockTranslationKey(this);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
|
@ -91,7 +91,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public @NotNull String translationKey() {
|
||||
return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
import java.util.Map;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
// Requires access to NMS
|
||||
return ensureServerConversions().getMaxItemUseDuration();
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public boolean canRepair(@NotNull ItemStack toBeRepaired) {
|
||||
return Bukkit.getUnsafe().isValidRepairItemStack(toBeRepaired, this);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return result.ensureServerConversions(); // Paper
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public String getI18NDisplayName() {
|
||||
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
public io.papermc.paper.inventory.ItemRarity getRarity() {
|
||||
return Bukkit.getUnsafe().getItemStackRarity(this);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/M
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
ACACIA_PLANKS(31312),
|
||||
DARK_OAK_PLANKS(20869),
|
||||
MANGROVE_PLANKS(7078),
|
||||
|
@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_MOSAIC(10715),
|
||||
/**
|
||||
* BlockData: {@link Sapling}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Orientable}
|
||||
*/
|
||||
|
@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_BLOCK(20770, Orientable.class),
|
||||
/**
|
||||
* BlockData: {@link Orientable}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Orientable}
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
STRIPPED_BAMBOO_BLOCK(14799, Orientable.class),
|
||||
/**
|
||||
* BlockData: {@link Orientable}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Slab}
|
||||
*/
|
||||
|
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_MOSAIC_SLAB(22118, Slab.class),
|
||||
/**
|
||||
* BlockData: {@link Slab}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link ChiseledBookshelf}
|
||||
*/
|
||||
|
@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
CHISELED_BOOKSHELF(8099, ChiseledBookshelf.class),
|
||||
MOSSY_COBBLESTONE(21900),
|
||||
OBSIDIAN(32723),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Fence}
|
||||
*/
|
||||
|
@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_FENCE(17207, Fence.class),
|
||||
/**
|
||||
* BlockData: {@link Fence}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Stairs}
|
||||
*/
|
||||
|
@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_MOSAIC_STAIRS(20977, Stairs.class),
|
||||
/**
|
||||
* BlockData: {@link Stairs}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Switch}
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_BUTTON(21810, Switch.class),
|
||||
/**
|
||||
* BlockData: {@link Switch}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Powerable}
|
||||
*/
|
||||
|
@ -94,7 +94,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_PRESSURE_PLATE(26740, Powerable.class),
|
||||
/**
|
||||
* BlockData: {@link Powerable}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Door}
|
||||
*/
|
||||
|
@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_DOOR(19971, Door.class),
|
||||
/**
|
||||
* BlockData: {@link Door}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link TrapDoor}
|
||||
*/
|
||||
|
@ -110,7 +110,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_TRAPDOOR(9174, TrapDoor.class),
|
||||
/**
|
||||
* BlockData: {@link TrapDoor}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Gate}
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_FENCE_GATE(14290, Gate.class),
|
||||
/**
|
||||
* BlockData: {@link Gate}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
DARK_OAK_CHEST_BOAT(8733, 1),
|
||||
MANGROVE_BOAT(20792, 1),
|
||||
MANGROVE_CHEST_BOAT(18572, 1),
|
||||
|
@ -128,7 +128,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_CHEST_RAFT(20056, 1),
|
||||
/**
|
||||
* BlockData: {@link StructureBlock}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Sign}
|
||||
*/
|
||||
|
@ -136,7 +136,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_SIGN(26139, 16, Sign.class),
|
||||
/**
|
||||
* BlockData: {@link Sign}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link HangingSign}
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
WARPED_HANGING_SIGN(8195, 16, HangingSign.class),
|
||||
BUCKET(15215, 16),
|
||||
WATER_BUCKET(8802, 1),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
EGG(21603, 16),
|
||||
COMPASS(24139),
|
||||
RECOVERY_COMPASS(12710),
|
||||
|
@ -197,7 +197,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BUNDLE(16835, 1),
|
||||
FISHING_ROD(4167, 1, 64),
|
||||
CLOCK(14980),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
BEE_SPAWN_EGG(22924),
|
||||
BLAZE_SPAWN_EGG(4759),
|
||||
CAT_SPAWN_EGG(29583),
|
||||
|
@ -205,7 +205,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
CAMEL_SPAWN_EGG(14760),
|
||||
CAVE_SPIDER_SPAWN_EGG(23341),
|
||||
CHICKEN_SPAWN_EGG(5462),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Rotatable}
|
||||
*/
|
||||
|
@ -213,7 +213,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
PIGLIN_HEAD(5512, Rotatable.class),
|
||||
NETHER_STAR(12469),
|
||||
PUMPKIN_PIE(28725),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link WallSign}
|
||||
*/
|
||||
|
@ -271,7 +271,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BAMBOO_WALL_HANGING_SIGN(6669, WallHangingSign.class),
|
||||
/**
|
||||
* BlockData: {@link RedstoneWallTorch}
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, net.kyori.adventure.translation.Translata
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
/**
|
||||
* BlockData: {@link Directional}
|
||||
*/
|
||||
|
@ -430,7 +430,7 @@ diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed, net.kyori.adventure.translation.Transla
|
||||
@@ -0,0 +0,0 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
FROG("frog", Frog.class, -1),
|
||||
TADPOLE("tadpole", Tadpole.class, -1),
|
||||
WARDEN("warden", Warden.class, -1),
|
||||
|
|
|
@ -13,10 +13,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* An enum of all material IDs accepted by the official server and client
|
||||
*/
|
||||
+@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper
|
||||
public enum Material implements Keyed {
|
||||
public enum Material implements Keyed, Translatable {
|
||||
//<editor-fold desc="Materials" defaultstate="collapsed">
|
||||
AIR(9648, 0),
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed {
|
||||
@@ -0,0 +0,0 @@ public enum Material implements Keyed, Translatable {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2846,9 +2846,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
Material fromLegacy(Material material);
|
||||
@@ -0,0 +0,0 @@ public interface UnsafeValues {
|
||||
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
|
||||
String getTranslationKey(EntityType entityType);
|
||||
|
||||
CreativeCategory getCreativeCategory(Material material);
|
||||
String getTranslationKey(ItemStack itemStack);
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
|
|
|
@ -32,7 +32,7 @@ diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/o
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
@@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return Bukkit.getServer().getItemFactory().displayName(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
|
||||
public String translationKey() {
|
||||
return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
|
||||
return this.getNMS().getBlock().getDescriptionId();
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MelnCat <melncatuwu@gmail.com>
|
||||
Date: Fri, 12 Aug 2022 23:24:37 -0700
|
||||
Subject: [PATCH] Add getDrops to BlockState and isPreferredTool to BlockData
|
||||
Subject: [PATCH] Add getDrops to BlockState
|
||||
|
||||
Originally added isPreferredTool to BlockData but
|
||||
upstream added that.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
|
@ -42,20 +44,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData {
|
||||
return this.state.isRandomlyTicking();
|
||||
}
|
||||
// Paper end
|
||||
+
|
||||
+ // Paper start - Preferred tool API
|
||||
+ @Override
|
||||
+ public boolean isPreferredTool(org.bukkit.inventory.ItemStack item) {
|
||||
+ net.minecraft.world.item.ItemStack nms = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(item);
|
||||
+ return !state.requiresCorrectToolForDrops() || nms.isCorrectToolForDrops(state);
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
|
@ -19,13 +19,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTranslationKey() {
|
||||
+ return this.translationKey();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String translationKey() {
|
||||
+ return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ return this.getNMS().getBlock().getDescriptionId();
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
||||
|
@ -45,41 +40,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// Paper end
|
||||
|
||||
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
||||
return compound;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTranslationKey(Material mat) {
|
||||
+ if (mat.isBlock()) {
|
||||
+ return getBlock(mat).getDescriptionId();
|
||||
+ }
|
||||
+ return getItem(mat).getDescriptionId();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTranslationKey(org.bukkit.block.Block block) {
|
||||
+ return ((org.bukkit.craftbukkit.block.CraftBlock)block).getNMS().getBlock().getDescriptionId();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTranslationKey(org.bukkit.entity.EntityType type) {
|
||||
+ return net.minecraft.world.entity.EntityType.byString(type.getName()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElse(null);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public String getTranslationKey(org.bukkit.inventory.ItemStack itemStack) {
|
||||
+ net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
|
||||
+ return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java b/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/test/java/io/papermc/paper/world/TranslationKeyTest.java
|
||||
|
|
|
@ -25,10 +25,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
|
||||
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!");
|
||||
return compound;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextEntityId() {
|
||||
+ return net.minecraft.world.entity.Entity.nextEntityId();
|
||||
+ }
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Tue, 1 Mar 2022 12:45:50 -0800
|
||||
Subject: [PATCH] Fix Fluid tags isTagged method
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFluidTag extends CraftTag<net.minecraft.world.level.material.F
|
||||
|
||||
@Override
|
||||
public boolean isTagged(Fluid fluid) {
|
||||
- return CraftMagicNumbers.getFluid(fluid).is(tag);
|
||||
+ return registry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.Registry.FLUID_REGISTRY, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(fluid.getKey()))).is(tag); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CraftMagicNumbers.MATERIAL_BLOCK.get(material);
|
||||
}
|
||||
|
||||
- public static net.minecraft.world.level.material.Fluid getFluid(Fluid fluid) {
|
||||
+ public static net.minecraft.world.level.material.Fluid getFluid(Material fluid) { // Paper - wrong type
|
||||
return CraftMagicNumbers.MATERIAL_FLUID.get(fluid);
|
||||
}
|
||||
|
|
@ -54,8 +54,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CraftBlock implements Block {
|
||||
|
||||
return iblockdata.canSurvive(world, this.position);
|
||||
public String getTranslationKey() {
|
||||
return this.getNMS().getBlock().getDescriptionId();
|
||||
}
|
||||
+
|
||||
+ // Paper start
|
||||
|
|
|
@ -7622,9 +7622,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
private static final BiMap<net.minecraft.world.level.material.Fluid, Fluid> FLUIDTYPE_FLUID = HashBiMap.create();
|
||||
private static final Map<Material, Item> MATERIAL_ITEM = new HashMap<>();
|
||||
private static final Map<Material, Block> MATERIAL_BLOCK = new HashMap<>();
|
||||
private static final Map<Material, net.minecraft.world.level.material.Fluid> MATERIAL_FLUID = new HashMap<>();
|
||||
+ // Paper start
|
||||
+ private static final Map<org.bukkit.entity.EntityType, net.minecraft.world.entity.EntityType<?>> ENTITY_TYPE_ENTITY_TYPES = new HashMap<>();
|
||||
+ private static final Map<net.minecraft.world.entity.EntityType<?>, org.bukkit.entity.EntityType> ENTITY_TYPES_ENTITY_TYPE = new HashMap<>();
|
||||
|
|
|
@ -2038,7 +2038,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public static byte toLegacyData(BlockState data) {
|
||||
return CraftLegacy.toLegacyData(data);
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
return CreativeCategory.BUILDING_BLOCKS; // TODO: Figure out what to do with this
|
||||
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
|
|
@ -38,20 +38,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(entity, type -> ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(type.getKey())))).is(tag); // Paper - cache key
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftFluidTag.java
|
||||
@@ -0,0 +0,0 @@ public class CraftFluidTag extends CraftTag<net.minecraft.world.level.material.F
|
||||
super(registry, tag);
|
||||
}
|
||||
|
||||
+ private static final java.util.Map<Fluid, net.minecraft.resources.ResourceKey<net.minecraft.world.level.material.Fluid>> KEY_CACHE = Collections.synchronizedMap(new java.util.EnumMap<>(Fluid.class)); // Paper
|
||||
@Override
|
||||
public boolean isTagged(Fluid fluid) {
|
||||
- return registry.getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.Registry.FLUID_REGISTRY, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(fluid.getKey()))).is(tag); // Paper
|
||||
+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(fluid, f -> net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.FLUID, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(f.getKey())))).is(tag); // Paper - cache key
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 22f8c20898698bdd5fe348404a49d0cad36fef0b
|
||||
Subproject commit 37262de84b9613e61809f31691e6f9db48dce0a8
|
|
@ -1 +1 @@
|
|||
Subproject commit 39462a898595280d1a1c6197c2ad66082434ba80
|
||||
Subproject commit a50301aa51aab7aa25869d921fa0c6a65eeda547
|
Loading…
Reference in a new issue