even MOAR progress
This commit is contained in:
parent
42091ba5f0
commit
cfb17666ff
14 changed files with 156 additions and 268 deletions
30
patches/api/0222-Add-more-Evoker-API.patch
Normal file
30
patches/api/0222-Add-more-Evoker-API.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 23 Aug 2020 15:22:44 +0200
|
||||
Subject: [PATCH] Add more Evoker API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Evoker.java b/src/main/java/org/bukkit/entity/Evoker.java
|
||||
index f8d173adc09197418883dc7bc66dd8bfff8c5c72..76f81cd124090337876c9e5e469862a1c8da4ec8 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Evoker.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Evoker.java
|
||||
@@ -64,4 +64,19 @@ public interface Evoker extends Spellcaster {
|
||||
*/
|
||||
@Deprecated
|
||||
void setCurrentSpell(@Nullable Spell spell);
|
||||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * @return the sheep being targeted by the {@link Spell#WOLOLO wololo spell}, or {@code null} if none
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ Sheep getWololoTarget();
|
||||
+
|
||||
+ /**
|
||||
+ * Set the sheep to be the target of the {@link Spell#WOLOLO wololo spell}, or {@code null} to clear.
|
||||
+ *
|
||||
+ * @param sheep new wololo target
|
||||
+ */
|
||||
+ void setWololoTarget(@Nullable Sheep sheep);
|
||||
+ // Paper end
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
From 0000000000000000000000>>>>>>> replacement000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MeFisto94 <MeFisto94@users.noreply.github.com>
|
||||
Date: Tue, 11 Aug 2020 19:17:46 +0200
|
||||
Subject: [PATCH] Add a way to get translation keys for blocks, entities and
|
||||
materials
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 52290c43d1c02785c4cae4a73494a75cdc369e02..1efc97d88c38863bcd6cd4c11c8b88a18ee06b25 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -3992,6 +3992,16 @@ public enum Material implements Keyed {
|
||||
}
|
||||
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
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getTranslationKey() {
|
||||
+ return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ }
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index e348034288c74ab80360086d71f0b7f61551df24..2d9264ffe0fee863f1b814952ef063daa7962d76 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -101,5 +101,34 @@ public interface UnsafeValues {
|
||||
byte[] serializeItem(ItemStack item);
|
||||
|
||||
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
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 786b8011e98b2fe93cc2418d624f6350ede62d90..024deba760c41787190d20e4ac5c541920bb4991 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -610,5 +610,13 @@ public interface Block extends Metadatable {
|
||||
*/
|
||||
@NotNull
|
||||
com.destroystokyo.paper.block.BlockSoundGroup getSoundGroup();
|
||||
+
|
||||
+ /**
|
||||
+ * 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
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ String getTranslationKey();
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
index 9be5371c7f398d0ec8241403661415ff40661067..f415b61b0d4b57e1557aaf240a0f2ad5915035fc 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -419,4 +419,15 @@ public enum EntityType implements Keyed {
|
||||
public boolean isAlive() {
|
||||
return living;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * 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
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ String getTranslationKey() {
|
||||
+ return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 9a878e4fde31c015e2f3fdf365d5d16c30198685..bd96c06aca1fc18807e65c34f399ce2ebe891816 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -851,5 +851,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
|
||||
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
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public String getTranslationKey() {
|
||||
+ return Bukkit.getUnsafe().getTranslationKey(this);
|
||||
+ }
|
||||
// Paper end
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: ysl3000 <yannicklamprecht@live.de>
|
||||
Date: Mon, 6 Jul 2020 22:17:37 +0200
|
||||
Subject: [PATCH] Create HoverEvent from ItemStack Entity
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
index d773e8594f91017bddd7ea8aada3a1ff2781d05b..0a4466c6ca519c3a5da76ff870fb2a4e3a06effd 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
|
||||
@@ -184,5 +184,62 @@ public interface ItemFactory {
|
||||
*/
|
||||
@NotNull
|
||||
ItemStack ensureServerConversions(@NotNull ItemStack item);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack for displaying.
|
||||
+ *
|
||||
+ * @param itemStack
|
||||
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that ItemStack
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull ItemStack itemStack);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
||||
+ * Uses the display name of the entity, if present.
|
||||
+ *
|
||||
+ * @param entity Entity to create the HoverEvent for
|
||||
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
||||
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent()}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
||||
+ *
|
||||
+ * @param entity Entity to create the HoverEvent for
|
||||
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
||||
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
||||
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @Nullable String customName);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
||||
+ *
|
||||
+ * @param entity Entity to create the HoverEvent for
|
||||
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
||||
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
||||
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @Nullable net.md_5.bungee.api.chat.BaseComponent customName);
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity} for displaying.
|
||||
+ *
|
||||
+ * @param entity Entity to create the HoverEvent for
|
||||
+ * @param customName a custom name that should be displayed, if not passed entity name will be displayed
|
||||
+ * @return the {@link net.md_5.bungee.api.chat.hover.content.Content} of that {@link org.bukkit.entity.Entity}
|
||||
+ * @deprecated use {@link org.bukkit.entity.Entity#asHoverEvent(java.util.function.UnaryOperator)}
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ @Deprecated
|
||||
+ net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName);
|
||||
// Paper end
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue