3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Does not fix armour issue completely but improves right click armour items (it's still bugged, working on it)

Dieser Commit ist enthalten in:
Myles 2016-03-27 14:57:13 +01:00
Ursprung 46b2f69b01
Commit c0493de4df
2 geänderte Dateien mit 14 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -79,18 +79,16 @@ public class ArmorListener implements Listener {
public void onInteract(PlayerInteractEvent e) { public void onInteract(PlayerInteractEvent e) {
if (e.getItem() != null) { if (e.getItem() != null) {
if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (ArmorType.isArmor(e.getMaterial())) { final Player player = e.getPlayer();
final Player player = e.getPlayer(); // Due to odd bugs it's 3 ticks later
// Due to odd bugs it's 3 ticks later Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override
@Override public void run() {
public void run() { if (ViaVersion.getInstance().isPorted(player)) {
if (ViaVersion.getInstance().isPorted(player)) { sendArmorUpdate(player);
sendArmorUpdate(player);
}
} }
}, 3L); }
} }, 3L);
} }
} }
} }

Datei anzeigen

@ -14,6 +14,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.remapper.ValueCreator; import us.myles.ViaVersion.api.remapper.ValueCreator;
import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State; import us.myles.ViaVersion.packets.State;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ArmorType;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8; import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.sounds.SoundEffect; import us.myles.ViaVersion.protocols.protocol1_9to1_8.sounds.SoundEffect;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.ClientChunks; import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.ClientChunks;
@ -317,9 +318,11 @@ public class WorldPackets {
// Projectiles // Projectiles
special = special || m == Material.BOW; special = special || m == Material.BOW;
special = special || m == Material.SNOW_BALL || m == Material.EGG || m == Material.EXP_BOTTLE || m == Material.ENDER_PEARL || m == Material.EYE_OF_ENDER; special = special || m == Material.SNOW_BALL || m == Material.EGG || m == Material.EXP_BOTTLE || m == Material.ENDER_PEARL || m == Material.EYE_OF_ENDER;
// Armour
special = special || ArmorType.isArmor(m);
// Don't send data if special // Don't send data if special
if (special) { if (special && m != Material.AIR) {
wrapper.set(Type.POSITION, 0, new Position(-1L, 255L, -1L)); wrapper.set(Type.POSITION, 0, new Position(-1L, -1L, -1L));
wrapper.set(Type.BYTE, 0, (byte) -1); wrapper.set(Type.BYTE, 0, (byte) -1);
} }
EntityTracker tracker = wrapper.user().get(EntityTracker.class); EntityTracker tracker = wrapper.user().get(EntityTracker.class);