Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-20 06:50:10 +01:00
fix rewrite
Dieser Commit ist enthalten in:
Ursprung
55b4f6c080
Commit
ef5125e972
@ -190,9 +190,9 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
Item[] items = wrapper.get(Type.ITEM_ARRAY, 0);
|
Item[] items = wrapper.get(Type.ITEM_ARRAY, 0);
|
||||||
for (Item item : items) {
|
for (int i = 0; i < items.length; i++)
|
||||||
item = handleItemToClient(item);
|
items[i] = handleItemToClient(items[i]);
|
||||||
}
|
wrapper.set(Type.ITEM_ARRAY,0, items);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -210,6 +210,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
Item item = wrapper.get(Type.ITEM, 0);
|
Item item = wrapper.get(Type.ITEM, 0);
|
||||||
item = handleItemToClient(item);
|
item = handleItemToClient(item);
|
||||||
|
wrapper.set(Type.ITEM, 0, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -351,6 +352,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
Item item = wrapper.get(Type.ITEM, 0);
|
Item item = wrapper.get(Type.ITEM, 0);
|
||||||
item = handleItemToClient(item);
|
item = handleItemToClient(item);
|
||||||
|
wrapper.set(Type.ITEM, 0, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -368,6 +370,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
Item item = wrapper.get(Type.FLAT_ITEM, 0);
|
Item item = wrapper.get(Type.FLAT_ITEM, 0);
|
||||||
item = handleItemToServer(item);
|
item = handleItemToServer(item);
|
||||||
|
wrapper.set(Type.FLAT_ITEM, 0, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -388,6 +391,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
Item item = wrapper.get(Type.FLAT_ITEM, 0);
|
Item item = wrapper.get(Type.FLAT_ITEM, 0);
|
||||||
item = handleItemToServer(item);
|
item = handleItemToServer(item);
|
||||||
|
wrapper.set(Type.FLAT_ITEM, 0, item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -411,6 +415,12 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
rewrite(441).repItem(new Item((short) 103, (byte) 1, (short) -1, getNamedTag("1.12 Fire Coral")));
|
rewrite(441).repItem(new Item((short) 103, (byte) 1, (short) -1, getNamedTag("1.12 Fire Coral")));
|
||||||
rewrite(442).repItem(new Item((short) 98, (byte) 1, (short) -1, getNamedTag("1.12 Horn Coral")));
|
rewrite(442).repItem(new Item((short) 98, (byte) 1, (short) -1, getNamedTag("1.12 Horn Coral")));
|
||||||
|
|
||||||
|
rewrite(438).repItem(new Item((short) 78, (byte) 1, (short) -1, getNamedTag("1.12 Tube Coral")));
|
||||||
|
rewrite(439).repItem(new Item((short) 78, (byte) 1, (short) -1, getNamedTag("1.12 Brain Coral")));
|
||||||
|
rewrite(440).repItem(new Item((short) 78, (byte) 1, (short) -1, getNamedTag("1.12 Bubble Coral")));
|
||||||
|
rewrite(441).repItem(new Item((short) 78, (byte) 1, (short) -1, getNamedTag("1.12 Fire Coral")));
|
||||||
|
rewrite(442).repItem(new Item((short) 78, (byte) 1, (short) -1, getNamedTag("1.12 Horn Coral")));
|
||||||
|
|
||||||
rewrite(427).repItem(new Item((short) 561, (byte) 1, (short) -1, getNamedTag("1.12 Turtle Egg")));
|
rewrite(427).repItem(new Item((short) 561, (byte) 1, (short) -1, getNamedTag("1.12 Turtle Egg")));
|
||||||
|
|
||||||
rewrite(781).repItem(new Item((short) 488, (byte) 1, (short) -1, getNamedTag("1.12 Trident")));
|
rewrite(781).repItem(new Item((short) 488, (byte) 1, (short) -1, getNamedTag("1.12 Trident")));
|
||||||
@ -426,8 +436,10 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Item handleItemToClient(Item item) {
|
protected Item handleItemToClient(Item item) {
|
||||||
item = super.handleItemToClient(item);
|
|
||||||
if (item == null) return null;
|
if (item == null) return null;
|
||||||
|
System.out.println("Input ID: " + item.getId());
|
||||||
|
item = super.handleItemToClient(item);
|
||||||
|
System.out.println("Backwards ID: " + item.getId());
|
||||||
|
|
||||||
Integer rawId = null;
|
Integer rawId = null;
|
||||||
boolean gotRawIdFromTag = false;
|
boolean gotRawIdFromTag = false;
|
||||||
@ -623,6 +635,7 @@ public class BlockItemPackets1_13 extends BlockItemRewriter<Protocol1_12_2To1_13
|
|||||||
tag.put(newCanDestroy);
|
tag.put(newCanDestroy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
System.out.println("ViaVer Id: " + item.getId());
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,7 +403,8 @@ public class EntityPackets1_13 extends EntityRewriter<Protocol1_12_2To1_13> {
|
|||||||
// Rewrite items
|
// Rewrite items
|
||||||
else if (typeId == 6) {
|
else if (typeId == 6) {
|
||||||
meta.setMetaType(MetaType1_12.Slot);
|
meta.setMetaType(MetaType1_12.Slot);
|
||||||
getProtocol().getBlockItemPackets().handleItemToClient((Item) meta.getValue());
|
Item item = (Item) meta.getValue();
|
||||||
|
meta.setValue(getProtocol().getBlockItemPackets().handleItemToClient(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discontinue particles
|
// Discontinue particles
|
||||||
|
@ -34,19 +34,16 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
|
|||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
//Input Item
|
//Input Item
|
||||||
Item input = wrapper.read(Type.FLAT_ITEM);
|
Item input = wrapper.read(Type.FLAT_ITEM);
|
||||||
getProtocol().getBlockItemPackets().handleItemToClient(input);
|
wrapper.write(Type.ITEM, getProtocol().getBlockItemPackets().handleItemToClient(input));
|
||||||
wrapper.write(Type.ITEM, input);
|
|
||||||
//Output Item
|
//Output Item
|
||||||
Item output = wrapper.read(Type.FLAT_ITEM);
|
Item output = wrapper.read(Type.FLAT_ITEM);
|
||||||
getProtocol().getBlockItemPackets().handleItemToClient(output);
|
wrapper.write(Type.ITEM, getProtocol().getBlockItemPackets().handleItemToClient(output));
|
||||||
wrapper.write(Type.ITEM, output);
|
|
||||||
|
|
||||||
boolean secondItem = wrapper.passthrough(Type.BOOLEAN); //Has second item
|
boolean secondItem = wrapper.passthrough(Type.BOOLEAN); //Has second item
|
||||||
if (secondItem) {
|
if (secondItem) {
|
||||||
//Second Item
|
//Second Item
|
||||||
Item second = wrapper.read(Type.FLAT_ITEM);
|
Item second = wrapper.read(Type.FLAT_ITEM);
|
||||||
getProtocol().getBlockItemPackets().handleItemToClient(second);
|
wrapper.write(Type.ITEM, getProtocol().getBlockItemPackets().handleItemToClient(second));
|
||||||
wrapper.write(Type.ITEM, second);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper.passthrough(Type.BOOLEAN); //Trade disabled
|
wrapper.passthrough(Type.BOOLEAN); //Trade disabled
|
||||||
@ -207,8 +204,7 @@ public class PlayerPacket1_13 extends Rewriter<Protocol1_12_2To1_13> {
|
|||||||
if (channel.equals("MC|BSign") || channel.equals("MC|BEdit")) {
|
if (channel.equals("MC|BSign") || channel.equals("MC|BEdit")) {
|
||||||
wrapper.setId(0x0B);
|
wrapper.setId(0x0B);
|
||||||
Item book = wrapper.read(Type.ITEM);
|
Item book = wrapper.read(Type.ITEM);
|
||||||
getProtocol().getBlockItemPackets().handleItemToServer(book);
|
wrapper.write(Type.FLAT_ITEM, getProtocol().getBlockItemPackets().handleItemToServer(book));
|
||||||
wrapper.write(Type.FLAT_ITEM, book);
|
|
||||||
boolean signing = channel.equals("MC|BSign");
|
boolean signing = channel.equals("MC|BSign");
|
||||||
wrapper.write(Type.BOOLEAN, signing);
|
wrapper.write(Type.BOOLEAN, signing);
|
||||||
} else if (channel.equals("MC|ItemName")) {
|
} else if (channel.equals("MC|ItemName")) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren