2016-03-25 10:02:35 +01:00
|
|
|
From af956966919135aa17834ffb544bbb26b999edaf Mon Sep 17 00:00:00 2001
|
2015-06-04 23:25:07 +02:00
|
|
|
From: Iceee <andrew@opticgaming.tv>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Wed, 2 Mar 2016 23:00:53 -0600
|
2015-06-04 23:25:07 +02:00
|
|
|
Subject: [PATCH] Configurable TNT cannon fix
|
|
|
|
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2016-03-25 10:02:35 +01:00
|
|
|
index 1236128..8d97890 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2016-03-19 03:10:20 +01:00
|
|
|
@@ -241,4 +241,10 @@ public class PaperWorldConfig {
|
2016-03-01 00:09:49 +01:00
|
|
|
private void mobSpawnerTickRate() {
|
|
|
|
mobSpawnerTickRate = getInt("mob-spawner-tick-rate", 1);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean fixCannons;
|
|
|
|
+ private void fixCannons() {
|
|
|
|
+ fixCannons = getBoolean("fix-cannons", false);
|
|
|
|
+ log("Fix TNT cannons: " + fixCannons);
|
|
|
|
+ }
|
|
|
|
}
|
2015-06-04 23:25:07 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
2016-03-01 00:09:49 +01:00
|
|
|
index ffc07cd..64aaba4 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockDiodeAbstract.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -76,6 +76,17 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
2015-06-04 23:25:07 +02:00
|
|
|
} else {
|
|
|
|
this.b(world, blockposition, iblockdata, 0);
|
|
|
|
world.setAir(blockposition);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
2015-06-04 23:25:07 +02:00
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -173,6 +184,17 @@ public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
2015-06-04 23:25:07 +02:00
|
|
|
|
|
|
|
public void postBreak(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
2016-03-01 00:09:49 +01:00
|
|
|
if (this.d) {
|
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
2015-06-04 23:25:07 +02:00
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
|
2016-03-01 00:09:49 +01:00
|
|
|
index b4d1741..257bbbb 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
|
|
|
|
@@ -52,6 +52,17 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|
|
|
|
|
|
|
public void onPlace(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
if (this.isOn) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
2015-06-04 23:25:07 +02:00
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
@@ -66,6 +77,17 @@ public class BlockRedstoneTorch extends BlockTorch {
|
|
|
|
|
|
|
|
public void remove(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
|
|
|
if (this.isOn) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
2015-06-04 23:25:07 +02:00
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
2016-03-01 00:09:49 +01:00
|
|
|
index 1a133d9..f4f9be6 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -184,6 +184,17 @@ public class BlockRedstoneWire extends Block {
|
2015-06-04 23:25:07 +02:00
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
this.B.add(blockposition);
|
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.WEST));
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.EAST));
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.DOWN));
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.UP));
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.NORTH));
|
|
|
|
+ this.B.add(blockposition.shift(EnumDirection.SOUTH));
|
2015-06-04 23:25:07 +02:00
|
|
|
+ return iblockdata;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i1 = aenumdirection.length;
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -200,6 +211,17 @@ public class BlockRedstoneWire extends Block {
|
|
|
|
private void b(World world, BlockPosition blockposition) {
|
2015-06-04 23:25:07 +02:00
|
|
|
if (world.getType(blockposition).getBlock() == this) {
|
|
|
|
world.applyPhysics(blockposition, this);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
|
|
|
+ if (world.paperConfig.fixCannons) {
|
2015-06-04 23:25:07 +02:00
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.WEST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.EAST), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.NORTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.SOUTH), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.DOWN), this);
|
|
|
|
+ world.applyPhysics(blockposition.shift(EnumDirection.UP), this);
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
EnumDirection[] aenumdirection = EnumDirection.values();
|
|
|
|
int i = aenumdirection.length;
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
|
2016-03-25 10:02:35 +01:00
|
|
|
index f794167..021a3be 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockTNT.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
|
2016-03-25 10:02:35 +01:00
|
|
|
@@ -29,7 +29,11 @@ public class BlockTNT extends Block {
|
|
|
|
|
2015-06-04 23:25:07 +02:00
|
|
|
public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) {
|
|
|
|
if (!world.isClientSide) {
|
2016-03-25 10:02:35 +01:00
|
|
|
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource());
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ double y = blockposition.getY();
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
2016-03-25 10:02:35 +01:00
|
|
|
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), explosion.getSource());
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
entitytntprimed.setFuseTicks((short) (world.random.nextInt(entitytntprimed.getFuseTicks() / 4) + entitytntprimed.getFuseTicks() / 8));
|
2015-06-04 23:25:07 +02:00
|
|
|
world.addEntity(entitytntprimed);
|
2016-03-25 10:02:35 +01:00
|
|
|
@@ -43,7 +47,11 @@ public class BlockTNT extends Block {
|
|
|
|
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, EntityLiving entityliving) {
|
2015-06-04 23:25:07 +02:00
|
|
|
if (!world.isClientSide) {
|
|
|
|
if (((Boolean) iblockdata.get(BlockTNT.EXPLODE)).booleanValue()) {
|
2016-03-25 10:02:35 +01:00
|
|
|
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), (double) blockposition.getY(), (double) ((float) blockposition.getZ() + 0.5F), entityliving);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ double y = blockposition.getY();
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
2016-03-25 10:02:35 +01:00
|
|
|
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (double) ((float) blockposition.getX() + 0.5F), y, (double) ((float) blockposition.getZ() + 0.5F), entityliving);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
|
|
|
|
world.addEntity(entitytntprimed);
|
2016-03-01 00:09:49 +01:00
|
|
|
world.a((EntityHuman) null, entitytntprimed.locX, entitytntprimed.locY, entitytntprimed.locZ, SoundEffects.gj, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
2015-06-04 23:25:07 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java
|
2016-03-25 10:02:35 +01:00
|
|
|
index d7bea3d..61ac795 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/DispenserRegistry.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/DispenserRegistry.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -498,7 +498,11 @@ public class DispenserRegistry {
|
2015-06-04 23:25:07 +02:00
|
|
|
org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
|
|
|
CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1);
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D));
|
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ double y = blockposition.getY();
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (!world.paperConfig.fixCannons) y += 0.5;
|
|
|
|
+ BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector((double) blockposition.getX() + 0.5D, y, (double) blockposition.getZ() + 0.5D));
|
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
if (!BlockDispenser.eventFired) {
|
|
|
|
world.getServer().getPluginManager().callEvent(event);
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
2016-03-25 10:02:35 +01:00
|
|
|
index 8f2b253..23fb154 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
2016-03-25 10:02:35 +01:00
|
|
|
@@ -274,4 +274,22 @@ public class EntityFallingBlock extends Entity {
|
2016-03-01 00:09:49 +01:00
|
|
|
public boolean br() {
|
|
|
|
return true;
|
2015-06-04 23:25:07 +02:00
|
|
|
}
|
|
|
|
+
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ @Override
|
|
|
|
+ public double f(double d0, double d1, double d2) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (!world.paperConfig.fixCannons) return super.f(d0, d1, d2);
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
|
|
|
+ double d3 = this.locX - d0;
|
|
|
|
+ double d4 = this.locY + this.getHeadHeight() - d1;
|
|
|
|
+ double d5 = this.locZ - d2;
|
|
|
|
+
|
|
|
|
+ return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public float getHeadHeight() {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ return world.paperConfig.fixCannons ? this.length / 2 : super.getHeadHeight();
|
2015-06-04 23:25:07 +02:00
|
|
|
+ }
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
2016-03-25 10:02:35 +01:00
|
|
|
index 1113b1c..12feacf 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
2016-03-25 10:02:35 +01:00
|
|
|
@@ -30,6 +30,7 @@ public class EntityTNTPrimed extends Entity {
|
2015-06-04 23:25:07 +02:00
|
|
|
this.lastY = d1;
|
|
|
|
this.lastZ = d2;
|
|
|
|
this.source = entityliving;
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (world.paperConfig.fixCannons) this.motX = this.motZ = 0.0F; // Paper - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
protected void i() {
|
2016-03-25 10:02:35 +01:00
|
|
|
@@ -118,9 +119,66 @@ public class EntityTNTPrimed extends Entity {
|
2015-06-04 23:25:07 +02:00
|
|
|
return this.source;
|
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ @Override
|
|
|
|
+ public double f(double d0, double d1, double d2) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (!world.paperConfig.fixCannons) return super.f(d0, d1, d2);
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
|
|
|
+ double d3 = this.locX - d0;
|
|
|
|
+ double d4 = this.locY + this.getHeadHeight() - d1;
|
|
|
|
+ double d5 = this.locZ - d2;
|
|
|
|
+
|
|
|
|
+ return (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2016-03-01 00:09:49 +01:00
|
|
|
+ public boolean bd() {
|
|
|
|
+ return !world.paperConfig.fixCannons && super.bd();
|
2015-06-04 23:25:07 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
public float getHeadHeight() {
|
|
|
|
- return 0.0F;
|
2016-03-01 00:09:49 +01:00
|
|
|
+ return world.paperConfig.fixCannons ? this.length / 2 : 0.0F;
|
|
|
|
+ }
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Author: Jedediah Smith <jedediah@silencegreys.com>
|
|
|
|
+ */
|
|
|
|
+ @Override
|
2016-03-01 00:09:49 +01:00
|
|
|
+ public boolean aj() {
|
|
|
|
+ if (!world.paperConfig.fixCannons) return super.aj();
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
|
|
|
+ // Preserve velocity while calling the super method
|
|
|
|
+ double oldMotX = this.motX;
|
|
|
|
+ double oldMotY = this.motY;
|
|
|
|
+ double oldMotZ = this.motZ;
|
|
|
|
+
|
2016-03-01 00:09:49 +01:00
|
|
|
+ super.aj();
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
|
|
|
+ this.motX = oldMotX;
|
|
|
|
+ this.motY = oldMotY;
|
|
|
|
+ this.motZ = oldMotZ;
|
|
|
|
+
|
|
|
|
+ if (this.inWater) {
|
|
|
|
+ // Send position and velocity updates to nearby players on every tick while the TNT is in water.
|
|
|
|
+ // This does pretty well at keeping their clients in sync with the server.
|
|
|
|
+ EntityTrackerEntry ete = ((WorldServer) this.getWorld()).getTracker().trackedEntities.get(this.getId());
|
|
|
|
+ if (ete != null) {
|
|
|
|
+ PacketPlayOutEntityVelocity velocityPacket = new PacketPlayOutEntityVelocity(this);
|
|
|
|
+ PacketPlayOutEntityTeleport positionPacket = new PacketPlayOutEntityTeleport(this);
|
|
|
|
+
|
|
|
|
+ for (EntityPlayer viewer : ete.trackedPlayers) {
|
|
|
|
+ if ((viewer.locX - this.locX) * (viewer.locY - this.locY) * (viewer.locZ - this.locZ) < 16 * 16) {
|
|
|
|
+ viewer.playerConnection.sendPacket(velocityPacket);
|
|
|
|
+ viewer.playerConnection.sendPacket(positionPacket);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return this.inWater;
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
public void setFuseTicks(int i) {
|
|
|
|
this.datawatcher.set(EntityTNTPrimed.FUSE_TICKS, Integer.valueOf(i));
|
2015-06-04 23:25:07 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
2016-03-25 05:59:37 +01:00
|
|
|
index 418ee29..9b86454 100644
|
2015-06-04 23:25:07 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Explosion.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -148,9 +148,16 @@ public class Explosion {
|
|
|
|
d14 = entity instanceof EntityHuman && world.paperConfig.disableExplosionKnockback ? 0 : EnchantmentProtection.a((EntityLiving) entity, d13); // Paper - Disable explosion knockback
|
|
|
|
}
|
2015-06-04 23:25:07 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper start - Fix cannons
|
2015-06-04 23:25:07 +02:00
|
|
|
+ /*
|
|
|
|
entity.motX += d8 * d14;
|
|
|
|
entity.motY += d9 * d14;
|
|
|
|
entity.motZ += d10 * d14;
|
|
|
|
+ */
|
|
|
|
+ // This impulse method sets the dirty flag, so clients will get an immediate velocity update
|
|
|
|
+ entity.g(d8 * d14, d9 * d14, d10 * d14);
|
2016-03-01 00:09:49 +01:00
|
|
|
+ // Paper end
|
2015-06-04 23:25:07 +02:00
|
|
|
+
|
2016-03-01 00:09:49 +01:00
|
|
|
if (entity instanceof EntityHuman) {
|
|
|
|
EntityHuman entityhuman = (EntityHuman) entity;
|
|
|
|
|
2015-06-04 23:25:07 +02:00
|
|
|
--
|
2016-03-25 05:59:37 +01:00
|
|
|
2.7.1.windows.2
|
2015-06-04 23:25:07 +02:00
|
|
|
|