Skip to content

Commit

Permalink
Fix incorrect debug regions (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebo2022 authored Aug 29, 2024
1 parent ba3c7db commit 538acc9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.QuartPos;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Climate;
import net.minecraft.world.level.biome.MultiNoiseBiomeSource;
Expand Down Expand Up @@ -47,7 +48,9 @@ public void getNoiseBiome(int x, int y, int z, Climate.Sampler sampler, Callback
@Inject(method="addDebugInfo", at =@At("TAIL"))
public void addDebugInfo(List<String> debugLines, BlockPos pos, Climate.Sampler sampler, CallbackInfo ci)
{
int qx = QuartPos.fromBlock(pos.getX());
int qz = QuartPos.fromBlock(pos.getZ());
IExtendedParameterList<Holder<Biome>> extension = (IExtendedParameterList<Holder<Biome>>) this.parameters();
debugLines.add("Region: " + extension.getRegion(extension.getUniqueness(pos.getX(), pos.getY(), pos.getZ())).getName().toString());
debugLines.add("Region: " + extension.getRegion(extension.getUniqueness(qx, 0, qz)).getName().toString());
}
}

0 comments on commit 538acc9

Please sign in to comment.