String portalType = (String)params.get(0);
if (portalType.equalsIgnoreCase("end")) {
Coordinate coord = player.getPosition();
int x = MathHelper.floor_double(coord.getX());
int z = MathHelper.floor_double(coord.getZ());
EntityDragon entityDragon = new EntityDragon(player.getWorld().getMinecraftWorld()); // EntityDragon
try {
Class<?>[] args = new Class<?>[]{Integer.TYPE, Integer.TYPE};
Method method;
try {
method = entityDragon.getClass().getDeclaredMethod("c", args);
} catch (NoSuchMethodException nsme) {
method = entityDragon.getClass().getDeclaredMethod("createEnderPortal", args);
}
method.setAccessible(true);
method.invoke(entityDragon, new Object[]{x, z});
} catch (Throwable t) {
t.printStackTrace();