Skip to content

Commit

Permalink
fix: Revert change from level.hasChunk to level.hasChunkAt
Browse files Browse the repository at this point in the history
Addresses #775, #776
  • Loading branch information
Kamefrede committed Nov 7, 2023
1 parent 559ba8e commit 565ef2f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Object execute(SpellContext context) throws SpellRuntimeException {
}

public InteractionResult bonemeal(Player player, Level world, BlockPos pos) {
if(!world.hasChunk(pos.getX(), pos.getY()) || !world.mayInteract(player, pos)) {
if(!world.hasChunkAt(pos) || !world.mayInteract(player, pos)) {
return InteractionResult.PASS;
}
BlockHitResult hit = new BlockHitResult(Vec3.ZERO, Direction.UP, pos, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public Object execute(SpellContext context) throws SpellRuntimeException {

// [VanillaCopy] BucketItem.tryPlaceContainingLiquid because buckets are dumb
public static boolean placeWater(@Nullable Player playerIn, Level worldIn, BlockPos pos) {
if(playerIn == null || !worldIn.hasChunk(pos.getX(), pos.getY()) || !worldIn.mayInteract(playerIn, pos)) {
if(playerIn == null || !worldIn.hasChunkAt(pos) || !worldIn.mayInteract(playerIn, pos)) {
return false;
}
BlockState blockstate = worldIn.getBlockState(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static void removeBlockWithDrops(SpellContext context, Player player, Lev
stack = PsiAPI.getPlayerCAD(player);
}

if(!world.hasChunk(pos.getX(), pos.getY())) {
if(!world.hasChunkAt(pos)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static void conjure(SpellContext context, @Nullable Number timeVal, Block
}

public static boolean conjure(Level world, BlockPos pos, Player player, BlockState state) {
if(!world.hasChunk(pos.getX(), pos.getY()) || !world.mayInteract(player, pos)) {
if(!world.hasChunkAt(pos) || !world.mayInteract(player, pos)) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static void placeBlock(Player player, Level world, BlockPos pos, int slot
}

public static void placeBlock(Player player, Level world, BlockPos pos, int slot, boolean particles, boolean conjure, Direction direction, Direction horizontalDirection) {
if(!world.hasChunk(pos.getX(), pos.getY()) || !world.mayInteract(player, pos)) {
if(!world.hasChunkAt(pos) || !world.mayInteract(player, pos)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public PieceTrickTill(Spell spell) {
}

public static InteractionResult tillBlock(Player player, Level world, BlockPos pos) {
if(!world.hasChunk(pos.getX(), pos.getY()) || !world.mayInteract(player, pos)) {
if(!world.hasChunkAt(pos) || !world.mayInteract(player, pos)) {
return InteractionResult.PASS;
}
BlockHitResult hit = new BlockHitResult(Vec3.ZERO, Direction.UP, pos, false);
Expand Down

0 comments on commit 565ef2f

Please sign in to comment.