Fixed a further exploit with players attacking more things that they shouldn't.

This commit is contained in:
Nathan Adams 2012-01-14 18:12:59 +00:00
parent 2ab160e484
commit dfbcd36ab7
2 changed files with 5 additions and 4 deletions

View File

@ -648,7 +648,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.deathTicks = 0;
effects.clear();
this.activeContainer = this.defaultContainer;
this.lastSentExp = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {"
this.lastSentExp = -1;
if(this.keepLevel) {
this.exp = exp;
} else {

View File

@ -923,9 +923,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.player.updateInventory(this.player.activeContainer);
}
} else if (packet7useentity.c == 1) {
if (entity instanceof EntityItem) {
disconnect("Attacking an item is not permitted");
System.out.println("Player " + player.name + " tried to attack an item entity, so I have disconnected them for exploiting.");
if ((entity instanceof EntityItem) || (entity instanceof EntityExperienceOrb) || (entity instanceof EntityArrow)) {
String type = entity.getClass().getSimpleName();
disconnect("Attacking an " + type + " is not permitted");
System.out.println("Player " + player.name + " tried to attack an " + type + ", so I have disconnected them for exploiting.");
return;
}