Prevent players from being kicked for attacking enderdragon
This commit is contained in:
parent
a3ddce6c5f
commit
038b6478ea
@ -116,7 +116,8 @@ public class PacketsManager {
|
||||
Player observer = event.getPlayer();
|
||||
StructureModifier<Entity> entityModifer = event.getPacket().getEntityModifier(observer.getWorld());
|
||||
org.bukkit.entity.Entity entity = entityModifer.read(ReflectionManager.isAfter17() ? 0 : 1);
|
||||
if (entity instanceof ExperienceOrb || entity instanceof Item || entity instanceof Arrow) {
|
||||
if (entity instanceof ExperienceOrb || entity instanceof Item || entity instanceof Arrow
|
||||
|| entity == observer) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -258,16 +258,13 @@ public class ReflectionManager {
|
||||
stage++;
|
||||
switch (stage) {
|
||||
case 1:
|
||||
x = field.getDouble(boundingBox); //+ oldBox.getX();
|
||||
// field.setDouble(boundingBox, x - newBox.getX());
|
||||
x = field.getDouble(boundingBox);
|
||||
break;
|
||||
case 2:
|
||||
y = field.getDouble(boundingBox);// + oldBox.getY();
|
||||
// field.setDouble(boundingBox, y - newBox.getY());
|
||||
y = field.getDouble(boundingBox);
|
||||
break;
|
||||
case 3:
|
||||
z = field.getDouble(boundingBox); //+ oldBox.getZ();
|
||||
// field.setDouble(boundingBox, z - newBox.getZ());
|
||||
z = field.getDouble(boundingBox);
|
||||
break;
|
||||
case 4:
|
||||
field.setDouble(boundingBox, x + newBox.getX());
|
||||
|
Loading…
Reference in New Issue
Block a user