SPIGOT-3805: Minecart does not teleport through Nether Portal

This commit is contained in:
md_5 2018-02-09 18:02:53 +11:00
parent e3b4cf5c28
commit aa34e9bddd

View File

@ -85,16 +85,24 @@
if (this.getType() > 0) {
this.d(this.getType() - 1);
}
@@ -166,7 +216,7 @@
@@ -160,6 +210,8 @@
i = this.Z();
if (this.ak) {
- if (minecraftserver.getAllowNether()) {
+ if (true || minecraftserver.getAllowNether()) { // CraftBukkit - multi-world should still allow teleport even if default vanilla nether disabled
if (!this.isPassenger() && this.al++ >= i) {
this.al = i;
this.portalCooldown = this.aM();
@@ -266,6 +316,18 @@
int i;
+ // CraftBukkit - handled in postTick
+ /*
if (!this.world.isClientSide && this.world instanceof WorldServer) {
this.world.methodProfiler.a("portal");
MinecraftServer minecraftserver = this.world.getMinecraftServer();
@@ -199,6 +251,7 @@
this.world.methodProfiler.b();
}
+ */
if (this.world.isClientSide) {
if (this.at > 0) {
@@ -266,6 +319,18 @@
}
this.setYawPitch(this.yaw, this.pitch);
@ -113,7 +121,7 @@
if (this.v() == EntityMinecartAbstract.EnumMinecartType.RIDEABLE && this.motX * this.motX + this.motZ * this.motZ > 0.01D) {
List list = this.world.getEntities(this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), IEntitySelector.a(this));
@@ -274,8 +336,24 @@
@@ -274,8 +339,24 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@ -138,7 +146,7 @@
entity.collide(this);
}
}
@@ -287,6 +365,14 @@
@@ -287,6 +368,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@ -153,7 +161,7 @@
entity1.collide(this);
}
}
@@ -297,7 +383,7 @@
@@ -297,7 +386,7 @@
}
protected double p() {
@ -162,7 +170,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
@@ -308,16 +394,20 @@
@@ -308,16 +397,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) {
@ -189,7 +197,7 @@
}
}
@@ -505,7 +595,7 @@
@@ -505,7 +598,7 @@
}
protected void r() {
@ -198,7 +206,7 @@
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
@@ -780,4 +870,26 @@
@@ -780,4 +873,26 @@
}
}