mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-18 16:17:45 +01:00
📎 Rename 1.13.1 classes
This commit is contained in:
parent
8477e20725
commit
58b8f4004b
@ -2,9 +2,9 @@ package nl.matsv.viabackwards.protocol.protocol1_13to1_13_1;
|
||||
|
||||
import nl.matsv.viabackwards.api.BackwardsProtocol;
|
||||
import nl.matsv.viabackwards.api.entities.storage.EntityTracker;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.EntityPackets;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.InventoryPackets;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.WorldPackets;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.EntityPackets1_13_1;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.InventoryPackets1_13_1;
|
||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.WorldPackets1_13_1;
|
||||
import us.myles.ViaVersion.api.PacketWrapper;
|
||||
import us.myles.ViaVersion.api.data.UserConnection;
|
||||
import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||
@ -19,9 +19,9 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
new EntityPackets().register(this);
|
||||
InventoryPackets.register(this);
|
||||
WorldPackets.register(this);
|
||||
new EntityPackets1_13_1().register(this);
|
||||
InventoryPackets1_13_1.register(this);
|
||||
WorldPackets1_13_1.register(this);
|
||||
|
||||
//Tab complete
|
||||
registerIncoming(State.PLAY, 0x05, 0x05, new PacketRemapper() {
|
||||
@ -47,7 +47,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
||||
handler(new PacketHandler() {
|
||||
@Override
|
||||
public void handle(PacketWrapper wrapper) throws Exception {
|
||||
InventoryPackets.toServer(wrapper.get(Type.FLAT_ITEM, 0));
|
||||
InventoryPackets1_13_1.toServer(wrapper.get(Type.FLAT_ITEM, 0));
|
||||
wrapper.write(Type.VAR_INT, 0);
|
||||
}
|
||||
});
|
||||
@ -128,7 +128,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
||||
wrapper.passthrough(Type.STRING); // Title
|
||||
wrapper.passthrough(Type.STRING); // Description
|
||||
Item icon = wrapper.passthrough(Type.FLAT_ITEM);
|
||||
InventoryPackets.toClient(icon);
|
||||
InventoryPackets1_13_1.toClient(icon);
|
||||
wrapper.passthrough(Type.VAR_INT); // Frame type
|
||||
int flags = wrapper.passthrough(Type.INT); // Flags
|
||||
if ((flags & 1) != 0)
|
||||
@ -169,7 +169,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
||||
wrapper.passthrough(Type.STRING);
|
||||
Integer[] items = wrapper.passthrough(Type.VAR_INT_ARRAY);
|
||||
for (int j = 0; j < items.length; j++) {
|
||||
items[j] = InventoryPackets.getOldItemId(items[j]);
|
||||
items[j] = InventoryPackets1_13_1.getOldItemId(items[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import us.myles.ViaVersion.api.type.types.version.Types1_13;
|
||||
import us.myles.ViaVersion.packets.State;
|
||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||
|
||||
public class EntityPackets extends EntityRewriter<Protocol1_13To1_13_1> {
|
||||
public class EntityPackets1_13_1 extends EntityRewriter<Protocol1_13To1_13_1> {
|
||||
|
||||
@Override
|
||||
protected void registerPackets(Protocol1_13To1_13_1 protocol) {
|
||||
@ -322,7 +322,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_13To1_13_1> {
|
||||
Metadata meta = e.getData();
|
||||
|
||||
if (meta.getMetaType() == MetaType1_13.Slot) {
|
||||
InventoryPackets.toClient((Item) meta.getValue());
|
||||
InventoryPackets1_13_1.toClient((Item) meta.getValue());
|
||||
} else if (meta.getMetaType() == MetaType1_13.BlockID) {
|
||||
// Convert to new block id
|
||||
int data = (int) meta.getValue();
|
@ -8,7 +8,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.packets.State;
|
||||
|
||||
public class InventoryPackets {
|
||||
public class InventoryPackets1_13_1 {
|
||||
|
||||
public static void register(Protocol protocol) {
|
||||
|
@ -13,7 +13,7 @@ import us.myles.ViaVersion.packets.State;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Chunk1_13Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||
|
||||
public class WorldPackets {
|
||||
public class WorldPackets1_13_1 {
|
||||
|
||||
public static void register(Protocol protocol) {
|
||||
//Chunk
|
||||
@ -109,7 +109,7 @@ public class WorldPackets {
|
||||
int id = wrapper.get(Type.INT, 0);
|
||||
int data = wrapper.get(Type.INT, 1);
|
||||
if (id == 1010) { // Play record
|
||||
wrapper.set(Type.INT, 1, data = InventoryPackets.getNewItemId(data));
|
||||
wrapper.set(Type.INT, 1, data = InventoryPackets1_13_1.getNewItemId(data));
|
||||
} else if (id == 2001) { // Block break + block break sound
|
||||
wrapper.set(Type.INT, 1, data = Protocol1_13To1_13_1.getNewBlockStateId(data));
|
||||
}
|
||||
@ -140,7 +140,7 @@ public class WorldPackets {
|
||||
int data = wrapper.passthrough(Type.VAR_INT);
|
||||
wrapper.set(Type.VAR_INT, 0, Protocol1_13To1_13_1.getNewBlockStateId(data));
|
||||
} else if (id == 27) {
|
||||
InventoryPackets.toClient(wrapper.passthrough(Type.FLAT_ITEM));
|
||||
InventoryPackets1_13_1.toClient(wrapper.passthrough(Type.FLAT_ITEM));
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user