@@ -12,18 +12,18 @@
|
||||
+
|
||||
public class BlockPortal extends Block {
|
||||
|
||||
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.z;
|
||||
@@ -36,7 +42,8 @@
|
||||
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.D;
|
||||
@@ -34,7 +40,8 @@
|
||||
}
|
||||
|
||||
if (i > 0 && !world.getType(blockposition1.up()).isOccluding()) {
|
||||
- Entity entity = EntityTypes.ZOMBIE_PIGMAN.a(world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition1.up(), false, false);
|
||||
if (world.getType(blockposition).a((IBlockAccess) world, blockposition, EntityTypes.ZOMBIE_PIGMAN)) {
|
||||
- Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false);
|
||||
+ // CraftBukkit - set spawn reason to NETHER_PORTAL
|
||||
+ Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition1.up(), false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
+ Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(world, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
|
||||
if (entity != null) {
|
||||
entity.portalCooldown = entity.aQ();
|
||||
@@ -54,8 +61,10 @@
|
||||
entity.portalCooldown = entity.aW();
|
||||
@@ -48,8 +55,10 @@
|
||||
BlockPortal.Shape blockportal_shape = this.b(generatoraccess, blockposition);
|
||||
|
||||
if (blockportal_shape != null) {
|
||||
@@ -36,18 +36,18 @@
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -92,6 +101,10 @@
|
||||
|
||||
@@ -85,6 +94,10 @@
|
||||
@Override
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!entity.isPassenger() && !entity.isVehicle() && entity.bm()) {
|
||||
if (!entity.isPassenger() && !entity.isVehicle() && entity.canPortal()) {
|
||||
+ // CraftBukkit start - Entity in portal
|
||||
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+ // CraftBukkit end
|
||||
entity.e(blockposition);
|
||||
entity.c(blockposition);
|
||||
}
|
||||
|
||||
@@ -189,6 +202,7 @@
|
||||
@@ -177,6 +190,7 @@
|
||||
private BlockPosition position;
|
||||
private int height;
|
||||
private int width;
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
|
||||
this.a = generatoraccess;
|
||||
@@ -247,6 +261,9 @@
|
||||
@@ -235,6 +249,9 @@
|
||||
}
|
||||
|
||||
protected int c() {
|
||||
@@ -65,7 +65,7 @@
|
||||
int i;
|
||||
|
||||
label56:
|
||||
@@ -269,11 +286,21 @@
|
||||
@@ -257,11 +274,21 @@
|
||||
block = this.a.getType(blockposition.shift(this.d)).getBlock();
|
||||
if (block != Blocks.OBSIDIAN) {
|
||||
break label56;
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -283,6 +310,11 @@
|
||||
@@ -271,6 +298,11 @@
|
||||
if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) {
|
||||
this.height = 0;
|
||||
break;
|
||||
@@ -99,7 +99,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +338,27 @@
|
||||
@@ -294,7 +326,27 @@
|
||||
return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
for (int i = 0; i < this.width; ++i) {
|
||||
BlockPosition blockposition = this.position.shift(this.c, i);
|
||||
|
||||
@@ -315,6 +367,7 @@
|
||||
@@ -303,6 +355,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user