Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
📎 Rename 1.13.1 classes
Dieser Commit ist enthalten in:
Ursprung
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.BackwardsProtocol;
|
||||||
import nl.matsv.viabackwards.api.entities.storage.EntityTracker;
|
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.EntityPackets1_13_1;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.InventoryPackets;
|
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.InventoryPackets1_13_1;
|
||||||
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.WorldPackets;
|
import nl.matsv.viabackwards.protocol.protocol1_13to1_13_1.packets.WorldPackets1_13_1;
|
||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.minecraft.item.Item;
|
import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||||
@ -19,9 +19,9 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets() {
|
protected void registerPackets() {
|
||||||
new EntityPackets().register(this);
|
new EntityPackets1_13_1().register(this);
|
||||||
InventoryPackets.register(this);
|
InventoryPackets1_13_1.register(this);
|
||||||
WorldPackets.register(this);
|
WorldPackets1_13_1.register(this);
|
||||||
|
|
||||||
//Tab complete
|
//Tab complete
|
||||||
registerIncoming(State.PLAY, 0x05, 0x05, new PacketRemapper() {
|
registerIncoming(State.PLAY, 0x05, 0x05, new PacketRemapper() {
|
||||||
@ -47,7 +47,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
|||||||
handler(new PacketHandler() {
|
handler(new PacketHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
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);
|
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); // Title
|
||||||
wrapper.passthrough(Type.STRING); // Description
|
wrapper.passthrough(Type.STRING); // Description
|
||||||
Item icon = wrapper.passthrough(Type.FLAT_ITEM);
|
Item icon = wrapper.passthrough(Type.FLAT_ITEM);
|
||||||
InventoryPackets.toClient(icon);
|
InventoryPackets1_13_1.toClient(icon);
|
||||||
wrapper.passthrough(Type.VAR_INT); // Frame type
|
wrapper.passthrough(Type.VAR_INT); // Frame type
|
||||||
int flags = wrapper.passthrough(Type.INT); // Flags
|
int flags = wrapper.passthrough(Type.INT); // Flags
|
||||||
if ((flags & 1) != 0)
|
if ((flags & 1) != 0)
|
||||||
@ -169,7 +169,7 @@ public class Protocol1_13To1_13_1 extends BackwardsProtocol {
|
|||||||
wrapper.passthrough(Type.STRING);
|
wrapper.passthrough(Type.STRING);
|
||||||
Integer[] items = wrapper.passthrough(Type.VAR_INT_ARRAY);
|
Integer[] items = wrapper.passthrough(Type.VAR_INT_ARRAY);
|
||||||
for (int j = 0; j < items.length; j++) {
|
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.packets.State;
|
||||||
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;
|
||||||
|
|
||||||
public class EntityPackets extends EntityRewriter<Protocol1_13To1_13_1> {
|
public class EntityPackets1_13_1 extends EntityRewriter<Protocol1_13To1_13_1> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void registerPackets(Protocol1_13To1_13_1 protocol) {
|
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();
|
Metadata meta = e.getData();
|
||||||
|
|
||||||
if (meta.getMetaType() == MetaType1_13.Slot) {
|
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) {
|
} else if (meta.getMetaType() == MetaType1_13.BlockID) {
|
||||||
// Convert to new block id
|
// Convert to new block id
|
||||||
int data = (int) meta.getValue();
|
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.api.type.Type;
|
||||||
import us.myles.ViaVersion.packets.State;
|
import us.myles.ViaVersion.packets.State;
|
||||||
|
|
||||||
public class InventoryPackets {
|
public class InventoryPackets1_13_1 {
|
||||||
|
|
||||||
public static void register(Protocol protocol) {
|
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_13to1_12_2.types.Chunk1_13Type;
|
||||||
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;
|
||||||
|
|
||||||
public class WorldPackets {
|
public class WorldPackets1_13_1 {
|
||||||
|
|
||||||
public static void register(Protocol protocol) {
|
public static void register(Protocol protocol) {
|
||||||
//Chunk
|
//Chunk
|
||||||
@ -109,7 +109,7 @@ public class WorldPackets {
|
|||||||
int id = wrapper.get(Type.INT, 0);
|
int id = wrapper.get(Type.INT, 0);
|
||||||
int data = wrapper.get(Type.INT, 1);
|
int data = wrapper.get(Type.INT, 1);
|
||||||
if (id == 1010) { // Play record
|
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
|
} else if (id == 2001) { // Block break + block break sound
|
||||||
wrapper.set(Type.INT, 1, data = Protocol1_13To1_13_1.getNewBlockStateId(data));
|
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);
|
int data = wrapper.passthrough(Type.VAR_INT);
|
||||||
wrapper.set(Type.VAR_INT, 0, Protocol1_13To1_13_1.getNewBlockStateId(data));
|
wrapper.set(Type.VAR_INT, 0, Protocol1_13To1_13_1.getNewBlockStateId(data));
|
||||||
} else if (id == 27) {
|
} else if (id == 27) {
|
||||||
InventoryPackets.toClient(wrapper.passthrough(Type.FLAT_ITEM));
|
InventoryPackets1_13_1.toClient(wrapper.passthrough(Type.FLAT_ITEM));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren