Fixed not being able to place blocks if placement reach is 0, falls back to vanilla reach now.
This commit is contained in:
@@ -208,8 +208,10 @@ public class BuilderChain {
|
|||||||
|
|
||||||
private BlockEntry findStartPosition(Player player, BuildModeEnum buildMode) {
|
private BlockEntry findStartPosition(Player player, BuildModeEnum buildMode) {
|
||||||
|
|
||||||
|
int maxReach = EffortlessBuildingClient.POWER_LEVEL.getPlacementReach(player);
|
||||||
|
|
||||||
//Determine if we should look far or nearby
|
//Determine if we should look far or nearby
|
||||||
boolean shouldLookAtNear = buildMode == BuildModeEnum.DISABLED;
|
boolean shouldLookAtNear = buildMode == BuildModeEnum.DISABLED || maxReach < 3;
|
||||||
if (shouldLookAtNear) {
|
if (shouldLookAtNear) {
|
||||||
lookingAt = lookingAtNear;
|
lookingAt = lookingAtNear;
|
||||||
} else {
|
} else {
|
||||||
@@ -220,8 +222,7 @@ public class BuilderChain {
|
|||||||
var startPos = lookingAt.getBlockPos();
|
var startPos = lookingAt.getBlockPos();
|
||||||
|
|
||||||
//Check if out of reach
|
//Check if out of reach
|
||||||
int maxReach = EffortlessBuildingClient.POWER_LEVEL.getPlacementReach(player);
|
if (!shouldLookAtNear && player.blockPosition().distSqr(startPos) > maxReach * maxReach) return null;
|
||||||
if (player.blockPosition().distSqr(startPos) > maxReach * maxReach) return null;
|
|
||||||
|
|
||||||
startPosForBreaking = startPos;
|
startPosForBreaking = startPos;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user