From 099f733989def2414dda184f5922b570ff18533a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 24 May 2018 15:24:41 +1000 Subject: [PATCH] Fixes #1012 --- .../fawe/bukkit/v1_12/BukkitChunk_1_12.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_12/BukkitChunk_1_12.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_12/BukkitChunk_1_12.java index c432a666..3f4eedbb 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_12/BukkitChunk_1_12.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/v1_12/BukkitChunk_1_12.java @@ -3,7 +3,6 @@ package com.boydti.fawe.bukkit.v1_12; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweCache; import com.boydti.fawe.bukkit.v0.BukkitQueue_0; -import com.boydti.fawe.config.Settings; import com.boydti.fawe.example.CharFaweChunk; import com.boydti.fawe.object.FaweChunk; import com.boydti.fawe.object.FaweQueue; @@ -12,16 +11,17 @@ import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.ReflectionUtils; import com.sk89q.jnbt.*; import com.sk89q.worldedit.internal.Constants; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.*; import net.minecraft.server.v1_12_R1.*; import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.craftbukkit.v1_12_R1.CraftChunk; import org.bukkit.event.entity.CreatureSpawnEvent; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + public class BukkitChunk_1_12 extends CharFaweChunk { public DataPaletteBlock[] sectionPalettes; @@ -302,8 +302,9 @@ public class BukkitChunk_1_12 extends CharFaweChunk { for (MinecraftKey key : EntityTypes.a()) { String currentId = EntityTypes.a(key); Class clazz = EntityTypes.b.get(key); - entityKeys.put(currentId, clazz); - entityKeys.put(key.getKey(), clazz); + entityKeys.putIfAbsent(currentId, clazz); + entityKeys.putIfAbsent(key.getKey(), clazz); + entityKeys.put(key.b() + ":" + key.getKey(), clazz); } } Class clazz = entityKeys.get(id);