2024-01-27 19:32:05 +01:00
|
|
|
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
|
2024-05-29 20:27:29 +02:00
|
|
|
index cb72cc3e2b86b447e51236a70a4dd04a611ac81c..00cf4a0daa227e6b24ed052873290ff3fdae3119 100644
|
2024-01-27 19:32:05 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
2024-05-29 20:27:29 +02:00
|
|
|
@@ -653,6 +653,15 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
2024-05-11 23:48:37 +02:00
|
|
|
return CraftRegistry.get(registry, namespacedKey, ApiVersion.CURRENT);
|
2024-01-27 19:32:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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>
|