Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
Change the formatting and check if ClientWorld is already in the map
Dieser Commit ist enthalten in:
Ursprung
e26c34daf5
Commit
ceacce741a
@ -40,7 +40,9 @@ public class Protocol1_9To1_10 extends BackwardsProtocol {
|
||||
}
|
||||
|
||||
public void init(UserConnection user) {
|
||||
user.put(new ClientWorld(user));
|
||||
// Register ClientWorld
|
||||
if (!user.has(ClientWorld.class))
|
||||
user.put(new ClientWorld(user));
|
||||
|
||||
// Register EntityTracker if it doesn't exist yet.
|
||||
if (!user.has(EntityTracker.class))
|
||||
|
@ -124,9 +124,7 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
|
||||
// Click window packet
|
||||
protocol.registerIncoming(State.PLAY, 0x07, 0x07, new
|
||||
|
||||
PacketRemapper() {
|
||||
protocol.registerIncoming(State.PLAY, 0x07, 0x07, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.UNSIGNED_BYTE); // 0 - Window ID
|
||||
@ -145,13 +143,10 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Creative Inventory Action
|
||||
protocol.registerIncoming(State.PLAY, 0x18, 0x18, new
|
||||
|
||||
PacketRemapper() {
|
||||
protocol.registerIncoming(State.PLAY, 0x18, 0x18, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.SHORT); // 0 - Slot
|
||||
@ -166,15 +161,12 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
/* Block packets */
|
||||
|
||||
// Chunk packet
|
||||
protocol.registerOutgoing(State.PLAY, 0x20, 0x20, new
|
||||
|
||||
PacketRemapper() {
|
||||
protocol.registerOutgoing(State.PLAY, 0x20, 0x20, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
handler(new PacketHandler() {
|
||||
@ -206,13 +198,10 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Block Change Packet
|
||||
protocol.registerOutgoing(State.PLAY, 0x0B, 0x0B, new
|
||||
|
||||
PacketRemapper() {
|
||||
protocol.registerOutgoing(State.PLAY, 0x0B, 0x0B, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.POSITION); // 0 - Block Position
|
||||
@ -227,13 +216,10 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// Multi Block Change Packet
|
||||
protocol.registerOutgoing(State.PLAY, 0x10, 0x10, new
|
||||
|
||||
PacketRemapper() {
|
||||
protocol.registerOutgoing(State.PLAY, 0x10, 0x10, new PacketRemapper() {
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.INT); // 0 - Chunk X
|
||||
@ -255,7 +241,6 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_9To1_10> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
/* Register Metadata */
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren