2013-01-19 12:51:18 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Random;
|
|
|
|
|
2012-12-22 19:46:24 +01:00
|
|
|
import org.bukkit.event.entity.EntityPortalEnterEvent; // CraftBukkit
|
|
|
|
|
2013-01-19 12:51:18 +01:00
|
|
|
public class BlockEnderPortal extends BlockContainer {
|
|
|
|
|
2013-07-01 13:03:00 +02:00
|
|
|
public static boolean a;
|
2013-01-19 12:51:18 +01:00
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
protected BlockEnderPortal(Material material) {
|
|
|
|
super(material);
|
2013-01-19 12:51:18 +01:00
|
|
|
this.a(1.0F);
|
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public TileEntity a(World world, int i) {
|
2013-01-19 12:51:18 +01:00
|
|
|
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() {
|
2013-01-19 12:51:18 +01:00
|
|
|
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) {
|
2012-12-22 19:46:24 +01:00
|
|
|
// 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-01-19 12:51:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-04 14:07:38 +01:00
|
|
|
public int b() {
|
2013-01-19 12:51:18 +01:00
|
|
|
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-01-19 12:51:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-11-04 14:07:38 +01:00
|
|
|
|
|
|
|
public MaterialMapColor f(int i) {
|
|
|
|
return MaterialMapColor.J;
|
|
|
|
}
|
2013-01-19 12:51:18 +01:00
|
|
|
}
|