Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-20 06:50:08 +01:00
Refactor class names for protocols
The inconsistency was too much for me.
Dieser Commit ist enthalten in:
Ursprung
33315bc271
Commit
4a8534c164
@ -20,7 +20,7 @@ import us.myles.ViaVersion.api.Via;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ArmorType;
|
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 java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ public class ArmorListener extends ViaBukkitListener {
|
|||||||
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
||||||
|
|
||||||
public ArmorListener(ViaVersionPlugin plugin) {
|
public ArmorListener(ViaVersionPlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendArmorUpdate(Player player) {
|
public void sendArmorUpdate(Player player) {
|
||||||
@ -53,7 +53,7 @@ public class ArmorListener extends ViaBukkitListener {
|
|||||||
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
||||||
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -7,13 +7,13 @@ import org.bukkit.event.block.BlockPlaceEvent;
|
|||||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||||
import us.myles.ViaVersion.api.minecraft.Position;
|
import us.myles.ViaVersion.api.minecraft.Position;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
public class BlockListener extends ViaBukkitListener {
|
public class BlockListener extends ViaBukkitListener {
|
||||||
|
|
||||||
public BlockListener(ViaVersionPlugin plugin) {
|
public BlockListener(ViaVersionPlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
@ -11,11 +11,11 @@ import us.myles.ViaVersion.api.Via;
|
|||||||
import us.myles.ViaVersion.api.ViaVersion;
|
import us.myles.ViaVersion.api.ViaVersion;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
|
||||||
public class DeathListener extends ViaBukkitListener {
|
public class DeathListener extends ViaBukkitListener {
|
||||||
public DeathListener(ViaVersionPlugin plugin) {
|
public DeathListener(ViaVersionPlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||||
@ -44,9 +44,9 @@ public class DeathListener extends ViaBukkitListener {
|
|||||||
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
||||||
wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID
|
wrapper.write(Type.VAR_INT, p.getEntityId()); // Player ID
|
||||||
wrapper.write(Type.INT, p.getEntityId()); // Entity ID
|
wrapper.write(Type.INT, p.getEntityId()); // Entity ID
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, msg); // Message
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, msg); // Message
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -7,12 +7,12 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||||
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
import us.myles.ViaVersion.bukkit.listeners.ViaBukkitListener;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
|
||||||
public class PaperPatch extends ViaBukkitListener {
|
public class PaperPatch extends ViaBukkitListener {
|
||||||
|
|
||||||
public PaperPatch(ViaVersionPlugin plugin) {
|
public PaperPatch(ViaVersionPlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -21,7 +21,7 @@ import us.myles.ViaVersion.bungee.service.ProtocolDetectorService;
|
|||||||
import us.myles.ViaVersion.bungee.storage.BungeeStorage;
|
import us.myles.ViaVersion.bungee.storage.BungeeStorage;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@ -120,7 +120,7 @@ public class BungeeServerHandler implements Listener {
|
|||||||
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
|
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
|
||||||
wrapper.write(Type.UUID, uuid);
|
wrapper.write(Type.UUID, uuid);
|
||||||
wrapper.write(Type.VAR_INT, 1); // remove
|
wrapper.write(Type.VAR_INT, 1); // remove
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, true);
|
wrapper.send(Protocol1_9To1_8.class, true, true);
|
||||||
}
|
}
|
||||||
storage.getBossbar().clear();
|
storage.getBossbar().clear();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -28,7 +28,7 @@ public class ElytraPatch implements Listener {
|
|||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
|
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9To1_8.class)) {
|
||||||
int entityId = user.get(EntityTracker.class).getProvidedEntityId();
|
int entityId = user.get(EntityTracker.class).getProvidedEntityId();
|
||||||
|
|
||||||
PacketWrapper wrapper = new PacketWrapper(0x39, null, user);
|
PacketWrapper wrapper = new PacketWrapper(0x39, null, user);
|
||||||
@ -36,7 +36,7 @@ public class ElytraPatch implements Listener {
|
|||||||
wrapper.write(Type.VAR_INT, entityId);
|
wrapper.write(Type.VAR_INT, entityId);
|
||||||
wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));
|
wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -5,7 +5,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
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.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
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.providers.MovementTransmitterProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public class BungeeMovementTransmitter extends MovementTransmitterProvider {
|
|||||||
PacketWrapper wrapper = new PacketWrapper(0x03, null, userConnection);
|
PacketWrapper wrapper = new PacketWrapper(0x03, null, userConnection);
|
||||||
wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround());
|
wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround());
|
||||||
try {
|
try {
|
||||||
wrapper.sendToServer(Protocol1_9TO1_8.class);
|
wrapper.sendToServer(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -10,16 +10,16 @@ import us.myles.ViaVersion.protocols.base.BaseProtocol1_7;
|
|||||||
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
|
import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_11_1to1_11.Protocol1_11_1To1_11;
|
import us.myles.ViaVersion.protocols.protocol1_11_1to1_11.Protocol1_11_1To1_11;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_11to1_10.Protocol1_11To1_10;
|
import us.myles.ViaVersion.protocols.protocol1_11to1_10.Protocol1_11To1_10;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_12_1to1_12.Protocol1_12_1TO1_12;
|
import us.myles.ViaVersion.protocols.protocol1_12_1to1_12.Protocol1_12_1To1_12;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1.Protocol1_12_2TO1_12_1;
|
import us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1.Protocol1_12_2To1_12_1;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
|
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2TO1_9_3_4;
|
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2To1_9_3_4;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1TO1_9;
|
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1To1_9;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.Protocol1_9_3TO1_9_1_2;
|
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.Protocol1_9_3To1_9_1_2;
|
||||||
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_9_1.Protocol1_9TO1_9_1;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_9_1.Protocol1_9To1_9_1;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13;
|
import us.myles.ViaVersion.protocols.protocol1_13_1to1_13.Protocol1_13_1To1_13;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -41,20 +41,20 @@ public class ProtocolRegistry {
|
|||||||
registerBaseProtocol(new BaseProtocol1_7(), Range.<Integer>all());
|
registerBaseProtocol(new BaseProtocol1_7(), Range.<Integer>all());
|
||||||
|
|
||||||
// Register built in protocols
|
// Register built in protocols
|
||||||
registerProtocol(new Protocol1_9TO1_8(), Collections.singletonList(ProtocolVersion.v1_9.getId()), ProtocolVersion.v1_8.getId());
|
registerProtocol(new Protocol1_9To1_8(), Collections.singletonList(ProtocolVersion.v1_9.getId()), ProtocolVersion.v1_8.getId());
|
||||||
registerProtocol(new Protocol1_9_1TO1_9(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9.getId());
|
registerProtocol(new Protocol1_9_1To1_9(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9.getId());
|
||||||
registerProtocol(new Protocol1_9_3TO1_9_1_2(), Collections.singletonList(ProtocolVersion.v1_9_3.getId()), ProtocolVersion.v1_9_2.getId());
|
registerProtocol(new Protocol1_9_3To1_9_1_2(), Collections.singletonList(ProtocolVersion.v1_9_3.getId()), ProtocolVersion.v1_9_2.getId());
|
||||||
// Only supported for 1.9.4 server to 1.9 (nothing else)
|
// Only supported for 1.9.4 server to 1.9 (nothing else)
|
||||||
registerProtocol(new Protocol1_9TO1_9_1(), Collections.singletonList(ProtocolVersion.v1_9.getId()), ProtocolVersion.v1_9_2.getId());
|
registerProtocol(new Protocol1_9To1_9_1(), Collections.singletonList(ProtocolVersion.v1_9.getId()), ProtocolVersion.v1_9_2.getId());
|
||||||
registerProtocol(new Protocol1_9_1_2TO1_9_3_4(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9_3.getId());
|
registerProtocol(new Protocol1_9_1_2To1_9_3_4(), Arrays.asList(ProtocolVersion.v1_9_1.getId(), ProtocolVersion.v1_9_2.getId()), ProtocolVersion.v1_9_3.getId());
|
||||||
registerProtocol(new Protocol1_10To1_9_3_4(), Collections.singletonList(ProtocolVersion.v1_10.getId()), ProtocolVersion.v1_9_3.getId());
|
registerProtocol(new Protocol1_10To1_9_3_4(), Collections.singletonList(ProtocolVersion.v1_10.getId()), ProtocolVersion.v1_9_3.getId());
|
||||||
|
|
||||||
registerProtocol(new Protocol1_11To1_10(), Collections.singletonList(ProtocolVersion.v1_11.getId()), ProtocolVersion.v1_10.getId());
|
registerProtocol(new Protocol1_11To1_10(), Collections.singletonList(ProtocolVersion.v1_11.getId()), ProtocolVersion.v1_10.getId());
|
||||||
registerProtocol(new Protocol1_11_1To1_11(), Collections.singletonList(ProtocolVersion.v1_11_1.getId()), ProtocolVersion.v1_11.getId());
|
registerProtocol(new Protocol1_11_1To1_11(), Collections.singletonList(ProtocolVersion.v1_11_1.getId()), ProtocolVersion.v1_11.getId());
|
||||||
|
|
||||||
registerProtocol(new Protocol1_12To1_11_1(), Collections.singletonList(ProtocolVersion.v1_12.getId()), ProtocolVersion.v1_11_1.getId());
|
registerProtocol(new Protocol1_12To1_11_1(), Collections.singletonList(ProtocolVersion.v1_12.getId()), ProtocolVersion.v1_11_1.getId());
|
||||||
registerProtocol(new Protocol1_12_1TO1_12(), Collections.singletonList(ProtocolVersion.v1_12_1.getId()), ProtocolVersion.v1_12.getId());
|
registerProtocol(new Protocol1_12_1To1_12(), Collections.singletonList(ProtocolVersion.v1_12_1.getId()), ProtocolVersion.v1_12.getId());
|
||||||
registerProtocol(new Protocol1_12_2TO1_12_1(), Collections.singletonList(ProtocolVersion.v1_12_2.getId()), ProtocolVersion.v1_12_1.getId());
|
registerProtocol(new Protocol1_12_2To1_12_1(), Collections.singletonList(ProtocolVersion.v1_12_2.getId()), ProtocolVersion.v1_12_1.getId());
|
||||||
|
|
||||||
registerProtocol(new Protocol1_13To1_12_2(), Collections.singletonList(ProtocolVersion.v1_13.getId()), ProtocolVersion.v1_12_2.getId());
|
registerProtocol(new Protocol1_13To1_12_2(), Collections.singletonList(ProtocolVersion.v1_13.getId()), ProtocolVersion.v1_12_2.getId());
|
||||||
registerProtocol(new Protocol1_13_1To1_13(), Arrays.asList(ProtocolVersion.v1_13_1.getId()), ProtocolVersion.v1_13.getId());
|
registerProtocol(new Protocol1_13_1To1_13(), Arrays.asList(ProtocolVersion.v1_13_1.getId()), ProtocolVersion.v1_13.getId());
|
||||||
|
@ -13,7 +13,7 @@ import us.myles.ViaVersion.api.boss.BossStyle;
|
|||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
|
import us.myles.ViaVersion.api.protocol.ProtocolVersion;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public abstract class CommonBoss<T> extends BossBar<T> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ public abstract class CommonBoss<T> extends BossBar<T> {
|
|||||||
wrapper.write(Type.VAR_INT, action.getId());
|
wrapper.write(Type.VAR_INT, action.getId());
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ADD:
|
case ADD:
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, title);
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, title);
|
||||||
wrapper.write(Type.FLOAT, health);
|
wrapper.write(Type.FLOAT, health);
|
||||||
wrapper.write(Type.VAR_INT, color.getId());
|
wrapper.write(Type.VAR_INT, color.getId());
|
||||||
wrapper.write(Type.VAR_INT, style.getId());
|
wrapper.write(Type.VAR_INT, style.getId());
|
||||||
@ -192,7 +192,7 @@ public abstract class CommonBoss<T> extends BossBar<T> {
|
|||||||
wrapper.write(Type.FLOAT, health);
|
wrapper.write(Type.FLOAT, health);
|
||||||
break;
|
break;
|
||||||
case UPDATE_TITLE:
|
case UPDATE_TITLE:
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, title);
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, title);
|
||||||
break;
|
break;
|
||||||
case UPDATE_STYLE:
|
case UPDATE_STYLE:
|
||||||
wrapper.write(Type.VAR_INT, color.getId());
|
wrapper.write(Type.VAR_INT, color.getId());
|
||||||
|
@ -18,7 +18,7 @@ import us.myles.ViaVersion.api.remapper.PacketHandler;
|
|||||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||||
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.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
import us.myles.ViaVersion.util.GsonUtil;
|
import us.myles.ViaVersion.util.GsonUtil;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -169,7 +169,7 @@ public class BaseProtocol1_7 extends Protocol {
|
|||||||
if (!wrapper.user().getChannel().isOpen()) return;
|
if (!wrapper.user().getChannel().isOpen()) return;
|
||||||
|
|
||||||
PacketWrapper disconnectPacket = new PacketWrapper(0x00, null, wrapper.user()); // Disconnect Packet
|
PacketWrapper disconnectPacket = new PacketWrapper(0x00, null, wrapper.user()); // Disconnect Packet
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(disconnectPacket, ChatColor.translateAlternateColorCodes('&', Via.getConfig().getBlockedDisconnectMsg()));
|
Protocol1_9To1_8.FIX_JSON.write(disconnectPacket, ChatColor.translateAlternateColorCodes('&', Via.getConfig().getBlockedDisconnectMsg()));
|
||||||
wrapper.cancel(); // cancel current
|
wrapper.cancel(); // cancel current
|
||||||
|
|
||||||
// Send and close
|
// Send and close
|
||||||
|
@ -8,7 +8,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
|||||||
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;
|
||||||
|
|
||||||
public class Protocol1_12_1TO1_12 extends Protocol {
|
public class Protocol1_12_1To1_12 extends Protocol {
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
registerOutgoing(State.PLAY, -1, 0x2B); // TODO new packet?
|
registerOutgoing(State.PLAY, -1, 0x2B); // TODO new packet?
|
@ -6,7 +6,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
|||||||
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;
|
||||||
|
|
||||||
public class Protocol1_12_2TO1_12_1 extends Protocol {
|
public class Protocol1_12_2To1_12_1 extends Protocol {
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
// Outgoing
|
// Outgoing
|
@ -24,7 +24,7 @@ import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.providers.InventoryQui
|
|||||||
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.storage.EntityTracker;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
|
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
|
||||||
public class Protocol1_12To1_11_1 extends Protocol {
|
public class Protocol1_12To1_11_1 extends Protocol {
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ public class Protocol1_12To1_11_1 extends Protocol {
|
|||||||
registerOutgoing(State.PLAY, 0x0F, 0x0F, new PacketRemapper() {
|
registerOutgoing(State.PLAY, 0x0F, 0x0F, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 0 - Chat Message (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Chat Message (json)
|
||||||
map(Type.BYTE); // 1 - Chat Positon
|
map(Type.BYTE); // 1 - Chat Positon
|
||||||
|
|
||||||
handler(new PacketHandler() {
|
handler(new PacketHandler() {
|
||||||
|
@ -15,7 +15,7 @@ import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.types.Chunk1_9_3_4
|
|||||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.types.Chunk1_9_1_2Type;
|
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.types.Chunk1_9_1_2Type;
|
||||||
|
|
||||||
public class Protocol1_9_1_2TO1_9_3_4 extends Protocol {
|
public class Protocol1_9_1_2To1_9_3_4 extends Protocol {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
@ -7,7 +7,7 @@ import us.myles.ViaVersion.api.Via;
|
|||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.minecraft.Position;
|
import us.myles.ViaVersion.api.minecraft.Position;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2TO1_9_3_4;
|
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2To1_9_3_4;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -63,6 +63,6 @@ public class BlockEntity {
|
|||||||
wrapper.write(Type.POSITION, pos);
|
wrapper.write(Type.POSITION, pos);
|
||||||
wrapper.write(Type.UNSIGNED_BYTE, id);
|
wrapper.write(Type.UNSIGNED_BYTE, id);
|
||||||
wrapper.write(Type.NBT, tag);
|
wrapper.write(Type.NBT, tag);
|
||||||
wrapper.send(Protocol1_9_1_2TO1_9_3_4.class, false);
|
wrapper.send(Protocol1_9_1_2To1_9_3_4.class, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
|||||||
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;
|
||||||
|
|
||||||
public class Protocol1_9_1TO1_9 extends Protocol {
|
public class Protocol1_9_1To1_9 extends Protocol {
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
// Currently supports 1.9.1 and 1.9.2
|
// Currently supports 1.9.1 and 1.9.2
|
@ -19,7 +19,7 @@ import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.types.Chunk1_9_1_2Ty
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Protocol1_9_3TO1_9_1_2 extends Protocol {
|
public class Protocol1_9_3To1_9_1_2 extends Protocol {
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
|
|
@ -261,7 +261,7 @@ public class ItemRewriter {
|
|||||||
}
|
}
|
||||||
ListTag pages = tag.get("pages");
|
ListTag pages = tag.get("pages");
|
||||||
if (pages == null) {
|
if (pages == null) {
|
||||||
pages = new ListTag("pages", Collections.<Tag>singletonList(new StringTag(Protocol1_9TO1_8.fixJson(""))));
|
pages = new ListTag("pages", Collections.<Tag>singletonList(new StringTag(Protocol1_9To1_8.fixJson(""))));
|
||||||
tag.put(pages);
|
tag.put(pages);
|
||||||
item.setTag(tag);
|
item.setTag(tag);
|
||||||
return;
|
return;
|
||||||
@ -271,7 +271,7 @@ public class ItemRewriter {
|
|||||||
if (!(pages.get(i) instanceof StringTag))
|
if (!(pages.get(i) instanceof StringTag))
|
||||||
continue;
|
continue;
|
||||||
StringTag page = pages.get(i);
|
StringTag page = pages.get(i);
|
||||||
page.setValue(Protocol1_9TO1_8.fixJson(page.getValue()));
|
page.setValue(Protocol1_9To1_8.fixJson(page.getValue()));
|
||||||
}
|
}
|
||||||
item.setTag(tag);
|
item.setTag(tag);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import us.myles.ViaVersion.util.GsonUtil;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Protocol1_9TO1_8 extends Protocol {
|
public class Protocol1_9To1_8 extends Protocol {
|
||||||
public static final ValueTransformer<String, String> FIX_JSON = new ValueTransformer<String, String>(Type.STRING) {
|
public static final ValueTransformer<String, String> FIX_JSON = new ValueTransformer<String, String>(Type.STRING) {
|
||||||
@Override
|
@Override
|
||||||
public String transform(PacketWrapper wrapper, String line) {
|
public String transform(PacketWrapper wrapper, String line) {
|
||||||
@ -76,7 +76,7 @@ public class Protocol1_9TO1_8 extends Protocol {
|
|||||||
registerOutgoing(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
|
registerOutgoing(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 0 - Reason
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Reason
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -10,7 +10,7 @@ public class ViaIdleThread implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (UserConnection info : Via.getManager().getPortedPlayers().values()) {
|
for (UserConnection info : Via.getManager().getPortedPlayers().values()) {
|
||||||
if (info.has(ProtocolInfo.class) && info.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
|
if (info.has(ProtocolInfo.class) && info.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9To1_8.class)) {
|
||||||
long nextIdleUpdate = info.get(MovementTracker.class).getNextIdlePacket();
|
long nextIdleUpdate = info.get(MovementTracker.class).getNextIdlePacket();
|
||||||
if (nextIdleUpdate <= System.currentTimeMillis()) {
|
if (nextIdleUpdate <= System.currentTimeMillis()) {
|
||||||
if (info.getChannel().isOpen()) {
|
if (info.getChannel().isOpen()) {
|
||||||
|
@ -10,7 +10,7 @@ import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
|||||||
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_8;
|
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_8;
|
||||||
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
|
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -117,7 +117,7 @@ public class MetadataRewriter {
|
|||||||
entry.setValue(angle);
|
entry.setValue(angle);
|
||||||
break;
|
break;
|
||||||
case Chat:
|
case Chat:
|
||||||
value = Protocol1_9TO1_8.fixJson((String) value);
|
value = Protocol1_9To1_8.fixJson((String) value);
|
||||||
entry.setValue(value);
|
entry.setValue(value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -17,7 +17,7 @@ import us.myles.ViaVersion.api.type.types.version.Types1_8;
|
|||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
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.metadata.MetadataRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public class EntityPackets {
|
|||||||
passengerPacket.write(Type.VAR_INT_ARRAY, new Integer[]{passenger});
|
passengerPacket.write(Type.VAR_INT_ARRAY, new Integer[]{passenger});
|
||||||
tracker.getVehicleMap().put(passenger, vehicle);
|
tracker.getVehicleMap().put(passenger, vehicle);
|
||||||
}
|
}
|
||||||
passengerPacket.send(Protocol1_9TO1_8.class); // Send the packet
|
passengerPacket.send(Protocol1_9To1_8.class); // Send the packet
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ public class EntityPackets {
|
|||||||
Item stack = wrapper.get(Type.ITEM, 0);
|
Item stack = wrapper.get(Type.ITEM, 0);
|
||||||
|
|
||||||
if (stack != null) {
|
if (stack != null) {
|
||||||
if (Protocol1_9TO1_8.isSword(stack.getId())) {
|
if (Protocol1_9To1_8.isSword(stack.getId())) {
|
||||||
entityTracker.getValidBlocking().add(entityID);
|
entityTracker.getValidBlocking().add(entityID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ public class EntityPackets {
|
|||||||
if (wrapper.get(Type.VAR_INT, 0) == 2) { // entity dead
|
if (wrapper.get(Type.VAR_INT, 0) == 2) { // entity dead
|
||||||
wrapper.passthrough(Type.VAR_INT); //Player id
|
wrapper.passthrough(Type.VAR_INT); //Player id
|
||||||
wrapper.passthrough(Type.INT); //Entity id
|
wrapper.passthrough(Type.INT); //Entity id
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING));
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@ 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.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.InventoryTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.InventoryTracker;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ public class InventoryPackets {
|
|||||||
wrapper.write(Type.SHORT, property);
|
wrapper.write(Type.SHORT, property);
|
||||||
wrapper.write(Type.SHORT, enchantID);
|
wrapper.write(Type.SHORT, enchantID);
|
||||||
}
|
}
|
||||||
}).send(Protocol1_9TO1_8.class);
|
}).send(Protocol1_9To1_8.class);
|
||||||
|
|
||||||
wrapper.set(Type.SHORT, 0, (short) (property + 3));
|
wrapper.set(Type.SHORT, 0, (short) (property + 3));
|
||||||
wrapper.set(Type.SHORT, 1, level);
|
wrapper.set(Type.SHORT, 1, level);
|
||||||
@ -62,7 +62,7 @@ public class InventoryPackets {
|
|||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.UNSIGNED_BYTE); // 0 - Window ID
|
map(Type.UNSIGNED_BYTE); // 0 - Window ID
|
||||||
map(Type.STRING); // 1 - Window Type
|
map(Type.STRING); // 1 - Window Type
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 2 - Window Title
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 2 - Window Title
|
||||||
map(Type.UNSIGNED_BYTE); // 3 - Slot Count
|
map(Type.UNSIGNED_BYTE); // 3 - Slot Count
|
||||||
// There is a horse parameter after this, we don't handle it and let it passthrough
|
// There is a horse parameter after this, we don't handle it and let it passthrough
|
||||||
// Inventory tracking
|
// Inventory tracking
|
||||||
@ -230,7 +230,7 @@ public class InventoryPackets {
|
|||||||
wrapper.write(Type.SHORT, slot);
|
wrapper.write(Type.SHORT, slot);
|
||||||
wrapper.write(Type.ITEM, null);
|
wrapper.write(Type.ITEM, null);
|
||||||
}
|
}
|
||||||
}).send(Protocol1_9TO1_8.class);
|
}).send(Protocol1_9To1_8.class);
|
||||||
// Finally reset to simulate throwing item
|
// Finally reset to simulate throwing item
|
||||||
wrapper.set(Type.SHORT, 0, (short) -999); // Set slot to -999
|
wrapper.set(Type.SHORT, 0, (short) -999); // Set slot to -999
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ public class InventoryPackets {
|
|||||||
wrapper.write(Type.SHORT, slot);
|
wrapper.write(Type.SHORT, slot);
|
||||||
wrapper.write(Type.ITEM, null);
|
wrapper.write(Type.ITEM, null);
|
||||||
}
|
}
|
||||||
}).send(Protocol1_9TO1_8.class);
|
}).send(Protocol1_9To1_8.class);
|
||||||
// Finally reset to simulate throwing item
|
// Finally reset to simulate throwing item
|
||||||
wrapper.set(Type.BYTE, 0, (byte) 0); // Set button to 0
|
wrapper.set(Type.BYTE, 0, (byte) 0); // Set button to 0
|
||||||
wrapper.set(Type.BYTE, 1, (byte) 0); // Set mode to 0
|
wrapper.set(Type.BYTE, 1, (byte) 0); // Set mode to 0
|
||||||
|
@ -15,7 +15,7 @@ import us.myles.ViaVersion.packets.State;
|
|||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.PlayerMovementMapper;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.PlayerMovementMapper;
|
||||||
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.chat.ChatRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.chat.ChatRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.chat.GameMode;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.chat.GameMode;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.CommandBlockProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.CommandBlockProvider;
|
||||||
@ -29,7 +29,7 @@ public class PlayerPackets {
|
|||||||
protocol.registerOutgoing(State.PLAY, 0x02, 0x0F, new PacketRemapper() {
|
protocol.registerOutgoing(State.PLAY, 0x02, 0x0F, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 0 - Chat Message (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Chat Message (json)
|
||||||
map(Type.BYTE); // 1 - Chat Positon
|
map(Type.BYTE); // 1 - Chat Positon
|
||||||
|
|
||||||
handler(new PacketHandler() {
|
handler(new PacketHandler() {
|
||||||
@ -51,8 +51,8 @@ public class PlayerPackets {
|
|||||||
protocol.registerOutgoing(State.PLAY, 0x47, 0x48, new PacketRemapper() {
|
protocol.registerOutgoing(State.PLAY, 0x47, 0x48, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 0 - Header
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Header
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 1 - Footer
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 1 - Footer
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class PlayerPackets {
|
|||||||
protocol.registerOutgoing(State.PLAY, 0x40, 0x1A, new PacketRemapper() {
|
protocol.registerOutgoing(State.PLAY, 0x40, 0x1A, new PacketRemapper() {
|
||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 0 - Reason
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Reason
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ public class PlayerPackets {
|
|||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
int action = wrapper.get(Type.VAR_INT, 0);
|
int action = wrapper.get(Type.VAR_INT, 0);
|
||||||
if (action == 0 || action == 1) {
|
if (action == 0 || action == 1) {
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING));
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -139,7 +139,7 @@ public class PlayerPackets {
|
|||||||
if (mode == 4) {
|
if (mode == 4) {
|
||||||
// since removing add to auto team
|
// since removing add to auto team
|
||||||
// Workaround for packet order issue
|
// Workaround for packet order issue
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, true);
|
wrapper.send(Protocol1_9To1_8.class, true, true);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
entityTracker.sendTeamPacket(true, true);
|
entityTracker.sendTeamPacket(true, true);
|
||||||
entityTracker.setCurrentTeam("viaversion");
|
entityTracker.setCurrentTeam("viaversion");
|
||||||
@ -159,7 +159,7 @@ public class PlayerPackets {
|
|||||||
&& teamName.equals(entityTracker.getCurrentTeam())) {
|
&& teamName.equals(entityTracker.getCurrentTeam())) {
|
||||||
// team was removed
|
// team was removed
|
||||||
// Workaround for packet order issue
|
// Workaround for packet order issue
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, true);
|
wrapper.send(Protocol1_9To1_8.class, true, true);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
entityTracker.sendTeamPacket(true, true);
|
entityTracker.sendTeamPacket(true, true);
|
||||||
entityTracker.setCurrentTeam("viaversion");
|
entityTracker.setCurrentTeam("viaversion");
|
||||||
@ -218,7 +218,7 @@ public class PlayerPackets {
|
|||||||
if (Via.getConfig().isAutoTeam()) {
|
if (Via.getConfig().isAutoTeam()) {
|
||||||
entityTracker.setAutoTeam(true);
|
entityTracker.setAutoTeam(true);
|
||||||
// Workaround for packet order issue
|
// Workaround for packet order issue
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, true);
|
wrapper.send(Protocol1_9To1_8.class, true, true);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
entityTracker.sendTeamPacket(true, true);
|
entityTracker.sendTeamPacket(true, true);
|
||||||
entityTracker.setCurrentTeam("viaversion");
|
entityTracker.setCurrentTeam("viaversion");
|
||||||
@ -265,14 +265,14 @@ public class PlayerPackets {
|
|||||||
wrapper.passthrough(Type.VAR_INT); // ping
|
wrapper.passthrough(Type.VAR_INT); // ping
|
||||||
boolean hasDisplayName = wrapper.passthrough(Type.BOOLEAN);
|
boolean hasDisplayName = wrapper.passthrough(Type.BOOLEAN);
|
||||||
if (hasDisplayName) {
|
if (hasDisplayName) {
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING)); // display name
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING)); // display name
|
||||||
}
|
}
|
||||||
} else if ((action == 1) || (action == 2)) { // update gamemode || update latency
|
} else if ((action == 1) || (action == 2)) { // update gamemode || update latency
|
||||||
wrapper.passthrough(Type.VAR_INT);
|
wrapper.passthrough(Type.VAR_INT);
|
||||||
} else if (action == 3) { // update display name
|
} else if (action == 3) { // update display name
|
||||||
boolean hasDisplayName = wrapper.passthrough(Type.BOOLEAN);
|
boolean hasDisplayName = wrapper.passthrough(Type.BOOLEAN);
|
||||||
if (hasDisplayName) {
|
if (hasDisplayName) {
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING)); // display name
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, wrapper.read(Type.STRING)); // display name
|
||||||
}
|
}
|
||||||
} else if (action == 4) { // remove player
|
} else if (action == 4) { // remove player
|
||||||
// no fields
|
// no fields
|
||||||
@ -465,7 +465,7 @@ public class PlayerPackets {
|
|||||||
(short) (wrapper.get(Type.UNSIGNED_BYTE, 0).intValue() | 0x80)
|
(short) (wrapper.get(Type.UNSIGNED_BYTE, 0).intValue() | 0x80)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
wrapper.sendToServer(Protocol1_9TO1_8.class, true, true);
|
wrapper.sendToServer(Protocol1_9To1_8.class, true, true);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
Via.getManager().getProviders().get(MainHandProvider.class).setMainHand(wrapper.user(), hand);
|
Via.getManager().getProviders().get(MainHandProvider.class).setMainHand(wrapper.user(), hand);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import us.myles.ViaVersion.api.type.types.version.Types1_8;
|
|||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
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.metadata.MetadataRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ public class SpawnPackets {
|
|||||||
wrapper.write(Types1_9.METADATA_LIST, meta);
|
wrapper.write(Types1_9.METADATA_LIST, meta);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
metaPacket.send(Protocol1_9TO1_8.class);
|
metaPacket.send(Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -304,7 +304,7 @@ public class SpawnPackets {
|
|||||||
packet.write(Type.VAR_INT, 0);
|
packet.write(Type.VAR_INT, 0);
|
||||||
packet.write(Type.ITEM, new Item(item, (byte) 1, (short) 0, null));
|
packet.write(Type.ITEM, new Item(item, (byte) 1, (short) 0, null));
|
||||||
try {
|
try {
|
||||||
packet.send(Protocol1_9TO1_8.class, true, true);
|
packet.send(Protocol1_9To1_8.class, true, true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ 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.ItemRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ItemRewriter;
|
||||||
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.api.minecraft.chunks.Chunk1_8;
|
import us.myles.ViaVersion.api.minecraft.chunks.Chunk1_8;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BulkChunkTranslatorProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BulkChunkTranslatorProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.CommandBlockProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.CommandBlockProvider;
|
||||||
@ -36,10 +36,10 @@ public class WorldPackets {
|
|||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.POSITION); // 0 - Sign Position
|
map(Type.POSITION); // 0 - Sign Position
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 1 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 1 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 2 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 2 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 3 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 3 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 4 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 4 - Sign Line (json)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ public class WorldPackets {
|
|||||||
output.setId(-1); // -1 for no writing of id
|
output.setId(-1); // -1 for no writing of id
|
||||||
output.writeToBuffer(buffer);
|
output.writeToBuffer(buffer);
|
||||||
PacketWrapper chunkPacket = new PacketWrapper(0x21, buffer, wrapper.user());
|
PacketWrapper chunkPacket = new PacketWrapper(0x21, buffer, wrapper.user());
|
||||||
chunkPacket.send(Protocol1_9TO1_8.class, false, true);
|
chunkPacket.send(Protocol1_9To1_8.class, false, true);
|
||||||
buffer.release();
|
buffer.release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -237,10 +237,10 @@ public class WorldPackets {
|
|||||||
@Override
|
@Override
|
||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.POSITION); // 0 - Sign Position
|
map(Type.POSITION); // 0 - Sign Position
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 1 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 1 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 2 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 2 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 3 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 3 - Sign Line (json)
|
||||||
map(Type.STRING, Protocol1_9TO1_8.FIX_JSON); // 4 - Sign Line (json)
|
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 4 - Sign Line (json)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -291,12 +291,12 @@ public class WorldPackets {
|
|||||||
wrapper.write(Type.LONG, -1L);
|
wrapper.write(Type.LONG, -1L);
|
||||||
wrapper.write(Type.BYTE, (byte) 255);
|
wrapper.write(Type.BYTE, (byte) 255);
|
||||||
// Write item in hand
|
// Write item in hand
|
||||||
Item item = Protocol1_9TO1_8.getHandItem(wrapper.user());
|
Item item = Protocol1_9To1_8.getHandItem(wrapper.user());
|
||||||
// Blocking patch
|
// Blocking patch
|
||||||
if (Via.getConfig().isShieldBlocking()) {
|
if (Via.getConfig().isShieldBlocking()) {
|
||||||
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
|
||||||
|
|
||||||
if (item != null && Protocol1_9TO1_8.isSword(item.getId())) {
|
if (item != null && Protocol1_9To1_8.isSword(item.getId())) {
|
||||||
if (hand == 0) {
|
if (hand == 0) {
|
||||||
if (!tracker.isBlocking()) {
|
if (!tracker.isBlocking()) {
|
||||||
tracker.setBlocking(true);
|
tracker.setBlocking(true);
|
||||||
@ -331,7 +331,7 @@ public class WorldPackets {
|
|||||||
create(new ValueCreator() {
|
create(new ValueCreator() {
|
||||||
@Override
|
@Override
|
||||||
public void write(PacketWrapper wrapper) throws Exception {
|
public void write(PacketWrapper wrapper) throws Exception {
|
||||||
Item item = Protocol1_9TO1_8.getHandItem(wrapper.user());
|
Item item = Protocol1_9To1_8.getHandItem(wrapper.user());
|
||||||
wrapper.write(Type.ITEM, item); // 3 - Item
|
wrapper.write(Type.ITEM, item); // 3 - Item
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -404,7 +404,7 @@ public class WorldPackets {
|
|||||||
updateBlockEntity.write(Type.UNSIGNED_BYTE, (short) 2);
|
updateBlockEntity.write(Type.UNSIGNED_BYTE, (short) 2);
|
||||||
updateBlockEntity.write(Type.NBT, tag.get());
|
updateBlockEntity.write(Type.NBT, tag.get());
|
||||||
|
|
||||||
updateBlockEntity.send(Protocol1_9TO1_8.class);
|
updateBlockEntity.send(Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
import us.myles.ViaVersion.api.minecraft.Position;
|
import us.myles.ViaVersion.api.minecraft.Position;
|
||||||
import us.myles.ViaVersion.api.platform.providers.Provider;
|
import us.myles.ViaVersion.api.platform.providers.Provider;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
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.storage.CommandBlockStorage;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.CommandBlockStorage;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ public class CommandBlockProvider implements Provider {
|
|||||||
wrapper.write(Type.INT, user.get(EntityTracker.class).getProvidedEntityId()); // Entity ID
|
wrapper.write(Type.INT, user.get(EntityTracker.class).getProvidedEntityId()); // Entity ID
|
||||||
wrapper.write(Type.BYTE, (byte) 26); // Hardcoded op permission level
|
wrapper.write(Type.BYTE, (byte) 26); // Hardcoded op permission level
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
|
|
||||||
user.get(CommandBlockStorage.class).setPermissions(true);
|
user.get(CommandBlockStorage.class).setPermissions(true);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
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.chat.GameMode;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.chat.GameMode;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.metadata.MetadataRewriter;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BossBarProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.BossBarProvider;
|
||||||
@ -78,7 +78,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
wrapper.write(Type.VAR_INT, 1); // slot
|
wrapper.write(Type.VAR_INT, 1); // slot
|
||||||
wrapper.write(Type.ITEM, item);
|
wrapper.write(Type.ITEM, item);
|
||||||
try {
|
try {
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
wrapper.write(Type.SHORT, (short) (128D * (Via.getConfig().getHologramYOffset() * 32D)));
|
wrapper.write(Type.SHORT, (short) (128D * (Via.getConfig().getHologramYOffset() * 32D)));
|
||||||
wrapper.write(Type.SHORT, (short) 0);
|
wrapper.write(Type.SHORT, (short) 0);
|
||||||
wrapper.write(Type.BOOLEAN, true);
|
wrapper.write(Type.BOOLEAN, true);
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, false);
|
wrapper.send(Protocol1_9To1_8.class, true, false);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,7 +271,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
}
|
}
|
||||||
teamExists = add;
|
teamExists = add;
|
||||||
try {
|
try {
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, now);
|
wrapper.send(Protocol1_9To1_8.class, true, now);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ public class EntityTracker extends StoredObject {
|
|||||||
handleMetadata(entityID, metadataList);
|
handleMetadata(entityID, metadataList);
|
||||||
if (metadataList.size() > 0) {
|
if (metadataList.size() > 0) {
|
||||||
try {
|
try {
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
|||||||
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;
|
||||||
|
|
||||||
public class Protocol1_9TO1_9_1 extends Protocol {
|
public class Protocol1_9To1_9_1 extends Protocol {
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
// Currently supports 1.9.1 and 1.9.2
|
// Currently supports 1.9.1 and 1.9.2
|
@ -16,7 +16,7 @@ import us.myles.ViaVersion.api.Via;
|
|||||||
import us.myles.ViaVersion.api.ViaListener;
|
import us.myles.ViaVersion.api.ViaListener;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ArmorType;
|
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 java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -28,7 +28,7 @@ public class Sponge4ArmorListener extends ViaListener {
|
|||||||
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
||||||
|
|
||||||
public Sponge4ArmorListener() {
|
public Sponge4ArmorListener() {
|
||||||
super(Protocol1_9TO1_8.class);
|
super(Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -54,7 +54,7 @@ public class Sponge4ArmorListener extends ViaListener {
|
|||||||
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
||||||
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,14 @@ import org.spongepowered.api.event.filter.cause.Root;
|
|||||||
import org.spongepowered.api.world.Location;
|
import org.spongepowered.api.world.Location;
|
||||||
import us.myles.ViaVersion.SpongePlugin;
|
import us.myles.ViaVersion.SpongePlugin;
|
||||||
import us.myles.ViaVersion.api.minecraft.Position;
|
import us.myles.ViaVersion.api.minecraft.Position;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
import us.myles.ViaVersion.sponge.listeners.ViaSpongeListener;
|
import us.myles.ViaVersion.sponge.listeners.ViaSpongeListener;
|
||||||
|
|
||||||
public class BlockListener extends ViaSpongeListener {
|
public class BlockListener extends ViaSpongeListener {
|
||||||
|
|
||||||
public BlockListener(SpongePlugin plugin) {
|
public BlockListener(SpongePlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener
|
@Listener
|
||||||
|
@ -9,14 +9,14 @@ import us.myles.ViaVersion.SpongePlugin;
|
|||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
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.sponge.listeners.ViaSpongeListener;
|
import us.myles.ViaVersion.sponge.listeners.ViaSpongeListener;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
public class DeathListener extends ViaSpongeListener {
|
public class DeathListener extends ViaSpongeListener {
|
||||||
public DeathListener(SpongePlugin plugin) {
|
public DeathListener(SpongePlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Listener(order = Order.LAST)
|
@Listener(order = Order.LAST)
|
||||||
@ -53,9 +53,9 @@ public class DeathListener extends ViaSpongeListener {
|
|||||||
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
wrapper.write(Type.VAR_INT, 2); // Event - Entity dead
|
||||||
wrapper.write(Type.VAR_INT, entityId); // Player ID
|
wrapper.write(Type.VAR_INT, entityId); // Player ID
|
||||||
wrapper.write(Type.INT, entityId); // Entity ID
|
wrapper.write(Type.INT, entityId); // Entity ID
|
||||||
Protocol1_9TO1_8.FIX_JSON.write(wrapper, msg); // Message
|
Protocol1_9To1_8.FIX_JSON.write(wrapper, msg); // Message
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import us.myles.ViaVersion.api.PacketWrapper;
|
|||||||
import us.myles.ViaVersion.api.Via;
|
import us.myles.ViaVersion.api.Via;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.ArmorType;
|
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.sponge.listeners.ViaSpongeListener;
|
import us.myles.ViaVersion.sponge.listeners.ViaSpongeListener;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@ -26,7 +26,7 @@ public class Sponge5ArmorListener extends ViaSpongeListener {
|
|||||||
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
private static final UUID ARMOR_ATTRIBUTE = UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150");
|
||||||
|
|
||||||
public Sponge5ArmorListener(SpongePlugin plugin) {
|
public Sponge5ArmorListener(SpongePlugin plugin) {
|
||||||
super(plugin, Protocol1_9TO1_8.class);
|
super(plugin, Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -52,7 +52,7 @@ public class Sponge5ArmorListener extends ViaSpongeListener {
|
|||||||
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
wrapper.write(Type.DOUBLE, (double) armor); // the modifier value
|
||||||
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
wrapper.write(Type.BYTE, (byte) 0);// the modifier operation, 0 is add number
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
||||||
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.util.ReflectionUtil;
|
import us.myles.ViaVersion.util.ReflectionUtil;
|
||||||
import us.myles.ViaVersion.velocity.service.ProtocolDetectorService;
|
import us.myles.ViaVersion.velocity.service.ProtocolDetectorService;
|
||||||
import us.myles.ViaVersion.velocity.storage.VelocityStorage;
|
import us.myles.ViaVersion.velocity.storage.VelocityStorage;
|
||||||
@ -116,7 +116,7 @@ public class VelocityServerHandler {
|
|||||||
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
|
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
|
||||||
wrapper.write(Type.UUID, uuid);
|
wrapper.write(Type.UUID, uuid);
|
||||||
wrapper.write(Type.VAR_INT, 1); // remove
|
wrapper.write(Type.VAR_INT, 1); // remove
|
||||||
wrapper.send(Protocol1_9TO1_8.class, true, true);
|
wrapper.send(Protocol1_9To1_8.class, true, true);
|
||||||
}
|
}
|
||||||
storage.getBossbar().clear();
|
storage.getBossbar().clear();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_9;
|
|||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
import us.myles.ViaVersion.api.type.types.version.Types1_9;
|
||||||
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
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.storage.EntityTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -27,7 +27,7 @@ public class ElytraPatch {
|
|||||||
if (user == null) return;
|
if (user == null) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9TO1_8.class)) {
|
if (user.get(ProtocolInfo.class).getPipeline().contains(Protocol1_9To1_8.class)) {
|
||||||
int entityId = user.get(EntityTracker.class).getProvidedEntityId();
|
int entityId = user.get(EntityTracker.class).getProvidedEntityId();
|
||||||
|
|
||||||
PacketWrapper wrapper = new PacketWrapper(0x39, null, user);
|
PacketWrapper wrapper = new PacketWrapper(0x39, null, user);
|
||||||
@ -35,7 +35,7 @@ public class ElytraPatch {
|
|||||||
wrapper.write(Type.VAR_INT, entityId);
|
wrapper.write(Type.VAR_INT, entityId);
|
||||||
wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));
|
wrapper.write(Types1_9.METADATA_LIST, Collections.singletonList(new Metadata(0, MetaType1_9.Byte, (byte) 0)));
|
||||||
|
|
||||||
wrapper.send(Protocol1_9TO1_8.class);
|
wrapper.send(Protocol1_9To1_8.class);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -5,7 +5,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
|||||||
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.base.ProtocolInfo;
|
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
|
||||||
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.providers.MovementTransmitterProvider;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.MovementTracker;
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public class VelocityMovementTransmitter extends MovementTransmitterProvider {
|
|||||||
PacketWrapper wrapper = new PacketWrapper(0x03, null, userConnection);
|
PacketWrapper wrapper = new PacketWrapper(0x03, null, userConnection);
|
||||||
wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround());
|
wrapper.write(Type.BOOLEAN, userConnection.get(MovementTracker.class).isGround());
|
||||||
try {
|
try {
|
||||||
wrapper.sendToServer(Protocol1_9TO1_8.class);
|
wrapper.sendToServer(Protocol1_9To1_8.class);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren