Implemented sandbox mode

This commit is contained in:
Anuken
2018-08-01 20:13:57 -04:00
parent 9b01140882
commit 5206079e23
8 changed files with 18 additions and 8 deletions

View File

@@ -227,10 +227,12 @@ public class BlocksFragment extends Fragment{
if(entity == null) return;
for(ItemStack s : r.requirements){
if(!entity.items.has(s.item, Mathf.ceil(s.amount))){
istack.setColor(Color.GRAY);
return;
if(!state.mode.infiniteResources){
for(ItemStack s : r.requirements){
if(!entity.items.has(s.item, Mathf.ceil(s.amount))){
istack.setColor(Color.GRAY);
return;
}
}
}
istack.setColor(Color.WHITE);
@@ -310,7 +312,7 @@ public class BlocksFragment extends Fragment{
requirements.addImage(stack.item.region).size(8 * 3);
Label reqlabel = new Label(() -> {
TileEntity core = players[0].getClosestCore();
if(core == null) return "*/*";
if(core == null || state.mode.infiniteResources) return "*/*";
int amount = core.items.get(stack.item);
String color = (amount < stack.amount / 2f ? "[red]" : amount < stack.amount ? "[orange]" : "[white]");