This commit is contained in:
Anuken
2020-07-29 14:24:42 -04:00
parent f840b007ed
commit 5d266174af
4 changed files with 15 additions and 21 deletions

View File

@@ -146,17 +146,16 @@ public class ItemBridge extends Block{
public void drawSelect(){
if(linkValid(tile, world.tile(link))){
drawInput(world.tile(link));
}else{
incoming.each(pos -> drawInput(world.tile(pos)));
}
incoming.each(pos -> drawInput(world.tile(pos)));
Draw.reset();
}
private void drawInput(Tile other){
if(!linkValid(tile, other, false)) return;
boolean linked = other.pos() == link;
if(!linked && !(other.<ItemBridgeEntity>bc().link == tile.pos())) return;
Tmp.v2.trns(tile.angleTo(other), 2f);
float tx = tile.drawx(), ty = tile.drawy();

View File

@@ -97,6 +97,7 @@ public class CoreBlock extends StorageBlock{
@Override
public boolean canPlaceOn(Tile tile, Team team){
if(tile == null) return false;
CoreEntity core = team.core();
//must have all requirements
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements))) return false;
@@ -138,7 +139,9 @@ public class CoreBlock extends StorageBlock{
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
if(!canPlaceOn(world.tile(x, y),player.team())){
if(world.tile(x, y) == null) return;
if(!canPlaceOn(world.tile(x, y), player.team())){
drawPlaceText(Core.bundle.get((player.team().core() != null && player.team().core().items.has(requirements) && !state.rules.infiniteResources) ?
"bar.corereq" :