Skip to content

Commit

Permalink
Making deepslate generate below y=0, not y=16 (#1433)
Browse files Browse the repository at this point in the history
* Fixes #1431

* Updating carpet rule description

* Making it work for cobbled deepslate
  • Loading branch information
Ghoulboy78 authored May 11, 2022
1 parent e5a3cdf commit 648ea01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main/java/carpet/CarpetSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,7 @@ public enum RenewableCoralMode {
public static boolean renewableBlackstone = false;

@Rule(
desc = "Lava and water generate deepslate and cobbled deepslate instead below Y16",
extra = "This rule may change Y value to 0 with 1.18",
desc = "Lava and water generate deepslate and cobbled deepslate instead below Y0",
category = FEATURE
)
public static boolean renewableDeepslate = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class LavaFluid_renewableDeepslateMixin {
@Inject(method = "spreadTo", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/Block;defaultBlockState()Lnet/minecraft/world/level/block/state/BlockState;"), cancellable = true)
private void generateDeepslate(LevelAccessor world, BlockPos pos, BlockState state, Direction direction, FluidState fluidState, CallbackInfo ci)
{
if(CarpetSettings.renewableDeepslate && ((Level)world).dimension() == Level.OVERWORLD && pos.getY() < 16)
if(CarpetSettings.renewableDeepslate && ((Level)world).dimension() == Level.OVERWORLD && pos.getY() < 0)
{
world.setBlock(pos, Blocks.DEEPSLATE.defaultBlockState(), 3);
this.fizz(world, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class LiquidBlock_renewableDeepslateMixin {
@Inject(method = "shouldSpreadLiquid", at = @At(value = "INVOKE",target = "Lnet/minecraft/world/level/material/FluidState;isSource()Z"), cancellable = true)
private void receiveFluidToDeepslate(Level world, BlockPos pos, BlockState state, CallbackInfoReturnable<Boolean> cir)
{
if(CarpetSettings.renewableDeepslate && !world.getFluidState(pos).isSource() && world.dimension() == Level.OVERWORLD && pos.getY() < 16)
if(CarpetSettings.renewableDeepslate && !world.getFluidState(pos).isSource() && world.dimension() == Level.OVERWORLD && pos.getY() < 0)
{
world.setBlockAndUpdate(pos, Blocks.COBBLED_DEEPSLATE.defaultBlockState());
this.fizz(world, pos);
Expand Down

0 comments on commit 648ea01

Please sign in to comment.