Skip to content

Commit

Permalink
Tool Texture Cleanup, Claim command messages, max limit to Builder pr…
Browse files Browse the repository at this point in the history
…ogress-needed (ldtteam#6726)

from ldtteam#6657, protects against the negative percentages on builder resource-related UIs, caused by situations where neededResources was getting filled up while the work order itself was only partially filled.
from same issue, cleans up the alpha channels on the guard tool, lumberjack restriction tool, and permission scepter. The minecolonies sceptergold isn't the one that gets actually used in all cases, but changed it anyway; will do the same in Structurize as a separate PR.
adds a separate message for the Claim command in "false" mode, to better distinguish between claim and unclaim commands. Fixes a related typo.
  • Loading branch information
gattsuru authored Mar 15, 2021
1 parent 67e4f3b commit b686716
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ public int onExecute(final CommandContext<CommandSource> context)
}

ChunkDataHelper.claimChunksInRange(colonyID, context.getSource().getWorld().getDimensionKey(), add, new BlockPos(sender.getPositionVec()), range, 0, sender.world);
LanguageHandler.sendPlayerMessage((PlayerEntity) sender, "com.minecolonies.command.claim.success");
if(add)
{
LanguageHandler.sendPlayerMessage((PlayerEntity) sender, "com.minecolonies.command.claim.success");
}
else
{
LanguageHandler.sendPlayerMessage((PlayerEntity) sender, "com.minecolonies.command.claim.unclaim");
}
return 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,15 @@ private void requestMaterialsState()
return;
}

final AbstractBuildingStructureBuilder buildingWorker = getOwnBuilding();
if (requestMaterials())
{
final AbstractBuildingStructureBuilder buildingWorker = getOwnBuilding();
job.getWorkOrder().setRequested(true);

int newQuantity = buildingWorker.getNeededResources().values().stream().mapToInt(ItemStorage::getAmount).sum();
if (job.getWorkOrder().getAmountOfRes() == 0 || newQuantity > job.getWorkOrder().getAmountOfRes())
{
job.getWorkOrder().setAmountOfRes(newQuantity);
}
}
int newQuantity = buildingWorker.getNeededResources().values().stream().mapToInt(ItemStorage::getAmount).sum();
if (job.getWorkOrder().getAmountOfRes() == 0 || newQuantity > job.getWorkOrder().getAmountOfRes())
{
job.getWorkOrder().setAmountOfRes(newQuantity);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/minecolonies/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@
"com.minecolonies.command.ownerchange.success": "Set %s as owner of colony %s",
"com.minecolonies.command.claim.toolarge": "Tried to claim a too large area, max size is config workingRangeTownHallChunks * 2",
"com.minecolonies.command.claim.maxchunks": "You've reached the maximal claimable chunk count, aborting.",
"com.minecolonies.command.claim.success": "Succesfully claimed chunks in every direction.",
"com.minecolonies.command.claim.success": "Successfully claimed chunks in every direction.",
"com.minecolonies.command.claim.unclaim": "Successfully unclaimed chunks in every direction.",
"com.minecolonies.command.teleport.success": "Teleporting you to colony %s.",
"com.minecolonies.command.delete.success": "Created backup and deleted colony %s.",
"com.minecolonies.command.canspawnraider.success": "Colony %s can spawn raiders: %s",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b686716

Please sign in to comment.