summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityMinecartAbstract.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityMinecartAbstract.patch')
-rw-r--r--nms-patches/EntityMinecartAbstract.patch58
1 files changed, 29 insertions, 29 deletions
diff --git a/nms-patches/EntityMinecartAbstract.patch b/nms-patches/EntityMinecartAbstract.patch
index 7e9aac01..d3ac7cc3 100644
--- a/nms-patches/EntityMinecartAbstract.patch
+++ b/nms-patches/EntityMinecartAbstract.patch
@@ -1,7 +1,7 @@
--- a/net/minecraft/server/EntityMinecartAbstract.java
+++ b/net/minecraft/server/EntityMinecartAbstract.java
-@@ -6,6 +6,15 @@
- import java.util.Map;
+@@ -8,6 +8,15 @@
+ import java.util.function.ToIntFunction;
import javax.annotation.Nullable;
+// CraftBukkit start
@@ -16,9 +16,9 @@
public abstract class EntityMinecartAbstract extends Entity implements INamableTileEntity {
private static final DataWatcherObject<Integer> a = DataWatcher.a(EntityMinecartAbstract.class, DataWatcherRegistry.b);
-@@ -23,6 +32,17 @@
- private double ax;
- private double ay;
+@@ -25,6 +34,17 @@
+ private double aA;
+ private double aB;
+ // CraftBukkit start
+ public boolean slowWhenEmpty = true;
@@ -31,10 +31,10 @@
+ public double maxSpeed = 0.4D;
+ // CraftBukkit end
+
- public EntityMinecartAbstract(World world) {
- super(world);
- this.i = true;
-@@ -101,6 +121,19 @@
+ protected EntityMinecartAbstract(EntityTypes<?> entitytypes, World world) {
+ super(entitytypes, world);
+ this.j = true;
+@@ -98,6 +118,19 @@
if (this.isInvulnerable(damagesource)) {
return false;
} else {
@@ -51,10 +51,10 @@
+
+ f = (float) event.getDamage();
+ // CraftBukkit end
- this.e(-this.u());
- this.d(10);
- this.ax();
-@@ -108,6 +141,15 @@
+ this.l(-this.u());
+ this.e(10);
+ this.aA();
+@@ -105,6 +138,15 @@
boolean flag = damagesource.getEntity() instanceof EntityHuman && ((EntityHuman) damagesource.getEntity()).abilities.canInstantlyBuild;
if (flag || this.getDamage() > 40.0F) {
@@ -70,10 +70,10 @@
this.ejectPassengers();
if (flag && !this.hasCustomName()) {
this.die();
-@@ -146,6 +188,14 @@
+@@ -143,6 +185,14 @@
}
- public void B_() {
+ public void tick() {
+ // CraftBukkit start
+ double prevX = this.locX;
+ double prevY = this.locY;
@@ -83,9 +83,9 @@
+ // CraftBukkit end
+
if (this.getType() > 0) {
- this.d(this.getType() - 1);
+ this.e(this.getType() - 1);
}
-@@ -160,6 +210,8 @@
+@@ -157,6 +207,8 @@
int i;
@@ -94,15 +94,15 @@
if (!this.world.isClientSide && this.world instanceof WorldServer) {
this.world.methodProfiler.a("portal");
MinecraftServer minecraftserver = this.world.getMinecraftServer();
-@@ -199,6 +251,7 @@
+@@ -196,6 +248,7 @@
- this.world.methodProfiler.b();
+ this.world.methodProfiler.e();
}
+ */
if (this.world.isClientSide) {
- if (this.at > 0) {
-@@ -266,6 +319,18 @@
+ if (this.aw > 0) {
+@@ -263,6 +316,18 @@
}
this.setYawPitch(this.yaw, this.pitch);
@@ -121,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 +339,24 @@
+@@ -271,8 +336,24 @@
Entity entity = (Entity) list.get(l);
if (!(entity instanceof EntityHuman) && !(entity instanceof EntityIronGolem) && !(entity instanceof EntityMinecartAbstract) && !this.isVehicle() && !entity.isPassenger()) {
@@ -146,7 +146,7 @@
entity.collide(this);
}
}
-@@ -287,6 +368,14 @@
+@@ -284,6 +365,14 @@
Entity entity1 = (Entity) iterator.next();
if (!this.w(entity1) && entity1.isCollidable() && entity1 instanceof EntityMinecartAbstract) {
@@ -161,7 +161,7 @@
entity1.collide(this);
}
}
-@@ -297,7 +386,7 @@
+@@ -294,7 +383,7 @@
}
protected double p() {
@@ -170,7 +170,7 @@
}
public void a(int i, int j, int k, boolean flag) {}
-@@ -308,16 +397,20 @@
+@@ -305,16 +394,20 @@
this.motX = MathHelper.a(this.motX, -d0, d0);
this.motZ = MathHelper.a(this.motZ, -d0, d0);
if (this.onGround) {
@@ -197,7 +197,7 @@
}
}
-@@ -505,7 +598,7 @@
+@@ -502,7 +595,7 @@
}
protected void r() {
@@ -206,7 +206,7 @@
this.motX *= 0.996999979019165D;
this.motY *= 0.0D;
this.motZ *= 0.996999979019165D;
-@@ -618,6 +711,14 @@
+@@ -599,6 +692,14 @@
if (!this.world.isClientSide) {
if (!entity.noclip && !this.noclip) {
if (!this.w(entity)) {
@@ -221,8 +221,8 @@
double d0 = entity.locX - this.locX;
double d1 = entity.locZ - this.locZ;
double d2 = d0 * d0 + d1 * d1;
-@@ -780,4 +881,26 @@
-
+@@ -745,4 +846,26 @@
+ return this.i;
}
}
+