add message saying claimblocks amount when switching to tool or making/resizing claims
This commit is contained in:
parent
996a78a73c
commit
240d009e1b
@ -84,6 +84,8 @@ public class ClaimStorage {
|
|||||||
this.addClaim(claim);
|
this.addClaim(claim);
|
||||||
data.addDisplayClaim(claim, EnumDisplayType.MAIN, player.getBlockPos().getY());
|
data.addDisplayClaim(claim, EnumDisplayType.MAIN, player.getBlockPos().getY());
|
||||||
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.claimCreateSuccess, Formatting.GOLD), false);
|
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.claimCreateSuccess, Formatting.GOLD), false);
|
||||||
|
player.sendMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat,
|
||||||
|
data.getClaimBlocks(), data.getAdditionalClaims(), data.usedClaimBlocks()), Formatting.GOLD), false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
PlayerClaimData data = PlayerClaimData.get(player);
|
PlayerClaimData data = PlayerClaimData.get(player);
|
||||||
@ -158,6 +160,8 @@ public class ClaimStorage {
|
|||||||
this.addClaim(claim);
|
this.addClaim(claim);
|
||||||
data.addDisplayClaim(claim, EnumDisplayType.MAIN, player.getBlockPos().getY());
|
data.addDisplayClaim(claim, EnumDisplayType.MAIN, player.getBlockPos().getY());
|
||||||
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.resizeSuccess, Formatting.GOLD), false);
|
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.resizeSuccess, Formatting.GOLD), false);
|
||||||
|
player.sendMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat,
|
||||||
|
data.getClaimBlocks(), data.getAdditionalClaims(), data.usedClaimBlocks()), Formatting.GOLD), false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.notEnoughBlocks, Formatting.RED), false);
|
player.sendMessage(PermHelper.simpleColoredText(ConfigHandler.lang.notEnoughBlocks, Formatting.RED), false);
|
||||||
|
@ -47,7 +47,7 @@ public class PlayerClaimData {
|
|||||||
|
|
||||||
private final ServerPlayerEntity player;
|
private final ServerPlayerEntity player;
|
||||||
|
|
||||||
private boolean confirmDeleteAll, adminIgnoreClaim;
|
private boolean confirmDeleteAll, adminIgnoreClaim, claimBlockMessage;
|
||||||
private boolean dirty;
|
private boolean dirty;
|
||||||
|
|
||||||
public PlayerClaimData(ServerPlayerEntity player) {
|
public PlayerClaimData(ServerPlayerEntity player) {
|
||||||
@ -200,6 +200,12 @@ public class PlayerClaimData {
|
|||||||
if (this.player.getMainHandStack().getItem() != ConfigHandler.config.claimingItem && this.player.getOffHandStack().getItem() != ConfigHandler.config.claimingItem) {
|
if (this.player.getMainHandStack().getItem() != ConfigHandler.config.claimingItem && this.player.getOffHandStack().getItem() != ConfigHandler.config.claimingItem) {
|
||||||
this.setEditingCorner(null);
|
this.setEditingCorner(null);
|
||||||
this.setEditClaim(null, 0);
|
this.setEditClaim(null, 0);
|
||||||
|
this.claimBlockMessage = false;
|
||||||
|
}
|
||||||
|
else if(!this.claimBlockMessage){
|
||||||
|
this.claimBlockMessage = true;
|
||||||
|
this.player.sendMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat,
|
||||||
|
this.getClaimBlocks(), this.getAdditionalClaims(), this.usedClaimBlocks()), Formatting.GOLD), false);
|
||||||
}
|
}
|
||||||
this.actionCooldown--;
|
this.actionCooldown--;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user