3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-24 15:20:19 +01:00
Dieser Commit ist enthalten in:
KennyTV 2021-02-25 00:31:41 +01:00
Ursprung 0fbe2dc432
Commit a349c001fe
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
6 geänderte Dateien mit 192 neuen und 61 gelöschten Zeilen

Datei anzeigen

@ -7,7 +7,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "3.3.0-21w07a"
version = "3.3.0-21w08"
description = "Allow older clients to join newer server versions."
}

Datei anzeigen

@ -1,6 +1,6 @@
object Versions {
// ViaVersion
const val viaversion = "3.3.0-21w07a"
const val viaversion = "3.3.0-21w08a"
// Common
const val netty = "4.0.20.Final"

Datei anzeigen

@ -138,6 +138,29 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_17.EXPLOSION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.FLOAT); // X
map(Type.FLOAT); // Y
map(Type.FLOAT); // Z
handler(wrapper -> {
wrapper.write(Type.INT, wrapper.read(Type.VAR_INT)); // Collection length
});
}
});
registerOutgoing(ClientboundPackets1_17.SPAWN_POSITION, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION1_14);
handler(wrapper -> {
// Angle (which Mojang just forgot to write to the buffer, lol)
wrapper.read(Type.FLOAT);
});
}
});
registerIncoming(ServerboundPackets1_16_2.CLIENT_SETTINGS, new PacketRemapper() {
@Override
public void registerMap() {
@ -153,6 +176,23 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
}
});
mergePacket(ClientboundPackets1_17.TITLE_TEXT, ClientboundPackets1_16_2.TITLE, 0);
mergePacket(ClientboundPackets1_17.TITLE_SUBTITLE, ClientboundPackets1_16_2.TITLE, 1);
mergePacket(ClientboundPackets1_17.ACTIONBAR, ClientboundPackets1_16_2.TITLE, 2);
mergePacket(ClientboundPackets1_17.TITLE_TIMES, ClientboundPackets1_16_2.TITLE, 3);
registerOutgoing(ClientboundPackets1_17.CLEAR_TITLES, ClientboundPackets1_16_2.TITLE, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
if (wrapper.read(Type.BOOLEAN)) {
wrapper.write(Type.VAR_INT, 5); // Reset times
} else {
wrapper.write(Type.VAR_INT, 4); // Simple clear
}
});
}
});
cancelOutgoing(ClientboundPackets1_17.ADD_VIBRATION_SIGNAL);
}
@ -172,4 +212,16 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
public BackwardsMappings getMappingData() {
return MAPPINGS;
}
public void mergePacket(ClientboundPackets1_17 newPacketType, ClientboundPackets1_16_2 oldPacketType, int type) {
// A few packets that had different handling based on an initially read enum type were split into different ones
registerOutgoing(newPacketType, oldPacketType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
wrapper.write(Type.VAR_INT, type);
});
}
});
}
}

Datei anzeigen

@ -11,6 +11,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.rewriters.BlockRewriter;
import us.myles.ViaVersion.api.rewriters.ItemRewriter;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ServerboundPackets1_16_2;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.types.Chunk1_16_2Type;
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.data.RecipeRewriter1_16;
@ -89,6 +90,13 @@ public class BlockItemPackets1_17 extends nl.matsv.viabackwards.api.rewriters.It
}
});
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_SIZE, ClientboundPackets1_16_2.WORLD_BORDER, 0);
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_LERP_SIZE, ClientboundPackets1_16_2.WORLD_BORDER, 1);
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_CENTER, ClientboundPackets1_16_2.WORLD_BORDER, 2);
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_INIT, ClientboundPackets1_16_2.WORLD_BORDER, 3);
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_WARNING_DELAY, ClientboundPackets1_16_2.WORLD_BORDER, 4);
protocol.mergePacket(ClientboundPackets1_17.WORLD_BORDER_WARNING_DISTANCE, ClientboundPackets1_16_2.WORLD_BORDER, 5);
// The Great Shrunkening
// Chunk sections *will* be lost ¯\_()_/¯
protocol.registerOutgoing(ClientboundPackets1_17.UPDATE_LIGHT, new PacketRemapper() {

Datei anzeigen

@ -15,6 +15,7 @@ import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.api.type.types.Particle;
import us.myles.ViaVersion.api.type.types.version.Types1_14;
import us.myles.ViaVersion.api.type.types.version.Types1_17;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.ClientboundPackets1_17;
import us.myles.viaversion.libs.gson.JsonElement;
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
@ -94,6 +95,20 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
});
}
});
protocol.registerOutgoing(ClientboundPackets1_17.ENTITY_PROPERTIES, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Entity id
handler(wrapper -> {
wrapper.write(Type.INT, wrapper.read(Type.VAR_INT)); // Collection length
});
}
});
protocol.mergePacket(ClientboundPackets1_17.COMBAT_ENTER, ClientboundPackets1_16_2.COMBAT_EVENT, 0);
protocol.mergePacket(ClientboundPackets1_17.COMBAT_END, ClientboundPackets1_16_2.COMBAT_EVENT, 1);
protocol.mergePacket(ClientboundPackets1_17.COMBAT_KILL, ClientboundPackets1_16_2.COMBAT_EVENT, 2);
}
@Override

Datei anzeigen

