@@ -13,19 +13,19 @@
|
||||
+
|
||||
public class BlockPortal extends Block {
|
||||
|
||||
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.D;
|
||||
public static final BlockStateEnum<EnumDirection.EnumAxis> AXIS = BlockProperties.E;
|
||||
@@ -34,7 +41,8 @@
|
||||
}
|
||||
|
||||
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIE_PIGMAN)) {
|
||||
- Entity entity = EntityTypes.ZOMBIE_PIGMAN.spawnCreature(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false);
|
||||
if (worldserver.getType(blockposition).a((IBlockAccess) worldserver, blockposition, EntityTypes.ZOMBIFIED_PIGLIN)) {
|
||||
- Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, (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(worldserver, (NBTTagCompound) null, (IChatBaseComponent) null, (EntityHuman) null, blockposition.up(), EnumMobSpawn.STRUCTURE, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NETHER_PORTAL);
|
||||
+ Entity entity = EntityTypes.ZOMBIFIED_PIGLIN.spawnCreature(worldserver, (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.ba();
|
||||
entity.portalCooldown = entity.getDefaultPortalCooldown();
|
||||
@@ -48,8 +56,10 @@
|
||||
BlockPortal.Shape blockportal_shape = this.b(generatoraccess, blockposition);
|
||||
BlockPortal.Shape blockportal_shape = b(generatoraccess, blockposition);
|
||||
|
||||
if (blockportal_shape != null) {
|
||||
- blockportal_shape.createPortal();
|
||||
@@ -45,7 +45,7 @@
|
||||
+ 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.c(blockposition);
|
||||
entity.d(blockposition);
|
||||
}
|
||||
|
||||
@@ -172,6 +186,7 @@
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
public Shape(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection.EnumAxis enumdirection_enumaxis) {
|
||||
this.a = generatoraccess;
|
||||
@@ -230,6 +245,9 @@
|
||||
@@ -228,6 +243,9 @@
|
||||
}
|
||||
|
||||
protected int c() {
|
||||
@@ -66,9 +66,9 @@
|
||||
int i;
|
||||
|
||||
label56:
|
||||
@@ -252,11 +270,21 @@
|
||||
block = this.a.getType(blockposition.shift(this.d)).getBlock();
|
||||
if (block != Blocks.OBSIDIAN) {
|
||||
@@ -247,9 +265,19 @@
|
||||
if (i == 0) {
|
||||
if (!this.a.getType(blockposition.shift(this.d)).a(Blocks.OBSIDIAN)) {
|
||||
break label56;
|
||||
+ // CraftBukkit start - add the block to our list
|
||||
+ } else {
|
||||
@@ -76,20 +76,18 @@
|
||||
+ blocks.add(CraftBlock.at(this.a, pos).getState());
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else if (i == this.width - 1) {
|
||||
block = this.a.getType(blockposition.shift(this.c)).getBlock();
|
||||
if (block != Blocks.OBSIDIAN) {
|
||||
break label56;
|
||||
+ // CraftBukkit start - add the block to our list
|
||||
+ } else {
|
||||
+ BlockPosition pos = blockposition.shift(this.c);
|
||||
+ blocks.add(CraftBlock.at(this.a, pos).getState());
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else if (i == this.width - 1 && !this.a.getType(blockposition.shift(this.c)).a(Blocks.OBSIDIAN)) {
|
||||
break label56;
|
||||
+ // CraftBukkit start - add the block to our list
|
||||
+ } else {
|
||||
+ BlockPosition pos = blockposition.shift(this.c);
|
||||
+ blocks.add(CraftBlock.at(this.a, pos).getState());
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -266,6 +294,11 @@
|
||||
if (this.a.getType(this.position.shift(this.c, i).up(this.height)).getBlock() != Blocks.OBSIDIAN) {
|
||||
}
|
||||
@@ -258,6 +286,11 @@
|
||||
if (!this.a.getType(this.position.shift(this.c, i).up(this.height)).a(Blocks.OBSIDIAN)) {
|
||||
this.height = 0;
|
||||
break;
|
||||
+ // CraftBukkit start - add the block to our list
|
||||
@@ -100,7 +98,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +322,29 @@
|
||||
@@ -279,7 +312,29 @@
|
||||
return this.position != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
|
||||
}
|
||||
|
||||
@@ -131,7 +129,7 @@
|
||||
for (int i = 0; i < this.width; ++i) {
|
||||
BlockPosition blockposition = this.position.shift(this.c, i);
|
||||
|
||||
@@ -298,6 +353,7 @@
|
||||
@@ -288,6 +343,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user