From 0e61175a956d77d8c5181233af92525f6f489ea9 Mon Sep 17 00:00:00 2001 From: screret <68943070+screret@users.noreply.github.com> Date: Fri, 27 Dec 2024 15:01:11 +0200 Subject: [PATCH] fix oil spouts not updating the fluid when they're generated --- .../java/com/gregtechceu/gtceu/common/commands/GTCommands.java | 2 +- .../gtceu/common/worldgen/feature/FluidSproutFeature.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/common/commands/GTCommands.java b/src/main/java/com/gregtechceu/gtceu/common/commands/GTCommands.java index 13d213bd4c..ff0f9fb037 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/commands/GTCommands.java +++ b/src/main/java/com/gregtechceu/gtceu/common/commands/GTCommands.java @@ -94,7 +94,7 @@ public static void register(CommandDispatcher dispatcher, Co .then(argument("vein", GTRegistryArgument.registry(GTRegistries.ORE_VEINS, ResourceLocation.class)) .executes(context -> GTCommands.placeVein(context, - context.getSource().getEntityOrException().blockPosition())) + BlockPos.containing(context.getSource().getPosition()))) .then(argument("position", BlockPosArgument.blockPos()) .executes(context -> GTCommands.placeVein(context, BlockPosArgument.getBlockPos(context, "position"))))))); diff --git a/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/FluidSproutFeature.java b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/FluidSproutFeature.java index be3a4ccadd..e9899a7ef8 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/FluidSproutFeature.java +++ b/src/main/java/com/gregtechceu/gtceu/common/worldgen/feature/FluidSproutFeature.java @@ -46,7 +46,7 @@ public boolean place(FeaturePlaceContext context) { if (config.fluid().isSame(Fluids.EMPTY)) { return false; } - int surfaceHeight = level.getHeight(Heightmap.Types.OCEAN_FLOOR_WG, blockpos.getX(), blockpos.getZ()); + int surfaceHeight = level.getHeight(Heightmap.Types.WORLD_SURFACE_WG, blockpos.getX(), blockpos.getZ()); if (blockpos.getY() >= surfaceHeight) { return false; } @@ -126,6 +126,7 @@ public void setBlock(BlockPos.MutableBlockPos mutablePos, int currentX, int curr int sectionZ = SectionPos.sectionRelative(currentZ); levelchunksection.setBlockState(sectionX, sectionY, sectionZ, config.fluid().defaultFluidState().createLegacyBlock(), false); + level.getChunk(mutablePos).markPosForPostprocessing(mutablePos); placedAmount.add(1); }