mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-23 02:25:19 +01:00
Fix shields not being configurable
This commit is contained in:
parent
0992c74351
commit
d72b7fc4df
@ -241,17 +241,19 @@ public class WorldPackets {
|
||||
// Write item in hand
|
||||
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);
|
||||
if (!tracker.isBlocking()) {
|
||||
tracker.setBlocking(true);
|
||||
Item shield = new Item((short) 442, (byte) 1, (short) 0, null);
|
||||
tracker.setSecondHand(shield);
|
||||
if (ViaVersion.getConfig().isShieldBlocking()) {
|
||||
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);
|
||||
if (!tracker.isBlocking()) {
|
||||
tracker.setBlocking(true);
|
||||
Item shield = new Item((short) 442, (byte) 1, (short) 0, null);
|
||||
tracker.setSecondHand(shield);
|
||||
}
|
||||
wrapper.cancel();
|
||||
}
|
||||
wrapper.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user