3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 16:12:43 +01:00
Dieser Commit ist enthalten in:
creeper123123321 2019-03-16 09:27:36 -03:00
Ursprung d99c5f5e60
Commit 1885840768
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0AC57D54786721D1
4 geänderte Dateien mit 106 neuen und 49 gelöschten Zeilen

Datei anzeigen

@ -54,6 +54,48 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol {
}
});
//Unknown packet added in 19w11a - 0x02
registerIncoming(State.PLAY, 0x03, 0x02); // r
registerIncoming(State.PLAY, 0x04, 0x03); // r
registerIncoming(State.PLAY, 0x05, 0x04); // r
registerIncoming(State.PLAY, 0x06, 0x05); // r
registerIncoming(State.PLAY, 0x07, 0x06); // r
registerIncoming(State.PLAY, 0x08, 0x07); // r
registerIncoming(State.PLAY, 0x0A, 0x09); // r
registerIncoming(State.PLAY, 0x0B, 0x0A); // r
registerIncoming(State.PLAY, 0x0D, 0x0C); // r
registerIncoming(State.PLAY, 0x0E, 0x0D); // r
//Unknown packet added in 19w11a - 0x0F
registerIncoming(State.PLAY, 0x10, 0x0E); // r
registerIncoming(State.PLAY, 0x11, 0x0F); // r
registerIncoming(State.PLAY, 0x12, 0x10); // r
registerIncoming(State.PLAY, 0x13, 0x11); // r
registerIncoming(State.PLAY, 0x14, 0x12); // r
registerIncoming(State.PLAY, 0x15, 0x13); // r
registerIncoming(State.PLAY, 0x16, 0x14); // r
registerIncoming(State.PLAY, 0x17, 0x15); // r
registerIncoming(State.PLAY, 0x18, 0x16); // r
registerIncoming(State.PLAY, 0x19, 0x17); // r
registerIncoming(State.PLAY, 0x1B, 0x19); // r
registerIncoming(State.PLAY, 0x1C, 0x1A); // r
registerIncoming(State.PLAY, 0x1E, 0x1C); // r
registerIncoming(State.PLAY, 0x1F, 0x1D); // r
registerIncoming(State.PLAY, 0x20, 0x1E); // r
registerIncoming(State.PLAY, 0x21, 0x1F); // r
registerIncoming(State.PLAY, 0x22, 0x20); // r
registerIncoming(State.PLAY, 0x23, 0x21); // r
registerIncoming(State.PLAY, 0x25, 0x23); // r
registerIncoming(State.PLAY, 0x29, 0x27); // r
registerIncoming(State.PLAY, 0x2A, 0x28); // r
registerIncoming(State.PLAY, 0x2C, 0x2A); // r
registerOutgoing(State.PLAY, 0x4F, 0x4E); // c
registerOutgoing(State.PLAY, 0x50, 0x4F); // c
registerOutgoing(State.PLAY, 0x51, 0x50); // c

Datei anzeigen

@ -45,46 +45,42 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
int type = wrapper.read(Type.VAR_INT);
String stringType = null;
int slotSize = 0;
switch (type) {
case 0:
stringType = "minecraft:container";
slotSize = 27;
break;
case 1:
stringType = "minecraft:container";
slotSize = 54;
break;
case 7:
stringType = "minecraft:crafting_table";
break;
case 9:
stringType = "minecraft:furnace";
break;
case 2:
stringType = "minecraft:dropper";
break;
case 8:
stringType = "minecraft:enchanting_table";
break;
case 6:
stringType = "minecraft:brewing_stand";
break;
case 14:
stringType = "minecraft:villager";
break;
case 4:
stringType = "minecraft:beacon";
break;
case 3:
stringType = "minecraft:anvil";
break;
case 11:
stringType = "minecraft:hopper";
break;
case 15:
stringType = "minecraft:shulker_box";
break;
}
if (type < 6) {
stringType = "minecraft:container";
slotSize = (type + 1) * 9;
} else
switch (type) {
case 11:
stringType = "minecraft:crafting_table";
break;
case 14:
stringType = "minecraft:furnace";
break;
case 6:
stringType = "minecraft:dropper";
break;
case 12:
stringType = "minecraft:enchanting_table";
break;
case 10:
stringType = "minecraft:brewing_stand";
break;
case 18:
stringType = "minecraft:villager";
break;
case 8:
stringType = "minecraft:beacon";
break;
case 7:
stringType = "minecraft:anvil";
break;
case 15:
stringType = "minecraft:hopper";
break;
case 19:
stringType = "minecraft:shulker_box";
break;
}
if (stringType == null) {
ViaBackwards.getPlatform().getLogger().warning("Can't open inventory for 1.13 player! Type: " + type);
@ -180,7 +176,14 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
wrapper.passthrough(Type.BOOLEAN); // Trade disabled
wrapper.passthrough(Type.INT); // Number of tools uses
wrapper.passthrough(Type.INT); // Maximum number of trade uses
wrapper.read(Type.INT);
wrapper.read(Type.INT);
wrapper.read(Type.FLOAT);
}
wrapper.read(Type.VAR_INT);
wrapper.read(Type.VAR_INT);
wrapper.read(Type.BOOLEAN);
}
});
}
@ -292,7 +295,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
*/
// Click window packet
protocol.registerIncoming(State.PLAY, 0x08, 0x08, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x09, 0x08, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -312,7 +315,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
});
// Creative Inventory Action
protocol.registerIncoming(State.PLAY, 0x24, 0x24, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x26, 0x24, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.SHORT); // 0 - Slot
@ -501,6 +504,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
int dimensionId = wrapper.get(Type.INT, 0);
clientWorld.setEnvironment(dimensionId);
wrapper.write(Type.UNSIGNED_BYTE, (short) 0); // todo - do we need to store it from difficulty packet?
}
});
}

Datei anzeigen

@ -256,6 +256,8 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
// Register Type ID
addTrackedEntity(wrapper.user(), entityId, EntityType1_14.EntityType.PLAYER);
wrapper.write(Type.UNSIGNED_BYTE, (short) 0);
}
});
}

Datei anzeigen

@ -13,6 +13,15 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
@Override
protected void registerPackets(Protocol1_13_2To1_14 protocol) {
// Server Difficulty
protocol.registerOutgoing(State.PLAY, 0x0D, 0x0D, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE);
map(Type.BOOLEAN, Type.NOTHING); // Locked
}
});
// Open Sign Editor
protocol.registerOutgoing(State.PLAY, 0x2D, 0x2C, new PacketRemapper() { // c
@Override
@ -31,7 +40,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Edit Book
protocol.registerIncoming(State.PLAY, 0x0B, 0x0B, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x0c, 0x0B, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -44,7 +53,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Player Digging
protocol.registerIncoming(State.PLAY, 0x18, 0x18, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x1a, 0x18, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -54,7 +63,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Recipe Book Data
protocol.registerIncoming(State.PLAY, 0x1B, 0x1B, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x1d, 0x1B, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -82,7 +91,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Update Command Block
protocol.registerIncoming(State.PLAY, 0x22, 0x22, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x24, 0x22, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
@ -90,7 +99,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Update Structure Block
protocol.registerIncoming(State.PLAY, 0x25, 0x25, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x27, 0x25, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
@ -98,7 +107,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Update Sign
protocol.registerIncoming(State.PLAY, 0x26, 0x26, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x28, 0x26, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
@ -106,7 +115,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
});
// Player Block Placement
protocol.registerIncoming(State.PLAY, 0x29, 0x29, new PacketRemapper() {
protocol.registerIncoming(State.PLAY, 0x2b, 0x29, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {