3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 04:50:06 +01:00

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

Dieser Commit ist enthalten in:
Nathan Adams 2012-01-14 18:12:59 +00:00
Ursprung 2ab160e484
Commit dfbcd36ab7
2 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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