20w30a, bump version to match VV's

This commit is contained in:
KennyTV 2020-07-22 21:52:48 +02:00
parent 61b1f0d8a4
commit d209e9b768
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
12 changed files with 37 additions and 62 deletions

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-all</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-bukkit</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-bungee</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-core</artifactId>

View File

@ -1,36 +0,0 @@
package nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.data;
import nl.matsv.viabackwards.ViaBackwards;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.data.BiomeMappings;
import us.myles.viaversion.libs.fastutil.ints.Int2IntMap;
import us.myles.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
public class BackwardsBiomeMappings {
private static final Int2IntMap BIOMES = new Int2IntOpenHashMap();
private static final int HIGHEST_VANILLA_BIOME;
static {
int lastBiome = 0;
for (Int2IntMap.Entry entry : BiomeMappings.getBiomes().int2IntEntrySet()) {
int newBiome = entry.getIntValue();
BIOMES.put(newBiome, entry.getIntKey());
if (newBiome > lastBiome) {
lastBiome = newBiome;
}
}
HIGHEST_VANILLA_BIOME = lastBiome;
}
public static int getOldBiomeId(int biomeId) {
if (biomeId > HIGHEST_VANILLA_BIOME) {
if (!Via.getConfig().isSuppressConversionWarnings()) {
ViaBackwards.getPlatform().getLogger().warning("Custom biome id could not be mapped: " + biomeId);
}
return 0;
}
return BIOMES.getOrDefault(biomeId, biomeId);
}
}

View File

@ -3,7 +3,6 @@ package nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.packets;
import nl.matsv.viabackwards.ViaBackwards;
import nl.matsv.viabackwards.api.rewriters.TranslatableRewriter;
import nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.Protocol1_16_1To1_16_2;
import nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.data.BackwardsBiomeMappings;
import nl.matsv.viabackwards.protocol.protocol1_16_1to1_16_2.data.BackwardsMappings;
import us.myles.ViaVersion.api.minecraft.BlockChangeRecord;
import us.myles.ViaVersion.api.minecraft.BlockChangeRecord1_8;
@ -72,14 +71,6 @@ public class BlockItemPackets1_16_2 extends nl.matsv.viabackwards.api.rewriters.
Chunk chunk = wrapper.read(new Chunk1_16_2Type(clientWorld));
wrapper.write(new Chunk1_16Type(clientWorld), chunk);
if (chunk.isBiomeData()) {
int[] biomes = chunk.getBiomeData();
for (int i = 0; i < biomes.length; i++) {
int biome = biomes[i];
biomes[i] = BackwardsBiomeMappings.getOldBiomeId(biome);
}
}
for (int i = 0; i < chunk.getSections().length; i++) {
ChunkSection section = chunk.getSections()[i];
if (section == null) continue;

View File

@ -16,6 +16,9 @@ import us.myles.ViaVersion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_
import us.myles.ViaVersion.protocols.protocol1_16to1_15_2.packets.EntityPackets;
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
import us.myles.viaversion.libs.gson.JsonElement;
import us.myles.viaversion.libs.opennbt.NBTIO;
import java.io.File;
public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2> {
@ -49,7 +52,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
map(Type.STRING_ARRAY); // World List
handler(wrapper -> {
// Just screw the registry and write the defaults for 1.16 and 1.16.1 clients
wrapper.read(Type.NBT);
NBTIO.writeFile(wrapper.read(Type.NBT), new File("oo.jbt"));
wrapper.write(Type.NBT, EntityPackets.DIMENSIONS_TAG);
});
map(Type.STRING); // Dimension Type
@ -90,6 +93,15 @@ public class EntityPackets1_16_2 extends EntityRewriter<Protocol1_16_1To1_16_2>
mapTypes(Entity1_16_2Types.EntityType.values(), Entity1_16Types.EntityType.class);
mapEntity(Entity1_16_2Types.EntityType.PIGLIN_BRUTE, Entity1_16_2Types.EntityType.PIGLIN).jsonName("Piglin Brute");
registerMetaHandler().filter(Entity1_16_2Types.EntityType.ABSTRACT_PIGLIN).handle(meta -> {
if (meta.getIndex() == 15) {
meta.getData().setId(16);
} else if (meta.getIndex() == 16) {
meta.getData().setId(15);
}
return meta.getData();
});
}
@Override

View File

@ -1,5 +1,13 @@
{
"blockstates": {
"minecraft:lantern[hanging=true,waterlogged=true]": "minecraft:lantern[hanging=true]",
"minecraft:lantern[hanging=true,waterlogged=false]": "minecraft:lantern[hanging=true]",
"minecraft:lantern[hanging=false,waterlogged=true]": "minecraft:lantern[hanging=false]",
"minecraft:lantern[hanging=false,waterlogged=false]": "minecraft:lantern[hanging=false]",
"minecraft:soul_lantern[hanging=true,waterlogged=true]": "minecraft:soul_lantern[hanging=true]",
"minecraft:soul_lantern[hanging=true,waterlogged=false]": "minecraft:soul_lantern[hanging=true]",
"minecraft:soul_lantern[hanging=false,waterlogged=true]": "minecraft:soul_lantern[hanging=false]",
"minecraft:soul_lantern[hanging=false,waterlogged=false]": "minecraft:soul_lantern[hanging=false]"
},
"items": {
"minecraft:piglin_brute_spawn_egg": {
@ -8,12 +16,12 @@
}
},
"sounds": {
"entity.parrot.imitate.piglin_brute" : "entity.parrot.imitate.piglin",
"entity.piglin_brute.ambient" : "entity.piglin.ambient",
"entity.piglin_brute.angry" : "entity.piglin.angry",
"entity.piglin_brute.death" : "entity.piglin.death",
"entity.piglin_brute.hurt" : "entity.piglin.hurt",
"entity.piglin_brute.step" : "entity.piglin.step",
"entity.piglin_brute.converted_to_zombified" : "entity.piglin.converted_to_zombified"
"entity.parrot.imitate.piglin_brute": "entity.parrot.imitate.piglin",
"entity.piglin_brute.ambient": "entity.piglin.ambient",
"entity.piglin_brute.angry": "entity.piglin.angry",
"entity.piglin_brute.death": "entity.piglin.death",
"entity.piglin_brute.hurt": "entity.piglin.hurt",
"entity.piglin_brute.step": "entity.piglin.step",
"entity.piglin_brute.converted_to_zombified": "entity.piglin.converted_to_zombified"
}
}

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-fabric</artifactId>

View File

@ -16,7 +16,7 @@
<groupId>nl.matsv</groupId>
<artifactId>viabackwards-parent</artifactId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>Allow older clients to join newer server versions.</description>
@ -65,7 +65,7 @@
<dependency>
<groupId>us.myles</groupId>
<artifactId>viaversion</artifactId>
<version>3.0.2-20w28a</version>
<version>3.1.0-20w30a</version>
<scope>provided</scope>
</dependency>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-sponge</artifactId>

View File

@ -16,7 +16,7 @@
<parent>
<artifactId>viabackwards-parent</artifactId>
<groupId>nl.matsv</groupId>
<version>3.0.2-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>viabackwards-velocity</artifactId>