Paper/src/main/java/net/minecraft/server/BlockEnderPortal.java

67 Zeilen
1.7 KiB
Java

package net.minecraft.server;
import java.util.List;
import java.util.Random;
import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
public class BlockEnderPortal extends BlockContainer {
2013-07-01 13:03:00 +02:00
public static boolean a;
2013-11-04 14:07:38 +01:00
protected BlockEnderPortal(Material material) {
super(material);
this.a(1.0F);
}
2013-11-04 14:07:38 +01:00
public TileEntity a(World world, int i) {
return new TileEntityEnderPortal();
}
public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
float f = 0.0625F;
this.a(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
}
public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List list, Entity entity) {}
public boolean c() {
return false;
}
2013-11-04 14:07:38 +01:00
public boolean d() {
return false;
}
public int a(Random random) {
return 0;
}
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
2013-07-01 13:03:00 +02:00
entity.b(1);
}
}
2013-11-04 14:07:38 +01:00
public int b() {
return -1;
}
public void onPlace(World world, int i, int j, int k) {
if (!a) {
if (world.worldProvider.dimension != 0) {
2013-03-13 23:33:27 +01:00
world.setAir(i, j, k);
}
}
}
2013-11-04 14:07:38 +01:00
public MaterialMapColor f(int i) {
return MaterialMapColor.J;
}
}