mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-24 03:15:12 +01:00
Fix "touch slime" not showing up
This commit is contained in:
parent
22fce3aa2b
commit
9ea8c99929
@ -22,8 +22,12 @@ import com.gmail.filoghost.holographicdisplays.object.line.CraftItemLine;
|
||||
import com.gmail.filoghost.holographicdisplays.object.line.CraftTouchSlimeLine;
|
||||
import com.gmail.filoghost.holographicdisplays.util.DebugHandler;
|
||||
import com.gmail.filoghost.holographicdisplays.util.Validator;
|
||||
import com.gmail.filoghost.holographicdisplays.util.VersionUtils;
|
||||
|
||||
import net.minecraft.server.v1_11_R1.Entity;
|
||||
import net.minecraft.server.v1_11_R1.EntityTypes;
|
||||
import net.minecraft.server.v1_11_R1.MathHelper;
|
||||
import net.minecraft.server.v1_11_R1.MinecraftKey;
|
||||
import net.minecraft.server.v1_11_R1.World;
|
||||
import net.minecraft.server.v1_11_R1.WorldServer;
|
||||
|
||||
@ -35,6 +39,18 @@ public class NmsManagerImpl implements NMSManager {
|
||||
public void setup() throws Exception {
|
||||
validateEntityMethod = World.class.getDeclaredMethod("b", Entity.class);
|
||||
validateEntityMethod.setAccessible(true);
|
||||
|
||||
registerCustomEntity(EntityNMSSlime.class, "slimeHolographicDisplays", 55);
|
||||
}
|
||||
|
||||
public void registerCustomEntity(Class<? extends Entity> entityClass, String nameId, int id) throws Exception {
|
||||
if (VersionUtils.isMCPCOrCauldron()) {
|
||||
// MCPC+ / Cauldron entity registration.
|
||||
throw new UnsupportedOperationException("MCPC, Cauldron and similar softwares are not supported");
|
||||
} else {
|
||||
// Normal entity registration.
|
||||
EntityTypes.b.a(id, new MinecraftKey(nameId), entityClass);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user