[Bleeding] Add experimental support for entity portal traveling

This commit is contained in:
EdGruberman
2012-12-22 11:46:24 -07:00
committed by feildmaster
parent 9cb320654d
commit d834ca4c6c
11 changed files with 427 additions and 570 deletions

View File

@@ -3,6 +3,8 @@ package net.minecraft.server;
import java.util.List;
import java.util.Random;
import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
public class BlockEnderPortal extends BlockContainer {
public static boolean a = false;
@@ -38,6 +40,10 @@ public class BlockEnderPortal extends BlockContainer {
public void a(World world, int i, int j, int k, Entity entity) {
if (entity.vehicle == null && entity.passenger == null && !world.isStatic) {
// CraftBukkit start - Entity in portal
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), i, j, k));
world.getServer().getPluginManager().callEvent(event);
// CraftBukkit end
entity.b(1);
}
}