mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-11-27 00:14:19 +00:00
feat: update mappings to 26.1 & adapt allay update
This commit is contained in:
1 parent
25d510156d
commit
5d1faf3c00
10 files changed
+37
-38
No files matched your search
@@ -86,13 +86,13 @@ object Versions {
|
||||
}
|
||||
|
||||
object Allay {
|
||||
const val api = "0.20.0"
|
||||
const val api = "0.28.0"
|
||||
const val gson = "2.13.2"
|
||||
|
||||
const val mappings = "366baa6"
|
||||
const val mappingsGenerator = "e957088"
|
||||
const val mappings = "0c2ac22"
|
||||
const val mappingsGenerator = "3742321"
|
||||
|
||||
const val mcmeta = "c976eb3"
|
||||
const val mcmeta = "805b8ac"
|
||||
}
|
||||
|
||||
object Minestom {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## 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/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();
|
||||
TerraAllayPlugin.instance.getPluginLogger().info(
|
||||
"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) {
|
||||
return switch(beDimensionId) {
|
||||
case "overworld" -> "minecraft:overworld";
|
||||
case "nether" -> "minecraft:the_nether";
|
||||
case "the_end" -> "minecraft:the_end";
|
||||
default -> beDimensionId;
|
||||
};
|
||||
if(beDimensionId.equals("minecraft:nether")) {
|
||||
return "minecraft:the_nether";
|
||||
}
|
||||
|
||||
return beDimensionId;
|
||||
}
|
||||
|
||||
public static Map<String, String> getJeBlockDefaultProperties(String jeBlockIdentifier) {
|
||||
|
||||
@@ -21,10 +21,10 @@ public record AllayChunk(ServerWorld world, Chunk allayChunk) implements com.dfs
|
||||
|
||||
@Override
|
||||
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 ||
|
||||
z < 0 || z > 15 ||
|
||||
y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) {
|
||||
y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ public record AllayProtoChunk(UnsafeChunk allayChunk) implements ProtoChunk {
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() {
|
||||
return allayChunk.getDimensionInfo().maxHeight();
|
||||
return allayChunk.getDimensionType().getMaxHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
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 ||
|
||||
z < 0 || z > 15 ||
|
||||
y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) {
|
||||
y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAcces
|
||||
var currentChunk = context.getCurrentChunk();
|
||||
var currentChunkX = currentChunk.getX();
|
||||
var currentChunkZ = currentChunk.getZ();
|
||||
var dimInfo = currentChunk.getDimensionInfo();
|
||||
var dimensionType = currentChunk.getDimensionType();
|
||||
|
||||
if(x >= currentChunkX * 16 && x < currentChunkX * 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);
|
||||
} else {
|
||||
var chunk = context.getChunkSource().getChunk(x >> 4, z >> 4);
|
||||
@@ -60,8 +60,8 @@ public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAcces
|
||||
|
||||
@Override
|
||||
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
|
||||
var dimensionInfo = allayServerWorld.allayDimension().getDimensionInfo();
|
||||
if(y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) {
|
||||
var dimensionType = allayServerWorld.allayDimension().getDimensionType();
|
||||
if(y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dime
|
||||
|
||||
@Override
|
||||
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
|
||||
var dimensionInfo = allayDimension.getDimensionInfo();
|
||||
if(y < dimensionInfo.minHeight() || y > dimensionInfo.maxHeight()) {
|
||||
var dimensionType = allayDimension.getDimensionType();
|
||||
if(y < dimensionType.getMinHeight() || y > dimensionType.getMaxHeight()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,12 +74,12 @@ public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dime
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() {
|
||||
return allayDimension.getDimensionInfo().maxHeight();
|
||||
return allayDimension.getDimensionType().getMaxHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinHeight() {
|
||||
return allayDimension.getDimensionInfo().minHeight();
|
||||
return allayDimension.getDimensionType().getMinHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
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;
|
||||
|
||||
@@ -12,12 +12,12 @@ public class AllayWorldProperties implements WorldProperties {
|
||||
|
||||
private final Object fakeHandle;
|
||||
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.seed = seed;
|
||||
this.dimensionInfo = dimensionInfo;
|
||||
this.dimensionType = dimensionType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,12 +27,12 @@ public class AllayWorldProperties implements WorldProperties {
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() {
|
||||
return dimensionInfo.maxHeight();
|
||||
return dimensionType.getMaxHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinHeight() {
|
||||
return dimensionInfo.minHeight();
|
||||
return dimensionType.getMinHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-7
@@ -4,7 +4,7 @@ import com.google.common.base.Preconditions;
|
||||
import org.allaymc.api.utils.AllayStringUtils;
|
||||
import org.allaymc.api.world.biome.BiomeType;
|
||||
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.context.NoiseContext;
|
||||
import org.allaymc.api.world.generator.context.PopulateContext;
|
||||
@@ -55,11 +55,11 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
.populators(new AllayPopulator())
|
||||
.onDimensionSet(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);
|
||||
if(metaPackName != null) {
|
||||
setConfigPack(getConfigPackByMeta(metaPackName, dimension.getDimensionInfo()));
|
||||
setConfigPack(getConfigPackByMeta(metaPackName, dimension.getDimensionType()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,13 +94,13 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
.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
|
||||
.getMetaConfigRegistry()
|
||||
.getByID(metaPackId)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Cant find terra meta pack named " + metaPackId))
|
||||
.packs()
|
||||
.get(Mapping.dimensionIdBeToJe(dimensionInfo.toString()));
|
||||
.get(Mapping.dimensionIdBeToJe(dimensionType.getIdentifier().toString()));
|
||||
}
|
||||
|
||||
protected static ChunkGenerator createGenerator(ConfigPack configPack) {
|
||||
@@ -148,8 +148,8 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
worldProperties, biomeProvider,
|
||||
chunkX, chunkZ
|
||||
);
|
||||
int minHeight = context.getDimensionInfo().minHeight();
|
||||
int maxHeight = context.getDimensionInfo().maxHeight();
|
||||
int minHeight = context.getDimensionType().getMinHeight();
|
||||
int maxHeight = context.getDimensionType().getMaxHeight();
|
||||
for(int x = 0; x < 16; x++) {
|
||||
for(int y = minHeight; y < maxHeight; y++) {
|
||||
for(int z = 0; z < 16; z++) {
|
||||
|
||||
Reference in new issue
Block a user