3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-17 20:10:10 +01:00
Paper/CraftBukkit-Patches/0060-Create-CraftHorse-Instance-for-EntityHorse.patch
Mike Primm a7014a3eb7 Create CraftHorse Instance for EntityHorse
Handle creating instance of CraftHorse for EntityHorse instances and spawn()
Pulls Bukkit/CraftBukkit#1185
2013-07-05 12:22:01 +10:00

36 Zeilen
1.9 KiB
Diff

From f4021d998e46e7453c071ed237055ffb1db2e41d Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Thu, 4 Jul 2013 00:03:42 -0500
Subject: [PATCH] Create CraftHorse Instance for EntityHorse
Handle creating instance of CraftHorse for EntityHorse instances and spawn()
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9da1a47..88745a4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -893,6 +893,8 @@ public class CraftWorld implements World {
entity = new EntityCreeper(world);
} else if (Ghast.class.isAssignableFrom(clazz)) {
entity = new EntityGhast(world);
+ } else if (Horse.class.isAssignableFrom(clazz)) {
+ entity = new EntityHorse(world);
} else if (Pig.class.isAssignableFrom(clazz)) {
entity = new EntityPig(world);
} else if (Player.class.isAssignableFrom(clazz)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 97f3c1d..4aec8e9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -51,6 +51,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityOcelot) { return new CraftOcelot(server, (EntityOcelot) entity); }
}
else if (entity instanceof EntitySheep) { return new CraftSheep(server, (EntitySheep) entity); }
+ else if (entity instanceof EntityHorse) { return new CraftHorse(server, (EntityHorse) entity); }
else { return new CraftAnimals(server, (EntityAnimal) entity); }
}
// Monsters
--
1.8.1.2