diff --git a/src/main/java/com/flemmli97/flan/player/ClaimDisplay.java b/src/main/java/com/flemmli97/flan/player/ClaimDisplay.java index 3d920bf..f6300ad 100644 --- a/src/main/java/com/flemmli97/flan/player/ClaimDisplay.java +++ b/src/main/java/com/flemmli97/flan/player/ClaimDisplay.java @@ -55,8 +55,10 @@ public class ClaimDisplay { } } - public boolean display(ServerPlayerEntity player) { - if (--this.displayTime % 2 == 0) + public boolean display(ServerPlayerEntity player, boolean tick) { + if(tick) + --this.displayTime; + if (this.displayTime % 2 == 0) return this.toDisplay.isRemoved(); int[] dims = this.toDisplay.getDimensions(); if (this.poss == null || this.changed(dims)) { diff --git a/src/main/java/com/flemmli97/flan/player/PlayerClaimData.java b/src/main/java/com/flemmli97/flan/player/PlayerClaimData.java index 11d3d94..8fc02a9 100644 --- a/src/main/java/com/flemmli97/flan/player/PlayerClaimData.java +++ b/src/main/java/com/flemmli97/flan/player/PlayerClaimData.java @@ -176,14 +176,18 @@ public class PlayerClaimData { } public void tick() { - this.displayToAdd.forEach(add -> { + boolean tool = this.player.getMainHandStack().getItem() == ConfigHandler.config.claimingItem + || this.player.getOffHandStack().getItem() == ConfigHandler.config.claimingItem; + boolean stick = this.player.getMainHandStack().getItem() == ConfigHandler.config.inspectionItem + || this.player.getOffHandStack().getItem() == ConfigHandler.config.inspectionItem; + this.displayToAdd.forEach(add -> { if (!this.claimDisplayList.add(add)) { this.claimDisplayList.removeIf(c -> c.equals(add) && c.type != add.type); this.claimDisplayList.add(add); } }); this.displayToAdd.clear(); - this.claimDisplayList.removeIf(d -> d.display(this.player)); + this.claimDisplayList.removeIf(d -> d.display(this.player, !tool && !stick)); if (++this.lastBlockTick > ConfigHandler.config.ticksForNextBlock) { this.addClaimBlocks(1); this.lastBlockTick = 0; @@ -196,8 +200,8 @@ public class PlayerClaimData { if (--this.confirmTick < 0) this.confirmDeleteAll = false; if (this.displayEditing != null) - this.displayEditing.display(this.player); - if (this.player.getMainHandStack().getItem() != ConfigHandler.config.claimingItem && this.player.getOffHandStack().getItem() != ConfigHandler.config.claimingItem) { + this.displayEditing.display(this.player, !tool && !stick); + if (!tool) { this.setEditingCorner(null); this.setEditClaim(null, 0); this.claimBlockMessage = false;