aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0911-Add-api-for-spawn-egg-texture-colors.patch
blob: e75dc4c9615b879483490c99b33fa5ea03acf90e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 066d8f0592fa4fc9886eab7ca1ba1151b3748b95..44abd5742f2682b6224d6de90d52312000d20429 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -637,6 +637,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
     }
     // Paper end
 
+    // 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);
+        if (eggItem != null) {
+            throw new UnsupportedOperationException("Not yet implemented");
+        }
+        return eggItem == null ? null : org.bukkit.Color.fromRGB(1); // TODO
+    }
+    // Paper end - spawn egg color visibility
+
     /**
      * This helper class represents the different NBT Tags.
      * <p>