3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-11-03 14:50:38 +01:00

fix wandering traders + trades

Dieser Commit ist enthalten in:
Marco 2019-05-22 11:27:27 +02:00
Ursprung 24bfa82c0c
Commit 1dc4a771a3
3 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -253,7 +253,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol {
registerIncoming(State.PLAY, 0x1E, 0x1C); // r registerIncoming(State.PLAY, 0x1E, 0x1C); // r
registerIncoming(State.PLAY, 0x1F, 0x1D); // r registerIncoming(State.PLAY, 0x1F, 0x1D); // r
registerIncoming(State.PLAY, 0x20, 0x1E); // r registerIncoming(State.PLAY, 0x20, 0x1E); // r
// registerIncoming(State.PLAY, 0x21, 0x1F); // r TDO fix registerIncoming(State.PLAY, 0x21, 0x1F); // r
registerIncoming(State.PLAY, 0x22, 0x20); // r registerIncoming(State.PLAY, 0x22, 0x20); // r
registerIncoming(State.PLAY, 0x23, 0x21); // r registerIncoming(State.PLAY, 0x23, 0x21); // r

Datei anzeigen

@ -170,10 +170,10 @@ public class BlockItemPackets1_14 extends BlockItemRewriter<Protocol1_13_2To1_14
@Override @Override
public void handle(PacketWrapper wrapper) throws Exception { public void handle(PacketWrapper wrapper) throws Exception {
wrapper.write(Type.STRING, "minecraft:trader_list"); wrapper.write(Type.STRING, "minecraft:trader_list");
wrapper.read(Type.STRING); // Remove channel // wrapper.read(Type.STRING); // Remove channel
int windowId = wrapper.read(Type.INT); int windowId = wrapper.read(Type.VAR_INT);
wrapper.write(Type.VAR_INT, windowId); wrapper.write(Type.INT, windowId);
int size = wrapper.passthrough(Type.UNSIGNED_BYTE); int size = wrapper.passthrough(Type.UNSIGNED_BYTE);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {

Datei anzeigen

@ -128,8 +128,12 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
); );
Optional<Integer> oldId = EntityTypeMapping.getOldId(type); Optional<Integer> oldId = EntityTypeMapping.getOldId(type);
if (!oldId.isPresent()) { if (!oldId.isPresent()) {
if (!hasData(entityType)) Optional<EntityData> oldType = getEntityData(entityType);if (!oldType.isPresent()) {
ViaBackwards.getPlatform().getLogger().warning("Could not find 1.13.2 entity type for 1.14 entity type " + type + "/" + entityType); ViaBackwards.getPlatform().getLogger().warning("Could not find 1.13.2 entity type for 1.14 entity type " + type + "/" + entityType);
wrapper.cancel();
}else{
wrapper.set(Type.VAR_INT, 1, oldType.get().getReplacementId());
}
} else { } else {
wrapper.set(Type.VAR_INT, 1, oldId.get()); wrapper.set(Type.VAR_INT, 1, oldId.get());
} }
@ -297,6 +301,7 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
regEntType(EntityType1_14.EntityType.FOX, EntityType1_14.EntityType.WOLF).mobName("Fox"); regEntType(EntityType1_14.EntityType.FOX, EntityType1_14.EntityType.WOLF).mobName("Fox");
regEntType(EntityType1_14.EntityType.PANDA, EntityType1_14.EntityType.POLAR_BEAR).mobName("Panda"); regEntType(EntityType1_14.EntityType.PANDA, EntityType1_14.EntityType.POLAR_BEAR).mobName("Panda");
regEntType(EntityType1_14.EntityType.PILLAGER, EntityType1_14.EntityType.VILLAGER).mobName("Pillager"); regEntType(EntityType1_14.EntityType.PILLAGER, EntityType1_14.EntityType.VILLAGER).mobName("Pillager");
regEntType(EntityType1_14.EntityType.WANDERING_TRADER, EntityType1_14.EntityType.VILLAGER).mobName("Wandering Trader");
regEntType(EntityType1_14.EntityType.RAVAGER, EntityType1_14.EntityType.COW).mobName("Ravager"); regEntType(EntityType1_14.EntityType.RAVAGER, EntityType1_14.EntityType.COW).mobName("Ravager");
registerMetaHandler().handle(e -> { registerMetaHandler().handle(e -> {