mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-09-06 01:08:08 +02:00
Merge pull request #123 from Gerrygames/dev
fix #122 and wrong byte types in trade list packets
This commit is contained in:
commit
e481c45b62
@ -139,7 +139,7 @@ public class BlockItemPackets1_11 extends BlockItemRewriter<Protocol1_10To1_11>
|
|||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
||||||
|
@ -140,7 +140,7 @@ public class BlockItemPackets1_12 extends BlockItemRewriter<Protocol1_11_1To1_12
|
|||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
||||||
|
@ -90,7 +90,7 @@ public class ItemPackets1_11_1 extends BlockItemRewriter<Protocol1_11To1_11_1> {
|
|||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
||||||
|
@ -125,8 +125,8 @@ public class Protocol1_12_2To1_13 extends BackwardsProtocol {
|
|||||||
in(State.PLAY, 0x1B, 0x17, cancel()); // Recipe Book Data TODO MODIFIED
|
in(State.PLAY, 0x1B, 0x17, cancel()); // Recipe Book Data TODO MODIFIED
|
||||||
in(State.PLAY, 0x1D, 0x18); // Resource Pack Status
|
in(State.PLAY, 0x1D, 0x18); // Resource Pack Status
|
||||||
in(State.PLAY, 0x1E, 0x19); // Advancement Tab
|
in(State.PLAY, 0x1E, 0x19); // Advancement Tab
|
||||||
in(State.PLAY, 0x1F, -1); // Select Trade
|
//in(State.PLAY, 0x1F, -1); // Select Trade (the client won't send this)
|
||||||
in(State.PLAY, 0x20, -1); // Set Beacon Effect
|
//in(State.PLAY, 0x20, -1); // Set Beacon Effect (the client won't send this)
|
||||||
in(State.PLAY, 0x21, 0x1A); // Held Item Change (serverbound)
|
in(State.PLAY, 0x21, 0x1A); // Held Item Change (serverbound)
|
||||||
in(State.PLAY, 0x26, 0x1C); // Update Sign
|
in(State.PLAY, 0x26, 0x1C); // Update Sign
|
||||||
in(State.PLAY, 0x27, 0x1D); // Animation (serverbound)
|
in(State.PLAY, 0x27, 0x1D); // Animation (serverbound)
|
||||||
|
@ -96,7 +96,7 @@ public class BlockItemPackets1_10 extends BlockItemRewriter<Protocol1_9_4To1_10>
|
|||||||
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) {
|
||||||
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
wrapper.passthrough(Type.INT); // Passthrough Window ID
|
||||||
|
|
||||||
int size = wrapper.passthrough(Type.BYTE);
|
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Input Item
|
||||||
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
wrapper.write(Type.ITEM, handleItemToClient(wrapper.read(Type.ITEM))); // Output Item
|
||||||
|
Loading…
Reference in New Issue
Block a user