Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-26 08:10:10 +01:00
Ursprung
600c843747
Commit
ab0406ba77
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-all</artifactId>
|
<artifactId>viabackwards-all</artifactId>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-bukkit</artifactId>
|
<artifactId>viabackwards-bukkit</artifactId>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-bungee</artifactId>
|
<artifactId>viabackwards-bungee</artifactId>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-core</artifactId>
|
<artifactId>viabackwards-core</artifactId>
|
||||||
|
@ -18,6 +18,7 @@ import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.ClientboundPackets1_17
|
|||||||
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.types.Chunk1_17Type;
|
import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.types.Chunk1_17Type;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class BlockItemPackets1_17 extends nl.matsv.viabackwards.api.rewriters.ItemRewriter<Protocol1_16_4To1_17> {
|
public class BlockItemPackets1_17 extends nl.matsv.viabackwards.api.rewriters.ItemRewriter<Protocol1_16_4To1_17> {
|
||||||
@ -171,6 +172,8 @@ public class BlockItemPackets1_17 extends nl.matsv.viabackwards.api.rewriters.It
|
|||||||
Chunk chunk = wrapper.read(new Chunk1_17Type(currentWorldSectionHeight));
|
Chunk chunk = wrapper.read(new Chunk1_17Type(currentWorldSectionHeight));
|
||||||
wrapper.write(new Chunk1_16_2Type(), chunk);
|
wrapper.write(new Chunk1_16_2Type(), chunk);
|
||||||
|
|
||||||
|
chunk.setBiomeData(Arrays.copyOf(chunk.getBiomeData(), 1024));
|
||||||
|
|
||||||
// Cut down to int mask
|
// Cut down to int mask
|
||||||
chunk.setBitmask(cutLongArrayMask(chunk.getChunkMask().toLongArray()));
|
chunk.setBitmask(cutLongArrayMask(chunk.getChunkMask().toLongArray()));
|
||||||
chunk.setChunkMask(null);
|
chunk.setChunkMask(null);
|
||||||
|
@ -19,6 +19,8 @@ import us.myles.ViaVersion.protocols.protocol1_17to1_16_4.ClientboundPackets1_17
|
|||||||
import us.myles.viaversion.libs.gson.JsonElement;
|
import us.myles.viaversion.libs.gson.JsonElement;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||||
import us.myles.viaversion.libs.opennbt.tag.builtin.IntTag;
|
import us.myles.viaversion.libs.opennbt.tag.builtin.IntTag;
|
||||||
|
import us.myles.viaversion.libs.opennbt.tag.builtin.ListTag;
|
||||||
|
import us.myles.viaversion.libs.opennbt.tag.builtin.Tag;
|
||||||
|
|
||||||
public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
|
public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
|
||||||
|
|
||||||
@ -53,7 +55,16 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
|
|||||||
});
|
});
|
||||||
handler(getTrackerHandler(Entity1_16_2Types.EntityType.PLAYER, Type.INT));
|
handler(getTrackerHandler(Entity1_16_2Types.EntityType.PLAYER, Type.INT));
|
||||||
handler(getWorldDataTracker(1));
|
handler(getWorldDataTracker(1));
|
||||||
handler(wrapper -> warnForExtendedHeight(wrapper.get(Type.NBT, 1)));
|
handler(wrapper -> {
|
||||||
|
CompoundTag dimensionRegistry = wrapper.get(Type.NBT, 0).get("minecraft:dimension_type");
|
||||||
|
ListTag dimensions = dimensionRegistry.get("value");
|
||||||
|
for (Tag dimension : dimensions) {
|
||||||
|
CompoundTag dimensionCompound = ((CompoundTag) dimension).get("element");
|
||||||
|
reduceForExtendedHeight(dimensionCompound, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
reduceForExtendedHeight(wrapper.get(Type.NBT, 1), true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
protocol.registerOutgoing(ClientboundPackets1_17.RESPAWN, new PacketRemapper() {
|
protocol.registerOutgoing(ClientboundPackets1_17.RESPAWN, new PacketRemapper() {
|
||||||
@ -61,7 +72,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
|
|||||||
public void registerMap() {
|
public void registerMap() {
|
||||||
map(Type.NBT); // Dimension data
|
map(Type.NBT); // Dimension data
|
||||||
handler(getWorldDataTracker(0));
|
handler(getWorldDataTracker(0));
|
||||||
handler(wrapper -> warnForExtendedHeight(wrapper.get(Type.NBT, 0)));
|
handler(wrapper -> reduceForExtendedHeight(wrapper.get(Type.NBT, 0), true));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -149,12 +160,18 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
|
|||||||
return Entity1_17Types.getTypeFromId(typeId);
|
return Entity1_17Types.getTypeFromId(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void warnForExtendedHeight(CompoundTag tag) {
|
private void reduceForExtendedHeight(CompoundTag tag, boolean warn) {
|
||||||
IntTag minY = tag.get("min_y");
|
IntTag minY = tag.get("min_y");
|
||||||
IntTag height = tag.get("height");
|
IntTag height = tag.get("height");
|
||||||
if (minY.getValue() != 0 || height.getValue() != 256) {
|
IntTag logicalHeight = tag.get("logical_height");
|
||||||
ViaBackwards.getPlatform().getLogger().severe("Custom worlds heights are NOT SUPPORTED for 1.16 players and older and may lead to errors!");
|
if (minY.getValue() != 0 || height.getValue() > 256 || logicalHeight.getValue() > 256) {
|
||||||
ViaBackwards.getPlatform().getLogger().severe("You have min/max set to " + minY.getValue() + "/" + height.getValue());
|
if (warn) {
|
||||||
|
ViaBackwards.getPlatform().getLogger().severe("Custom worlds heights are NOT SUPPORTED for 1.16 players and older and may lead to errors!");
|
||||||
|
ViaBackwards.getPlatform().getLogger().severe("You have min/max set to " + minY.getValue() + "/" + height.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
height.setValue(Math.min(256, height.getValue()));
|
||||||
|
logicalHeight.setValue(Math.min(256, logicalHeight.getValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-fabric</artifactId>
|
<artifactId>viabackwards-fabric</artifactId>
|
||||||
|
4
pom.xml
4
pom.xml
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<description>Allow older clients to join newer server versions.</description>
|
<description>Allow older clients to join newer server versions.</description>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>us.myles</groupId>
|
<groupId>us.myles</groupId>
|
||||||
<artifactId>viaversion</artifactId>
|
<artifactId>viaversion</artifactId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-sponge</artifactId>
|
<artifactId>viabackwards-sponge</artifactId>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>viabackwards-parent</artifactId>
|
<artifactId>viabackwards-parent</artifactId>
|
||||||
<groupId>nl.matsv</groupId>
|
<groupId>nl.matsv</groupId>
|
||||||
<version>3.3.0-21w05b</version>
|
<version>3.3.0-21w06b</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>viabackwards-velocity</artifactId>
|
<artifactId>viabackwards-velocity</artifactId>
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren