mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 17:17:13 +01:00
26 lines
1.4 KiB
Diff
26 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Luis <luisc99@icloud.com>
|
|
Date: Thu, 11 Jan 2024 19:58:23 +0100
|
|
Subject: [PATCH] Add api for spawn egg texture colors
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
index fa3add7cc39997d137b9dbc2178e08e9a6e5f31a..b6591836a8d9301b8cf909223426df0e8e675c1f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
@@ -643,6 +643,15 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
|
return CraftRegistry.get(registry, namespacedKey, ApiVersion.CURRENT);
|
|
}
|
|
|
|
+ // Paper start - spawn egg color visibility
|
|
+ @Override
|
|
+ public org.bukkit.Color getSpawnEggLayerColor(final EntityType entityType, final int layer) {
|
|
+ final net.minecraft.world.entity.EntityType<?> nmsType = org.bukkit.craftbukkit.entity.CraftEntityType.bukkitToMinecraft(entityType);
|
|
+ final net.minecraft.world.item.SpawnEggItem eggItem = net.minecraft.world.item.SpawnEggItem.byId(nmsType);
|
|
+ return eggItem == null ? null : org.bukkit.Color.fromRGB(eggItem.getColor(layer));
|
|
+ }
|
|
+ // Paper end - spawn egg color visibility
|
|
+
|
|
/**
|
|
* This helper class represents the different NBT Tags.
|
|
* <p>
|