diff options
Diffstat (limited to 'nms-patches/PortalTravelAgent.patch')
-rw-r--r-- | nms-patches/PortalTravelAgent.patch | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/nms-patches/PortalTravelAgent.patch b/nms-patches/PortalTravelAgent.patch index d44c9470..43117352 100644 --- a/nms-patches/PortalTravelAgent.patch +++ b/nms-patches/PortalTravelAgent.patch @@ -12,10 +12,12 @@ public class PortalTravelAgent { -@@ -26,6 +31,19 @@ +@@ -26,8 +31,21 @@ int i = MathHelper.floor(entity.locX); int j = MathHelper.floor(entity.locY) - 1; int k = MathHelper.floor(entity.locZ); +- boolean flag = true; +- boolean flag1 = false; + // CraftBukkit start - Modularize end portal creation + BlockPosition created = this.createEndPortal(entity.locX, entity.locY, entity.locZ); + entity.setPositionRotation((double) created.getX(), (double) created.getY(), (double) created.getZ(), entity.yaw, 0.0F); @@ -29,15 +31,19 @@ + int j = MathHelper.floor(y) - 1; + int k = MathHelper.floor(z); + // CraftBukkit end - byte b0 = 1; - byte b1 = 0; ++ byte b0 = 1; ++ byte b1 = 0; -@@ -42,16 +60,63 @@ + for (int l = -2; l <= 2; ++l) { + for (int i1 = -2; i1 <= 2; ++i1) { +@@ -42,18 +60,63 @@ } } - entity.setPositionRotation((double) i, (double) j, (double) k, entity.yaw, 0.0F); -- entity.motX = entity.motY = entity.motZ = 0.0D; +- entity.motX = 0.0D; +- entity.motY = 0.0D; +- entity.motZ = 0.0D; + // CraftBukkit start + return new BlockPosition(i, k, k); + } @@ -101,7 +107,7 @@ boolean flag1 = true; Object object = BlockPosition.ZERO; long k = ChunkCoordIntPair.a(i, j); -@@ -64,12 +129,12 @@ +@@ -66,12 +129,12 @@ portaltravelagent_chunkcoordinatesportal.b = this.world.getTime(); flag1 = false; } else { @@ -117,7 +123,7 @@ for (BlockPosition blockposition2 = blockposition.a(l, this.world.Z() - 1 - blockposition.getY(), i1); blockposition2.getY() >= 0; blockposition2 = blockposition1) { blockposition1 = blockposition2.down(); if (this.world.getType(blockposition2).getBlock() == Blocks.PORTAL) { -@@ -93,6 +158,29 @@ +@@ -95,6 +158,29 @@ if (flag1) { this.c.put(k, new PortalTravelAgent.ChunkCoordinatesPortal((BlockPosition) object, this.world.getTime())); } @@ -146,8 +152,8 @@ + // CraftBukkit end double d2 = (double) ((BlockPosition) object).getX() + 0.5D; - double d3 = (double) ((BlockPosition) object).getY() + 0.5D; -@@ -131,30 +219,59 @@ + double d3 = (double) ((BlockPosition) object).getZ() + 0.5D; +@@ -132,30 +218,59 @@ f4 = 1.0F; } @@ -158,9 +164,9 @@ - entity.motZ = d6 * (double) f3 + d7 * (double) f2; - entity.yaw = f - (float) (entity.getPortalDirection().opposite().get2DRotationValue() * 90) + (float) (shapedetector_shapedetectorcollection.getFacing().get2DRotationValue() * 90); - if (entity instanceof EntityPlayer) { -- ((EntityPlayer) entity).playerConnection.a(d2, d3, d4, entity.yaw, entity.pitch); +- ((EntityPlayer) entity).playerConnection.a(d2, d5, d3, entity.yaw, entity.pitch); - } else { -- entity.setPositionRotation(d2, d3, d4, entity.yaw, entity.pitch); +- entity.setPositionRotation(d2, d5, d3, entity.yaw, entity.pitch); - } - - return true; @@ -202,7 +208,7 @@ } public boolean a(Entity entity) { -- byte b0 = 16; +- boolean flag = true; + // CraftBukkit start - Allow for portal creation to be based on coordinates instead of entity + return this.createPortal(entity.locX, entity.locY, entity.locZ, 16); + } @@ -225,20 +231,20 @@ int l = i; int i1 = j; int j1 = k; -@@ -179,10 +296,10 @@ +@@ -180,10 +295,10 @@ double d4; - for (i2 = i - b0; i2 <= i + b0; ++i2) { + for (i2 = i - 16; i2 <= i + 16; ++i2) { - d1 = (double) i2 + 0.5D - entity.locX; + d1 = (double) i2 + 0.5D - x; // CraftBukkit - for (j2 = k - b0; j2 <= k + b0; ++j2) { + for (j2 = k - 16; j2 <= k + 16; ++j2) { - d2 = (double) j2 + 0.5D - entity.locZ; + d2 = (double) j2 + 0.5D - z; // CraftBukkit label271: for (k2 = this.world.Z() - 1; k2 >= 0; --k2) { -@@ -214,7 +331,7 @@ +@@ -215,7 +330,7 @@ } } @@ -247,20 +253,20 @@ d4 = d1 * d1 + d3 * d3 + d2 * d2; if (d0 < 0.0D || d4 < d0) { d0 = d4; -@@ -231,10 +348,10 @@ +@@ -232,10 +347,10 @@ if (d0 < 0.0D) { - for (i2 = i - b0; i2 <= i + b0; ++i2) { + for (i2 = i - 16; i2 <= i + 16; ++i2) { - d1 = (double) i2 + 0.5D - entity.locX; + d1 = (double) i2 + 0.5D - x; // CraftBukkit - for (j2 = k - b0; j2 <= k + b0; ++j2) { + for (j2 = k - 16; j2 <= k + 16; ++j2) { - d2 = (double) j2 + 0.5D - entity.locZ; + d2 = (double) j2 + 0.5D - z; // CraftBukkit label219: for (k2 = this.world.Z() - 1; k2 >= 0; --k2) { -@@ -259,7 +376,7 @@ +@@ -260,7 +375,7 @@ } } @@ -269,7 +275,7 @@ d4 = d1 * d1 + d3 * d3 + d2 * d2; if (d0 < 0.0D || d4 < d0) { d0 = d4; -@@ -358,5 +475,10 @@ +@@ -359,5 +474,10 @@ super(blockposition.getX(), blockposition.getY(), blockposition.getZ()); this.b = i; } |