Skip to content

Commit 821ae79

Browse files
Check the center of BlockPos for ambit instead of the corner (#959)
2 parents 285c9df + 081b588 commit 821ae79

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Common/src/main/java/at/petrak/hexcasting/api/casting/eval/CastingEnvironment.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,15 @@ public final void assertVecInRange(Vec3 vec) throws MishapBadLocation {
330330
}
331331

332332
public final void assertPosInRange(BlockPos vec) throws MishapBadLocation {
333-
this.assertVecInRange(new Vec3(vec.getX(), vec.getY(), vec.getZ()));
333+
Vec3 centered = Vec3.atCenterOf(vec);
334+
this.assertVecInRange(centered);
334335
}
335336

336337
public final void assertPosInRangeForEditing(BlockPos vec) throws MishapBadLocation {
337-
this.assertVecInRange(new Vec3(vec.getX(), vec.getY(), vec.getZ()));
338+
Vec3 centered = Vec3.atCenterOf(vec);
339+
this.assertVecInRange(centered);
338340
if (!this.canEditBlockAt(vec))
339-
throw new MishapBadLocation(Vec3.atCenterOf(vec), "forbidden");
341+
throw new MishapBadLocation(centered, "forbidden");
340342
}
341343

342344
public final boolean canEditBlockAt(BlockPos vec) {

0 commit comments

Comments
 (0)