dont tick down display when the claiming tools are held

This commit is contained in:
Flemmli97 2020-11-28 20:50:52 +01:00
parent 27f39ea48e
commit 685bafc755
2 changed files with 7 additions and 10 deletions

View File

@ -55,10 +55,8 @@ public class ClaimDisplay {
} }
} }
public boolean display(ServerPlayerEntity player, boolean tick) { public boolean display(ServerPlayerEntity player, boolean remove) {
if(tick) if (--this.displayTime % 2 == 0)
--this.displayTime;
if (this.displayTime % 2 == 0)
return this.toDisplay.isRemoved(); return this.toDisplay.isRemoved();
int[] dims = this.toDisplay.getDimensions(); int[] dims = this.toDisplay.getDimensions();
if (this.poss == null || this.changed(dims)) { if (this.poss == null || this.changed(dims)) {
@ -82,7 +80,7 @@ public class ClaimDisplay {
player.networkHandler.sendPacket(new ParticleS2CPacket(this.middle, true, pos[0] + 0.5, pos[1] + 0.25, pos[3] + 0.5, 0, 0.5f, 0, 0, 1)); player.networkHandler.sendPacket(new ParticleS2CPacket(this.middle, true, pos[0] + 0.5, pos[1] + 0.25, pos[3] + 0.5, 0, 0.5f, 0, 0, 1));
} }
this.prevDims = dims; this.prevDims = dims;
return this.toDisplay.isRemoved() || this.displayTime < 0; return this.toDisplay.isRemoved() || (remove && this.displayTime < 0);
} }
private boolean changed(int[] dims) { private boolean changed(int[] dims) {

View File

@ -205,8 +205,7 @@ public class PlayerClaimData {
this.setEditingCorner(null); this.setEditingCorner(null);
this.setEditClaim(null, 0); this.setEditClaim(null, 0);
this.claimBlockMessage = false; this.claimBlockMessage = false;
} } else if (!this.claimBlockMessage) {
else if(!this.claimBlockMessage){
this.claimBlockMessage = true; this.claimBlockMessage = true;
this.player.sendMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat, this.player.sendMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat,
this.getClaimBlocks(), this.getAdditionalClaims(), this.usedClaimBlocks()), Formatting.GOLD), false); this.getClaimBlocks(), this.getAdditionalClaims(), this.usedClaimBlocks()), Formatting.GOLD), false);