feat: update mappings to 26.1 & adapt allay update

This commit is contained in:
IWareQ committed 2026-06-13 20:14:42 +04:00
1 parent 25d510156d
commit 5d1faf3c00
10 files changed
+37 -38

No files matched your search

+4 -4
View File
@@ -86,13 +86,13 @@ object Versions {
} }
object Allay { object Allay {
const val api = "0.20.0" const val api = "0.28.0"
const val gson = "2.13.2" const val gson = "2.13.2"
const val mappings = "366baa6" const val mappings = "0c2ac22"
const val mappingsGenerator = "e957088" const val mappingsGenerator = "3742321"
const val mcmeta = "c976eb3" const val mcmeta = "805b8ac"
} }
object Minestom { object Minestom {
+1 -1
View File
@@ -2,7 +2,7 @@
## Resource files ## Resource files
Current mapping version: je 1.21.11 to be 1.21.111 Current mapping version: JE 26.1.2 to BE 26.1
- `mapping/biomes.json` and `mapping/items.json` are obtained from [GeyserMC/mappings](https://github.com/GeyserMC/mappings). - `mapping/biomes.json` and `mapping/items.json` are obtained from [GeyserMC/mappings](https://github.com/GeyserMC/mappings).
- `mapping/blocks.json` is obtained from [GeyserMC/mappings-generator](https://github.com/GeyserMC/mappings-generator) (path: `https://github.com/GeyserMC/mappings-generator/blob/master/generator_blocks.json`). - `mapping/blocks.json` is obtained from [GeyserMC/mappings-generator](https://github.com/GeyserMC/mappings-generator) (path: `https://github.com/GeyserMC/mappings-generator/blob/master/generator_blocks.json`).
@@ -47,7 +47,7 @@ public class AllayPlatform extends AbstractPlatform {
var dimension = wrapper.getAllayWorldGenerator().getDimension(); var dimension = wrapper.getAllayWorldGenerator().getDimension();
TerraAllayPlugin.instance.getPluginLogger().info( TerraAllayPlugin.instance.getPluginLogger().info(
"Replaced pack in chunk generator for world {}", "Replaced pack in chunk generator for world {}",
dimension.getWorld().getWorldData().getDisplayName() + ":" + dimension.getDimensionInfo().dimensionId() dimension.getWorld().getWorldData().getDisplayName() + ":" + dimension.getDimensionType().getIdentifier()
); );
}); });
}); });
@@ -82,12 +82,11 @@ public final class Mapping {
} }
public static String dimensionIdBeToJe(String beDimensionId) { public static String dimensionIdBeToJe(String beDimensionId) {
return switch(beDimensionId) { if(beDimensionId.equals("minecraft:nether")) {
case "overworld" -> "minecraft:overworld"; return "minecraft:the_nether";
case "nether" -> "minecraft:the_nether"; }
case "the_end" -> "minecraft:the_end";
default -> beDimensionId; return beDimensionId;
};
} }
public static Map<String, String> getJeBlockDefaultProperties(String jeBlockIdentifier) { public static Map<String, String> getJeBlockDefaultProperties(String jeBlockIdentifier) {
@@ -21,10 +21,10 @@ public record AllayChunk(ServerWorld world, Chunk allayChunk) implements com.dfs
@Override @Override
public void setBlock(int x, int y, int z, BlockState data, boolean physics) { public void setBlock(int x, int y, int z, BlockState data, boolean physics) {
var dimensionInfo = allayChunk.getDimensionInfo(); var dimensionType = allayChunk.getDimensionType();
if(x < 0 || x > 15 || if(x < 0 || x > 15 ||
z < 0 || z > 15 || z < 0 || z > 15 ||
y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) { y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
return; return;
} }
@@ -21,15 +21,15 @@ public record AllayProtoChunk(UnsafeChunk allayChunk) implements ProtoChunk {
@Override @Override
public int getMaxHeight() { public int getMaxHeight() {
return allayChunk.getDimensionInfo().maxHeight(); return allayChunk.getDimensionType().getMaxHeight();
} }
@Override @Override
public void setBlock(int x, int y, int z, @NotNull BlockState blockState) { public void setBlock(int x, int y, int z, @NotNull BlockState blockState) {
var dimensionInfo = allayChunk.getDimensionInfo(); var dimensionType = allayChunk.getDimensionType();
if(x < 0 || x > 15 || if(x < 0 || x > 15 ||
z < 0 || z > 15 || z < 0 || z > 15 ||
y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) { y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
return; return;
} }
@@ -31,11 +31,11 @@ public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAcces
var currentChunk = context.getCurrentChunk(); var currentChunk = context.getCurrentChunk();
var currentChunkX = currentChunk.getX(); var currentChunkX = currentChunk.getX();
var currentChunkZ = currentChunk.getZ(); var currentChunkZ = currentChunk.getZ();
var dimInfo = currentChunk.getDimensionInfo(); var dimensionType = currentChunk.getDimensionType();
if(x >= currentChunkX * 16 && x < currentChunkX * 16 + 16 && if(x >= currentChunkX * 16 && x < currentChunkX * 16 + 16 &&
z >= currentChunkZ * 16 && z < currentChunkZ * 16 + 16 && z >= currentChunkZ * 16 && z < currentChunkZ * 16 + 16 &&
y >= dimInfo.minHeight() && y <= dimInfo.maxHeight()) { y >= dimensionType.getMinHeight() && y <= dimensionType.getMaxHeight()) {
return currentChunk.getBlockEntity(x & 15, y, z & 15); return currentChunk.getBlockEntity(x & 15, y, z & 15);
} else { } else {
var chunk = context.getChunkSource().getChunk(x >> 4, z >> 4); var chunk = context.getChunkSource().getChunk(x >> 4, z >> 4);
@@ -60,8 +60,8 @@ public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAcces
@Override @Override
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) { public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
var dimensionInfo = allayServerWorld.allayDimension().getDimensionInfo(); var dimensionType = allayServerWorld.allayDimension().getDimensionType();
if(y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) { if(y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
return; return;
} }
@@ -27,8 +27,8 @@ public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dime
@Override @Override
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) { public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
var dimensionInfo = allayDimension.getDimensionInfo(); var dimensionType = allayDimension.getDimensionType();
if(y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) { if(y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
return; return;
} }
@@ -74,12 +74,12 @@ public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dime
@Override @Override
public int getMaxHeight() { public int getMaxHeight() {
return allayDimension.getDimensionInfo().maxHeight(); return allayDimension.getDimensionType().getMaxHeight();
} }
@Override @Override
public int getMinHeight() { public int getMinHeight() {
return allayDimension.getDimensionInfo().minHeight(); return allayDimension.getDimensionType().getMinHeight();
} }
@Override @Override
@@ -1,6 +1,6 @@
package com.dfsek.terra.allay.delegate; package com.dfsek.terra.allay.delegate;
import org.allaymc.api.world.data.DimensionInfo; import org.allaymc.api.world.dimension.DimensionType;
import com.dfsek.terra.api.world.info.WorldProperties; import com.dfsek.terra.api.world.info.WorldProperties;
@@ -12,12 +12,12 @@ public class AllayWorldProperties implements WorldProperties {
private final Object fakeHandle; private final Object fakeHandle;
private final long seed; private final long seed;
private final DimensionInfo dimensionInfo; private final DimensionType dimensionType;
public AllayWorldProperties(long seed, DimensionInfo dimensionInfo) { public AllayWorldProperties(long seed, DimensionType dimensionType) {
this.fakeHandle = new Object(); this.fakeHandle = new Object();
this.seed = seed; this.seed = seed;
this.dimensionInfo = dimensionInfo; this.dimensionType = dimensionType;
} }
@Override @Override
@@ -27,12 +27,12 @@ public class AllayWorldProperties implements WorldProperties {
@Override @Override
public int getMaxHeight() { public int getMaxHeight() {
return dimensionInfo.maxHeight(); return dimensionType.getMaxHeight();
} }
@Override @Override
public int getMinHeight() { public int getMinHeight() {
return dimensionInfo.minHeight(); return dimensionType.getMinHeight();
} }
@Override @Override
@@ -4,7 +4,7 @@ import com.google.common.base.Preconditions;
import org.allaymc.api.utils.AllayStringUtils; import org.allaymc.api.utils.AllayStringUtils;
import org.allaymc.api.world.biome.BiomeType; import org.allaymc.api.world.biome.BiomeType;
import org.allaymc.api.world.chunk.UnsafeChunk; import org.allaymc.api.world.chunk.UnsafeChunk;
import org.allaymc.api.world.data.DimensionInfo; import org.allaymc.api.world.dimension.DimensionType;
import org.allaymc.api.world.generator.WorldGenerator; import org.allaymc.api.world.generator.WorldGenerator;
import org.allaymc.api.world.generator.context.NoiseContext; import org.allaymc.api.world.generator.context.NoiseContext;
import org.allaymc.api.world.generator.context.PopulateContext; import org.allaymc.api.world.generator.context.PopulateContext;
@@ -55,11 +55,11 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
.populators(new AllayPopulator()) .populators(new AllayPopulator())
.onDimensionSet(dimension -> { .onDimensionSet(dimension -> {
this.allayServerWorld = new AllayServerWorld(this, dimension); this.allayServerWorld = new AllayServerWorld(this, dimension);
this.worldProperties = new AllayWorldProperties(this.seed, dimension.getDimensionInfo()); this.worldProperties = new AllayWorldProperties(this.seed, dimension.getDimensionType());
var metaPackName = options.get(OPTION_META_PACK_NAME); var metaPackName = options.get(OPTION_META_PACK_NAME);
if(metaPackName != null) { if(metaPackName != null) {
setConfigPack(getConfigPackByMeta(metaPackName, dimension.getDimensionInfo())); setConfigPack(getConfigPackByMeta(metaPackName, dimension.getDimensionType()));
return; return;
} }
@@ -94,13 +94,13 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
.orElseThrow(() -> new IllegalArgumentException("Cant find terra config pack named " + packId)); .orElseThrow(() -> new IllegalArgumentException("Cant find terra config pack named " + packId));
} }
protected static ConfigPack getConfigPackByMeta(String metaPackId, DimensionInfo dimensionInfo) { protected static ConfigPack getConfigPackByMeta(String metaPackId, DimensionType dimensionType) {
return TerraAllayPlugin.platform return TerraAllayPlugin.platform
.getMetaConfigRegistry() .getMetaConfigRegistry()
.getByID(metaPackId) .getByID(metaPackId)
.orElseThrow(() -> new IllegalArgumentException("Cant find terra meta pack named " + metaPackId)) .orElseThrow(() -> new IllegalArgumentException("Cant find terra meta pack named " + metaPackId))
.packs() .packs()
.get(Mapping.dimensionIdBeToJe(dimensionInfo.toString())); .get(Mapping.dimensionIdBeToJe(dimensionType.getIdentifier().toString()));
} }
protected static ChunkGenerator createGenerator(ConfigPack configPack) { protected static ChunkGenerator createGenerator(ConfigPack configPack) {
@@ -148,8 +148,8 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
worldProperties, biomeProvider, worldProperties, biomeProvider,
chunkX, chunkZ chunkX, chunkZ
); );
int minHeight = context.getDimensionInfo().minHeight(); int minHeight = context.getDimensionType().getMinHeight();
int maxHeight = context.getDimensionInfo().maxHeight(); int maxHeight = context.getDimensionType().getMaxHeight();
for(int x = 0; x < 16; x++) { for(int x = 0; x < 16; x++) {
for(int y = minHeight; y < maxHeight; y++) { for(int y = minHeight; y < maxHeight; y++) {
for(int z = 0; z < 16; z++) { for(int z = 0; z < 16; z++) {