3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-03 22:18:04 +02:00
Dieser Commit ist enthalten in:
KennyTV 2020-07-22 21:47:18 +02:00
Ursprung 2c9ce50312
Commit 48f8412440
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
19 geänderte Dateien mit 2305 neuen und 2336 gelöschten Zeilen

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -107,8 +107,11 @@ public class Entity1_16_2Types {
WITCH(96, ABSTRACT_MONSTER),
WITHER(97, ABSTRACT_MONSTER),
RAVAGER(67, ABSTRACT_MONSTER),
PIGLIN(60, ABSTRACT_MONSTER),
PIGLIN_BRUTE(61, ABSTRACT_MONSTER),
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
PIGLIN(60, ABSTRACT_PIGLIN),
PIGLIN_BRUTE(61, ABSTRACT_PIGLIN),
HOGLIN(32, ABSTRACT_ANIMAL),
STRIDER(83, ABSTRACT_ANIMAL),

Datei anzeigen

@ -84,7 +84,7 @@ public class ProtocolVersion {
register(v1_15_2 = new ProtocolVersion(578, "1.15.2"));
register(v1_16 = new ProtocolVersion(735, "1.16"));
register(v1_16_1 = new ProtocolVersion(736, "1.16.1"));
register(v1_16_2 = new ProtocolVersion(741, "1.16.2"));
register(v1_16_2 = new ProtocolVersion(743, "1.16.2"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}

Datei anzeigen

@ -1,48 +0,0 @@
package us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.data;
import it.unimi.dsi.fastutil.ints.Int2IntMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
public class BiomeMappings {
private static final Int2IntMap BIOMES = new Int2IntOpenHashMap();
static {
BIOMES.put(127, 51);
BIOMES.put(129, 52);
BIOMES.put(130, 53);
BIOMES.put(131, 54);
BIOMES.put(132, 55);
BIOMES.put(133, 56);
BIOMES.put(134, 57);
BIOMES.put(140, 58);
BIOMES.put(149, 59);
BIOMES.put(151, 60);
BIOMES.put(155, 61);
BIOMES.put(156, 62);
BIOMES.put(157, 63);
BIOMES.put(158, 64);
BIOMES.put(160, 65);
BIOMES.put(161, 66);
BIOMES.put(162, 67);
BIOMES.put(163, 68);
BIOMES.put(164, 69);
BIOMES.put(165, 70);
BIOMES.put(166, 71);
BIOMES.put(167, 72);
BIOMES.put(168, 73);
BIOMES.put(169, 74);
BIOMES.put(170, 75);
BIOMES.put(171, 76);
BIOMES.put(172, 77);
BIOMES.put(173, 78);
}
public static Int2IntMap getBiomes() {
return BIOMES;
}
public static int getNewBiomeId(int biomeId) {
return BIOMES.getOrDefault(biomeId, biomeId);
}
}

Datei anzeigen

@ -19,6 +19,7 @@ public class MappingData {
public static void init() {
Via.getPlatform().getLogger().info("Loading 1.16.1 -> 1.16.2 mappings...");
JsonObject diffmapping = MappingDataLoader.loadData("mappingdiff-1.16.1to1.16.2.json");
JsonObject mapping1_16 = MappingDataLoader.loadData("mapping-1.16.json", true);
JsonObject mapping1_16_2 = MappingDataLoader.loadData("mapping-1.16.2.json", true);
@ -30,7 +31,7 @@ public class MappingData {
}
oldToNewItems.defaultReturnValue(-1);
blockStateMappings = new Mappings(mapping1_16.getAsJsonObject("blockstates"), mapping1_16_2.getAsJsonObject("blockstates"));
blockStateMappings = new Mappings(mapping1_16.getAsJsonObject("blockstates"), mapping1_16_2.getAsJsonObject("blockstates"), diffmapping.getAsJsonObject("blockstates"));
blockMappings = new Mappings(mapping1_16.getAsJsonObject("blocks"), mapping1_16_2.getAsJsonObject("blocks"));
MappingDataLoader.mapIdentifiers(oldToNewItems, mapping1_16.getAsJsonObject("items"), mapping1_16_2.getAsJsonObject("items"));
soundMappings = new Mappings(mapping1_16.getAsJsonArray("sounds"), mapping1_16_2.getAsJsonArray("sounds"));

Datei anzeigen

@ -29,6 +29,16 @@ public class MetadataRewriter1_16_2To1_16_1 extends MetadataRewriter {
int data = (int) metadata.getValue();
metadata.setValue(Protocol1_16_2To1_16_1.getNewBlockStateId(data));
}
if (type == null) return;
if (type.isOrHasParent(Entity1_16_2Types.EntityType.ABSTRACT_PIGLIN)) {
if (metadata.getId() == 15) {
metadata.setId(16);
} else if (metadata.getId() == 16) {
metadata.setId(15);
}
}
}
@Override

Datei anzeigen

@ -11,7 +11,6 @@ import us.myles.ViaVersion.api.rewriters.BlockRewriter;
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.Protocol1_16_2To1_16_1;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.data.BiomeMappings;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.types.Chunk1_16_2Type;
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16;
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.types.Chunk1_16Type;
@ -39,14 +38,6 @@ public class WorldPackets {
Chunk chunk = wrapper.read(new Chunk1_16Type(clientWorld));
wrapper.write(new Chunk1_16_2Type(clientWorld), chunk);
if (chunk.isBiomeData()) {
int[] biomes = chunk.getBiomeData();
for (int i = 0; i < biomes.length; i++) {
int biome = biomes[i];
biomes[i] = BiomeMappings.getNewBiomeId(biome);
}
}
for (int s = 0; s < 16; s++) {
ChunkSection section = chunk.getSections()[s];
if (section == null) continue;

Datei anzeigen

@ -0,0 +1,8 @@
{
"blockstates": {
"14886": "minecraft:lantern[hanging=true,waterlogged=false]",
"14887": "minecraft:lantern[hanging=false,waterlogged=false]",
"14888": "minecraft:soul_lantern[hanging=true,waterlogged=false]",
"14889": "minecraft:soul_lantern[hanging=false,waterlogged=false]"
}
}

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>viaversion-jar</name>

Datei anzeigen

@ -6,7 +6,7 @@
<groupId>us.myles</groupId>
<artifactId>viaversion-parent</artifactId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
<packaging>pom</packaging>
<name>viaversion-parent</name>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Datei anzeigen

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>3.1.0-20w29a</version>
<version>3.1.0-20w30a</version>
</parent>
<modelVersion>4.0.0</modelVersion>