Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Fix issue with Bukkit materials which aren't found by ID
Dieser Commit ist enthalten in:
Ursprung
71a9c90fe9
Commit
f32d3211ed
@ -157,11 +157,13 @@ public class EntityPackets {
|
||||
Item stack = wrapper.get(Type.ITEM, 0);
|
||||
|
||||
if (stack != null) {
|
||||
if(Material.getMaterial(stack.getId()) != null) {
|
||||
if (Material.getMaterial(stack.getId()).name().endsWith("SWORD")) {
|
||||
entityTracker.getValidBlocking().add(entityID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
entityTracker.getValidBlocking().remove(entityID);
|
||||
}
|
||||
});
|
||||
|
@ -248,6 +248,7 @@ public class WorldPackets {
|
||||
Item item = Item.getItem(Protocol1_9TO1_8.getHandItem(wrapper.user()));
|
||||
// Blocking patch
|
||||
if (item != null) {
|
||||
if (Material.getMaterial(item.getId()) != null) {
|
||||
if (Material.getMaterial(item.getId()).name().endsWith("SWORD")) {
|
||||
if (hand == 0) {
|
||||
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
||||
@ -258,7 +259,7 @@ public class WorldPackets {
|
||||
}
|
||||
wrapper.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
wrapper.write(Type.ITEM, item);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren