From 1c28c946fa36623aeb5d341061438fe112fdf84e Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Mon, 13 Feb 2012 00:40:32 -0500 Subject: Fixed sprinting while breaking a painting edge case. Fixes BUKKIT-740 --- src/main/java/net/minecraft/server/EntityBoat.java | 16 ++++++++-------- src/main/java/net/minecraft/server/EntityPainting.java | 7 +++++-- src/main/java/net/minecraft/server/NetServerHandler.java | 7 +++++++ 3 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src/main/java/net/minecraft/server') diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index f88870b7..69d5f7cb 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -308,17 +308,17 @@ public class EntityBoat extends Entity { if (!destroyEvent.isCancelled()) { // CraftBukkit end - this.die(); + this.die(); - int k; + int k; - for (k = 0; k < 3; ++k) { - this.a(Block.WOOD.id, 1, 0.0F); - } + for (k = 0; k < 3; ++k) { + this.a(Block.WOOD.id, 1, 0.0F); + } - for (k = 0; k < 2; ++k) { - this.a(Item.STICK.id, 1, 0.0F); - } + for (k = 0; k < 2; ++k) { + this.a(Item.STICK.id, 1, 0.0F); + } } // CraftBukkit } } else { diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java index 22029666..fcabef3f 100644 --- a/src/main/java/net/minecraft/server/EntityPainting.java +++ b/src/main/java/net/minecraft/server/EntityPainting.java @@ -286,11 +286,14 @@ public class EntityPainting extends Entity { } public void b_(double d0, double d1, double d2) { - if (!this.world.isStatic && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + // CraftBukkit start - not needed for paintings + /* if (!this.world.isStatic && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { if (dead) return; // CraftBukkit this.die(); this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING))); - } + }*/ + // CraftBukkit end } + } diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 89e71ceb..8389ca25 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -244,6 +244,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } if (packet10flying.hasPos && packet10flying.y == -999.0D && packet10flying.stance == -999.0D) { + // CraftBukkit start + if (packet10flying.x > 1 || packet10flying.z > 1) { + System.err.println(player.getName() + " was caught trying to crash the server with an invalid position."); + player.kickPlayer("Nope!"); + return; + } + // CraftBukkit end d5 = packet10flying.x; d4 = packet10flying.z; } -- cgit v1.2.3