mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
#1361: Add more translation keys
By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
parent
d76a8e373b
commit
434aec3832
5 changed files with 30 additions and 0 deletions
|
@ -148,6 +148,11 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
|
|||
return !handle.isCompatibleWith(ench.getHandle());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
return handle.getDescriptionId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.bukkit.craftbukkit.inventory.trim;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.craftbukkit.CraftRegistry;
|
||||
|
@ -36,4 +37,10 @@ public class CraftTrimMaterial implements TrimMaterial, Handleable<net.minecraft
|
|||
public NamespacedKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
return ((TranslatableContents) handle.description().getContents()).getKey();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.bukkit.craftbukkit.inventory.trim;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.contents.TranslatableContents;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.craftbukkit.CraftRegistry;
|
||||
|
@ -36,4 +37,10 @@ public class CraftTrimPattern implements TrimPattern, Handleable<net.minecraft.w
|
|||
public NamespacedKey getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
return ((TranslatableContents) handle.description().getContents()).getKey();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,6 +108,12 @@ public class CraftPotionEffectType extends PotionEffectType implements Handleabl
|
|||
return Color.fromRGB(handle.getColor());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getTranslationKey() {
|
||||
return handle.getDescriptionId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
|
|
|
@ -375,6 +375,11 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|||
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslationKey(final Attribute attribute) {
|
||||
return CraftAttribute.bukkitToMinecraft(attribute).getDescriptionId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureFlag getFeatureFlag(NamespacedKey namespacedKey) {
|
||||
Preconditions.checkArgument(namespacedKey != null, "NamespaceKey cannot be null");
|
||||
|
|
Loading…
Reference in a new issue