@Override public int[] getEntitiesIDs() { if (isSpawned()) { return new int[] {nmsVehicle.getIdNMS(), nmsSlime.getIdNMS()}; } else { return new int[0]; } }
@Override public void despawn() { super.despawn(); if (nmsSlime != null) { nmsSlime.killEntityNMS(); nmsSlime = null; } if (nmsVehicle != null) { nmsVehicle.killEntityNMS(); nmsVehicle = null; } }
@Override public void teleport(double x, double y, double z) { double offset = HolographicDisplays.is1_8() ? Offsets.ARMOR_STAND_WITH_SLIME : Offsets.WITHER_SKULL_WITH_SLIME; if (nmsVehicle != null) { nmsVehicle.setLocationNMS(x, y + offset, z); } if (nmsSlime != null) { nmsSlime.setLocationNMS(x, y + offset, z); } }
@Override public void spawn(World world, double x, double y, double z) { super.spawn(world, x, y, z); double offset = HolographicDisplays.is1_8() ? Offsets.ARMOR_STAND_WITH_SLIME : Offsets.WITHER_SKULL_WITH_SLIME; nmsSlime = HolographicDisplays.getNMSManager().spawnNMSSlime(world, x, y + offset, z, this); if (HolographicDisplays.is1_8()) { nmsVehicle = HolographicDisplays.getNMSManager().spawnNMSArmorStand(world, x, y + offset, z, this); } else { nmsVehicle = HolographicDisplays.getNMSManager().spawnNMSWitherSkull(world, x, y + offset, z, this); } nmsSlime.setPassengerOfNMS(nmsVehicle); nmsSlime.setLockTick(true); nmsVehicle.setLockTick(true); }