3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 00:22:53 +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, 0x4F, 0x4E); // c
registerOutgoing(State.PLAY, 0x50, 0x4F); // c registerOutgoing(State.PLAY, 0x50, 0x4F); // c
registerOutgoing(State.PLAY, 0x51, 0x50); // 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); int type = wrapper.read(Type.VAR_INT);
String stringType = null; String stringType = null;
int slotSize = 0; int slotSize = 0;
switch (type) { if (type < 6) {
case 0: stringType = "minecraft:container";
stringType = "minecraft:container"; slotSize = (type + 1) * 9;
slotSize = 27; } else
break; switch (type) {
case 1: case 11:
stringType = "minecraft:container"; stringType = "minecraft:crafting_table";
slotSize = 54; break;
break; case 14:
case 7: stringType = "minecraft:furnace";
stringType = "minecraft:crafting_table"; break;
break; case 6:
case 9: stringType = "minecraft:dropper";
stringType = "minecraft:furnace"; break;
break; case 12:
case 2: stringType = "minecraft:enchanting_table";
stringType = "minecraft:dropper"; break;
break; case 10:
case 8: stringType = "minecraft:brewing_stand";
stringType = "minecraft:enchanting_table"; break;
break; case 18:
case 6: stringType = "minecraft:villager";
stringType = "minecraft:brewing_stand"; break;
break; case 8:
case 14: stringType = "minecraft:beacon";
stringType = "minecraft:villager"; break;
break; case 7:
case 4: stringType = "minecraft:anvil";
stringType = "minecraft:beacon"; break;
break; case 15:
case 3: stringType = "minecraft:hopper";
stringType = "minecraft:anvil"; break;
break; case 19:
case 11: stringType = "minecraft:shulker_box";
stringType = "minecraft:hopper"; break;
break; }
case 15:
stringType = "minecraft:shulker_box";
break;
}
if (stringType == null) { if (stringType == null) {
ViaBackwards.getPlatform().getLogger().warning("Can't open inventory for 1.13 player! Type: " + type); 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.BOOLEAN); // Trade disabled
wrapper.passthrough(Type.INT); // Number of tools uses wrapper.passthrough(Type.INT); // Number of tools uses
wrapper.passthrough(Type.INT); // Maximum number of trade 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 // Click window packet
protocol.registerIncoming(State.PLAY, 0x08, 0x08, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x09, 0x08, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -312,7 +315,7 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
}); });
// Creative Inventory Action // Creative Inventory Action
protocol.registerIncoming(State.PLAY, 0x24, 0x24, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x26, 0x24, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.SHORT); // 0 - Slot 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); ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
int dimensionId = wrapper.get(Type.INT, 0); int dimensionId = wrapper.get(Type.INT, 0);
clientWorld.setEnvironment(dimensionId); 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 // Register Type ID
addTrackedEntity(wrapper.user(), entityId, EntityType1_14.EntityType.PLAYER); 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 @Override
protected void registerPackets(Protocol1_13_2To1_14 protocol) { 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 // Open Sign Editor
protocol.registerOutgoing(State.PLAY, 0x2D, 0x2C, new PacketRemapper() { // c protocol.registerOutgoing(State.PLAY, 0x2D, 0x2C, new PacketRemapper() { // c
@Override @Override
@ -31,7 +40,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Edit Book // Edit Book
protocol.registerIncoming(State.PLAY, 0x0B, 0x0B, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x0c, 0x0B, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
handler(new PacketHandler() { handler(new PacketHandler() {
@ -44,7 +53,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Player Digging // Player Digging
protocol.registerIncoming(State.PLAY, 0x18, 0x18, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x1a, 0x18, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -54,7 +63,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Recipe Book Data // Recipe Book Data
protocol.registerIncoming(State.PLAY, 0x1B, 0x1B, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x1d, 0x1B, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.VAR_INT); map(Type.VAR_INT);
@ -82,7 +91,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Update Command Block // Update Command Block
protocol.registerIncoming(State.PLAY, 0x22, 0x22, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x24, 0x22, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.POSITION, Type.POSITION1_14); map(Type.POSITION, Type.POSITION1_14);
@ -90,7 +99,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Update Structure Block // Update Structure Block
protocol.registerIncoming(State.PLAY, 0x25, 0x25, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x27, 0x25, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.POSITION, Type.POSITION1_14); map(Type.POSITION, Type.POSITION1_14);
@ -98,7 +107,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Update Sign // Update Sign
protocol.registerIncoming(State.PLAY, 0x26, 0x26, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x28, 0x26, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.POSITION, Type.POSITION1_14); map(Type.POSITION, Type.POSITION1_14);
@ -106,7 +115,7 @@ public class PlayerPackets1_14 extends Rewriter<Protocol1_13_2To1_14> {
}); });
// Player Block Placement // Player Block Placement
protocol.registerIncoming(State.PLAY, 0x29, 0x29, new PacketRemapper() { protocol.registerIncoming(State.PLAY, 0x2b, 0x29, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
handler(new PacketHandler() { handler(new PacketHandler() {