diff --git a/src/main/java/de/dafuqs/spectrum/blocks/decay/DecayAwayBlock.java b/src/main/java/de/dafuqs/spectrum/blocks/decay/DecayAwayBlock.java index 1300d34d52..8782437d39 100644 --- a/src/main/java/de/dafuqs/spectrum/blocks/decay/DecayAwayBlock.java +++ b/src/main/java/de/dafuqs/spectrum/blocks/decay/DecayAwayBlock.java @@ -114,7 +114,7 @@ public BlockState getTargetState(Level world) { return Blocks.NETHERRACK.defaultBlockState(); } else if (BuiltinDimensionTypes.END_EFFECTS.equals(identifier)) { return Blocks.END_STONE.defaultBlockState(); - } else if (SpectrumDimensionKeys.DIMENSION_ID.equals(identifier)) { + } else if (SpectrumDimensionKeys.DEEPER_DOWN_ID.equals(identifier)) { return SpectrumBlocks.BLACKSLAG.get().defaultBlockState(); } return Blocks.DIRT.defaultBlockState(); diff --git a/src/main/java/de/dafuqs/spectrum/blocks/decay/RuinBlock.java b/src/main/java/de/dafuqs/spectrum/blocks/decay/RuinBlock.java index 624cd8f28c..8df6deadfe 100644 --- a/src/main/java/de/dafuqs/spectrum/blocks/decay/RuinBlock.java +++ b/src/main/java/de/dafuqs/spectrum/blocks/decay/RuinBlock.java @@ -1,7 +1,7 @@ package de.dafuqs.spectrum.blocks.decay; import com.mojang.serialization.*; -import de.dafuqs.spectrum.blocks.*; +import de.dafuqs.spectrum.blocks.portal.*; import de.dafuqs.spectrum.config.*; import de.dafuqs.spectrum.particle.effect.*; import de.dafuqs.spectrum.progression.*; @@ -109,7 +109,7 @@ protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos } } else if (conversion == Conversion.SPECIAL || level.dimension() == Level.OVERWORLD && pos.getY() == level.getMinBuildHeight()) { return SpectrumBlocks.DEEPER_DOWN_PORTAL.get().defaultBlockState().setValue(DeeperDownPortalBlock.FACING_UP, false); - } else if (level.dimension() == SpectrumDimensionKeys.DIMENSION_KEY && pos.getY() == level.getMaxBuildHeight() - 1) { // highest layer cannot be built on + } else if (level.dimension() == SpectrumDimensionKeys.DEEPER_DOWN_KEY && pos.getY() == level.getMaxBuildHeight() - 1) { // highest layer cannot be built on return SpectrumBlocks.DEEPER_DOWN_PORTAL.get().defaultBlockState().setValue(DeeperDownPortalBlock.FACING_UP, true); } return null; diff --git a/src/main/java/de/dafuqs/spectrum/blocks/portal/BedrockPortalBlock.java b/src/main/java/de/dafuqs/spectrum/blocks/portal/BedrockPortalBlock.java new file mode 100644 index 0000000000..82b3b89df2 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/blocks/portal/BedrockPortalBlock.java @@ -0,0 +1,115 @@ +package de.dafuqs.spectrum.blocks.portal; + +import com.google.common.collect.*; +import com.mojang.serialization.*; +import de.dafuqs.spectrum.*; +import de.dafuqs.spectrum.helpers.*; +import de.dafuqs.spectrum.networking.s2c_payloads.*; +import de.dafuqs.spectrum.particle.*; +import de.dafuqs.spectrum.registries.*; +import net.minecraft.core.*; +import net.minecraft.resources.*; +import net.minecraft.server.level.*; +import net.minecraft.sounds.*; +import net.minecraft.tags.*; +import net.minecraft.util.*; +import net.minecraft.world.*; +import net.minecraft.world.entity.*; +import net.minecraft.world.entity.player.*; +import net.minecraft.world.item.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.block.state.properties.*; +import net.minecraft.world.level.material.*; +import net.minecraft.world.level.portal.*; +import net.minecraft.world.phys.*; +import net.minecraft.world.phys.shapes.*; + +public abstract class BedrockPortalBlock extends Block { + + public static final BooleanProperty FACING_UP = BlockStateProperties.UP; + + protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 4D, 16.0D); + protected static final VoxelShape SHAPE_UP = Block.box(0.0D, 4D, 0.0D, 16.0D, 16.0D, 16.0D); + + public BedrockPortalBlock(Properties settings) { + super(settings); + this.registerDefaultState((this.stateDefinition.any()).setValue(FACING_UP, false)); + } + + @Override + public boolean useShapeForLightOcclusion(BlockState state) { + return true; + } + + @Override + public ItemInteractionResult useItemOn(ItemStack handStack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + if (handStack.is(SpectrumItems.BEDROCK_DUST)) { + if (world.isClientSide()) { + return ItemInteractionResult.SUCCESS; + } else { + BlockState placedState = Blocks.BEDROCK.defaultBlockState(); + world.setBlockAndUpdate(pos, placedState); + world.playSound(null, pos, placedState.getSoundType().getPlaceSound(), SoundSource.BLOCKS, 1.0F, 1.0F); + return ItemInteractionResult.CONSUME; + } + } + + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return state.getValue(FACING_UP) ? SHAPE_UP : SHAPE; + } + + @Override + public ItemStack getCloneItemStack(LevelReader world, BlockPos pos, BlockState state) { + return ItemStack.EMPTY; + } + + @Override + public boolean canBeReplaced(BlockState state, Fluid fluid) { + return false; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING_UP); + } + + public static void teleportToSafePosition(Level world, Entity entity, BlockPos targetPos, int maxRadius) { + for (BlockPos bp : BlockPos.withinManhattan(targetPos, maxRadius, maxRadius, maxRadius)) { + entity.setPos(Vec3.atBottomCenterOf(bp)); + if (world.getBlockState(bp.below()).getCollisionShape(world, bp.below()) == Shapes.block() + && world.noCollision(entity) + && entity.getY() < (double) world.getMaxBuildHeight() + && entity.getY() > (double) world.getMinBuildHeight()) { + + entity.teleportTo(bp.getX() + 0.5, bp.getY() + 0.5, bp.getZ() + 0.5); + return; + } + } + + world.removeBlock(targetPos.above(1), false); + world.removeBlock(targetPos, false); + world.setBlockAndUpdate(targetPos.below(1), Blocks.COBBLED_DEEPSLATE.defaultBlockState()); + entity.teleportTo(targetPos.getX() + 0.5, targetPos.getY() + 0.5, targetPos.getZ() + 0.5); + } + + @Override + public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) { + if (!state.getValue(BedrockPortalBlock.FACING_UP) || random.nextInt(8) == 0) { + spawnVoidFogParticle(world, pos, random); + } + } + + private static void spawnVoidFogParticle(Level world, BlockPos pos, RandomSource random) { + double d = (double) pos.getX() + random.nextDouble(); + double e = (double) pos.getY() + 0.3D; + double f = (double) pos.getZ() + random.nextDouble(); + world.addParticle(SpectrumParticleTypes.VOID_FOG, d, e, f, 0.0D, 0.1D, 0.0D); + } + +} diff --git a/src/main/java/de/dafuqs/spectrum/blocks/portal/ConservatoryPortalBlock.java b/src/main/java/de/dafuqs/spectrum/blocks/portal/ConservatoryPortalBlock.java new file mode 100644 index 0000000000..f4771aca5c --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/blocks/portal/ConservatoryPortalBlock.java @@ -0,0 +1,45 @@ +package de.dafuqs.spectrum.blocks.portal; + +import com.mojang.datafixers.util.*; +import com.mojang.serialization.*; +import de.dafuqs.spectrum.dimensions.*; +import de.dafuqs.spectrum.registries.*; +import net.minecraft.advancements.*; +import net.minecraft.core.*; +import net.minecraft.resources.*; +import net.minecraft.server.level.*; +import net.minecraft.world.entity.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.portal.*; +import net.minecraft.world.phys.*; + +public class ConservatoryPortalBlock extends BedrockPortalBlock { + + public static final MapCodec CODEC = simpleCodec(ConservatoryPortalBlock::new); + + public ConservatoryPortalBlock(Properties settings) { + super(settings); + } + + @Override + public MapCodec codec() { + return CODEC; + } + + @Override + public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) { + if (level instanceof ServerLevel currentLevel && entity.canUsePortal(false) && !entity.isOnPortalCooldown() && entity instanceof ServerPlayer player) { + + entity.setPortalCooldown(); + if (level.dimension() == SpectrumDimensionKeys.CONSERVATORY_KEY) { + // => teleport back to where the player entered from + ConservatoryDataStore.teleportBackToEntrance(currentLevel, player); + } else { + // => teleport to Conservatory + ConservatoryDataStore.teleportToConservatory(pos, currentLevel, player, SpectrumStructureIDs.TEST); + } + } + } + +} diff --git a/src/main/java/de/dafuqs/spectrum/blocks/DeeperDownPortalBlock.java b/src/main/java/de/dafuqs/spectrum/blocks/portal/DeeperDownPortalBlock.java similarity index 69% rename from src/main/java/de/dafuqs/spectrum/blocks/DeeperDownPortalBlock.java rename to src/main/java/de/dafuqs/spectrum/blocks/portal/DeeperDownPortalBlock.java index db2891a8e8..a0cbdd8a5c 100644 --- a/src/main/java/de/dafuqs/spectrum/blocks/DeeperDownPortalBlock.java +++ b/src/main/java/de/dafuqs/spectrum/blocks/portal/DeeperDownPortalBlock.java @@ -1,4 +1,4 @@ -package de.dafuqs.spectrum.blocks; +package de.dafuqs.spectrum.blocks.portal; import com.google.common.collect.*; import com.mojang.serialization.*; @@ -12,35 +12,23 @@ import net.minecraft.server.level.*; import net.minecraft.sounds.*; import net.minecraft.tags.*; -import net.minecraft.util.*; -import net.minecraft.world.*; import net.minecraft.world.entity.*; import net.minecraft.world.entity.player.*; -import net.minecraft.world.item.*; import net.minecraft.world.level.*; import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.*; -import net.minecraft.world.level.block.state.properties.*; -import net.minecraft.world.level.material.*; import net.minecraft.world.level.portal.*; import net.minecraft.world.phys.*; -import net.minecraft.world.phys.shapes.*; -public class DeeperDownPortalBlock extends Block { +public class DeeperDownPortalBlock extends BedrockPortalBlock { public static final MapCodec CODEC = simpleCodec(DeeperDownPortalBlock::new); private final static ResourceLocation CREATE_PORTAL_ADVANCEMENT_IDENTIFIER = SpectrumCommon.locate("midgame/open_deeper_down_portal"); private final static String CREATE_PORTAL_ADVANCEMENT_CRITERION = "opened_deeper_down_portal"; - public static final BooleanProperty FACING_UP = BlockStateProperties.UP; - - protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 4D, 16.0D); - protected static final VoxelShape SHAPE_UP = Block.box(0.0D, 4D, 0.0D, 16.0D, 16.0D, 16.0D); - public DeeperDownPortalBlock(Properties settings) { super(settings); - this.registerDefaultState((this.stateDefinition.any()).setValue(FACING_UP, false)); } @Override @@ -48,11 +36,6 @@ public MapCodec codec() { return CODEC; } - @Override - public boolean useShapeForLightOcclusion(BlockState state) { - return true; - } - @Override public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { super.onPlace(state, world, pos, oldState, notify); @@ -69,22 +52,6 @@ public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldS } } - @Override - public ItemInteractionResult useItemOn(ItemStack handStack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - if (handStack.is(SpectrumItems.BEDROCK_DUST)) { - if (world.isClientSide()) { - return ItemInteractionResult.SUCCESS; - } else { - BlockState placedState = Blocks.BEDROCK.defaultBlockState(); - world.setBlockAndUpdate(pos, placedState); - world.playSound(null, pos, placedState.getSoundType().getPlaceSound(), SoundSource.BLOCKS, 1.0F, 1.0F); - return ItemInteractionResult.CONSUME; - } - } - - return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; - } - private boolean hasNeighboringPortals(Level world, BlockPos pos) { for (Direction direction : Direction.Plane.HORIZONTAL) { if (world.getBlockState(pos.relative(direction)).is(this)) { @@ -94,26 +61,6 @@ private boolean hasNeighboringPortals(Level world, BlockPos pos) { return false; } - @Override - public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { - return state.getValue(FACING_UP) ? SHAPE_UP : SHAPE; - } - - @Override - public ItemStack getCloneItemStack(LevelReader world, BlockPos pos, BlockState state) { - return ItemStack.EMPTY; - } - - @Override - public boolean canBeReplaced(BlockState state, Fluid fluid) { - return false; - } - - @Override - protected void createBlockStateDefinition(StateDefinition.Builder builder) { - builder.add(FACING_UP); - } - @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (world instanceof ServerLevel serverWorld && entity.canUsePortal(false) && !entity.isOnPortalCooldown()) { @@ -158,7 +105,7 @@ public void entityInside(BlockState state, Level world, BlockPos pos, Entity ent if (currentWorldKey == Level.OVERWORLD) { // => teleport to DD - ServerLevel targetWorld = serverWorld.getServer().getLevel(SpectrumDimensionKeys.DIMENSION_KEY); + ServerLevel targetWorld = serverWorld.getServer().getLevel(SpectrumDimensionKeys.DEEPER_DOWN_KEY); if (targetWorld != null) { BlockPos portalPos = new BlockPos(pos.getX(), targetWorld.getMaxBuildHeight() - 1, pos.getZ()); if (!targetWorld.getBlockState(portalPos).is(SpectrumBlocks.DEEPER_DOWN_PORTAL)) { @@ -250,37 +197,4 @@ protected BlockPos computeNext() { }; } - public void teleportToSafePosition(Level world, Entity entity, BlockPos targetPos, int maxRadius) { - for (BlockPos bp : BlockPos.withinManhattan(targetPos, maxRadius, maxRadius, maxRadius)) { - entity.setPos(Vec3.atBottomCenterOf(bp)); - if (world.getBlockState(bp.below()).getCollisionShape(world, bp.below()) == Shapes.block() - && world.noCollision(entity) - && entity.getY() < (double) world.getMaxBuildHeight() - && entity.getY() > (double) world.getMinBuildHeight()) { - - entity.teleportTo(bp.getX() + 0.5, bp.getY() + 0.5, bp.getZ() + 0.5); - return; - } - } - - world.removeBlock(targetPos.above(1), false); - world.removeBlock(targetPos, false); - world.setBlockAndUpdate(targetPos.below(1), Blocks.COBBLED_DEEPSLATE.defaultBlockState()); - entity.teleportTo(targetPos.getX() + 0.5, targetPos.getY() + 0.5, targetPos.getZ() + 0.5); - } - - @Override - public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) { - if (!state.getValue(DeeperDownPortalBlock.FACING_UP) || random.nextInt(8) == 0) { - spawnVoidFogParticle(world, pos, random); - } - } - - private static void spawnVoidFogParticle(Level world, BlockPos pos, RandomSource random) { - double d = (double) pos.getX() + random.nextDouble(); - double e = (double) pos.getY() + 0.3D; - double f = (double) pos.getZ() + random.nextDouble(); - world.addParticle(SpectrumParticleTypes.VOID_FOG, d, e, f, 0.0D, 0.1D, 0.0D); - } - } diff --git a/src/main/java/de/dafuqs/spectrum/deeper_down/client/package-info.java b/src/main/java/de/dafuqs/spectrum/blocks/portal/package-info.java similarity index 73% rename from src/main/java/de/dafuqs/spectrum/deeper_down/client/package-info.java rename to src/main/java/de/dafuqs/spectrum/blocks/portal/package-info.java index 31e5b01801..a1e58c1b28 100644 --- a/src/main/java/de/dafuqs/spectrum/deeper_down/client/package-info.java +++ b/src/main/java/de/dafuqs/spectrum/blocks/portal/package-info.java @@ -1,7 +1,7 @@ @NullMarked @MethodsReturnNonnullByDefault @FieldsAreNonnullByDefault -package de.dafuqs.spectrum.deeper_down.client; +package de.dafuqs.spectrum.blocks.portal; import net.minecraft.*; import org.jspecify.annotations.*; diff --git a/src/main/java/de/dafuqs/spectrum/dimensions/ConservatoryDataStore.java b/src/main/java/de/dafuqs/spectrum/dimensions/ConservatoryDataStore.java new file mode 100644 index 0000000000..b0ef473836 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/dimensions/ConservatoryDataStore.java @@ -0,0 +1,171 @@ +package de.dafuqs.spectrum.dimensions; + +import com.mojang.datafixers.util.*; +import de.dafuqs.spectrum.blocks.portal.*; +import de.dafuqs.spectrum.registries.*; +import net.minecraft.advancements.*; +import net.minecraft.core.*; +import net.minecraft.core.registries.*; +import net.minecraft.nbt.*; +import net.minecraft.resources.*; +import net.minecraft.server.*; +import net.minecraft.server.level.*; +import net.minecraft.world.entity.*; +import net.minecraft.world.entity.player.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.chunk.*; +import net.minecraft.world.level.levelgen.structure.*; +import net.minecraft.world.level.portal.*; +import net.minecraft.world.level.saveddata.*; +import net.minecraft.world.phys.*; +import org.jspecify.annotations.*; + +import java.util.*; + +public class ConservatoryDataStore extends SavedData { + + public record Entry(UUID player, ResourceLocation returnLevel, BlockPos returnPos, BlockPos conservatoryPos) { + + public Optional> getReturnLevel(HolderLookup.Provider lookup) { + HolderLookup.RegistryLookup dimensionRegistry = lookup.lookup(Registries.DIMENSION).get(); + return dimensionRegistry.get(ResourceKey.create(Registries.DIMENSION, this.returnLevel)); + } + } + + protected final Collection entries = new ArrayList<>(); + + public static ConservatoryDataStore load(CompoundTag compoundTag, HolderLookup.Provider lookupProvider) { + ConservatoryDataStore dataStore = new ConservatoryDataStore(); + + ListTag entries = compoundTag.getList("entries", CompoundTag.TAG_COMPOUND); + for(int i = 0; i < entries.size(); ++i) { + CompoundTag entry = entries.getCompound(i); + UUID player = entry.getUUID("player"); + ResourceLocation returnLevel = ResourceLocation.parse(entry.getString("return_level")); + BlockPos returnPos = NbtUtils.readBlockPos(entry, "return_pos").get(); + BlockPos conservatoryPos = NbtUtils.readBlockPos(entry, "conservatory_pos").get(); + dataStore.entries.add(new Entry(player, returnLevel, returnPos, conservatoryPos)); + } + + return dataStore; + } + + @Override + public CompoundTag save(CompoundTag tag, HolderLookup.Provider lookup) { + ListTag list = new ListTag(); + for(Entry entry : this.entries) { + CompoundTag t = new CompoundTag(); + t.putString("return_level", entry.returnLevel.toString()); + t.put("return_pos", NbtUtils.writeBlockPos(entry.returnPos)); + t.put("conservatory_pos", NbtUtils.writeBlockPos(entry.conservatoryPos)); + t.putUUID("player", entry.player); + list.add(t); + } + + tag.put("entries", list); + return tag; + } + + public static ConservatoryDataStore getInstance(MinecraftServer server) { + return server.overworld().getDataStorage().computeIfAbsent(new Factory<>(ConservatoryDataStore::new, ConservatoryDataStore::load), "conservatory_data_store"); + } + + protected static final int STRUCTURE_HEIGHT = 64; + protected static final int STRUCTURE_OFFSET = 1024; + protected static final int MAX_ALLOWED_PLAYER_DISTANCE_FROM_ORIGIN = 512; + + + public static void teleportToConservatory(BlockPos origin, ServerLevel currentLevel, ServerPlayer player, ResourceLocation structure) { + ServerLevel targetLevel = currentLevel.getServer().getLevel(SpectrumDimensionKeys.CONSERVATORY_KEY); + if (targetLevel != null) { + BlockPos targetPos = ConservatoryDataStore.getInstance(currentLevel.getServer()).getOrCreateConservatoryDestinationForExternalPlayer(currentLevel, origin, player, structure); + if(targetPos != null) { + player.changeDimension(new DimensionTransition(targetLevel, Vec3.atCenterOf(targetPos), Vec3.ZERO, player.getYRot(), player.getXRot(), DimensionTransition.PLAY_PORTAL_SOUND.then(DimensionTransition.PLACE_PORTAL_TICKET))); + BedrockPortalBlock.teleportToSafePosition(targetLevel, player, targetPos, 5); + CriteriaTriggers.CHANGED_DIMENSION.trigger(player, currentLevel.dimension(), targetLevel.dimension()); + } + } + } + + public static void teleportBackToEntrance(ServerLevel currentLevel, ServerPlayer player) { + Pair returnPos = ConservatoryDataStore.getInstance(currentLevel.getServer()).getReturnDestinationForPlayer(currentLevel, player); + if(returnPos == null) { + // if we can't find where to exit the player, we make them respawn + currentLevel.getServer().getPlayerList().respawn(player, true, Entity.RemovalReason.CHANGED_DIMENSION); + } else { + player.changeDimension(new DimensionTransition(returnPos.getFirst(), Vec3.atCenterOf(returnPos.getSecond()), Vec3.ZERO, player.getYRot(), player.getXRot(), DimensionTransition.PLAY_PORTAL_SOUND.then(DimensionTransition.PLACE_PORTAL_TICKET))); + BedrockPortalBlock.teleportToSafePosition(returnPos.getFirst(), player, returnPos.getSecond(), 3); + CriteriaTriggers.CHANGED_DIMENSION.trigger(player, currentLevel.dimension(), returnPos.getFirst().dimension()); + } + } + + private @Nullable BlockPos getOrCreateConservatoryDestinationForExternalPlayer(ServerLevel externalLevel, BlockPos externalPos, Player player, ResourceLocation structureToGenerate) { + UUID uuid = player.getUUID(); + for(Entry entry : this.entries) { + if(entry.returnPos.equals(externalPos) && entry.player.equals(uuid)) { + return entry.conservatoryPos; + } + } + + BlockPos.MutableBlockPos conservatoryPos = new BlockPos.MutableBlockPos(0, STRUCTURE_HEIGHT, 0); + for(Entry entry : this.entries) { + if(entry.returnPos.equals(conservatoryPos)) { + conservatoryPos.setY(entry.conservatoryPos.getY() + STRUCTURE_OFFSET); + } + } + + ServerLevel conservatory = externalLevel.getServer().getLevel(SpectrumDimensionKeys.CONSERVATORY_KEY); + Structure structure = externalLevel.registryAccess().registry(Registries.STRUCTURE).get().get(structureToGenerate); + if(conservatory == null || structure == null) { + return null; + } + placeStructure(conservatory, structure, conservatoryPos); + + Entry newEntry = new Entry(uuid, externalLevel.dimension().location(), externalPos, conservatoryPos); + this.entries.add(newEntry); + this.setDirty(); + return newEntry.conservatoryPos; + } + + public boolean isPlayerOutsideConservatoryBounds(Level conservatory, Player player) { + UUID uuid = player.getUUID(); + for(Entry entry : this.entries) { + if(entry.conservatoryPos.equals(conservatory) && entry.player.equals(uuid)) { + return entry.conservatoryPos.distManhattan(player.blockPosition()) > MAX_ALLOWED_PLAYER_DISTANCE_FROM_ORIGIN; + } + } + + // why are they here in the first place?! + return true; + } + + private @Nullable Pair getReturnDestinationForPlayer(ServerLevel conservatory, Player player) { + UUID uuid = player.getUUID(); + for(Entry entry : this.entries) { + if(entry.player.equals(uuid) && entry.conservatoryPos.distManhattan(player.blockPosition()) > MAX_ALLOWED_PLAYER_DISTANCE_FROM_ORIGIN) { + Optional> returnLevel = entry.getReturnLevel(conservatory.registryAccess()); + return returnLevel + .map(levelReference -> new Pair<>((ServerLevel) levelReference.value(), entry.returnPos)) + .orElse(null); + } + } + return null; + } + + private static boolean placeStructure(ServerLevel conservatory, Structure structure, BlockPos pos) { + ChunkGenerator chunkgenerator = conservatory.getChunkSource().getGenerator(); + StructureStart structurestart = structure.generate(conservatory.registryAccess(), chunkgenerator, chunkgenerator.getBiomeSource(), conservatory.getChunkSource().randomState(), + conservatory.getStructureManager(), conservatory.getSeed(), new ChunkPos(pos), 0, conservatory, (b) -> true); + + if (!structurestart.isValid()) { + return false; + } + + BoundingBox boundingbox = structurestart.getBoundingBox(); + ChunkPos chunkpos = new ChunkPos(SectionPos.blockToSectionCoord(boundingbox.minX()), SectionPos.blockToSectionCoord(boundingbox.minZ())); + ChunkPos chunkpos1 = new ChunkPos(SectionPos.blockToSectionCoord(boundingbox.maxX()), SectionPos.blockToSectionCoord(boundingbox.maxZ())); + ChunkPos.rangeClosed(chunkpos, chunkpos1).forEach((cp) -> structurestart.placeInChunk(conservatory, conservatory.structureManager(), chunkgenerator, conservatory.getRandom(), new BoundingBox(cp.getMinBlockX(), conservatory.getMinBuildHeight(), cp.getMinBlockZ(), cp.getMaxBlockX(), conservatory.getMaxBuildHeight(), cp.getMaxBlockZ()), cp)); + return true; + } + +} diff --git a/src/main/java/de/dafuqs/spectrum/deeper_down/DDOreVeinSampler.java b/src/main/java/de/dafuqs/spectrum/dimensions/DDOreVeinSampler.java similarity index 99% rename from src/main/java/de/dafuqs/spectrum/deeper_down/DDOreVeinSampler.java rename to src/main/java/de/dafuqs/spectrum/dimensions/DDOreVeinSampler.java index 7c631524a2..ce908932b8 100644 --- a/src/main/java/de/dafuqs/spectrum/deeper_down/DDOreVeinSampler.java +++ b/src/main/java/de/dafuqs/spectrum/dimensions/DDOreVeinSampler.java @@ -1,4 +1,4 @@ -package de.dafuqs.spectrum.deeper_down; +package de.dafuqs.spectrum.dimensions; import de.dafuqs.spectrum.registries.*; import net.minecraft.util.*; diff --git a/src/main/java/de/dafuqs/spectrum/deeper_down/client/DeeperDownDimensionEffects.java b/src/main/java/de/dafuqs/spectrum/dimensions/client/DeeperDownDimensionSpecialEffects.java similarity index 62% rename from src/main/java/de/dafuqs/spectrum/deeper_down/client/DeeperDownDimensionEffects.java rename to src/main/java/de/dafuqs/spectrum/dimensions/client/DeeperDownDimensionSpecialEffects.java index 231a85921d..ba92ab12d2 100644 --- a/src/main/java/de/dafuqs/spectrum/deeper_down/client/DeeperDownDimensionEffects.java +++ b/src/main/java/de/dafuqs/spectrum/dimensions/client/DeeperDownDimensionSpecialEffects.java @@ -1,18 +1,18 @@ -package de.dafuqs.spectrum.deeper_down.client; +package de.dafuqs.spectrum.dimensions.client; import net.minecraft.client.renderer.*; import net.minecraft.world.phys.*; import org.jspecify.annotations.*; -public class DeeperDownDimensionEffects extends DimensionSpecialEffects { +public class DeeperDownDimensionSpecialEffects extends DimensionSpecialEffects { - public DeeperDownDimensionEffects() { + public DeeperDownDimensionSpecialEffects() { super(Float.NaN, false, DimensionSpecialEffects.SkyType.NONE, false, true); } @Override - public @Nullable float[] getSunriseColor(float skyAngle, float tickDelta) { + public float @Nullable [] getSunriseColor(float skyAngle, float tickDelta) { return null; } diff --git a/src/main/java/de/dafuqs/spectrum/deeper_down/client/HowlingSpireEffects.java b/src/main/java/de/dafuqs/spectrum/dimensions/client/HowlingSpireEffects.java similarity index 98% rename from src/main/java/de/dafuqs/spectrum/deeper_down/client/HowlingSpireEffects.java rename to src/main/java/de/dafuqs/spectrum/dimensions/client/HowlingSpireEffects.java index 7edd036190..2a0783ff5b 100644 --- a/src/main/java/de/dafuqs/spectrum/deeper_down/client/HowlingSpireEffects.java +++ b/src/main/java/de/dafuqs/spectrum/dimensions/client/HowlingSpireEffects.java @@ -1,4 +1,4 @@ -package de.dafuqs.spectrum.deeper_down.client; +package de.dafuqs.spectrum.dimensions.client; import de.dafuqs.spectrum.config.*; import de.dafuqs.spectrum.particle.*; diff --git a/src/main/java/de/dafuqs/spectrum/dimensions/client/package-info.java b/src/main/java/de/dafuqs/spectrum/dimensions/client/package-info.java new file mode 100644 index 0000000000..acea696c8a --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/dimensions/client/package-info.java @@ -0,0 +1,7 @@ +@NullMarked +@MethodsReturnNonnullByDefault +@FieldsAreNonnullByDefault +package de.dafuqs.spectrum.dimensions.client; + +import net.minecraft.*; +import org.jspecify.annotations.*; diff --git a/src/main/java/de/dafuqs/spectrum/deeper_down/package-info.java b/src/main/java/de/dafuqs/spectrum/dimensions/package-info.java similarity index 76% rename from src/main/java/de/dafuqs/spectrum/deeper_down/package-info.java rename to src/main/java/de/dafuqs/spectrum/dimensions/package-info.java index e5d291cadb..3a92b0a1b7 100644 --- a/src/main/java/de/dafuqs/spectrum/deeper_down/package-info.java +++ b/src/main/java/de/dafuqs/spectrum/dimensions/package-info.java @@ -1,7 +1,7 @@ @NullMarked @MethodsReturnNonnullByDefault @FieldsAreNonnullByDefault -package de.dafuqs.spectrum.deeper_down; +package de.dafuqs.spectrum.dimensions; import net.minecraft.*; import org.jspecify.annotations.*; diff --git a/src/main/java/de/dafuqs/spectrum/mixin/ChunkNoiseSamplerMixin.java b/src/main/java/de/dafuqs/spectrum/mixin/ChunkNoiseSamplerMixin.java index f0468a4a76..9af3b591cf 100644 --- a/src/main/java/de/dafuqs/spectrum/mixin/ChunkNoiseSamplerMixin.java +++ b/src/main/java/de/dafuqs/spectrum/mixin/ChunkNoiseSamplerMixin.java @@ -2,7 +2,7 @@ import com.google.common.collect.*; import com.llamalad7.mixinextras.sugar.*; -import de.dafuqs.spectrum.deeper_down.*; +import de.dafuqs.spectrum.dimensions.*; import de.dafuqs.spectrum.registries.*; import net.minecraft.world.level.levelgen.*; import net.minecraft.world.level.levelgen.NoiseChunk.*; diff --git a/src/main/java/de/dafuqs/spectrum/mixin/FireBlockMixin.java b/src/main/java/de/dafuqs/spectrum/mixin/FireBlockMixin.java index 92163e5048..17821284ca 100644 --- a/src/main/java/de/dafuqs/spectrum/mixin/FireBlockMixin.java +++ b/src/main/java/de/dafuqs/spectrum/mixin/FireBlockMixin.java @@ -13,7 +13,7 @@ public class FireBlockMixin { @ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "net/minecraft/server/level/ServerLevel.isRaining ()Z", ordinal = 0)) public boolean spectrum$extinguishInPermanentRain(boolean original, @Local(argsOnly = true) ServerLevel world) { - if (world.dimension().equals(SpectrumDimensionKeys.DIMENSION_KEY)) { + if (world.dimension().equals(SpectrumDimensionKeys.DEEPER_DOWN_KEY)) { return true; } return original; @@ -21,7 +21,7 @@ public class FireBlockMixin { @ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "net/minecraft/server/level/ServerLevel.isRaining ()Z", ordinal = 1)) public boolean spectrum$assuageInPermanentRain(boolean original, @Local(argsOnly = true) ServerLevel world) { - if (world.dimension().equals(SpectrumDimensionKeys.DIMENSION_KEY)) { + if (world.dimension().equals(SpectrumDimensionKeys.DEEPER_DOWN_KEY)) { return true; } return original; diff --git a/src/main/java/de/dafuqs/spectrum/mixin/client/InGameHudMixin.java b/src/main/java/de/dafuqs/spectrum/mixin/client/InGameHudMixin.java index 0da4e19b08..2c7f723d5e 100644 --- a/src/main/java/de/dafuqs/spectrum/mixin/client/InGameHudMixin.java +++ b/src/main/java/de/dafuqs/spectrum/mixin/client/InGameHudMixin.java @@ -26,7 +26,7 @@ public abstract class InGameHudMixin { @ModifyExpressionValue(method = "renderCameraOverlays", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;useFancyGraphics()Z")) private boolean spectrum$disableVignetteInDimension(boolean original) { var player = Minecraft.getInstance().player; - var isInDim = player != null && SpectrumDimensionKeys.DIMENSION_KEY.equals(player.level().dimension()); + var isInDim = player != null && SpectrumDimensionKeys.DEEPER_DOWN_KEY.equals(player.level().dimension()); return !isInDim && original; } diff --git a/src/main/java/de/dafuqs/spectrum/particle/client/FallingAshParticle.java b/src/main/java/de/dafuqs/spectrum/particle/client/FallingAshParticle.java index a89a64283a..159edad3e5 100644 --- a/src/main/java/de/dafuqs/spectrum/particle/client/FallingAshParticle.java +++ b/src/main/java/de/dafuqs/spectrum/particle/client/FallingAshParticle.java @@ -1,7 +1,7 @@ package de.dafuqs.spectrum.particle.client; import de.dafuqs.spectrum.config.*; -import de.dafuqs.spectrum.deeper_down.client.*; +import de.dafuqs.spectrum.dimensions.client.*; import de.dafuqs.spectrum.registries.*; import net.minecraft.client.*; import net.minecraft.client.multiplayer.*; diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumBlocks.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumBlocks.java index 087f8e4dcd..25aa1fd75b 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumBlocks.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumBlocks.java @@ -41,6 +41,7 @@ import de.dafuqs.spectrum.blocks.pastel_network.nodes.*; import de.dafuqs.spectrum.blocks.pastel_network.payloads.*; import de.dafuqs.spectrum.blocks.pedestal.*; +import de.dafuqs.spectrum.blocks.portal.*; import de.dafuqs.spectrum.blocks.potion_workshop.*; import de.dafuqs.spectrum.blocks.present.*; import de.dafuqs.spectrum.blocks.redstone.*; @@ -1312,6 +1313,7 @@ private static BlockBehaviour.Properties spiritVines(MapColor mapColor) { public static final DeferredBlock STUCK_STORM_STONE = register(defaultWestHorizontalFacing(block("stuck_storm_stone", () -> new StuckStormStoneBlock(settings(MapColor.NONE, SoundType.SMALL_AMETHYST_BUD, 0.0F).noCollission().noOcclusion().isSuffocating(SpectrumBlocks::never).noTerrainParticles().isViewBlocking(SpectrumBlocks::never).replaceable())), ModelLocationUtils::getModelLocation)); public static final DeferredBlock DEEPER_DOWN_PORTAL = register(block("deeper_down_portal", () -> new DeeperDownPortalBlock(settings(MapColor.COLOR_BLACK, SoundType.EMPTY, -1.0F, 3600000.0F).isValidSpawn(Blocks::never).pushReaction(PushReaction.BLOCK).lightLevel(state -> 8).noLootTable())).withBlockModel((ctx, block) -> MultiVariantGenerator.multiVariant(block).with(SpectrumModelHelper.createBooleanModelMap(DeeperDownPortalBlock.FACING_UP, ModelLocationUtils.getModelLocation(block, "_up"), ModelLocationUtils.getModelLocation(block))))); + public static final DeferredBlock CONSERVATORY_PORTAL = register(block("conservatory_portal", () -> new ConservatoryPortalBlock(settings(MapColor.COLOR_BLACK, SoundType.EMPTY, -1.0F, 3600000.0F).isValidSpawn(Blocks::never).pushReaction(PushReaction.BLOCK).lightLevel(state -> 8).noLootTable())).withBlockModel((ctx, block) -> MultiVariantGenerator.multiVariant(block).with(SpectrumModelHelper.createBooleanModelMap(DeeperDownPortalBlock.FACING_UP, ModelLocationUtils.getModelLocation(block, "_up"), ModelLocationUtils.getModelLocation(block))))); private static BlockBehaviour.Properties upgrade() { return BlockBehaviour.Properties.ofFullCopy(POLISHED_BASALT.get()).forceSolidOn(); @@ -1748,7 +1750,6 @@ private static BlockBehaviour.Properties preservationBlock() { public static final DeferredBlock PRESERVATION_BRICKS = register(simple(blockWithItem("preservation_bricks", () -> new Block(preservationBlock())))); public static final DeferredBlock SHIMMERING_PRESERVATION_BRICKS = register(blockWithItem("shimmering_preservation_bricks", () -> new Block(preservationBlock().lightLevel(s -> 5))).withBlockModel((ctx, block) -> MultiVariantGenerator.multiVariant(block, createModelVariant(TexturedModel.CUBE.create(block, ctx.modelOutput)), createModelVariant(SpectrumTexturedModelProviders.cubeAll(b -> b, "_fast").createWithSuffix(block, "_fast", ctx.modelOutput)), createModelVariant(SpectrumTexturedModelProviders.cubeAll(b -> b, "_slow").createWithSuffix(block, "_slow", ctx.modelOutput))))); - public static final DeferredBlock COURIER_STATUE = register(blockWithItem("courier_statue", () -> new StatueBlock(preservationBlock())).withBlockItemModel((ctx, block) -> SpectrumModelHelper.registerParentedItemModel(ctx, block, block, "_top")).withBlockModel((ctx, block) -> MultiVariantGenerator.multiVariant(block).with(SpectrumModelHelper.createNorthDefaultHorizontalFacingVariantMap()).with(PropertyDispatch.property(StatueBlock.HALF).select(DoubleBlockHalf.LOWER, SpectrumModelHelper.createModelVariant(block, "_bottom")).select(DoubleBlockHalf.UPPER, SpectrumModelHelper.createModelVariant(block, "_top"))))); public static final DeferredBlock MANXI = register(singletonWithSoup(block("manxi", () -> new ManxiBlock(preservationBlock().noOcclusion().noCollission().noLootTable())), b -> SpectrumModelTemplates.MOB_HEAD)); public static final DeferredBlock BLACK_CHISELED_PRESERVATION_STONE = register(singleton(blockWithItem("black_chiseled_preservation_stone", () -> new Block(preservationBlock())), TexturedModel.COLUMN_ALT)); @@ -2541,7 +2542,6 @@ public static void registerClient(FMLClientSetupEvent event) { ItemBlockRenderTypes.setRenderLayer(DREAM_GATE.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(INVISIBLE_WALL.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(PRESERVATION_ITEM_BOWL.get(), RenderType.cutout()); - ItemBlockRenderTypes.setRenderLayer(COURIER_STATUE.get(), RenderType.cutout()); ItemBlockRenderTypes.setRenderLayer(PRESERVATION_GLASS.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(TINTED_PRESERVATION_GLASS.get(), RenderType.translucent()); ItemBlockRenderTypes.setRenderLayer(GLISTERING_SHOOTING_STAR.get(), RenderType.cutout()); diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumDimensionKeys.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumDimensionKeys.java index 5c98fa0fba..4850905d92 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumDimensionKeys.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumDimensionKeys.java @@ -7,9 +7,17 @@ public class SpectrumDimensionKeys { - public static final ResourceLocation DIMENSION_ID = SpectrumCommon.locate("deeper_down"); - public static final ResourceKey DIMENSION_KEY = ResourceKey.create(Registries.DIMENSION, DIMENSION_ID); + public static final ResourceLocation DEEPER_DOWN_ID = SpectrumCommon.locate("deeper_down"); + public static final ResourceKey DEEPER_DOWN_KEY = ResourceKey.create(Registries.DIMENSION, DEEPER_DOWN_ID); - public static final ResourceLocation DIMENSION_EFFECTS_ID = SpectrumCommon.locate("deeper_down"); + public static final ResourceLocation DEEPER_DOWN_SPECIAL_EFFECTS_ID = SpectrumCommon.locate("deeper_down"); + + public static final ResourceLocation CONSERVATORY_ID = SpectrumCommon.locate("the_conservatory"); + public static final ResourceKey CONSERVATORY_KEY = ResourceKey.create(Registries.DIMENSION, CONSERVATORY_ID); + + public static boolean isSpectrumDimension(Level level) { + ResourceKey dimensionKey = level.dimension(); + return dimensionKey.equals(SpectrumDimensionKeys.DEEPER_DOWN_KEY) || dimensionKey.equals(SpectrumDimensionKeys.CONSERVATORY_KEY); + } } diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumEventListeners.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumEventListeners.java index fb3e895a6e..3c358893fe 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumEventListeners.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumEventListeners.java @@ -10,8 +10,10 @@ import de.dafuqs.spectrum.attachment_types.*; import de.dafuqs.spectrum.blocks.idols.*; import de.dafuqs.spectrum.blocks.pastel_network.*; +import de.dafuqs.spectrum.blocks.portal.*; import de.dafuqs.spectrum.components.*; import de.dafuqs.spectrum.config.*; +import de.dafuqs.spectrum.dimensions.*; import de.dafuqs.spectrum.entity.spawners.*; import de.dafuqs.spectrum.events.*; import de.dafuqs.spectrum.helpers.*; @@ -61,6 +63,8 @@ import net.minecraft.world.level.block.*; import net.minecraft.world.level.block.state.*; import net.minecraft.world.level.gameevent.*; +import net.minecraft.world.level.levelgen.structure.*; +import net.minecraft.world.level.portal.*; import net.minecraft.world.phys.*; import net.neoforged.api.distmarker.*; import net.neoforged.bus.api.*; @@ -86,6 +90,7 @@ import java.util.*; import java.util.concurrent.atomic.*; +import java.util.function.*; @EventBusSubscriber(modid = SpectrumCommon.MOD_ID) public class SpectrumEventListeners { @@ -310,18 +315,58 @@ public static void tickPastelNetwork(ServerTickEvent.Post event) { } @SubscribeEvent - public static void damagePlayersOutOfBoundsInDD(PlayerTickEvent.Post event) { + public static void damagePlayersOutOfDimensionBounds(PlayerTickEvent.Post event) { if(event.getEntity() instanceof ServerPlayer player) { - Level world = player.level(); - if (!player.isCreative() && !player.isSpectator() && world.dimension() == SpectrumDimensionKeys.DIMENSION_KEY && player.getY() > world.getMaxBuildHeight()) { - player.hurt(player.damageSources().fellOutOfWorld(), 10.0F); - if (player.isDeadOrDying()) { - Support.grantAdvancementCriterion(player, "lategame/get_killed_while_out_of_deeper_down_bounds", "get_rekt"); + Level level = player.level(); + if (!player.isCreative() && !player.isSpectator()) { + ResourceKey dimensionKey = level.dimension(); + boolean isDeeperDown = dimensionKey.equals(SpectrumDimensionKeys.DEEPER_DOWN_KEY); + boolean isConservatory = dimensionKey.equals(SpectrumDimensionKeys.CONSERVATORY_KEY); + + if(isDeeperDown) { + if(player.getY() < level.getMaxBuildHeight()) { + return; + } + player.hurt(player.damageSources().fellOutOfWorld(), 10.0F); + if (player.isDeadOrDying()) { + Support.grantAdvancementCriterion(player, "lategame/get_killed_while_out_of_deeper_down_bounds", "get_rekt"); + } + } else if(isConservatory) { + if((player.getY() < level.getMaxBuildHeight() || !ConservatoryDataStore.getInstance(level.getServer()).isPlayerOutsideConservatoryBounds(level, player))) { + return; + } + player.hurt(player.damageSources().fellOutOfWorld(), 10.0F); + if (player.isDeadOrDying()) { + Support.grantAdvancementCriterion(player, "lategame/get_killed_while_out_of_conservatory_bounds", "get_rekt"); + } } } } } + @SubscribeEvent + public static void onChorusFruitTeleport(EntityTeleportEvent.ChorusFruit event) { + if(!(event.getEntityLiving() instanceof ServerPlayer player)) { + return; + } + + ServerLevel currentLevel = (ServerLevel) player.level(); + BlockPos playerPos = player.blockPosition(); + StructureStart structureStart = currentLevel.structureManager().getStructureWithPieceAt(playerPos, structureHolder -> structureHolder.is(SpectrumStructureTags.END_CITIES)); + // yes, this can and will be null outside any structure + if(structureStart.getStructure() == null) { + return; + } + + BoundingBox boundingBox = structureStart.getBoundingBox(); + if(boundingBox.isInside(playerPos.below(5))) { + return; + } + + // we are at the bottom of an end city, whee! + ConservatoryDataStore.teleportToConservatory(boundingBox.getCenter(), currentLevel, player, SpectrumStructureIDs.END_TEST); + } + @SubscribeEvent public static void onEquipmentChange(LivingEquipmentChangeEvent event) { var livingEntity = event.getEntity(); @@ -366,10 +411,9 @@ public static void onLivingDeath(LivingDeathEvent event) { LastKillAttachmentType.rememberKillTick(livinSource, livinSource.level().getGameTime()); MobEffectInstance frenzy = livinSource.getEffect(SpectrumMobEffects.FRENZY); + // A mixin in Vestiges https://www.curseforge.com/minecraft/mc-mods/vestiges-of-the-present/ + // returned a dummy status effect for any getEffect() calls if (frenzy != null && frenzy.getEffect() instanceof FrenzyMobEffect frenzyMobEffect) { - // I assume some mod scrambled effects? We once had an issue with - // java.lang.ClassCastException: class net.minecraft.world.effect.HealOrHarmMobEffect cannot be cast to class de.dafuqs.spectrum.mob_effect.FrenzyMobEffect - // in combination with Vestiges https://www.curseforge.com/minecraft/mc-mods/vestiges-of-the-present/ frenzyMobEffect.onKill(livinSource, frenzy.getAmplifier()); } } @@ -997,7 +1041,7 @@ private static void onGameModeChange(PlayerEvent.PlayerChangeGameModeEvent event } @SubscribeEvent - private static void onEntityJoinLevel(EntityJoinLevelEvent event) { + private static void onEntityJoinLevel(FinalizeSpawnEvent event) { event.getEntity().gameEvent(SpectrumGameEvents.ENTITY_SPAWNED); } diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumItemGroups.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumItemGroups.java index 84f62338cf..726b82fca6 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumItemGroups.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumItemGroups.java @@ -1551,7 +1551,6 @@ public static void registerSubTabs() { entries.accept(SpectrumBlocks.YELLOW_CHISELED_PRESERVATION_STONE); entries.accept(SpectrumBlocks.INVISIBLE_WALL); - entries.accept(SpectrumBlocks.COURIER_STATUE); entries.accept(SpectrumBlocks.PRESERVATION_CHEST); entries.accept(SpectrumItems.DIVINATION_HEART); diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureIDs.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureIDs.java new file mode 100644 index 0000000000..6f501b9300 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureIDs.java @@ -0,0 +1,12 @@ +package de.dafuqs.spectrum.registries; + +import de.dafuqs.spectrum.*; +import net.minecraft.resources.*; + +public class SpectrumStructureIDs { + + public static final ResourceLocation TEST = SpectrumCommon.locate("conservatory/test"); + public static final ResourceLocation END_TEST = SpectrumCommon.locate("conservatory/end_test"); + + +} diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTags.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTags.java index 8d678ced0a..d1688b28cd 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTags.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTags.java @@ -15,6 +15,7 @@ public class SpectrumStructureTags { public static final TagKey MYSTERIOUS_COMPASS_LOCATED = of("mysterious_compass_located"); public static final TagKey ON_SURVEILLANCE_MAPS = of("on_surveillance_maps"); public static final TagKey UNLOCATABLE = of("unlocatable"); + public static final TagKey END_CITIES = of("end_cities"); private static TagKey of(String id) { return TagKey.create(Registries.STRUCTURE, SpectrumCommon.locate(id)); diff --git a/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTypes.java b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTypes.java index c686ebd01c..4e93008f87 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTypes.java +++ b/src/main/java/de/dafuqs/spectrum/registries/SpectrumStructureTypes.java @@ -12,9 +12,11 @@ public class SpectrumStructureTypes { private static final DeferredRegister> REGISTRAR = DeferredRegister.create(Registries.STRUCTURE_TYPE, SpectrumCommon.MOD_ID); public static StructureType UNDERGROUND_JIGSAW = () -> UndergroundJigsawStructure.CODEC; + public static StructureType CONSERVATORY_ENTRANCE = () -> ConservatoryEntranceStructure.CODEC; public static void register(IEventBus bus) { REGISTRAR.register("underground_jigsaw", () -> UNDERGROUND_JIGSAW); + REGISTRAR.register("conservatory_entrance", () -> CONSERVATORY_ENTRANCE); REGISTRAR.register(bus); } diff --git a/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumClientEventListeners.java b/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumClientEventListeners.java index fa3b256c07..caa3353ce0 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumClientEventListeners.java +++ b/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumClientEventListeners.java @@ -12,7 +12,7 @@ import de.dafuqs.spectrum.blocks.pastel_network.nodes.*; import de.dafuqs.spectrum.config.*; import de.dafuqs.spectrum.data_loaders.client.*; -import de.dafuqs.spectrum.deeper_down.client.*; +import de.dafuqs.spectrum.dimensions.client.*; import de.dafuqs.spectrum.helpers.*; import de.dafuqs.spectrum.items.magic_items.*; import de.dafuqs.spectrum.items.tooltip.*; @@ -37,7 +37,6 @@ import net.minecraft.core.particles.*; import net.minecraft.core.registries.*; import net.minecraft.network.chat.*; -import net.minecraft.resources.*; import net.minecraft.server.packs.resources.*; import net.minecraft.util.*; import net.minecraft.world.*; @@ -128,7 +127,7 @@ private static void registerRenderBlockScreenEffectEvent(RenderBlockScreenEffect @SubscribeEvent private static void registerDimensionSpecialEffectsEvent(RegisterDimensionSpecialEffectsEvent event) { - event.register(SpectrumDimensionKeys.DIMENSION_EFFECTS_ID, new DeeperDownDimensionEffects()); + event.register(SpectrumDimensionKeys.DEEPER_DOWN_SPECIAL_EFFECTS_ID, new DeeperDownDimensionSpecialEffects()); } @SubscribeEvent diff --git a/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumEnvironmentalDataOverrides.java b/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumEnvironmentalDataOverrides.java index 6e5d7f5af6..7e753e9592 100644 --- a/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumEnvironmentalDataOverrides.java +++ b/src/main/java/de/dafuqs/spectrum/registries/client/SpectrumEnvironmentalDataOverrides.java @@ -13,31 +13,31 @@ public class SpectrumEnvironmentalDataOverrides { public static void register() { EnvironmentalDataOverride.register(new EnvironmentalDataOverride(e -> e instanceof LivingEntity l && l.hasEffect(SpectrumMobEffects.FRENZY) && (l.hasEffect(SpectrumMobEffects.ETERNAL_SLUMBER) || l.hasEffect(SpectrumMobEffects.FATAL_SLUMBER)), new EnvironmentalDataOverride.ColorData(0xdf2449, 0.55F), - new EnvironmentalData(0.25F, 0.25F, 0.334F, 0.5F), + new EnvironmentalData(false, 0.25F, 0.25F, 0.334F, 0.5F), 5) ); EnvironmentalDataOverride.register(new EnvironmentalDataOverride(hasMobEffect(SpectrumMobEffects.FATAL_SLUMBER), new EnvironmentalDataOverride.ColorData(0x8136c2, 0.65F), - new EnvironmentalData(0.1F, 0.6F, 0.05F, 0.1F), + new EnvironmentalData(false, 0.1F, 0.6F, 0.05F, 0.1F), 10) ); EnvironmentalDataOverride.register(new EnvironmentalDataOverride(hasMobEffect(SpectrumMobEffects.ETERNAL_SLUMBER), new EnvironmentalDataOverride.ColorData(SpectrumMobEffects.ETERNAL_SLUMBER_COLOR, 0.65F), - new EnvironmentalData(0.1F, 0.5F, 0.05F, 0.2F), + new EnvironmentalData(false, 0.1F, 0.5F, 0.05F, 0.2F), 15) ); EnvironmentalDataOverride.register(new EnvironmentalDataOverride(hasMobEffect(SpectrumMobEffects.FRENZY), new EnvironmentalDataOverride.ColorData(0xb9080e, 0.3F), - new EnvironmentalData(1.0F, 1.0F, 0.334F, 0.5F), + new EnvironmentalData(false, 1.0F, 1.0F, 0.334F, 0.5F), 20) ); EnvironmentalDataOverride.register(new EnvironmentalDataOverride(hasMobEffect(SpectrumMobEffects.SOMNOLENCE), new EnvironmentalDataOverride.ColorData(SpectrumMobEffects.ETERNAL_SLUMBER_COLOR, 0.575F), - new EnvironmentalData(0.5F, 0.5F, 0.125F, 0.25F), + new EnvironmentalData(false, 0.5F, 0.5F, 0.125F, 0.25F), 25) ); } diff --git a/src/main/java/de/dafuqs/spectrum/render/SpectrumShaders.java b/src/main/java/de/dafuqs/spectrum/render/SpectrumShaders.java index 49dd137f53..f550f667d0 100644 --- a/src/main/java/de/dafuqs/spectrum/render/SpectrumShaders.java +++ b/src/main/java/de/dafuqs/spectrum/render/SpectrumShaders.java @@ -48,21 +48,21 @@ public static void disableShaders() { noiseEdgePostProcess = Optional.empty(); } - public static void updateShaders(Minecraft client, ClientLevel world) { + public static void updateShaders(Minecraft client, ClientLevel level) { tickNoise(client); - if (world.dimension().equals(SpectrumDimensionKeys.DIMENSION_KEY)) { + if (SpectrumDimensionKeys.isSpectrumDimension(level)) { if (colorGradingPostProcess.isEmpty()) { colorGradingPostProcess = SpectrumShaders.loadPostProcess(client, SpectrumShaders.COLOR_GRADING_ID); } - tickColorGrading(world); + tickColorGrading(level); } else if (colorGradingPostProcess.isPresent()) { colorGradingPostProcess.get().close(); colorGradingPostProcess = Optional.empty(); } } - private static void tickColorGrading(ClientLevel world) { - if (world.dimension().equals(SpectrumDimensionKeys.DIMENSION_KEY)) { + private static void tickColorGrading(ClientLevel level) { + if (SpectrumDimensionKeys.isSpectrumDimension(level)) { colorGradingPostProcess.ifPresent(pps -> { for (int i = 0; i < 5; i++) { pps.setUniform(COLOR_GRADING_UNIFORMS[i], ColorGrading.GRADING_OUT[i]); diff --git a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalData.java b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalData.java index ecd0d4b202..00f66c4b54 100644 --- a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalData.java +++ b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalData.java @@ -5,19 +5,20 @@ import de.dafuqs.spectrum.config.*; import net.minecraft.util.*; -public record EnvironmentalData(float environmentalLightingMultiplier, float fogBrightnessMultiplier, float nearFogDistanceMultiplier, float farFogDistanceMultiplier) { +public record EnvironmentalData(boolean ultradark, float environmentalLightingMultiplier, float fogBrightnessMultiplier, float nearFogDistanceMultiplier, float farFogDistanceMultiplier) { - public static final EnvironmentalData NOOP = new EnvironmentalData(1F, 1F, 1F, 1F); + public static final EnvironmentalData NOOP = new EnvironmentalData(false, 1F, 1F, 1F, 1F); public static final Codec CODEC = RecordCodecBuilder.create(i -> i.group( + Codec.BOOL.fieldOf("ultradark").forGetter(EnvironmentalData::ultradark), Codec.FLOAT.fieldOf("environmental_lighting_multiplier").forGetter(EnvironmentalData::environmentalLightingMultiplier), ExtraCodecs.POSITIVE_FLOAT.fieldOf("fog_brightness_multiplier").forGetter(EnvironmentalData::fogBrightnessMultiplier), Codec.FLOAT.fieldOf("fog_near_multiplier").forGetter(EnvironmentalData::nearFogDistanceMultiplier), Codec.FLOAT.fieldOf("fog_far_multiplier").forGetter(EnvironmentalData::farFogDistanceMultiplier) ).apply(i, EnvironmentalData::new)); - public static EnvironmentalData fromArray(float[] data) { - return new EnvironmentalData(data[0], data[1], data[2], data[3]); + public static EnvironmentalData of(boolean ultradark, float[] data) { + return new EnvironmentalData(ultradark, data[0], data[1], data[2], data[3]); } public float[] asArray() { diff --git a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalDataOverride.java b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalDataOverride.java index 80ce0e9165..fe99e567c7 100644 --- a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalDataOverride.java +++ b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalDataOverride.java @@ -28,10 +28,10 @@ public boolean isBlank() { public static final ColorData BLANK = new ColorData(new Vector3f(), 0); public static final EnvironmentalDataOverride INACTIVE = new EnvironmentalDataOverride(null, BLANK, EnvironmentalData.NOOP, -999); - public static EnvironmentalDataOverride fromArray(float[] override) { + public static EnvironmentalDataOverride fromArray(boolean ultradark, float[] override) { return new EnvironmentalDataOverride(null, new ColorData(new Vector3f(override[1], override[2], override[3]), override[0]), - new EnvironmentalData(override[4], override[5], override[6], override[7]), + new EnvironmentalData(ultradark, override[4], override[5], override[6], override[7]), -999 ); } diff --git a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalRendering.java b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalRendering.java index 7a2a1f77b6..4699bb7756 100644 --- a/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalRendering.java +++ b/src/main/java/de/dafuqs/spectrum/render/biome_rendering/EnvironmentalRendering.java @@ -2,7 +2,6 @@ import com.mojang.datafixers.util.*; import de.dafuqs.spectrum.data_loaders.client.*; -import de.dafuqs.spectrum.registries.*; import net.minecraft.client.*; import net.minecraft.core.*; import net.minecraft.resources.*; @@ -21,6 +20,7 @@ public class EnvironmentalRendering { private static final InterpolationMemory GRADING_QUEUE = new InterpolationMemory<>(); private static final InterpolationMemory ENVIRONMENTAL_RENDERING_QUEUE = new InterpolationMemory<>(); private static final InterpolationMemory OVERRIDE_QUEUE = new InterpolationMemory<>(); + private static boolean ULTRADARK = false; private static final Minecraft client = Minecraft.getInstance(); private static final Supplier delta = () -> client.getTimer().getGameTimeDeltaPartialTick(false); @@ -66,7 +66,7 @@ private static void updateBiomeData(BlockPos center, int blendingRadius) { ResourceKey biome = getBiomeAtPos(center); Pair biomeRenderingData = BiomeRenderingDataLoader.get(biome); GRADING_QUEUE.accept(biomeRenderingData.getFirst().asArray()); - processAndAcceptEnvironmentalData(center, biomeRenderingData.getSecond().asArray()); + processAndAcceptEnvironmentalData(center, biomeRenderingData.getSecond().ultradark(), biomeRenderingData.getSecond().asArray()); return; } @@ -83,6 +83,7 @@ private static void updateBiomeData(BlockPos center, int blendingRadius) { ); BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(); + boolean ultradark = false; while (cursor.advance()) { pos.set(cursor.nextX(), cursor.nextY(), cursor.nextZ()); @@ -90,13 +91,14 @@ private static void updateBiomeData(BlockPos center, int blendingRadius) { Pair biomeRenderingData = BiomeRenderingDataLoader.get(biome); gradingStack.insert(biomeRenderingData.getFirst().asArray()); environmentalRenderingStack.insert(biomeRenderingData.getSecond().asArray()); + ultradark = ultradark || biomeRenderingData.getSecond().ultradark(); } - processAndAcceptEnvironmentalData(center, environmentalRenderingStack.get()); + processAndAcceptEnvironmentalData(center, ultradark, environmentalRenderingStack.get()); GRADING_QUEUE.accept(gradingStack.get()); } - private static void processAndAcceptEnvironmentalData(BlockPos ref, float[] env) { + private static void processAndAcceptEnvironmentalData(BlockPos ref, boolean ultradark, float[] env) { float depthDarkening = 0F; int topSpace = client.level.getMaxBuildHeight() - ref.getY(); depthDarkening += Mth.clampedLerp(0.334F, 0F, topSpace / 48F); @@ -112,6 +114,7 @@ private static void processAndAcceptEnvironmentalData(BlockPos ref, float[] env) env[2] = Math.min(env[2], env[3]); ENVIRONMENTAL_RENDERING_QUEUE.accept(env); + ULTRADARK = ultradark; } public static EnvironmentalData getCurrentEnvironmentalData() { @@ -131,7 +134,7 @@ public static EnvironmentalData getCurrentEnvironmentalData() { interpolated[2] = Mth.lerp(overrideDelta, interpolated[2], override[2]); interpolated[3] = Mth.lerp(overrideDelta, interpolated[3], override[3]); - return EnvironmentalData.fromArray(interpolated); + return EnvironmentalData.of(ULTRADARK, interpolated); } public static void applyColor(ViewportEvent.ComputeFogColor event, EnvironmentalData environmentalData) { @@ -168,7 +171,7 @@ private static EnvironmentalDataOverride processOverrides() { interpolated[i] = Mth.lerp((overrideLoop + delta.get()) / 4F, lastOverride[i], currentOverride[i]); } - return EnvironmentalDataOverride.fromArray(interpolated); + return EnvironmentalDataOverride.fromArray(ULTRADARK, interpolated); } private static ResourceKey getBiomeAtPos(BlockPos pos) { @@ -206,7 +209,7 @@ public static RenderState getRenderState() { if (client.level == null) return RenderState.INACTIVE; - if (client.level.dimension().equals(SpectrumDimensionKeys.DIMENSION_KEY)) + if (getCurrentEnvironmentalData().ultradark()) return RenderState.ULTRA_DARK; if (overrideActive || overrideActiveTicks > 0) diff --git a/src/main/java/de/dafuqs/spectrum/sound/DimensionReverb.java b/src/main/java/de/dafuqs/spectrum/sound/DimensionReverb.java index c526eff48f..436029c0dc 100644 --- a/src/main/java/de/dafuqs/spectrum/sound/DimensionReverb.java +++ b/src/main/java/de/dafuqs/spectrum/sound/DimensionReverb.java @@ -38,7 +38,7 @@ public static void tick(SoundInstance soundInstance, int sourceID) { if (level == null) { return; } - if (level.dimension().location() != SpectrumDimensionKeys.DIMENSION_ID) { + if (level.dimension().location() != SpectrumDimensionKeys.DEEPER_DOWN_ID) { return; } diff --git a/src/main/java/de/dafuqs/spectrum/worldgen/structures/ConservatoryEntranceStructure.java b/src/main/java/de/dafuqs/spectrum/worldgen/structures/ConservatoryEntranceStructure.java new file mode 100644 index 0000000000..257311de95 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/worldgen/structures/ConservatoryEntranceStructure.java @@ -0,0 +1,134 @@ +package de.dafuqs.spectrum.worldgen.structures; + +import com.mojang.serialization.*; +import com.mojang.serialization.codecs.*; +import de.dafuqs.spectrum.registries.*; +import net.minecraft.core.*; +import net.minecraft.nbt.*; +import net.minecraft.resources.*; +import net.minecraft.util.*; +import net.minecraft.util.valueproviders.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.entity.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.chunk.*; +import net.minecraft.world.level.levelgen.*; +import net.minecraft.world.level.levelgen.heightproviders.*; +import net.minecraft.world.level.levelgen.structure.*; +import net.minecraft.world.level.levelgen.structure.pieces.*; +import net.minecraft.world.level.levelgen.structure.pools.*; +import net.minecraft.world.level.levelgen.structure.pools.alias.*; +import net.minecraft.world.level.levelgen.structure.structures.*; +import net.minecraft.world.level.levelgen.structure.templatesystem.*; +import net.minecraft.world.level.storage.loot.*; + +import java.util.*; +import java.util.function.*; + +public class ConservatoryEntranceStructure extends UndergroundStructure { + + public record Entry(ResourceLocation bottomStructure, ResourceLocation middleStructure, ResourceLocation topStructure) { + + public static final Codec CODEC = RecordCodecBuilder.create((instance) -> instance.group( + ResourceLocation.CODEC.fieldOf("bottom").forGetter(entry -> entry.bottomStructure), + ResourceLocation.CODEC.fieldOf("middle").forGetter(entry -> entry.middleStructure), + ResourceLocation.CODEC.fieldOf("top").forGetter(entry -> entry.topStructure) + ).apply(instance, Entry::new)); + + } + + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec((instance) -> + instance.group(ConservatoryEntranceStructure.settingsCodec(instance), + Entry.CODEC.listOf().fieldOf("entries").forGetter((structure) -> structure.entries), + Codec.intRange(0, 7).fieldOf("size").forGetter((structure) -> structure.size), + HeightProvider.CODEC.fieldOf("start_height").forGetter((structure) -> structure.startHeight), + IntProvider.NON_NEGATIVE_CODEC.fieldOf("bury_depth").forGetter((structure) -> structure.buryDepth), + Codec.intRange(0, 64).fieldOf("placement_check_width").forGetter((structure) -> structure.placementCheckWidth), + Codec.intRange(0, 64).fieldOf("placement_check_height").forGetter((structure) -> structure.placementCheckHeight), + Codec.intRange(1, 128).fieldOf("max_distance_from_center").forGetter((structure) -> structure.maxDistanceFromCenter) + ).apply(instance, ConservatoryEntranceStructure::new)); + + protected final List entries; + + public ConservatoryEntranceStructure(StructureSettings config, List entries, Integer size, HeightProvider startHeight, IntProvider buryDepth, Integer placementCheckWidth, Integer placementCheckHeight, Integer maxDistanceFromCenter) { + super(config, size, startHeight, buryDepth, placementCheckWidth, placementCheckHeight, maxDistanceFromCenter); + this.entries = entries; + } + + @Override + public Optional findGenerationPoint(GenerationContext context) { + WorldgenRandom chunkRandom = context.random(); + WorldGenerationContext heightContext = new WorldGenerationContext(context.chunkGenerator(), context.heightAccessor()); + + int x = context.chunkPos().getMinBlockX() + chunkRandom.nextInt(16); + int z = context.chunkPos().getMinBlockZ() + chunkRandom.nextInt(16); + int y = this.startHeight.sample(chunkRandom, heightContext); + + ChunkGenerator chunkGenerator = context.chunkGenerator(); + LevelHeightAccessor world = context.heightAccessor(); + RandomState noiseConfig = context.randomState(); + + BoundingBox structureBox = BoundingBox.fromCorners( + new BlockPos(x - placementCheckWidth / 2, y, z - placementCheckWidth / 2), + new BlockPos(x + placementCheckWidth / 2, y + placementCheckHeight, z + placementCheckWidth / 2) + ); + Optional floorHeight = getFloorHeight(chunkRandom, chunkGenerator, world, noiseConfig, structureBox, buryDepth); + if (floorHeight.isEmpty()) { + return Optional.empty(); + } + + return Optional.of(new Structure.GenerationStub(new BlockPos(x, floorHeight.get(), z), (builder) -> generatePieces(builder, context, floorHeight.get()))); + } + + private void generatePieces(StructurePiecesBuilder builder, Structure.GenerationContext context, int y) { + ChunkPos chunkpos = context.chunkPos(); + WorldgenRandom worldgenrandom = context.random(); + BlockPos blockpos = new BlockPos(chunkpos.getMinBlockX(), y, chunkpos.getMinBlockZ()); + Rotation rotation = Rotation.NONE; // Rotation.getRandom(worldgenrandom); + addPieces(context, blockpos, rotation, builder, worldgenrandom); + } + + public void addPieces(Structure.GenerationContext context, BlockPos startPos, Rotation rotation, StructurePieceAccessor pieces, RandomSource random) { + StructureTemplateManager structureTemplateManager = context.structureTemplateManager(); + + Entry e = this.entries.get(random.nextInt(this.entries.size())); + + for(int y = context.chunkGenerator().getMinY() + 3; y < startPos.getY(); y++) { + pieces.addPiece(new Piece(structureTemplateManager, e.middleStructure, rotation, new BlockPos(startPos.getX(), y, startPos.getZ()))); + } + pieces.addPiece(new Piece(structureTemplateManager, e.topStructure, rotation, startPos.offset(-2, 0, -2))); + pieces.addPiece(new Piece(structureTemplateManager, e.bottomStructure, rotation, new BlockPos(startPos.getX(), context.chunkGenerator().getMinY() + 1, startPos.getZ()))); + } + + public static class Piece extends TemplateStructurePiece { + + public Piece(StructureTemplateManager structureTemplateManager, ResourceLocation location, Rotation rotation, BlockPos pos) { + super( + StructurePieceType.IGLOO, + 0, + structureTemplateManager, + location, + location.toString(), + new StructurePlaceSettings() + .setRotation(rotation) + .setMirror(Mirror.NONE) + .addProcessor(BlockIgnoreProcessor.STRUCTURE_BLOCK) + .setLiquidSettings(LiquidSettings.IGNORE_WATERLOGGING), + pos + ); + } + + @Override + protected void handleDataMarker(String name, BlockPos pos, ServerLevelAccessor level, RandomSource random, BoundingBox box) { + + } + + } + + @Override + public StructureType type() { + return SpectrumStructureTypes.CONSERVATORY_ENTRANCE; + } + +} diff --git a/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundJigsawStructure.java b/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundJigsawStructure.java index dc172d6ce2..cc0c79a94c 100644 --- a/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundJigsawStructure.java +++ b/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundJigsawStructure.java @@ -5,14 +5,13 @@ import de.dafuqs.spectrum.registries.*; import net.minecraft.core.*; import net.minecraft.resources.*; -import net.minecraft.util.*; import net.minecraft.util.valueproviders.*; import net.minecraft.world.level.*; -import net.minecraft.world.level.block.state.*; import net.minecraft.world.level.chunk.*; import net.minecraft.world.level.levelgen.*; import net.minecraft.world.level.levelgen.heightproviders.*; import net.minecraft.world.level.levelgen.structure.*; +import net.minecraft.world.level.levelgen.structure.pieces.*; import net.minecraft.world.level.levelgen.structure.pools.*; import net.minecraft.world.level.levelgen.structure.pools.alias.*; import net.minecraft.world.level.levelgen.structure.structures.*; @@ -27,7 +26,7 @@ * Making it easier to place at a position that matches a certain condition */ @SuppressWarnings("OptionalUsedAsFieldOrParameterType") -public class UndergroundJigsawStructure extends Structure { +public class UndergroundJigsawStructure extends UndergroundStructure { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec((instance) -> instance.group(UndergroundJigsawStructure.settingsCodec(instance), @@ -43,29 +42,17 @@ public class UndergroundJigsawStructure extends Structure { protected final Holder startPool; protected final Optional startJigsawName; - protected final int size; - protected final int placementCheckWidth; - protected final int placementCheckHeight; - protected final HeightProvider startHeight; - protected final IntProvider buryDepth; - protected final int maxDistanceFromCenter; public UndergroundJigsawStructure(Structure.StructureSettings config, Holder startPool, Optional startJigsawName, Integer size, HeightProvider startHeight, IntProvider buryDepth, Integer placementCheckWidth, Integer placementCheckHeight, Integer maxDistanceFromCenter) { - super(config); + super(config, size, startHeight, buryDepth, placementCheckWidth, placementCheckHeight, maxDistanceFromCenter); this.startPool = startPool; this.startJigsawName = startJigsawName; - this.size = size; - this.startHeight = startHeight; - this.buryDepth = buryDepth; - this.placementCheckWidth = placementCheckWidth; - this.placementCheckHeight = placementCheckHeight; - this.maxDistanceFromCenter = maxDistanceFromCenter; } @Override - public Optional findGenerationPoint(Structure.GenerationContext context) { + public Optional findGenerationPoint(GenerationContext context) { WorldgenRandom chunkRandom = context.random(); WorldGenerationContext heightContext = new WorldGenerationContext(context.chunkGenerator(), context.heightAccessor()); @@ -101,67 +88,7 @@ public Optional findGenerationPoint(Structure.Generati } @Override - public StructureType type() { + public StructureType type() { return SpectrumStructureTypes.UNDERGROUND_JIGSAW; } - - private static Optional getFloorHeight(RandomSource random, ChunkGenerator chunkGenerator, LevelHeightAccessor world, RandomState noiseConfig, BoundingBox box, IntProvider buryDepth) { - int lowestY = world.getMinBuildHeight() + 12; - - int floorY = box.minY(); - int structureHeight = box.maxY() - box.minY(); - if (floorY > chunkGenerator.getBaseHeight(box.minX(), box.minZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight - || floorY > chunkGenerator.getBaseHeight(box.minX(), box.maxZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight - || floorY > chunkGenerator.getBaseHeight(box.maxZ(), box.minZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight - || floorY > chunkGenerator.getBaseHeight(box.maxZ(), box.maxZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight) { - - return Optional.empty(); - } - - // if we randomly picked a solid block: - // search downwards until we find the first non-solid block - // (so we do not place our structure in solid stone) - NoiseColumn heightLimitView = chunkGenerator.getBaseColumn(box.getCenter().getX(), box.getCenter().getZ(), world, noiseConfig); - do { - if (floorY < lowestY) { - return Optional.empty(); - } - if (!heightLimitView.getBlock(floorY).isSolid()) { - break; - } - floorY--; - } while (true); - - // then search down until we find a position - // that matches the criteria of at least 2/4 corner blocks - NoiseColumn[] verticalBlockSamples = new NoiseColumn[]{ - chunkGenerator.getBaseColumn(box.minX(), box.minZ(), world, noiseConfig), - chunkGenerator.getBaseColumn(box.minX(), box.maxZ(), world, noiseConfig), - chunkGenerator.getBaseColumn(box.maxX(), box.minZ(), world, noiseConfig), - chunkGenerator.getBaseColumn(box.maxX(), box.maxZ(), world, noiseConfig) - }; - - Predicate blockPredicate = Heightmap.Types.OCEAN_FLOOR_WG.isOpaque(); - - while (floorY >= lowestY) { - int matchingBlocks = 0; - for (NoiseColumn verticalBlockSample : verticalBlockSamples) { - BlockState blockState = verticalBlockSample.getBlock(floorY); - if (blockPredicate.test(blockState)) { - matchingBlocks++; - if (matchingBlocks == 2) { - floorY -= buryDepth.sample(random); - if (floorY < lowestY) { - return Optional.empty(); - } - return Optional.of(floorY); - } - } - } - floorY--; - } - - return Optional.empty(); - } - } diff --git a/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundStructure.java b/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundStructure.java new file mode 100644 index 0000000000..5b835087f2 --- /dev/null +++ b/src/main/java/de/dafuqs/spectrum/worldgen/structures/UndergroundStructure.java @@ -0,0 +1,111 @@ +package de.dafuqs.spectrum.worldgen.structures; + +import com.mojang.serialization.*; +import com.mojang.serialization.codecs.*; +import de.dafuqs.spectrum.registries.*; +import net.minecraft.core.*; +import net.minecraft.resources.*; +import net.minecraft.util.*; +import net.minecraft.util.valueproviders.*; +import net.minecraft.world.level.*; +import net.minecraft.world.level.block.state.*; +import net.minecraft.world.level.chunk.*; +import net.minecraft.world.level.levelgen.*; +import net.minecraft.world.level.levelgen.heightproviders.*; +import net.minecraft.world.level.levelgen.structure.*; +import net.minecraft.world.level.levelgen.structure.pieces.*; +import net.minecraft.world.level.levelgen.structure.pools.*; +import net.minecraft.world.level.levelgen.structure.pools.alias.*; +import net.minecraft.world.level.levelgen.structure.structures.*; + +import java.util.*; +import java.util.function.*; + +/** + * A Jigsaw Structure that has more control over where it can be placed (VerticalPlacement) + * Since JigsawStructure and its properties are all final, we use our own implementation + * This different jigsaw structure uses the chunk generator sample instead of a heightmap for its placement + * Making it easier to place at a position that matches a certain condition + */ +public abstract class UndergroundStructure extends Structure { + + protected final int size; + protected final int placementCheckWidth; + protected final int placementCheckHeight; + protected final HeightProvider startHeight; + protected final IntProvider buryDepth; + protected final int maxDistanceFromCenter; + + public UndergroundStructure(StructureSettings config, Integer size, HeightProvider startHeight, + IntProvider buryDepth, Integer placementCheckWidth, Integer placementCheckHeight, Integer maxDistanceFromCenter) { + + super(config); + this.size = size; + this.startHeight = startHeight; + this.buryDepth = buryDepth; + this.placementCheckWidth = placementCheckWidth; + this.placementCheckHeight = placementCheckHeight; + this.maxDistanceFromCenter = maxDistanceFromCenter; + } + + + protected static Optional getFloorHeight(RandomSource random, ChunkGenerator chunkGenerator, LevelHeightAccessor world, RandomState noiseConfig, BoundingBox box, IntProvider buryDepth) { + int lowestY = world.getMinBuildHeight() + 12; + + int floorY = box.minY(); + int structureHeight = box.maxY() - box.minY(); + if (floorY > chunkGenerator.getBaseHeight(box.minX(), box.minZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight + || floorY > chunkGenerator.getBaseHeight(box.minX(), box.maxZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight + || floorY > chunkGenerator.getBaseHeight(box.maxZ(), box.minZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight + || floorY > chunkGenerator.getBaseHeight(box.maxZ(), box.maxZ(), Heightmap.Types.OCEAN_FLOOR_WG, world, noiseConfig) - structureHeight) { + + return Optional.empty(); + } + + // if we randomly picked a solid block: + // search downwards until we find the first non-solid block + // (so we do not place our structure in solid stone) + NoiseColumn heightLimitView = chunkGenerator.getBaseColumn(box.getCenter().getX(), box.getCenter().getZ(), world, noiseConfig); + do { + if (floorY < lowestY) { + return Optional.empty(); + } + if (!heightLimitView.getBlock(floorY).isSolid()) { + break; + } + floorY--; + } while (true); + + // then search down until we find a position + // that matches the criteria of at least 2/4 corner blocks + NoiseColumn[] verticalBlockSamples = new NoiseColumn[]{ + chunkGenerator.getBaseColumn(box.minX(), box.minZ(), world, noiseConfig), + chunkGenerator.getBaseColumn(box.minX(), box.maxZ(), world, noiseConfig), + chunkGenerator.getBaseColumn(box.maxX(), box.minZ(), world, noiseConfig), + chunkGenerator.getBaseColumn(box.maxX(), box.maxZ(), world, noiseConfig) + }; + + Predicate blockPredicate = Heightmap.Types.OCEAN_FLOOR_WG.isOpaque(); + + while (floorY >= lowestY) { + int matchingBlocks = 0; + for (NoiseColumn verticalBlockSample : verticalBlockSamples) { + BlockState blockState = verticalBlockSample.getBlock(floorY); + if (blockPredicate.test(blockState)) { + matchingBlocks++; + if (matchingBlocks == 2) { + floorY -= buryDepth.sample(random); + if (floorY < lowestY) { + return Optional.empty(); + } + return Optional.of(floorY); + } + } + } + floorY--; + } + + return Optional.empty(); + } + +} diff --git a/src/main/resources/assets/spectrum/advancement_frames/spectrum.json b/src/main/resources/assets/spectrum/advancement_frames/spectrum.json index e9806006c4..3ab4fc319a 100644 --- a/src/main/resources/assets/spectrum/advancement_frames/spectrum.json +++ b/src/main/resources/assets/spectrum/advancement_frames/spectrum.json @@ -127,6 +127,10 @@ "advancement": "spectrum:lategame/get_killed_while_out_of_deeper_down_bounds", "frame": "spectrum:pile_of_poo" }, + { + "advancement": "spectrum:lategame/get_killed_while_out_of_conservatory_bounds", + "frame": "spectrum:pile_of_poo" + }, { "advancement": "spectrum:lategame/wear_both_gravity_trinkets", "frame": "spectrum:pile_of_poo" diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/black_langast.json b/src/main/resources/assets/spectrum/biome_rendering_data/black_langast.json index da466063ed..d103983ee1 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/black_langast.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/black_langast.json @@ -1,6 +1,8 @@ { "biome": "spectrum:black_langast", + "ultradark": true, "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.6, "fog_brightness_multiplier": 0.6, "fog_near_multiplier": 0.1, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/crystal_gardens.json b/src/main/resources/assets/spectrum/biome_rendering_data/crystal_gardens.json index 14eb051270..a90db64e4a 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/crystal_gardens.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/crystal_gardens.json @@ -1,6 +1,7 @@ { "biome": "spectrum:crystal_gardens", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 1.0, "fog_brightness_multiplier": 1.0, "fog_near_multiplier": 0.05, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/deep_barrens.json b/src/main/resources/assets/spectrum/biome_rendering_data/deep_barrens.json index 02a223b81b..e617bb6a5a 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/deep_barrens.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/deep_barrens.json @@ -1,6 +1,7 @@ { "biome": "spectrum:deep_barrens", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.75, "fog_brightness_multiplier": 0.75, "fog_near_multiplier": 0.75, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/deep_dripstone_caves.json b/src/main/resources/assets/spectrum/biome_rendering_data/deep_dripstone_caves.json index e4e8137ab3..bc91b21c2e 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/deep_dripstone_caves.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/deep_dripstone_caves.json @@ -1,6 +1,7 @@ { "biome": "spectrum:deep_dripstone_caves", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.9, "fog_brightness_multiplier": 0.65, "fog_near_multiplier": 0.5, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/dragonrot_swamp.json b/src/main/resources/assets/spectrum/biome_rendering_data/dragonrot_swamp.json index 9d4bd51394..acf9e583f4 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/dragonrot_swamp.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/dragonrot_swamp.json @@ -1,6 +1,7 @@ { "biome": "spectrum:dragonrot_swamp", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.8, "fog_brightness_multiplier": 1.0, "fog_near_multiplier": 0.25, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/howling_spires.json b/src/main/resources/assets/spectrum/biome_rendering_data/howling_spires.json index d342f757ef..d625466ed7 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/howling_spires.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/howling_spires.json @@ -1,6 +1,7 @@ { "biome": "spectrum:howling_spires", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.9, "fog_brightness_multiplier": 1.0, "fog_near_multiplier": 0.2, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/noxshroom_forest.json b/src/main/resources/assets/spectrum/biome_rendering_data/noxshroom_forest.json index 05b6976880..6d0b6147fa 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/noxshroom_forest.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/noxshroom_forest.json @@ -1,6 +1,7 @@ { "biome": "spectrum:noxshroom_forest", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.8, "fog_brightness_multiplier": 0.8, "fog_near_multiplier": 0.5, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/razor_edge.json b/src/main/resources/assets/spectrum/biome_rendering_data/razor_edge.json index b279b206c5..86a784d3ab 100644 --- a/src/main/resources/assets/spectrum/biome_rendering_data/razor_edge.json +++ b/src/main/resources/assets/spectrum/biome_rendering_data/razor_edge.json @@ -1,6 +1,7 @@ { "biome": "spectrum:razor_edge", "environmental_data": { + "ultradark": true, "environmental_lighting_multiplier": 0.9, "fog_brightness_multiplier": 0.8, "fog_near_multiplier": 0.5, diff --git a/src/main/resources/assets/spectrum/biome_rendering_data/the_conservatory.json b/src/main/resources/assets/spectrum/biome_rendering_data/the_conservatory.json new file mode 100644 index 0000000000..e8a90bc590 --- /dev/null +++ b/src/main/resources/assets/spectrum/biome_rendering_data/the_conservatory.json @@ -0,0 +1,17 @@ +{ + "biome": "spectrum:the_conservatory", + "environmental_data": { + "ultradark": false, + "environmental_lighting_multiplier": 0.75, + "fog_brightness_multiplier": 0.75, + "fog_near_multiplier": 0.5, + "fog_far_multiplier": 0.5 + }, + "color_grading": { + "saturation": 0.75, + "rubedo": 0, + "temperature": 55, + "threshold": 0.7, + "bloom": 0.2 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/blockstates/conservatory_portal.json b/src/main/resources/assets/spectrum/blockstates/conservatory_portal.json new file mode 100644 index 0000000000..4b17d57c96 --- /dev/null +++ b/src/main/resources/assets/spectrum/blockstates/conservatory_portal.json @@ -0,0 +1,10 @@ +{ + "variants": { + "up=false": { + "model": "spectrum:block/conservatory_portal" + }, + "up=true": { + "model": "spectrum:block/conservatory_portal_up" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/blockstates/courier_statue.json b/src/main/resources/assets/spectrum/blockstates/courier_statue.json deleted file mode 100644 index 109763a094..0000000000 --- a/src/main/resources/assets/spectrum/blockstates/courier_statue.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "variants": { - "facing=east,half=lower": { - "model": "spectrum:block/courier_statue_bottom", - "y": 90 - }, - "facing=east,half=upper": { - "model": "spectrum:block/courier_statue_top", - "y": 90 - }, - "facing=north,half=lower": { - "model": "spectrum:block/courier_statue_bottom" - }, - "facing=north,half=upper": { - "model": "spectrum:block/courier_statue_top" - }, - "facing=south,half=lower": { - "model": "spectrum:block/courier_statue_bottom", - "y": 180 - }, - "facing=south,half=upper": { - "model": "spectrum:block/courier_statue_top", - "y": 180 - }, - "facing=west,half=lower": { - "model": "spectrum:block/courier_statue_bottom", - "y": 270 - }, - "facing=west,half=upper": { - "model": "spectrum:block/courier_statue_top", - "y": 270 - } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/lang/en_us.json b/src/main/resources/assets/spectrum/lang/en_us.json index c41a894133..7d945d3526 100644 --- a/src/main/resources/assets/spectrum/lang/en_us.json +++ b/src/main/resources/assets/spectrum/lang/en_us.json @@ -319,6 +319,8 @@ "advancements.spectrum.get_hit_while_wearing_full_suit_of_gemstone_armor.title": "Overcharged", "advancements.spectrum.get_killed_while_out_of_deeper_down_bounds.description": "Find the way back to your home via unusual means", "advancements.spectrum.get_killed_while_out_of_deeper_down_bounds.title": "Duct Tape Escape", + "advancements.spectrum.get_killed_while_out_of_conservatory_bounds.description": "Find the way back to your home via unusual means", + "advancements.spectrum.get_killed_while_out_of_conservatory_bounds.title": "How Did We Get Here?*", "advancements.spectrum.collect_radiating_ender.description": "Some Endermen that appear in your world carry blocks with them that seem to radiate an eerie aura", "advancements.spectrum.collect_radiating_ender.title": "Torn from cold, dead Hands", "advancements.spectrum.get_semi_permeable_glass.description": "Craft semi-permeable glass to protect your home from intruders", @@ -1113,7 +1115,6 @@ "block.spectrum.connection_node": "§7Pastel Connection Node", "block.spectrum.connection_node.tooltip": "Extends the range of your Network", "block.spectrum.copper_cluster": "Copper Cluster", - "block.spectrum.courier_statue": "Ancient Statue", "block.spectrum.cod_head": "Cod Head", "block.spectrum.cow_head": "Cow Head", "block.spectrum.cow_idol": "Peaceful Idol", @@ -1153,6 +1154,7 @@ "block.spectrum.decay_away": "Decay Away", "block.spectrum.transient_light": "Transient Shimmerstone Light", "block.spectrum.deeper_down_portal": "Portal Deeper Down", + "block.spectrum.conservatory_portal": "Portal to an Unknown Place", "block.spectrum.deepslate_amethyst_ore": "Deepslate Amethyst Ore", "block.spectrum.deepslate_azurite_ore": "Deepslate Azurite Ore", "block.spectrum.deepslate_citrine_ore": "Deepslate Citrine Ore", diff --git a/src/main/resources/assets/spectrum/lang/ko_kr.json b/src/main/resources/assets/spectrum/lang/ko_kr.json index 2eebb7a2a2..6df96feed4 100644 --- a/src/main/resources/assets/spectrum/lang/ko_kr.json +++ b/src/main/resources/assets/spectrum/lang/ko_kr.json @@ -1113,7 +1113,6 @@ "block.spectrum.connection_node": "§7파스텔 연결 노드", "block.spectrum.connection_node.tooltip": "네트워크의 범위를 확장합니다", "block.spectrum.copper_cluster": "구리 군집", - "block.spectrum.courier_statue": "고대 석상", "block.spectrum.cod_head": "대구 머리", "block.spectrum.cow_head": "소 머리", "block.spectrum.cow_idol": "평화로운 우상", diff --git a/src/main/resources/assets/spectrum/lang/pt_br.json b/src/main/resources/assets/spectrum/lang/pt_br.json index 5a4e3f8cef..b5f9fc32f0 100644 --- a/src/main/resources/assets/spectrum/lang/pt_br.json +++ b/src/main/resources/assets/spectrum/lang/pt_br.json @@ -235,7 +235,6 @@ "block.spectrum.dike_chiseled_preservation_stone": "Pedra Dique de Preservação Talhado", "block.spectrum.dike_gate": "Portão Dique", "block.spectrum.dike_gate_fountain": "Fonte dePortão Dique", - "block.spectrum.courier_statue": "Estátua Anciã", "block.spectrum.preservation_chest": "Baú de Tesouro Brilhante", "block.spectrum.jade_vines": "Vinhas de Jade", diff --git a/src/main/resources/assets/spectrum/lang/ru_ru.json b/src/main/resources/assets/spectrum/lang/ru_ru.json index d79f301462..1814e8cd93 100644 --- a/src/main/resources/assets/spectrum/lang/ru_ru.json +++ b/src/main/resources/assets/spectrum/lang/ru_ru.json @@ -1115,7 +1115,6 @@ "block.spectrum.connection_node": "§7Узел Соединения вайдовой сети", "block.spectrum.connection_node.tooltip": "Увеличивает дальность подключения вашей вайдовой сети", "block.spectrum.copper_cluster": "Медная друза", - "block.spectrum.courier_statue": "Древняя статуя", "block.spectrum.cod_head": "Голова трески", "block.spectrum.cow_head": "Голова коровы", "block.spectrum.cow_idol": "Молочный идол", diff --git a/src/main/resources/assets/spectrum/lang/zh_cn.json b/src/main/resources/assets/spectrum/lang/zh_cn.json index d53988bd9f..499beffcaa 100644 --- a/src/main/resources/assets/spectrum/lang/zh_cn.json +++ b/src/main/resources/assets/spectrum/lang/zh_cn.json @@ -2058,7 +2058,6 @@ "block.spectrum.dike_gate_fountain": "蔚蓝力场源泉", "block.spectrum.dream_gate": "幻梦之门", "block.spectrum.invisible_wall": "无形的墙", - "block.spectrum.courier_statue": "远古雕像", "block.spectrum.preservation_chest": "保护石箱子", "block.spectrum.preservation_controller": "保护石控制器", "block.spectrum.preservation_block_detector": "保护石探测器", diff --git a/src/main/resources/assets/spectrum/models/block/conservatory_portal.json b/src/main/resources/assets/spectrum/models/block/conservatory_portal.json new file mode 100644 index 0000000000..bb2e1c7797 --- /dev/null +++ b/src/main/resources/assets/spectrum/models/block/conservatory_portal.json @@ -0,0 +1,6 @@ +{ + "parent": "spectrum:templates/bedrock_portal", + "textures": { + "portal": "spectrum:block/deeper_down_portal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/block/conservatory_portal_up.json b/src/main/resources/assets/spectrum/models/block/conservatory_portal_up.json new file mode 100644 index 0000000000..e160b183bc --- /dev/null +++ b/src/main/resources/assets/spectrum/models/block/conservatory_portal_up.json @@ -0,0 +1,6 @@ +{ + "parent": "spectrum:templates/bedrock_portal_up", + "textures": { + "portal": "spectrum:block/deeper_down_portal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/block/courier_statue_bottom.json b/src/main/resources/assets/spectrum/models/block/courier_statue_bottom.json deleted file mode 100644 index 29be672897..0000000000 --- a/src/main/resources/assets/spectrum/models/block/courier_statue_bottom.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "minecraft:block/block", - "textures": { - "0": "spectrum:block/courier_statue", - "particle": "spectrum:block/courier_statue" - }, - "elements": [ - { - "from": [2, 0, 2.75], - "to": [14, 3, 13.75], - "faces": { - "north": {"uv": [0, 0, 12, 3], "texture": "#0"}, - "east": {"uv": [0, 0, 11, 3], "texture": "#0"}, - "south": {"uv": [0, 0, 12, 3], "texture": "#0"}, - "west": {"uv": [0, 0, 11, 3], "texture": "#0"}, - "up": {"uv": [0, 0, 12, 11], "texture": "#0"}, - "down": {"uv": [0, 0, 12, 11], "texture": "#0"} - } - }, - { - "from": [3, 3, 4.75], - "to": [13, 5, 11.75], - "faces": { - "north": {"uv": [0, 0, 10, 2], "texture": "#0"}, - "east": {"uv": [0, 0, 7, 2], "texture": "#0"}, - "south": {"uv": [0, 0, 10, 2], "texture": "#0"}, - "west": {"uv": [0, 0, 7, 2], "texture": "#0"}, - "up": {"uv": [0, 0, 10, 7], "texture": "#0"}, - "down": {"uv": [0, 0, 10, 7], "texture": "#0"} - } - }, - { - "from": [5, 5, 6], - "to": [11, 16, 10.75], - "faces": { - "north": {"uv": [6, 1, 12, 12], "texture": "#0"}, - "east": {"uv": [7, 1, 11.75, 12], "texture": "#0"}, - "south": {"uv": [5, 1, 11, 12], "texture": "#0"}, - "west": {"uv": [4, 1, 8.75, 12], "texture": "#0"}, - "up": {"uv": [5, 4, 11, 8.75], "texture": "#0"}, - "down": {"uv": [4, 3, 10, 7.75], "texture": "#0"} - } - } - ], - "display": { - "thirdperson_righthand": { - "rotation": [30.25, 0, 0], - "translation": [0.25, 0, 0.75], - "scale": [0.50781, 0.50781, 0.50781] - }, - "thirdperson_lefthand": { - "scale": [0.5625, 0.5625, 0.5625] - }, - "firstperson_righthand": { - "scale": [0.52344, 0.52344, 0.52344] - }, - "firstperson_lefthand": { - "scale": [0.49414, 0.49414, 0.49414] - }, - "ground": { - "scale": [0.58984, 0.58984, 0.58984] - }, - "gui": { - "rotation": [180, 40.25, 180], - "translation": [0, -2.75, 0], - "scale": [0.48047, 0.48047, 0.48047] - }, - "fixed": { - "translation": [0, -2.75, -1.25], - "scale": [0.62109, 0.62109, 0.62109] - } - }, - "groups": [ - 0, - 1, - 2, - { - "name": "top", - "origin": [0.75, -2.25, 0], - "color": 0, - "children": [] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/block/courier_statue_top.json b/src/main/resources/assets/spectrum/models/block/courier_statue_top.json deleted file mode 100644 index 6a536d1295..0000000000 --- a/src/main/resources/assets/spectrum/models/block/courier_statue_top.json +++ /dev/null @@ -1,345 +0,0 @@ -{ - "credit": "Made with Blockbench", - "parent": "minecraft:block/block", - "textures": { - "0": "spectrum:block/courier_statue", - "particle": "spectrum:block/courier_statue" - }, - "elements": [ - { - "from": [12, -2.75, 6.25], - "to": [14.25, 0, 9.5], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -1]}, - "faces": { - "north": {"uv": [0, 0, 2.25, 2.75], "texture": "#0"}, - "east": {"uv": [0, 0, 3.25, 2.75], "texture": "#0"}, - "south": {"uv": [0, 0, 2.25, 2.75], "texture": "#0"}, - "west": {"uv": [0, 0, 3.25, 2.75], "texture": "#0"}, - "up": {"uv": [0, 0, 2.25, 3.25], "texture": "#0"}, - "down": {"uv": [0, 0, 2.25, 3.25], "texture": "#0"} - } - }, - { - "from": [12, -2.75, 0.5], - "to": [14, -0.5, 6.25], - "rotation": {"angle": -45, "axis": "x", "origin": [13, 0.6875, 6.5625]}, - "faces": { - "north": {"uv": [0, 0, 2, 2.25], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 2.25, 5.75], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 2, 2.25], "texture": "#0"}, - "west": {"uv": [0, 0, 2.25, 5.75], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 2, 5.75], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 2, 5.75], "texture": "#0"} - } - }, - { - "from": [12.5, -13.75, 1.25], - "to": [13.5, 4, 2.25], - "rotation": {"angle": -45, "axis": "x", "origin": [13, 0.6875, 6.5625]}, - "faces": { - "north": {"uv": [0, 0, 1, 16], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 16, 1], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 1, 16], "texture": "#0"}, - "west": {"uv": [0, 0, 16, 1], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1], "texture": "#0"} - } - }, - { - "from": [12.25, 4, 0.75], - "to": [13.75, 5, 2.75], - "rotation": {"angle": -45, "axis": "x", "origin": [13, 0.6875, 6.5625]}, - "faces": { - "north": {"uv": [0, 0, 1.5, 1], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 1, 2], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 1.5, 1], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 2], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 1.5, 2], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 1.5, 2], "texture": "#0"} - } - }, - { - "from": [12.75, 5, 1], - "to": [13.25, 7.5, 2.5], - "rotation": {"angle": -45, "axis": "x", "origin": [13, 0.6875, 6.5625]}, - "faces": { - "north": {"uv": [0, 0, 0.5, 2.5], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 2.5, 1.5], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 0.5, 2.5], "texture": "#0"}, - "west": {"uv": [0, 0, 2.5, 1.5], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 0.5, 1.5], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 0.5, 1.5], "texture": "#0"} - } - }, - { - "from": [2, -5.00888, 4.29657], - "to": [4, -2.75888, 10.04657], - "rotation": {"angle": -45, "axis": "x", "origin": [3, -5.88388, 7.17157]}, - "faces": { - "north": {"uv": [0, 0, 2, 2.25], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 2.25, 5.75], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 2, 2.25], "texture": "#0"}, - "west": {"uv": [0, 0, 2.25, 5.75], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 2, 5.75], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 2, 5.75], "texture": "#0"} - } - }, - { - "from": [1.75, -2.75, 6.25], - "to": [4, 0, 9.5], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -1]}, - "faces": { - "north": {"uv": [0, 0, 2.25, 2.75], "texture": "#0"}, - "east": {"uv": [0, 0, 3.25, 2.75], "texture": "#0"}, - "south": {"uv": [0, 0, 2.25, 2.75], "texture": "#0"}, - "west": {"uv": [0, 0, 3.25, 2.75], "texture": "#0"}, - "up": {"uv": [0, 0, 2.25, 3.25], "texture": "#0"}, - "down": {"uv": [0, 0, 2.25, 3.25], "texture": "#0"} - } - }, - { - "from": [1.75, -10, 10.25], - "to": [6.75, 2, 10.75], - "rotation": {"angle": -22.5, "axis": "z", "origin": [6.25, -4.125, 10.625]}, - "faces": { - "north": {"uv": [0, 0, 5, 11.75], "texture": "#0"}, - "east": {"uv": [0, 0, 0.75, 11.75], "texture": "#0"}, - "south": {"uv": [0, 0, 5, 11.75], "texture": "#0"}, - "west": {"uv": [0, 0, 0.75, 11.75], "texture": "#0"}, - "up": {"uv": [0, 0, 5, 0.75], "texture": "#0"}, - "down": {"uv": [0, 0, 5, 0.75], "texture": "#0"} - } - }, - { - "from": [9.25, -10.25, 10.5], - "to": [14.25, 1.75, 11], - "rotation": {"angle": 22.5, "axis": "z", "origin": [9.75, -4.25, 10.75]}, - "faces": { - "north": {"uv": [5, 0, 10, 12], "texture": "#0"}, - "east": {"uv": [0.5, 0, 1, 12], "texture": "#0"}, - "south": {"uv": [5, 0, 10, 12], "texture": "#0"}, - "west": {"uv": [0.5, 0, 1, 12], "texture": "#0"}, - "up": {"uv": [5, 0, 10, 0.5], "texture": "#0"}, - "down": {"uv": [5, 0, 10, 0.5], "texture": "#0"} - } - }, - { - "from": [4.5, -9.25, 11.25], - "to": [11.5, 2.75, 11.75], - "faces": { - "north": {"uv": [0, 0, 7, 11], "texture": "#0"}, - "east": {"uv": [0, 0, 0.5, 11], "texture": "#0"}, - "south": {"uv": [0, 0, 7, 11], "texture": "#0"}, - "west": {"uv": [0, 0, 0.5, 11], "texture": "#0"}, - "up": {"uv": [0, 0, 7, 0.5], "texture": "#0"}, - "down": {"uv": [0, 0, 7, 0.5], "texture": "#0"} - } - }, - { - "from": [13, 0, 5.75], - "to": [14.75, 2.75, 10], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -1]}, - "faces": { - "north": {"uv": [0, 0, 1.75, 2.75], "texture": "#0"}, - "east": {"uv": [0, 0, 4.25, 2.75], "texture": "#0"}, - "south": {"uv": [0, 0, 1.75, 2.75], "texture": "#0"}, - "west": {"uv": [0, 0, 4.25, 2.75], "texture": "#0"}, - "up": {"uv": [0, 0, 1.75, 4.25], "texture": "#0"}, - "down": {"uv": [0, 0, 1.75, 4.25], "texture": "#0"} - } - }, - { - "from": [3, -0.25, 5.25], - "to": [13, 3.75, 11.25], - "faces": { - "north": {"uv": [1, 5, 11, 9], "texture": "#0"}, - "east": {"uv": [1, 5, 7, 9], "texture": "#0"}, - "south": {"uv": [4, 9, 14, 13], "texture": "#0"}, - "west": {"uv": [1, 5, 7, 9], "texture": "#0"}, - "up": {"uv": [2, 5, 12, 11], "texture": "#0"}, - "down": {"uv": [2, 5, 12, 11], "texture": "#0"} - } - }, - { - "from": [1.5, 0, 5.75], - "to": [3, 2.75, 10], - "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -1]}, - "faces": { - "north": {"uv": [0, 0, 1.5, 2.75], "texture": "#0"}, - "east": {"uv": [0, 0, 4.25, 2.75], "texture": "#0"}, - "south": {"uv": [0, 0, 1.5, 2.75], "texture": "#0"}, - "west": {"uv": [0, 0, 4.25, 2.75], "texture": "#0"}, - "up": {"uv": [0, 0, 1.5, 4.25], "texture": "#0"}, - "down": {"uv": [0, 0, 1.5, 4.25], "texture": "#0"} - } - }, - { - "from": [5.75, 4.28033, 8.88388], - "to": [10.75, 6.78033, 11.63388], - "rotation": {"angle": -45, "axis": "x", "origin": [8.25, 3.53033, 8.13388]}, - "faces": { - "north": {"uv": [0, 0, 5, 2.5], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 2.5, 2.75], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 5, 2.5], "texture": "#0"}, - "west": {"uv": [0, 0, 2.5, 2.75], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 5, 2.75], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 5, 2.75], "texture": "#0"} - } - }, - { - "from": [6.75, 4.28033, 7.13388], - "to": [9.75, 6.78033, 8.88388], - "rotation": {"angle": -45, "axis": "x", "origin": [8.25, 3.53033, 8.13388]}, - "faces": { - "north": {"uv": [0, 0, 3, 2.5], "rotation": 180, "texture": "#0"}, - "east": {"uv": [0, 0, 2.5, 1.75], "rotation": 270, "texture": "#0"}, - "south": {"uv": [0, 0, 3, 2.5], "texture": "#0"}, - "west": {"uv": [0, 0, 2.5, 1.75], "rotation": 90, "texture": "#0"}, - "up": {"uv": [0, 0, 3, 1.75], "rotation": 180, "texture": "#0"}, - "down": {"uv": [0, 0, 3, 1.75], "texture": "#0"} - } - }, - { - "from": [10, 7.93357, 7.49091], - "to": [11.25, 10.43357, 9.24091], - "rotation": {"angle": -22.5, "axis": "z", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [1.25, 0, 2.5, 2.5], "texture": "#0"}, - "east": {"uv": [1.75, 0, 3.5, 2.5], "texture": "#0"}, - "south": {"uv": [1.25, 0, 2.5, 2.5], "texture": "#0"}, - "west": {"uv": [1.75, 0, 3.5, 2.5], "texture": "#0"}, - "up": {"uv": [1.25, 0, 2.5, 1.75], "texture": "#0"}, - "down": {"uv": [1.25, 0, 2.5, 1.75], "texture": "#0"} - } - }, - { - "from": [9.53058, 8.09881, 8], - "to": [10.53058, 10.34881, 9.5], - "rotation": {"angle": 22.5, "axis": "z", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [1, 0, 2, 2.25], "texture": "#0"}, - "east": {"uv": [1.5, 0, 3, 2.25], "texture": "#0"}, - "south": {"uv": [1, 0, 2, 2.25], "texture": "#0"}, - "west": {"uv": [1.5, 0, 3, 2.25], "texture": "#0"}, - "up": {"uv": [1, 0, 2, 1.5], "texture": "#0"}, - "down": {"uv": [1, 0, 2, 1.5], "texture": "#0"} - } - }, - { - "from": [9.5, 10.75, 8.25], - "to": [10, 12.5, 9.25], - "rotation": {"angle": 0, "axis": "y", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [0.5, 0, 1, 1.75], "texture": "#0"}, - "east": {"uv": [1, 0, 2, 1.75], "texture": "#0"}, - "south": {"uv": [0.5, 0, 1, 1.75], "texture": "#0"}, - "west": {"uv": [1, 0, 2, 1.75], "texture": "#0"}, - "up": {"uv": [0.5, 0, 1, 1], "texture": "#0"}, - "down": {"uv": [0.5, 0, 1, 1], "texture": "#0"} - } - }, - { - "from": [6.5, 10.75, 8.25], - "to": [7, 12.5, 9.25], - "rotation": {"angle": 0, "axis": "y", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [0, 0, 0.5, 1.75], "texture": "#0"}, - "east": {"uv": [0, 0, 1, 1.75], "texture": "#0"}, - "south": {"uv": [0, 0, 0.5, 1.75], "texture": "#0"}, - "west": {"uv": [0, 0, 1, 1.75], "texture": "#0"}, - "up": {"uv": [0, 0, 0.5, 1], "texture": "#0"}, - "down": {"uv": [0, 0, 0.5, 1], "texture": "#0"} - } - }, - { - "from": [5.96942, 8.09881, 8], - "to": [6.96942, 10.34881, 9.5], - "rotation": {"angle": -22.5, "axis": "z", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [0, 0, 1, 2.25], "texture": "#0"}, - "east": {"uv": [0, 0, 1.5, 2.25], "texture": "#0"}, - "south": {"uv": [0, 0, 1, 2.25], "texture": "#0"}, - "west": {"uv": [0, 0, 1.5, 2.25], "texture": "#0"}, - "up": {"uv": [0, 0, 1, 1.5], "texture": "#0"}, - "down": {"uv": [0, 0, 1, 1.5], "texture": "#0"} - } - }, - { - "from": [5.25, 7.93357, 7.49091], - "to": [6.5, 10.43357, 9.24091], - "rotation": {"angle": 22.5, "axis": "z", "origin": [8.25, 9.90428, 8.55795]}, - "faces": { - "north": {"uv": [0, 0, 1.25, 2.5], "texture": "#0"}, - "east": {"uv": [0, 0, 1.75, 2.5], "texture": "#0"}, - "south": {"uv": [0, 0, 1.25, 2.5], "texture": "#0"}, - "west": {"uv": [0, 0, 1.75, 2.5], "texture": "#0"}, - "up": {"uv": [0, 0, 1.25, 1.75], "texture": "#0"}, - "down": {"uv": [0, 0, 1.25, 1.75], "texture": "#0"} - } - }, - { - "from": [4.25, 3.75, 5.5], - "to": [11.75, 4.25, 11.5], - "faces": { - "north": {"uv": [0, 0, 7.5, 0.5], "texture": "#0"}, - "east": {"uv": [0, 0, 6, 0.5], "texture": "#0"}, - "south": {"uv": [0, 0, 7.5, 0.5], "texture": "#0"}, - "west": {"uv": [0, 0, 6, 0.5], "texture": "#0"}, - "up": {"uv": [0, 0, 7.5, 6], "texture": "#0"}, - "down": {"uv": [0, 0, 7.5, 6], "texture": "#0"} - } - } - ], - "display": { - "thirdperson_righthand": { - "rotation": [30.25, 0, 0], - "translation": [0.25, 4.5, 0.75], - "scale": [0.50781, 0.50781, 0.50781] - }, - "thirdperson_lefthand": { - "scale": [0.5625, 0.5625, 0.5625] - }, - "firstperson_righthand": { - "translation": [0, 4.25, 0], - "scale": [0.52344, 0.52344, 0.52344] - }, - "firstperson_lefthand": { - "scale": [0.49414, 0.49414, 0.49414] - }, - "ground": { - "translation": [0, 3, 0], - "scale": [0.58984, 0.58984, 0.58984] - }, - "gui": { - "rotation": [180, -45, 180], - "translation": [0, 3.5, 0], - "scale": [0.5, 0.5, 0.5] - }, - "head": { - "translation": [0, 14, 0.75], - "scale": [1.5, 1.5, 1.5] - }, - "fixed": { - "translation": [0, 4, -1.25], - "scale": [0.62109, 0.62109, 0.62109] - } - }, - "groups": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - { - "name": "top", - "origin": [0.75, -2.25, 0], - "color": 0, - "children": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/block/deeper_down_portal.json b/src/main/resources/assets/spectrum/models/block/deeper_down_portal.json index 4da339e33f..bb2e1c7797 100644 --- a/src/main/resources/assets/spectrum/models/block/deeper_down_portal.json +++ b/src/main/resources/assets/spectrum/models/block/deeper_down_portal.json @@ -1,77 +1,6 @@ { + "parent": "spectrum:templates/bedrock_portal", "textures": { - "0": "minecraft:block/bedrock", - "1": "spectrum:block/deeper_down_portal", - "particle": "minecraft:block/bedrock" - }, - "elements": [ - { - "from": [ - 0, - 0, - 0 - ], - "to": [ - 16, - 4, - 16 - ], - "faces": { - "north": { - "uv": [ - 0, - 0, - 16, - 4 - ], - "texture": "#0" - }, - "east": { - "uv": [ - 0, - 0, - 16, - 4 - ], - "texture": "#0" - }, - "south": { - "uv": [ - 0, - 0, - 16, - 4 - ], - "texture": "#0" - }, - "west": { - "uv": [ - 0, - 0, - 16, - 4 - ], - "texture": "#0" - }, - "up": { - "uv": [ - 0, - 0, - 16, - 16 - ], - "texture": "#1" - }, - "down": { - "uv": [ - 0, - 0, - 16, - 16 - ], - "texture": "#0" - } - } - } - ] + "portal": "spectrum:block/deeper_down_portal" + } } \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/block/deeper_down_portal_up.json b/src/main/resources/assets/spectrum/models/block/deeper_down_portal_up.json index c7287f695a..e160b183bc 100644 --- a/src/main/resources/assets/spectrum/models/block/deeper_down_portal_up.json +++ b/src/main/resources/assets/spectrum/models/block/deeper_down_portal_up.json @@ -1,77 +1,6 @@ { + "parent": "spectrum:templates/bedrock_portal_up", "textures": { - "0": "minecraft:block/bedrock", - "1": "spectrum:block/deeper_down_portal", - "particle": "minecraft:block/bedrock" - }, - "elements": [ - { - "from": [ - 0, - 4, - 0 - ], - "to": [ - 16, - 16, - 16 - ], - "faces": { - "north": { - "uv": [ - 0, - 0, - 16, - 12 - ], - "texture": "#0" - }, - "east": { - "uv": [ - 0, - 0, - 16, - 12 - ], - "texture": "#0" - }, - "south": { - "uv": [ - 0, - 0, - 16, - 12 - ], - "texture": "#0" - }, - "west": { - "uv": [ - 0, - 0, - 16, - 12 - ], - "texture": "#0" - }, - "up": { - "uv": [ - 0, - 0, - 16, - 16 - ], - "texture": "#0" - }, - "down": { - "uv": [ - 0, - 0, - 16, - 16 - ], - "texture": "#1" - } - } - } - ] + "portal": "spectrum:block/deeper_down_portal" + } } \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/item/courier_statue.json b/src/main/resources/assets/spectrum/models/item/courier_statue.json deleted file mode 100644 index dd374847d9..0000000000 --- a/src/main/resources/assets/spectrum/models/item/courier_statue.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "spectrum:block/courier_statue_top" -} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/templates/bedrock_portal.json b/src/main/resources/assets/spectrum/models/templates/bedrock_portal.json new file mode 100644 index 0000000000..f7e58f9494 --- /dev/null +++ b/src/main/resources/assets/spectrum/models/templates/bedrock_portal.json @@ -0,0 +1,77 @@ +{ + "textures": { + "bedrock": "minecraft:block/bedrock", + "portal": "spectrum:block/deeper_down_portal", + "particle": "#bedrock" + }, + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 4, + 16 + ], + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 4 + ], + "texture": "#bedrock" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 4 + ], + "texture": "#bedrock" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 4 + ], + "texture": "#bedrock" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 4 + ], + "texture": "#bedrock" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#bedrock" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/models/templates/bedrock_portal_up.json b/src/main/resources/assets/spectrum/models/templates/bedrock_portal_up.json new file mode 100644 index 0000000000..32e629ab92 --- /dev/null +++ b/src/main/resources/assets/spectrum/models/templates/bedrock_portal_up.json @@ -0,0 +1,77 @@ +{ + "textures": { + "bedrock": "minecraft:block/bedrock", + "portal": "spectrum:block/deeper_down_portal", + "particle": "#bedrock" + }, + "elements": [ + { + "from": [ + 0, + 4, + 0 + ], + "to": [ + 16, + 16, + 16 + ], + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 12 + ], + "texture": "#bedrock" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 12 + ], + "texture": "#bedrock" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 12 + ], + "texture": "#bedrock" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 12 + ], + "texture": "#bedrock" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#bedrock" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/spectrum/textures/block/courier_statue.png b/src/main/resources/assets/spectrum/textures/block/courier_statue.png deleted file mode 100644 index 0fe859a6d3..0000000000 Binary files a/src/main/resources/assets/spectrum/textures/block/courier_statue.png and /dev/null differ diff --git a/src/main/resources/data/spectrum/advancement/get_killed_while_out_of_conservatory_bounds.json b/src/main/resources/data/spectrum/advancement/get_killed_while_out_of_conservatory_bounds.json new file mode 100644 index 0000000000..aa2ceacc3b --- /dev/null +++ b/src/main/resources/data/spectrum/advancement/get_killed_while_out_of_conservatory_bounds.json @@ -0,0 +1,26 @@ +{ + "parent": "spectrum:spectrum", + "display": { + "icon": { + "id": "spectrum:preservation_stone" + }, + "hidden": true, + "title": { + "translate": "advancements.spectrum.get_killed_while_out_of_conservatory_bounds.title" + }, + "description": { + "translate": "advancements.spectrum.get_killed_while_out_of_conservatory_bounds.description" + } + }, + "criteria": { + "get_rekt": { + "trigger": "minecraft:impossible" + }, + "gotten_previous": { + "trigger": "revelationary:advancement_gotten", + "conditions": { + "advancement_identifier": "spectrum:spectrum" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/ink_color_mapping/item/spectrum.json b/src/main/resources/data/spectrum/ink_color_mapping/item/spectrum.json index 1d1d7d58d9..0833047b3a 100644 --- a/src/main/resources/data/spectrum/ink_color_mapping/item/spectrum.json +++ b/src/main/resources/data/spectrum/ink_color_mapping/item/spectrum.json @@ -1195,7 +1195,6 @@ "spectrum:dike_gate_fountain", "spectrum:preservation_bricks", "spectrum:shimmering_preservation_bricks", - "spectrum:courier_statue", "spectrum:blue_chiseled_preservation_stone", "spectrum:preservation_glass", "spectrum:tinted_preservation_glass", diff --git a/src/main/resources/data/spectrum/loot_table/blocks/courier_statue.json b/src/main/resources/data/spectrum/loot_table/blocks/courier_statue.json deleted file mode 100644 index 299e779c5d..0000000000 --- a/src/main/resources/data/spectrum/loot_table/blocks/courier_statue.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "spectrum:courier_statue", - "properties": { - "half": "lower" - } - } - ], - "name": "spectrum:courier_statue" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/structure/conservatory_entrance/bottom.nbt b/src/main/resources/data/spectrum/structure/conservatory_entrance/bottom.nbt new file mode 100644 index 0000000000..067fb3560c Binary files /dev/null and b/src/main/resources/data/spectrum/structure/conservatory_entrance/bottom.nbt differ diff --git a/src/main/resources/data/spectrum/structure/conservatory_entrance/middle.nbt b/src/main/resources/data/spectrum/structure/conservatory_entrance/middle.nbt new file mode 100644 index 0000000000..37b1e84a5a Binary files /dev/null and b/src/main/resources/data/spectrum/structure/conservatory_entrance/middle.nbt differ diff --git a/src/main/resources/data/spectrum/structure/conservatory_entrance/top.nbt b/src/main/resources/data/spectrum/structure/conservatory_entrance/top.nbt new file mode 100644 index 0000000000..2bf856af76 Binary files /dev/null and b/src/main/resources/data/spectrum/structure/conservatory_entrance/top.nbt differ diff --git a/src/main/resources/data/spectrum/tags/block/unbreakable_structure_blocks.json b/src/main/resources/data/spectrum/tags/block/unbreakable_structure_blocks.json index 687343f5fa..1fcdf212ba 100644 --- a/src/main/resources/data/spectrum/tags/block/unbreakable_structure_blocks.json +++ b/src/main/resources/data/spectrum/tags/block/unbreakable_structure_blocks.json @@ -16,7 +16,6 @@ "spectrum:tinted_preservation_glass", "spectrum:dike_gate", "spectrum:dream_gate", - "spectrum:courier_statue", "spectrum:preservation_chest", "spectrum:dike_gate_fountain", "spectrum:preservation_roundel", diff --git a/src/main/resources/data/spectrum/tags/worldgen/structure/end_cities.json b/src/main/resources/data/spectrum/tags/worldgen/structure/end_cities.json new file mode 100644 index 0000000000..798dea6a0d --- /dev/null +++ b/src/main/resources/data/spectrum/tags/worldgen/structure/end_cities.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:end_city" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/worldgen/structure/conservatory/end_test.json b/src/main/resources/data/spectrum/worldgen/structure/conservatory/end_test.json new file mode 100644 index 0000000000..348c488c68 --- /dev/null +++ b/src/main/resources/data/spectrum/worldgen/structure/conservatory/end_test.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:jigsaw", + "biomes": "spectrum:the_conservatory", + "step": "strongholds", + "spawn_overrides": {}, + "terrain_adaptation": "none", + "start_pool": "spectrum:excavation_site/main", + "size": 7, + "start_height": { + "absolute": 64 + }, + "max_distance_from_center": 116, + "use_expansion_hack": false, + "liquid_settings": "ignore_waterlogging" +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/worldgen/structure/conservatory/test.json b/src/main/resources/data/spectrum/worldgen/structure/conservatory/test.json new file mode 100644 index 0000000000..d07e38c9f5 --- /dev/null +++ b/src/main/resources/data/spectrum/worldgen/structure/conservatory/test.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:jigsaw", + "biomes": "spectrum:the_conservatory", + "step": "strongholds", + "spawn_overrides": {}, + "terrain_adaptation": "none", + "start_pool": "spectrum:city_below/city_centers", + "size": 7, + "start_height": { + "absolute": 64 + }, + "max_distance_from_center": 116, + "use_expansion_hack": false, + "liquid_settings": "ignore_waterlogging" +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance.json b/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance.json new file mode 100644 index 0000000000..905cefa4af --- /dev/null +++ b/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance.json @@ -0,0 +1,32 @@ +{ + "type": "spectrum:conservatory_entrance", + "entries": [ + { + "bottom": "spectrum:conservatory_entrance/bottom", + "middle": "spectrum:conservatory_entrance/middle", + "top": "spectrum:conservatory_entrance/top" + } + ], + "size": 2, + "max_distance_from_center": 80, + "biomes": "#spectrum:has_structure/pedestal_ruins", + "step": "strongholds", + "terrain_adaptation": "none", + "start_height": { + "type": "minecraft:uniform", + "min_inclusive": { + "above_bottom": 64 + }, + "max_inclusive": { + "above_bottom": 0 + } + }, + "bury_depth": { + "type": "minecraft:uniform", + "min_inclusive": 0, + "max_inclusive": 16 + }, + "placement_check_width": 8, + "placement_check_height": 8, + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance_test.json b/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance_test.json new file mode 100644 index 0000000000..139dbcd8a3 --- /dev/null +++ b/src/main/resources/data/spectrum/worldgen/structure/conservatory_entrance_test.json @@ -0,0 +1,32 @@ +{ + "type": "spectrum:conservatory_entrance", + "entries": [ + { + "bottom": "spectrum:conservatory_entrance/top", + "middle": "spectrum:conservatory_entrance/middle", + "top": "spectrum:conservatory_entrance/bottom" + } + ], + "size": 2, + "max_distance_from_center": 80, + "biomes": "#spectrum:has_structure/pedestal_ruins", + "step": "strongholds", + "terrain_adaptation": "none", + "start_height": { + "type": "minecraft:uniform", + "min_inclusive": { + "above_bottom": 64 + }, + "max_inclusive": { + "above_bottom": 0 + } + }, + "bury_depth": { + "type": "minecraft:uniform", + "min_inclusive": 0, + "max_inclusive": 16 + }, + "placement_check_width": 8, + "placement_check_height": 8, + "spawn_overrides": {} +} \ No newline at end of file diff --git a/src/main/resources/data/spectrum/worldgen/structure_set/conservatory_entrance.json b/src/main/resources/data/spectrum/worldgen/structure_set/conservatory_entrance.json new file mode 100644 index 0000000000..e4aadd7648 --- /dev/null +++ b/src/main/resources/data/spectrum/worldgen/structure_set/conservatory_entrance.json @@ -0,0 +1,18 @@ +{ + "structures": [ + { + "structure": "spectrum:conservatory_entrance", + "weight": 1 + }, + { + "structure": "spectrum:conservatory_entrance_test", + "weight": 1 + } + ], + "placement": { + "type": "minecraft:random_spread", + "spacing": 6, + "separation": 4, + "salt": 1646207470 + } +} \ No newline at end of file