@ -1322,23 +1322,31 @@
"minecraft:waxed_weathered_cut_copper_slab": "minecraft:brick_slab[",
"minecraft:waxed_exposed_cut_copper_slab": "minecraft:brick_slab[",
"minecraft:waxed_cut_copper_slab": "minecraft:brick_slab[",
"minecraft:grimstone": "minecraft:blackstone",
"minecraft:grimstone_stairs": "minecraft:blackstone_stairs[",
"minecraft:grimstone_slab": "minecraft:blackstone_slab[",
"minecraft:grimstone_wall": "minecraft:blackstone_wall[",
"minecraft:polished_grimstone": "minecraft:polished_blackstone",
"minecraft:polished_grimstone_stairs": "minecraft:polished_blackstone_stairs[",
"minecraft:polished_grimstone_slab": "minecraft:polished_blackstone_slab[",
"minecraft:polished_grimstone_wall": "minecraft:polished_blackstone_wall[",
"minecraft:grimstone_tiles": "minecraft:blackstone",
"minecraft:grimstone_tile_stairs": "minecraft:blackstone_stairs[",
"minecraft:grimstone_tile_slab": "minecraft:blackstone_slab[",
"minecraft:grimstone_tile_wall": "minecraft:blackstone_wall[",
"minecraft:grimstone_bricks": "minecraft:blackstone",
"minecraft:grimstone_brick_stairs": "minecraft:polished_blackstone_brick_stairs[",
"minecraft:grimstone_brick_slab": "minecraft:polished_blackstone_brick_slab[",
"minecraft:grimstone_brick_wall": "minecraft:polished_blackstone_brick_wall[",
"minecraft:chiseled_grimstone": "minecraft:blackstone"
"minecraft:deepslate": "minecraft:blackstone",
"minecraft:cobbled_deepslate": "minecraft:polished_blackstone",
"minecraft:cobbled_deepslate_stairs": "minecraft:polished_blackstone_stairs[",
"minecraft:cobbled_deepslate_slab": "minecraft:polished_blackstone_slab[",
"minecraft:cobbled_deepslate_wall": "minecraft:polished_blackstone_wall[",
"minecraft:polished_deepslate": "minecraft:polished_blackstone",
"minecraft:polished_deepslate_stairs": "minecraft:polished_blackstone_stairs[",
"minecraft:polished_deepslate_slab": "minecraft:polished_blackstone_slab[",
"minecraft:polished_deepslate_wall": "minecraft:polished_blackstone_wall[",
"minecraft:deepslate_tiles": "minecraft:blackstone",
"minecraft:deepslate_tile_stairs": "minecraft:blackstone_stairs[",
"minecraft:deepslate_tile_slab": "minecraft:blackstone_slab[",
"minecraft:deepslate_tile_wall": "minecraft:blackstone_wall[",
"minecraft:deepslate_bricks": "minecraft:blackstone",
"minecraft:deepslate_brick_stairs": "minecraft:polished_blackstone_brick_stairs[",
"minecraft:deepslate_brick_slab": "minecraft:polished_blackstone_brick_slab[",
"minecraft:deepslate_brick_wall": "minecraft:polished_blackstone_brick_wall[",
"minecraft:chiseled_deepslate": "minecraft:blackstone",
"minecraft:deepslate_gold_ore": "minecraft:gold_ore",
"minecraft:deepslate_iron_ore": "minecraft:iron_ore",
"minecraft:deepslate_lapis_ore": "minecraft:lapis_ore",
"minecraft:deepslate_diamond_ore": "minecraft:diamond_ore",
"minecraft:deepslate_redstone_ore[lit=true]": "minecraft:redstone_ore[lit=true]",
"minecraft:deepslate_redstone_ore[lit=false]": "minecraft:redstone_ore[lit=false]",
"minecraft:smooth_basalt": "minecraft:basalt[axis=x]"
},
"items": {
"minecraft:dirt_path": {
@ -1673,73 +1681,101 @@
"id": "minecraft:brick_slab",
"name": "1.17 Waxed Weathered Cut Copper Slab"
},
"minecraft:grimstone": {
"minecraft:deepslate": {
"id": "minecraft:blackstone",
"name": "1.17 Grimstone"
"name": "1.17 Deepslate"
},
"minecraft:polished_grimstone": {
"minecraft:polished_deepslate": {
"id": "minecraft:polished_blackstone",
"name": "1.17 Polished Grimstone"
"name": "1.17 Polished Deepslate"
},
"minecraft:grimstone_bricks": {
"minecraft:deepslate_bricks": {
"id": "minecraft:polished_blackstone_bricks",
"name": "1.17 Grimstone Bricks"
"name": "1.17 Deepslate Bricks"
},
"minecraft:grimstone_tiles": {
"minecraft:deepslate_tiles": {
"id": "minecraft:blackstone",
"name": "1.17 Grimstone Tiles"
"name": "1.17 Deepslate Tiles"
},
"minecraft:chiseled_grimstone": {
"minecraft:chiseled_deepslate": {
"id": "minecraft:chiseled_polished_blackstone",
"name": "1.17 Chiseled Grimstone"
"name": "1.17 Chiseled Deepslate"
},
"minecraft:grimstone_wall": {
"id": "minecraft:blackstone_wall",
"name": "1.17 Grimstone Wall"
"minecraft:cobbled_deepslate": {
"id": "minecraft:polished_blackstone",
"name": "1.17 Cobbled Deepslate"
},
"minecraft:polished_grimstone_wall": {
"minecraft:polished_deepslate_wall": {
"id": "minecraft:polished_blackstone_wall",
"name": "1.17 Polished Grimstone Wall"
"name": "1.17 Polished Deepslate Wall"
},
"minecraft:grimstone_tile_wall": {
"id": "minecraft:blackstone_wall",
"name": "1.17 Grimstone Tile Wall"
"minecraft:deepslate_tile_wall": {
"id": "minecraft:polished_blackstone_wall",
"name": "1.17 Deepslate Tile Wall"
},
"minecraft:grimstone_brick_wall": {
"minecraft:deepslate_brick_wall": {
"id": "minecraft:polished_blackstone_brick_wall",
"name": "1.17 Grimstone Brick Wall"
"name": "1.17 Deepslate Brick Wall"
},
"minecraft:grimstone_stairs": {
"id": "minecraft:blackstone_stairs",
"name": "1.17 Grimstone Stairs"
"minecraft:cobbled_deepslate_wall": {
"id": "minecraft:polished_blackstone_wall",
"name": "1.17 Cobbled Deepslate Wall"
},
"minecraft:polished_grimstone_stairs": {
"minecraft:polished_deepslate_stairs": {
"id": "minecraft:polished_blackstone_brick_stairs",
"name": "1.17 Polished Grimstone Stairs"
"name": "1.17 Polished Deepslate Stairs"
},
"minecraft:grimstone_tile_stairs": {
"id": "minecraft:blackstone_stairs",
"name": "1.17 Grimstone Tile Stairs"
"minecraft:deepslate_tile_stairs": {
"id": "minecraft:polished_blackstone_stairs",
"name": "1.17 Deepslate Tile Stairs"
},
"minecraft:grimstone_brick_stairs": {
"minecraft:deepslate_brick_stairs": {
"id": "minecraft:polished_blackstone_brick_stairs",
"name": "1.17 Grimstone Brick Stairs"
"name": "1.17 Deepslate Brick Stairs"
},
"minecraft:polished_grimstone_slab": {
"minecraft:cobbled_deepslate_stairs": {
"id": "minecraft:polished_blackstone_stairs",
"name": "1.17 Cobbled Deepslate Stairs"
},
"minecraft:polished_deepslate_slab": {
"id": "minecraft:polished_blackstone_brick_slab",
"name": "1.17 Polished Grimstone Slab"
"name": "1.17 Polished Deepslate Slab"
},
"minecraft:grimstone_slab": {
"id": "minecraft:blackstone_slab",
"name": "1.17 Grimstone Slab"
"minecraft:deepslate_tile_slab": {
"id": "minecraft:polished_blackstone_slab",
"name": "1.17 Deepslate Tile Slab"
},
"minecraft:grimstone_tile_slab": {
"id": "minecraft:blackstone_slab",
"name": "1.17 Grimstone Tile Slab"
},
"minecraft:grimstone_brick_slab": {
"minecraft:deepslate_brick_slab": {
"id": "minecraft:polished_blackstone_brick_slab",
"name": "1.17 Grimstone Brick Slab"
"name": "1.17 Deepslate Brick Slab"
},
"minecraft:cobbled_deepslate_slab": {
"id": "minecraft:polished_blackstone_slab",
"name": "1.17 Cobbled Deepslate Slab"
},
"minecraft:smooth_basalt": {
"id": "minecraft:basalt",
"name": "1.17 Smooth Basalt"
},
"minecraft:deepslate_redstone_ore": {
"id": "minecraft:redstone_ore",
"name": "1.17 Deepslate Redstone Ore"
},
"minecraft:deepslate_iron_ore": {
"id": "minecraft:iron_ore",
"name": "1.17 Deepslate Iron Ore"
},
"minecraft:deepslate_diamond_ore": {
"id": "minecraft:diamond_ore",
"name": "1.17 Deepslate Diamond Ore"
},
"minecraft:deepslate_gold_ore": {
"id": "minecraft:gold_ore",
"name": "1.17 Deepslate Gold Ore"
},
"minecraft:deepslate_lapis_ore": {
"id": "minecraft:lapis_ore",
"name": "1.17 Deepslate Lapis Ore"
}
},
"sounds": {
@ -1894,7 +1930,27 @@
"block.vine.break": "",
"block.vine.fall": "",
"block.vine.hit": "",
"block.vine.place": ""
"block.vine.place": "",
"block.deepslate_bricks.break": "",
"block.deepslate_bricks.fall": "",
"block.deepslate_bricks.hit": "",
"block.deepslate_bricks.place": "",
"block.deepslate_bricks.step": "",
"block.deepslate.break": "",
"block.deepslate.fall": "",
"block.deepslate.hit": "",
"block.deepslate.place": "",
"block.deepslate.step": "",
"block.deepslate_tiles.break": "",
"block.deepslate_tiles.fall": "",
"block.deepslate_tiles.hit": "",
"block.deepslate_tiles.place": "",
"block.deepslate_tiles.step": "",
"block.polished_deepslate.break": "",
"block.polished_deepslate.fall": "",
"block.polished_deepslate.hit": "",
"block.polished_deepslate.place": "",
"block.polished_deepslate.step": ""
},
"particles": {
"small_flame": "flame",