mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 02:20:57 +00:00
feat: adapting terra 6.5.1 (WIP)
This commit is contained in:
12
README.md
12
README.md
@@ -2,14 +2,12 @@
|
||||
|
||||
# Terra (Allay Platform)
|
||||
|
||||
This fork adds support for allay
|
||||
This fork adds support for allay, and if you want to build it, here are some files you may need:
|
||||
|
||||
if you want to build it, here are some files you may need:
|
||||
|
||||
- `mapping/biomes.json` from GeyserMC/mappings
|
||||
- `mapping/items.json` from GeyserMC/mappings
|
||||
- `mapping/blocks.json` you should generate it using GeyserMC/mappings-generator, and it's origin name is `generator_blocks.json`
|
||||
- `je_block_default_state` converted from https://zh.minecraft.wiki/w/Module:Block_state_values currently
|
||||
- `mapping/biomes_JE_1_21_to_BE_1_21_30.json` from GeyserMC/mappings
|
||||
- `mapping/items_JE_1_21_to_BE_1_21_30.json` from GeyserMC/mappings
|
||||
- `mapping/blocks_JE_1_21_to_BE_1_21_30.json` you should generate it using GeyserMC/mappings-generator, and it's origin name is `generator_blocks.json`
|
||||
- `je_block_default_states_1_21.json` converted from https://zh.minecraft.wiki/w/Module:Block_state_values currently
|
||||
|
||||
Terra is a modern world generation modding platform, primarily for Minecraft.
|
||||
Terra allows complete customization of world generation with an advanced API,
|
||||
|
||||
@@ -33,7 +33,7 @@ public class AllayPlatform extends AbstractPlatform {
|
||||
|
||||
@Override
|
||||
public boolean reload() {
|
||||
// TODO: Implement reload
|
||||
// TODO: implement reload
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,7 @@ import org.allaymc.api.block.type.BlockStateSafeGetter;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.api.item.type.ItemType;
|
||||
import org.allaymc.api.item.type.ItemTypeSafeGetter;
|
||||
import org.allaymc.api.registry.Registries;
|
||||
import org.allaymc.api.utils.HashUtils;
|
||||
import org.allaymc.api.utils.JSONUtils;
|
||||
import org.allaymc.updater.block.BlockStateUpdaters;
|
||||
import org.allaymc.updater.item.ItemStateUpdaters;
|
||||
import org.cloudburstmc.nbt.NbtMap;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@@ -28,6 +23,7 @@ import java.util.TreeMap;
|
||||
*/
|
||||
@Slf4j
|
||||
public final class Mapping {
|
||||
|
||||
private static final Map<String, Map<String, String>> JE_BLOCK_DEFAULT_PROPERTIES = new Object2ObjectOpenHashMap<>();
|
||||
private static final Map<BlockState, JeBlockState> BLOCK_STATE_BE_TO_JE = new Object2ObjectOpenHashMap<>();
|
||||
private static final Map<Integer, BlockState> BLOCK_STATE_JE_HASH_TO_BE = new Int2ObjectOpenHashMap<>();
|
||||
@@ -42,12 +38,52 @@ public final class Mapping {
|
||||
if(!initBiomeMapping()) error();
|
||||
}
|
||||
|
||||
public static JeBlockState blockStateBeToJe(BlockState beBlockState) {
|
||||
return BLOCK_STATE_BE_TO_JE.get(beBlockState);
|
||||
}
|
||||
|
||||
public static BlockState blockStateJeToBe(JeBlockState jeBlockState) {
|
||||
var result = BLOCK_STATE_JE_HASH_TO_BE.get(jeBlockState.getHash());
|
||||
if(result == null) {
|
||||
log.warn("Failed to find be block state for {}", jeBlockState);
|
||||
return BE_AIR_STATE;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ItemType<?> itemIdJeToBe(String jeItemId) {
|
||||
return ITEM_ID_JE_TO_BE.get(jeItemId);
|
||||
}
|
||||
|
||||
// Enchantment identifiers are same in both versions
|
||||
|
||||
public static String enchantmentIdBeToJe(String beEnchantmentId) {
|
||||
return beEnchantmentId;
|
||||
}
|
||||
|
||||
public static String enchantmentIdJeToBe(String jeEnchantmentId) {
|
||||
return jeEnchantmentId;
|
||||
}
|
||||
|
||||
public static int biomeIdJeToBe(String jeBiomeId) {
|
||||
return BIOME_ID_JE_TO_BE.get(jeBiomeId);
|
||||
}
|
||||
|
||||
public static Map<String, String> getJeBlockDefaultProperties(String jeBlockIdentifier) {
|
||||
var defaultProperties = JE_BLOCK_DEFAULT_PROPERTIES.get(jeBlockIdentifier);
|
||||
if( defaultProperties == null) {
|
||||
log.warn("Failed to find default properties for {}", jeBlockIdentifier);
|
||||
return Map.of();
|
||||
}
|
||||
return defaultProperties;
|
||||
}
|
||||
|
||||
private static void error() {
|
||||
throw new RuntimeException("Mapping not initialized");
|
||||
}
|
||||
|
||||
private static boolean initBiomeMapping() {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/biomes_JE_1_20_4_TO_BE_1_20_0.json")) {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/biomes_JE_1_21_to_BE_1_21_30.json")) {
|
||||
if (stream == null) {
|
||||
log.error("biomes mapping not found");
|
||||
return false;
|
||||
@@ -57,14 +93,14 @@ public final class Mapping {
|
||||
BIOME_ID_JE_TO_BE.put(mapping.getKey(), mapping.getValue().get("bedrock_id"));
|
||||
}
|
||||
} catch(IOException e) {
|
||||
log.error("Failed to load mapping", e);
|
||||
log.error("Failed to load biomes mapping", e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean initItemMapping() {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/items_JE_1_20_4_TO_BE_1_20_0.json")) {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/items_JE_1_21_to_BE_1_21_30.json")) {
|
||||
if (stream == null) {
|
||||
log.error("items mapping not found");
|
||||
return false;
|
||||
@@ -73,19 +109,19 @@ public final class Mapping {
|
||||
for(var mapping : mappings) {
|
||||
var item = ItemTypeSafeGetter
|
||||
.name((String) mapping.getValue().get("bedrock_identifier"))
|
||||
// NOTICE: Should be cast to double
|
||||
// NOTICE: should be cast to double
|
||||
.meta(((Double) mapping.getValue().get("bedrock_data")).intValue())
|
||||
.itemType();
|
||||
ITEM_ID_JE_TO_BE.put(mapping.getKey(), item);
|
||||
}
|
||||
} catch(IOException e) {
|
||||
log.error("Failed to load mapping", e);
|
||||
log.error("Failed to load items mapping", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean initBlockStateMapping() {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/blocks_JE_1_20_4_TO_BE_1_20_0.json")) {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("mapping/blocks_JE_1_21_to_BE_1_21_30.json")) {
|
||||
if (stream == null) {
|
||||
log.error("blocks mapping not found");
|
||||
return false;
|
||||
@@ -99,13 +135,13 @@ public final class Mapping {
|
||||
BLOCK_STATE_JE_HASH_TO_BE.put(jeState.getHash(), beState);
|
||||
}
|
||||
} catch(IOException e) {
|
||||
log.error("Failed to load mapping", e);
|
||||
log.error("Failed to load blocks mapping", e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean initJeBlockDefaultProperties() {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("je_block_default_states_1_20_4.json")) {
|
||||
try (var stream = Mapping.class.getClassLoader().getResourceAsStream("je_block_default_states_1_21.json")) {
|
||||
if (stream == null) {
|
||||
log.error("je_block_default_states.json not found");
|
||||
return false;
|
||||
@@ -150,44 +186,4 @@ public final class Mapping {
|
||||
// noinspection unchecked
|
||||
return JeBlockState.create(identifier, new TreeMap<>((Map<String, String>) data.getOrDefault("Properties", Map.of())));
|
||||
}
|
||||
|
||||
public static JeBlockState blockStateBeToJe(BlockState beBlockState) {
|
||||
return BLOCK_STATE_BE_TO_JE.get(beBlockState);
|
||||
}
|
||||
|
||||
public static BlockState blockStateJeToBe(JeBlockState jeBlockState) {
|
||||
var result = BLOCK_STATE_JE_HASH_TO_BE.get(jeBlockState.getHash());
|
||||
if(result == null) {
|
||||
log.warn("Failed to find be block state for {}", jeBlockState);
|
||||
return BlockTypes.AIR.getDefaultState();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ItemType<?> itemIdJeToBe(String jeItemId) {
|
||||
return ITEM_ID_JE_TO_BE.get(jeItemId);
|
||||
}
|
||||
|
||||
// Enchantment identifiers are same in both versions
|
||||
|
||||
public static String enchantmentIdBeToJe(String beEnchantmentId) {
|
||||
return beEnchantmentId;
|
||||
}
|
||||
|
||||
public static String enchantmentIdJeToBe(String jeEnchantmentId) {
|
||||
return jeEnchantmentId;
|
||||
}
|
||||
|
||||
public static int biomeIdJeToBe(String jeBiomeId) {
|
||||
return BIOME_ID_JE_TO_BE.get(jeBiomeId);
|
||||
}
|
||||
|
||||
public static Map<String, String> getJeBlockDefaultProperties(String jeBlockIdentifier) {
|
||||
var defaultProperties = JE_BLOCK_DEFAULT_PROPERTIES.get(jeBlockIdentifier);
|
||||
if( defaultProperties == null) {
|
||||
log.warn("Failed to find default properties for {}", jeBlockIdentifier);
|
||||
return Map.of();
|
||||
}
|
||||
return defaultProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import org.allaymc.terra.allay.JeBlockState;
|
||||
import com.dfsek.terra.api.block.BlockType;
|
||||
import com.dfsek.terra.api.block.state.properties.Property;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author daoge_cmd
|
||||
*/
|
||||
@@ -16,6 +14,7 @@ public final class AllayBlockState implements com.dfsek.terra.api.block.state.Bl
|
||||
|
||||
public static final AllayBlockState AIR = new AllayBlockState(BlockTypes.AIR.getDefaultState(),
|
||||
JeBlockState.fromString("minecraft:air"));
|
||||
|
||||
private final BlockState allayBlockState;
|
||||
private final JeBlockState jeBlockState;
|
||||
private final boolean containsWater;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import org.allaymc.api.block.tag.BlockTags;
|
||||
import org.allaymc.api.block.type.BlockType;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.terra.allay.Mapping;
|
||||
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
@@ -22,7 +22,7 @@ public record AllayBlockType(BlockType<?> allayBlockType) implements com.dfsek.t
|
||||
|
||||
@Override
|
||||
public boolean isWater() {
|
||||
return allayBlockType == BlockTypes.WATER || allayBlockType == BlockTypes.FLOWING_WATER;
|
||||
return allayBlockType.hasBlockTag(BlockTags.WATER);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import org.allaymc.api.block.property.type.BlockPropertyTypes;
|
||||
import org.allaymc.api.block.tag.BlockTags;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.api.world.chunk.Chunk;
|
||||
import org.allaymc.terra.allay.Mapping;
|
||||
@@ -14,18 +15,16 @@ import com.dfsek.terra.api.world.ServerWorld;
|
||||
*/
|
||||
public record AllayChunk(ServerWorld world, Chunk allayChunk) implements com.dfsek.terra.api.world.chunk.Chunk {
|
||||
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(15));
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(0));
|
||||
|
||||
@Override
|
||||
public void setBlock(int x, int y, int z, BlockState data, boolean physics) {
|
||||
var allayBlockState = (AllayBlockState)data;
|
||||
var containsWater = allayBlockState.containsWater();
|
||||
if (!containsWater) {
|
||||
var oldBlock = allayChunk.getBlockState(x, y, z);
|
||||
containsWater = oldBlock == BlockTypes.WATER;
|
||||
}
|
||||
var allayBlockState = (AllayBlockState) data;
|
||||
allayChunk.setBlockState(x, y, z, allayBlockState.allayBlockState());
|
||||
if (containsWater) allayChunk.setBlockState(x, y, z, WATER, 1);
|
||||
var containsWater = allayBlockState.containsWater() || allayChunk.getBlockState(x, y, z).getBlockType().hasBlockTag(BlockTags.WATER);
|
||||
if (containsWater) {
|
||||
allayChunk.setBlockState(x, y, z, WATER, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,7 +17,7 @@ public record AllayEnchantment(EnchantmentType allayEnchantment) implements Ench
|
||||
|
||||
@Override
|
||||
public boolean conflictsWith(Enchantment other) {
|
||||
return ((AllayEnchantment)other).allayEnchantment.checkIncompatible(allayEnchantment);
|
||||
return ((AllayEnchantment)other).allayEnchantment.isIncompatibleWith(allayEnchantment);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.ServerWorld;
|
||||
|
||||
/**
|
||||
* NOTICE: Entity is not supported currently, and this is a fake implementation.
|
||||
*
|
||||
* @author daoge_cmd
|
||||
*/
|
||||
public final class AllayFakeEntity implements Entity {
|
||||
|
||||
@@ -22,7 +22,7 @@ public record AllayItemMeta(ItemStack allayItemStack) implements ItemMeta {
|
||||
public Map<Enchantment, Integer> getEnchantments() {
|
||||
Map<Enchantment, Integer> results = new HashMap<>();
|
||||
for (var allayEnchantmentInstance : allayItemStack.getEnchantments()) {
|
||||
results.put(new AllayEnchantment(allayEnchantmentInstance.getType()), (int) allayEnchantmentInstance.getLevel());
|
||||
results.put(new AllayEnchantment(allayEnchantmentInstance.getType()), allayEnchantmentInstance.getLevel());
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@ package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import org.allaymc.api.item.data.ItemId;
|
||||
import org.allaymc.api.item.type.ItemType;
|
||||
import org.allaymc.api.registry.Registries;
|
||||
|
||||
import com.dfsek.terra.api.inventory.Item;
|
||||
|
||||
import org.allaymc.api.registry.Registries;
|
||||
|
||||
|
||||
/**
|
||||
* @author daoge_cmd
|
||||
@@ -34,8 +33,4 @@ public final class AllayItemType implements Item {
|
||||
public ItemType<?> getHandle() {
|
||||
return allayItemType;
|
||||
}
|
||||
|
||||
public ItemType<?> allayItemType() {
|
||||
return allayItemType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import org.allaymc.api.block.property.type.BlockPropertyTypes;
|
||||
import org.allaymc.api.block.tag.BlockTags;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.api.world.chunk.UnsafeChunk;
|
||||
import org.allaymc.terra.allay.Mapping;
|
||||
@@ -14,7 +15,7 @@ import com.dfsek.terra.api.world.chunk.generation.ProtoChunk;
|
||||
*/
|
||||
public record AllayProtoChunk(UnsafeChunk allayChunk) implements ProtoChunk {
|
||||
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(15));
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(0));
|
||||
|
||||
@Override
|
||||
public int getMaxHeight() {
|
||||
@@ -23,14 +24,12 @@ public record AllayProtoChunk(UnsafeChunk allayChunk) implements ProtoChunk {
|
||||
|
||||
@Override
|
||||
public void setBlock(int x, int y, int z, @NotNull BlockState blockState) {
|
||||
var allayBlockState = (AllayBlockState)blockState;
|
||||
var containsWater = allayBlockState.containsWater();
|
||||
if (!containsWater) {
|
||||
var oldBlock = allayChunk.getBlockState(x, y, z);
|
||||
containsWater = oldBlock == BlockTypes.WATER;
|
||||
}
|
||||
var allayBlockState = (AllayBlockState) blockState;
|
||||
allayChunk.setBlockState(x, y, z, allayBlockState.allayBlockState());
|
||||
if (containsWater) allayChunk.setBlockState(x, y, z, WATER, 1);
|
||||
var containsWater = allayBlockState.containsWater() || allayChunk.getBlockState(x, y, z).getBlockType().hasBlockTag(BlockTags.WATER);
|
||||
if (containsWater) {
|
||||
allayChunk.setBlockState(x, y, z, WATER, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
import org.allaymc.api.block.property.type.BlockPropertyTypes;
|
||||
import org.allaymc.api.block.tag.BlockTags;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.api.world.generator.context.OtherChunkAccessibleContext;
|
||||
import org.allaymc.terra.allay.Mapping;
|
||||
@@ -12,6 +11,7 @@ import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.entity.Entity;
|
||||
import com.dfsek.terra.api.entity.EntityType;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.ServerWorld;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
@@ -22,7 +22,7 @@ import com.dfsek.terra.api.world.chunk.generation.ProtoWorld;
|
||||
*/
|
||||
public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAccessibleContext context) implements ProtoWorld {
|
||||
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(15));
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(0));
|
||||
|
||||
@Override
|
||||
public int centerChunkX() {
|
||||
@@ -42,11 +42,7 @@ public record AllayProtoWorld(AllayServerWorld allayServerWorld, OtherChunkAcces
|
||||
@Override
|
||||
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
|
||||
var allayBlockState = (AllayBlockState)data;
|
||||
var containsWater = allayBlockState.containsWater();
|
||||
if (!containsWater) {
|
||||
var oldBlock = context.getBlockState(x, y, z).getBlockType();
|
||||
containsWater = oldBlock == BlockTypes.WATER;
|
||||
}
|
||||
var containsWater = allayBlockState.containsWater() || context.getBlockState(x, y, z).getBlockType().hasBlockTag(BlockTags.WATER);
|
||||
context.setBlockState(x, y, z, allayBlockState.allayBlockState());
|
||||
if (containsWater) context.setBlockState(x, y, z, WATER, 1);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.allaymc.terra.allay.delegate;
|
||||
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
|
||||
import org.allaymc.api.block.property.type.BlockPropertyTypes;
|
||||
import org.allaymc.api.block.type.BlockTypes;
|
||||
import org.allaymc.api.world.Dimension;
|
||||
@@ -13,6 +11,7 @@ import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.entity.Entity;
|
||||
import com.dfsek.terra.api.entity.EntityType;
|
||||
import com.dfsek.terra.api.util.vector.Vector3;
|
||||
import com.dfsek.terra.api.world.ServerWorld;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.Chunk;
|
||||
@@ -23,7 +22,7 @@ import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
*/
|
||||
public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dimension allayDimension) implements ServerWorld {
|
||||
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(15));
|
||||
private static final org.allaymc.api.block.type.BlockState WATER = BlockTypes.WATER.ofState(BlockPropertyTypes.LIQUID_DEPTH.createValue(0));
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
@@ -32,14 +31,8 @@ public record AllayServerWorld(AllayGeneratorWrapper allayGeneratorWrapper, Dime
|
||||
|
||||
@Override
|
||||
public void setBlockState(int x, int y, int z, BlockState data, boolean physics) {
|
||||
var allayBlockState = (AllayBlockState)data;
|
||||
var containsWater = allayBlockState.containsWater();
|
||||
if (!containsWater) {
|
||||
var oldBlock = allayDimension.getBlockState(x, y, z).getBlockType();
|
||||
containsWater = oldBlock == BlockTypes.WATER;
|
||||
}
|
||||
allayDimension.setBlockState(x, y, z, allayBlockState.allayBlockState());
|
||||
if (containsWater) allayDimension.setBlockState(x, y, z, WATER, 1);
|
||||
// In dimension#setBlockState() method, Water will be moved to layer 1 if it is placed at layer 0
|
||||
allayDimension.setBlockState(x, y, z, ((AllayBlockState) data).allayBlockState());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.allaymc.api.utils.AllayStringUtils;
|
||||
import org.allaymc.api.world.biome.BiomeType;
|
||||
import org.allaymc.api.world.generator.WorldGenerator;
|
||||
import org.allaymc.api.world.generator.WorldGeneratorType;
|
||||
import org.allaymc.api.world.generator.context.NoiseContext;
|
||||
import org.allaymc.api.world.generator.context.PopulateContext;
|
||||
import org.allaymc.api.world.generator.function.Noiser;
|
||||
@@ -28,6 +27,7 @@ import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
*/
|
||||
@Slf4j
|
||||
public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
|
||||
protected static final String DEFAULT_PACK_NAME = "overworld";
|
||||
protected static final String OPTION_PACK_NAME = "pack";
|
||||
protected static final String OPTION_SEED = "seed";
|
||||
@@ -54,12 +54,15 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
this.allayWorldGenerator = WorldGenerator
|
||||
.builder()
|
||||
.name("TERRA")
|
||||
.preset("")// preset已经在构造函数读取完了,这边不需要传preset
|
||||
.preset(preset)
|
||||
.noisers(new AllayNoiser())
|
||||
.populators(new AllayPopulator())
|
||||
.onDimensionSet(dimension -> {
|
||||
this.allayServerWorld = new AllayServerWorld(this, dimension);
|
||||
this.worldProperties = new WorldProperties() {
|
||||
|
||||
private final Object fakeHandle = new Object();
|
||||
|
||||
@Override
|
||||
public long getSeed() {
|
||||
return seed;
|
||||
@@ -77,8 +80,7 @@ public class AllayGeneratorWrapper implements GeneratorWrapper {
|
||||
|
||||
@Override
|
||||
public Object getHandle() {
|
||||
// 这里留null就行,没啥用
|
||||
return null;
|
||||
return fakeHandle;
|
||||
}
|
||||
};
|
||||
})
|
||||
|
||||
@@ -27,7 +27,6 @@ public class AllayWorldHandle implements WorldHandle {
|
||||
|
||||
@Override
|
||||
public @NotNull EntityType getEntity(@NotNull String id) {
|
||||
// TODO: 我们暂时不支持实体,因为端本身都没实体ai,生成实体没有意义
|
||||
return new EntityType() {
|
||||
private final Object fakeEntityType = new Object();
|
||||
@Override
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
{
|
||||
"minecraft:badlands": {
|
||||
"bedrock_id": 37
|
||||
},
|
||||
"minecraft:bamboo_jungle": {
|
||||
"bedrock_id": 48
|
||||
},
|
||||
"minecraft:basalt_deltas": {
|
||||
"bedrock_id": 181
|
||||
},
|
||||
"minecraft:beach": {
|
||||
"bedrock_id": 16
|
||||
},
|
||||
"minecraft:birch_forest": {
|
||||
"bedrock_id": 27
|
||||
},
|
||||
"minecraft:cherry_grove": {
|
||||
"bedrock_id": 192
|
||||
},
|
||||
"minecraft:cold_ocean": {
|
||||
"bedrock_id": 44
|
||||
},
|
||||
"minecraft:crimson_forest": {
|
||||
"bedrock_id": 179
|
||||
},
|
||||
"minecraft:dark_forest": {
|
||||
"bedrock_id": 29
|
||||
},
|
||||
"minecraft:deep_cold_ocean": {
|
||||
"bedrock_id": 45
|
||||
},
|
||||
"minecraft:deep_dark": {
|
||||
"bedrock_id": 190
|
||||
},
|
||||
"minecraft:deep_frozen_ocean": {
|
||||
"bedrock_id": 47
|
||||
},
|
||||
"minecraft:deep_lukewarm_ocean": {
|
||||
"bedrock_id": 43
|
||||
},
|
||||
"minecraft:deep_ocean": {
|
||||
"bedrock_id": 24
|
||||
},
|
||||
"minecraft:desert": {
|
||||
"bedrock_id": 2
|
||||
},
|
||||
"minecraft:dripstone_caves": {
|
||||
"bedrock_id": 188
|
||||
},
|
||||
"minecraft:end_barrens": {
|
||||
"bedrock_id": 9
|
||||
},
|
||||
"minecraft:end_highlands": {
|
||||
"bedrock_id": 9
|
||||
},
|
||||
"minecraft:end_midlands": {
|
||||
"bedrock_id": 9
|
||||
},
|
||||
"minecraft:eroded_badlands": {
|
||||
"bedrock_id": 165
|
||||
},
|
||||
"minecraft:flower_forest": {
|
||||
"bedrock_id": 132
|
||||
},
|
||||
"minecraft:forest": {
|
||||
"bedrock_id": 4
|
||||
},
|
||||
"minecraft:frozen_ocean": {
|
||||
"bedrock_id": 46
|
||||
},
|
||||
"minecraft:frozen_peaks": {
|
||||
"bedrock_id": 183
|
||||
},
|
||||
"minecraft:frozen_river": {
|
||||
"bedrock_id": 11
|
||||
},
|
||||
"minecraft:grove": {
|
||||
"bedrock_id": 185
|
||||
},
|
||||
"minecraft:ice_spikes": {
|
||||
"bedrock_id": 140
|
||||
},
|
||||
"minecraft:jagged_peaks": {
|
||||
"bedrock_id": 182
|
||||
},
|
||||
"minecraft:jungle": {
|
||||
"bedrock_id": 21
|
||||
},
|
||||
"minecraft:lukewarm_ocean": {
|
||||
"bedrock_id": 42
|
||||
},
|
||||
"minecraft:lush_caves": {
|
||||
"bedrock_id": 187
|
||||
},
|
||||
"minecraft:mangrove_swamp": {
|
||||
"bedrock_id": 191
|
||||
},
|
||||
"minecraft:meadow": {
|
||||
"bedrock_id": 186
|
||||
},
|
||||
"minecraft:mushroom_fields": {
|
||||
"bedrock_id": 14
|
||||
},
|
||||
"minecraft:nether_wastes": {
|
||||
"bedrock_id": 8
|
||||
},
|
||||
"minecraft:ocean": {
|
||||
"bedrock_id": 0
|
||||
},
|
||||
"minecraft:old_growth_birch_forest": {
|
||||
"bedrock_id": 155
|
||||
},
|
||||
"minecraft:old_growth_pine_taiga": {
|
||||
"bedrock_id": 32
|
||||
},
|
||||
"minecraft:old_growth_spruce_taiga": {
|
||||
"bedrock_id": 160
|
||||
},
|
||||
"minecraft:plains": {
|
||||
"bedrock_id": 1
|
||||
},
|
||||
"minecraft:river": {
|
||||
"bedrock_id": 7
|
||||
},
|
||||
"minecraft:savanna": {
|
||||
"bedrock_id": 35
|
||||
},
|
||||
"minecraft:savanna_plateau": {
|
||||
"bedrock_id": 36
|
||||
},
|
||||
"minecraft:small_end_islands": {
|
||||
"bedrock_id": 9
|
||||
},
|
||||
"minecraft:snowy_beach": {
|
||||
"bedrock_id": 26
|
||||
},
|
||||
"minecraft:snowy_plains": {
|
||||
"bedrock_id": 12
|
||||
},
|
||||
"minecraft:snowy_slopes": {
|
||||
"bedrock_id": 184
|
||||
},
|
||||
"minecraft:snowy_taiga": {
|
||||
"bedrock_id": 30
|
||||
},
|
||||
"minecraft:soul_sand_valley": {
|
||||
"bedrock_id": 178
|
||||
},
|
||||
"minecraft:sparse_jungle": {
|
||||
"bedrock_id": 23
|
||||
},
|
||||
"minecraft:stony_peaks": {
|
||||
"bedrock_id": 189
|
||||
},
|
||||
"minecraft:stony_shore": {
|
||||
"bedrock_id": 25
|
||||
},
|
||||
"minecraft:sunflower_plains": {
|
||||
"bedrock_id": 129
|
||||
},
|
||||
"minecraft:swamp": {
|
||||
"bedrock_id": 6
|
||||
},
|
||||
"minecraft:taiga": {
|
||||
"bedrock_id": 5
|
||||
},
|
||||
"minecraft:the_end": {
|
||||
"bedrock_id": 9
|
||||
},
|
||||
"minecraft:the_void": {
|
||||
"bedrock_id": 7
|
||||
},
|
||||
"minecraft:warm_ocean": {
|
||||
"bedrock_id": 40
|
||||
},
|
||||
"minecraft:warped_forest": {
|
||||
"bedrock_id": 180
|
||||
},
|
||||
"minecraft:windswept_forest": {
|
||||
"bedrock_id": 34
|
||||
},
|
||||
"minecraft:windswept_gravelly_hills": {
|
||||
"bedrock_id": 131
|
||||
},
|
||||
"minecraft:windswept_hills": {
|
||||
"bedrock_id": 3
|
||||
},
|
||||
"minecraft:windswept_savanna": {
|
||||
"bedrock_id": 163
|
||||
},
|
||||
"minecraft:wooded_badlands": {
|
||||
"bedrock_id": 38
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "minecraft:badlands": { "bedrock_id": 37 }, "minecraft:bamboo_jungle": { "bedrock_id": 48 }, "minecraft:basalt_deltas": { "bedrock_id": 181 }, "minecraft:beach": { "bedrock_id": 16 }, "minecraft:birch_forest": { "bedrock_id": 27 }, "minecraft:cherry_grove": { "bedrock_id": 192 }, "minecraft:cold_ocean": { "bedrock_id": 44 }, "minecraft:crimson_forest": { "bedrock_id": 179 }, "minecraft:dark_forest": { "bedrock_id": 29 }, "minecraft:deep_cold_ocean": { "bedrock_id": 45 }, "minecraft:deep_dark": { "bedrock_id": 190 }, "minecraft:deep_frozen_ocean": { "bedrock_id": 47 }, "minecraft:deep_lukewarm_ocean": { "bedrock_id": 43 }, "minecraft:deep_ocean": { "bedrock_id": 24 }, "minecraft:desert": { "bedrock_id": 2 }, "minecraft:dripstone_caves": { "bedrock_id": 188 }, "minecraft:end_barrens": { "bedrock_id": 9 }, "minecraft:end_highlands": { "bedrock_id": 9 }, "minecraft:end_midlands": { "bedrock_id": 9 }, "minecraft:eroded_badlands": { "bedrock_id": 165 }, "minecraft:flower_forest": { "bedrock_id": 132 }, "minecraft:forest": { "bedrock_id": 4 }, "minecraft:frozen_ocean": { "bedrock_id": 46 }, "minecraft:frozen_peaks": { "bedrock_id": 183 }, "minecraft:frozen_river": { "bedrock_id": 11 }, "minecraft:grove": { "bedrock_id": 185 }, "minecraft:ice_spikes": { "bedrock_id": 140 }, "minecraft:jagged_peaks": { "bedrock_id": 182 }, "minecraft:jungle": { "bedrock_id": 21 }, "minecraft:lukewarm_ocean": { "bedrock_id": 42 }, "minecraft:lush_caves": { "bedrock_id": 187 }, "minecraft:mangrove_swamp": { "bedrock_id": 191 }, "minecraft:meadow": { "bedrock_id": 186 }, "minecraft:mushroom_fields": { "bedrock_id": 14 }, "minecraft:nether_wastes": { "bedrock_id": 8 }, "minecraft:ocean": { "bedrock_id": 0 }, "minecraft:old_growth_birch_forest": { "bedrock_id": 155 }, "minecraft:old_growth_pine_taiga": { "bedrock_id": 32 }, "minecraft:old_growth_spruce_taiga": { "bedrock_id": 160 }, "minecraft:plains": { "bedrock_id": 1 }, "minecraft:river": { "bedrock_id": 7 }, "minecraft:savanna": { "bedrock_id": 35 }, "minecraft:savanna_plateau": { "bedrock_id": 36 }, "minecraft:small_end_islands": { "bedrock_id": 9 }, "minecraft:snowy_beach": { "bedrock_id": 26 }, "minecraft:snowy_plains": { "bedrock_id": 12 }, "minecraft:snowy_slopes": { "bedrock_id": 184 }, "minecraft:snowy_taiga": { "bedrock_id": 30 }, "minecraft:soul_sand_valley": { "bedrock_id": 178 }, "minecraft:sparse_jungle": { "bedrock_id": 23 }, "minecraft:stony_peaks": { "bedrock_id": 189 }, "minecraft:stony_shore": { "bedrock_id": 25 }, "minecraft:sunflower_plains": { "bedrock_id": 129 }, "minecraft:swamp": { "bedrock_id": 6 }, "minecraft:taiga": { "bedrock_id": 5 }, "minecraft:the_end": { "bedrock_id": 9 }, "minecraft:the_void": { "bedrock_id": 7 }, "minecraft:warm_ocean": { "bedrock_id": 40 }, "minecraft:warped_forest": { "bedrock_id": 180 }, "minecraft:windswept_forest": { "bedrock_id": 34 }, "minecraft:windswept_gravelly_hills": { "bedrock_id": 131 }, "minecraft:windswept_hills": { "bedrock_id": 3 }, "minecraft:windswept_savanna": { "bedrock_id": 163 }, "minecraft:wooded_badlands": { "bedrock_id": 38 } }
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -4,6 +4,5 @@
|
||||
"authors": [
|
||||
"daoge_cmd"
|
||||
],
|
||||
"version": "1.0.1",
|
||||
"order": "START_UP"
|
||||
"version": "1.0.1"
|
||||
}
|
||||
Reference in New Issue
Block a user