From 2f19cab144a10c7b7927911a6312db5aa107c407 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 23 Aug 2020 13:25:47 -0400 Subject: [PATCH] Fixed conduits not reacting with each other --- core/src/mindustry/ai/BlockIndexer.java | 12 ++-- core/src/mindustry/ai/types/SuicideAI.java | 2 +- core/src/mindustry/entities/Damage.java | 2 +- .../entities/bullet/HealBulletType.java | 4 +- .../entities/comp/BlockUnitComp.java | 4 +- .../mindustry/entities/comp/BuildingComp.java | 63 +++++++++---------- .../mindustry/entities/comp/PayloadComp.java | 2 +- core/src/mindustry/game/Teams.java | 4 +- .../src/mindustry/graphics/BlockRenderer.java | 2 +- .../mindustry/graphics/OverlayRenderer.java | 4 +- core/src/mindustry/input/InputHandler.java | 4 +- core/src/mindustry/input/MobileInput.java | 2 +- core/src/mindustry/world/Tile.java | 2 +- .../src/mindustry/world/blocks/Autotiler.java | 2 +- .../mindustry/world/blocks/defense/Wall.java | 2 +- .../blocks/defense/turrets/LaserTurret.java | 2 +- .../world/blocks/distribution/Conveyor.java | 2 +- .../world/blocks/distribution/ItemBridge.java | 2 +- .../world/blocks/distribution/Junction.java | 4 +- .../world/blocks/distribution/MassDriver.java | 4 +- .../blocks/distribution/OverflowGate.java | 4 +- .../world/blocks/distribution/Router.java | 2 +- .../world/blocks/distribution/Sorter.java | 2 +- .../world/blocks/liquid/ArmoredConduit.java | 2 +- .../world/blocks/payloads/BlockPayload.java | 2 +- .../world/blocks/power/PowerDiode.java | 2 +- .../world/blocks/power/PowerNode.java | 6 +- 27 files changed, 71 insertions(+), 74 deletions(-) diff --git a/core/src/mindustry/ai/BlockIndexer.java b/core/src/mindustry/ai/BlockIndexer.java index 5931068c48..26ec43e74b 100644 --- a/core/src/mindustry/ai/BlockIndexer.java +++ b/core/src/mindustry/ai/BlockIndexer.java @@ -185,7 +185,7 @@ public class BlockIndexer{ if(other == null) continue; - if(other.team() == team && pred.get(other) && intSet.add(other.pos())){ + if(other.team == team && pred.get(other) && intSet.add(other.pos())){ cons.get(other); any = true; } @@ -212,11 +212,11 @@ public class BlockIndexer{ } public void notifyTileDamaged(Building entity){ - if(damagedTiles[entity.team().id] == null){ - damagedTiles[entity.team().id] = new BuildingArray(); + if(damagedTiles[entity.team.id] == null){ + damagedTiles[entity.team.id] = new BuildingArray(); } - damagedTiles[entity.team().id].add(entity); + damagedTiles[entity.team.id].add(entity); } public Building findEnemyTile(Team team, float x, float y, float range, Boolf pred){ @@ -251,7 +251,7 @@ public class BlockIndexer{ if(e == null) continue; - if(e.team() != team || !pred.get(e) || !e.block().targetable) + if(e.team != team || !pred.get(e) || !e.block().targetable) continue; float ndst = e.dst2(x, y); @@ -390,7 +390,7 @@ public class BlockIndexer{ for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){ Building result = world.build(x, y); //when a targetable block is found, mark this quadrant as occupied and stop searching - if(result != null && result.team() == team){ + if(result != null && result.team == team){ bits.set(quadrantX, quadrantY); break outer; } diff --git a/core/src/mindustry/ai/types/SuicideAI.java b/core/src/mindustry/ai/types/SuicideAI.java index 354b90f8b3..275bc68204 100644 --- a/core/src/mindustry/ai/types/SuicideAI.java +++ b/core/src/mindustry/ai/types/SuicideAI.java @@ -39,7 +39,7 @@ public class SuicideAI extends GroundAI{ boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> { Tile tile = Vars.world.tile(x, y); if(tile != null && tile.build == target) return false; - if(tile != null && tile.build != null && tile.build.team() != unit.team()){ + if(tile != null && tile.build != null && tile.build.team != unit.team()){ blockedByBlock = true; return true; }else{ diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 2650588cb8..56acb90a22 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -87,7 +87,7 @@ public class Damage{ tr.trns(angle, length); Intc2 collider = (cx, cy) -> { Building tile = world.build(cx, cy); - if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team() != team && tile.collide(hitter)){ + if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team != team && tile.collide(hitter)){ tile.collision(hitter); collidedBlocks.add(tile.pos()); hitter.type.hit(hitter, tile.x, tile.y); diff --git a/core/src/mindustry/entities/bullet/HealBulletType.java b/core/src/mindustry/entities/bullet/HealBulletType.java index af66a4c931..4d363dc611 100644 --- a/core/src/mindustry/entities/bullet/HealBulletType.java +++ b/core/src/mindustry/entities/bullet/HealBulletType.java @@ -29,7 +29,7 @@ public class HealBulletType extends BulletType{ @Override public boolean collides(Bullet b, Building tile){ - return tile.team() != b.team || tile.healthf() < 1f; + return tile.team != b.team || tile.healthf() < 1f; } @Override @@ -46,7 +46,7 @@ public class HealBulletType extends BulletType{ public void hitTile(Bullet b, Building tile){ super.hit(b); - if(tile.team() == b.team && !(tile.block() instanceof BuildBlock)){ + if(tile.team == b.team && !(tile.block() instanceof BuildBlock)){ Fx.healBlockFull.at(tile.x, tile.y, tile.block().size, Pal.heal); tile.heal(healPercent / 100f * tile.maxHealth()); } diff --git a/core/src/mindustry/entities/comp/BlockUnitComp.java b/core/src/mindustry/entities/comp/BlockUnitComp.java index 4ae698db2a..39bfb85b97 100644 --- a/core/src/mindustry/entities/comp/BlockUnitComp.java +++ b/core/src/mindustry/entities/comp/BlockUnitComp.java @@ -27,7 +27,7 @@ abstract class BlockUnitComp implements Unitc{ @Override public void update(){ if(tile != null){ - team = tile.team(); + team = tile.team; } } @@ -61,7 +61,7 @@ abstract class BlockUnitComp implements Unitc{ public void team(Team team){ if(tile != null && this.team != team){ this.team = team; - if(tile.team() != team){ + if(tile.team != team){ tile.team(team); } } diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 073a9e62f8..c1040c979c 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -410,7 +410,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, int trns = block.size/2 + 1; Tile next = tile.getNearby(Geometry.d4(rotation).x * trns, Geometry.d4(rotation).y * trns); - if(next != null && next.build != null && next.build.team() == team && next.build.acceptPayload(base(), todump)){ + if(next != null && next.build != null && next.build.team == team && next.build.acceptPayload(base(), todump)){ next.build.handlePayload(base(), todump); return true; } @@ -431,7 +431,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(int i = 0; i < proximity.size; i++){ Building other = proximity.get((i + dump) % proximity.size); - if(other.team() == team && other.acceptPayload(base(), todump)){ + if(other.team == team && other.acceptPayload(base(), todump)){ other.handlePayload(base(), todump); incrementDump(proximity.size); return true; @@ -510,34 +510,31 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, next = next.getLiquidDestination(base(), liquid); - if(next.team() == team && next.block.hasLiquids && liquids.get(liquid) > 0f){ + if(next.team == team && next.block.hasLiquids && liquids.get(liquid) > 0f){ + float ofract = next.liquids.get(liquid) / next.block.liquidCapacity; + float fract = liquids.get(liquid) / block.liquidCapacity * block.liquidPressure; + float flow = Math.min(Mathf.clamp((fract - ofract) * (1f)) * (block.liquidCapacity), liquids.get(liquid)); + flow = Math.min(flow, next.block.liquidCapacity - next.liquids.get(liquid) - 0.001f); - if(next.acceptLiquid(base(), liquid, 0f)){ - float ofract = next.liquids().get(liquid) / next.block.liquidCapacity; - float fract = liquids.get(liquid) / block.liquidCapacity * block.liquidPressure; - float flow = Math.min(Mathf.clamp((fract - ofract) * (1f)) * (block.liquidCapacity), liquids.get(liquid)); - flow = Math.min(flow, next.block.liquidCapacity - next.liquids().get(liquid) - 0.001f); + if(flow > 0f && ofract <= fract && next.acceptLiquid(base(), liquid, flow)){ + next.handleLiquid(base(), liquid, flow); + liquids.remove(liquid, flow); + return flow; + }else if(next.liquids.currentAmount() / next.block.liquidCapacity > 0.1f && fract > 0.1f){ + //TODO these are incorrect effect positions + float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f; - if(flow > 0f && ofract <= fract && next.acceptLiquid(base(), liquid, flow)){ - next.handleLiquid(base(), liquid, flow); - liquids.remove(liquid, flow); - return flow; - }else if(ofract > 0.1f && fract > 0.1f){ - //TODO these are incorrect effect positions - float fx = (x + next.x) / 2f, fy = (y + next.y) / 2f; - - Liquid other = next.liquids().current(); - if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){ - damage(1 * Time.delta); - next.damage(1 * Time.delta); - if(Mathf.chance(0.1 * Time.delta)){ - Fx.fire.at(fx, fy); - } - }else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){ - liquids.remove(liquid, Math.min(liquids.get(liquid), 0.7f * Time.delta)); - if(Mathf.chance(0.2f * Time.delta)){ - Fx.steam.at(fx, fy); - } + Liquid other = next.liquids.current(); + if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){ + damage(1 * Time.delta); + next.damage(1 * Time.delta); + if(Mathf.chance(0.1 * Time.delta)){ + Fx.fire.at(fx, fy); + } + }else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){ + liquids.remove(liquid, Math.min(liquids.get(liquid), 0.7f * Time.delta)); + if(Mathf.chance(0.2f * Time.delta)){ + Fx.steam.at(fx, fy); } } } @@ -568,7 +565,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(int i = 0; i < proximity.size; i++){ incrementDump(proximity.size); Building other = proximity.get((i + dump) % proximity.size); - if(other.team() == team && other.acceptItem(base(), item) && canDump(other, item)){ + if(other.team == team && other.acceptItem(base(), item) && canDump(other, item)){ other.handleItem(base(), item); return; } @@ -586,7 +583,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(int i = 0; i < proximity.size; i++){ incrementDump(proximity.size); Building other = proximity.get((i + dump) % proximity.size); - if(other.team() == team && other.acceptItem(base(), item) && canDump(other, item)){ + if(other.team == team && other.acceptItem(base(), item) && canDump(other, item)){ other.handleItem(base(), item); return true; } @@ -619,7 +616,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, for(int ii = 0; ii < content.items().size; ii++){ Item item = content.item(ii); - if(other.team() == team && items.has(item) && other.acceptItem(base(), item) && canDump(other, item)){ + if(other.team == team && items.has(item) && other.acceptItem(base(), item) && canDump(other, item)){ other.handleItem(base(), item); items.remove(item, 1); incrementDump(proximity.size); @@ -627,7 +624,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } } }else{ - if(other.team() == team && other.acceptItem(base(), todump) && canDump(other, todump)){ + if(other.team == team && other.acceptItem(base(), todump) && canDump(other, todump)){ other.handleItem(base(), todump); items.remove(todump, 1); incrementDump(proximity.size); @@ -653,7 +650,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, /** Try offloading an item to a nearby container in its facing direction. Returns true if success. */ public boolean moveForward(Item item){ Building other = front(); - if(other != null && other.team() == team && other.acceptItem(base(), item)){ + if(other != null && other.team == team && other.acceptItem(base(), item)){ other.handleItem(base(), item); return true; } diff --git a/core/src/mindustry/entities/comp/PayloadComp.java b/core/src/mindustry/entities/comp/PayloadComp.java index d2bc746aa9..b715d4d7c4 100644 --- a/core/src/mindustry/entities/comp/PayloadComp.java +++ b/core/src/mindustry/entities/comp/PayloadComp.java @@ -95,7 +95,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc{ Building tile = payload.entity; int tx = Vars.world.toTile(x - tile.block().offset), ty = Vars.world.toTile(y - tile.block().offset); Tile on = Vars.world.tile(tx, ty); - if(on != null && Build.validPlace(tile.block(), tile.team(), tx, ty, tile.rotation)){ + if(on != null && Build.validPlace(tile.block(), tile.team, tx, ty, tile.rotation)){ int rot = (int)((rotation + 45f) / 90f) % 4; payload.place(on, rot); diff --git a/core/src/mindustry/game/Teams.java b/core/src/mindustry/game/Teams.java index b9d2f69594..75ad0ae02f 100644 --- a/core/src/mindustry/game/Teams.java +++ b/core/src/mindustry/game/Teams.java @@ -102,7 +102,7 @@ public class Teams{ } public void registerCore(CoreBuild core){ - TeamData data = get(core.team()); + TeamData data = get(core.team); //add core if not present if(!data.cores.contains(core)){ data.cores.add(core); @@ -117,7 +117,7 @@ public class Teams{ } public void unregisterCore(CoreBuild entity){ - TeamData data = get(entity.team()); + TeamData data = get(entity.team); //remove core data.cores.remove(entity); //unregister in active list diff --git a/core/src/mindustry/graphics/BlockRenderer.java b/core/src/mindustry/graphics/BlockRenderer.java index 97382dd6d7..08b13bf9b8 100644 --- a/core/src/mindustry/graphics/BlockRenderer.java +++ b/core/src/mindustry/graphics/BlockRenderer.java @@ -249,7 +249,7 @@ public class BlockRenderer implements Disposable{ Draw.z(Layer.block); } - if(entity.team() != player.team()){ + if(entity.team != player.team()){ entity.drawTeam(); Draw.z(Layer.block); } diff --git a/core/src/mindustry/graphics/OverlayRenderer.java b/core/src/mindustry/graphics/OverlayRenderer.java index 94a7835b63..133d8898b0 100644 --- a/core/src/mindustry/graphics/OverlayRenderer.java +++ b/core/src/mindustry/graphics/OverlayRenderer.java @@ -111,7 +111,7 @@ public class OverlayRenderer{ if(dst < state.rules.enemyCoreBuildRadius * 2.2f){ Draw.color(Color.darkGray); Lines.circle(core.x, core.y - 2, state.rules.enemyCoreBuildRadius); - Draw.color(Pal.accent, core.team().color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f)); + Draw.color(Pal.accent, core.team.color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f)); Lines.circle(core.x, core.y, state.rules.enemyCoreBuildRadius); } }); @@ -134,7 +134,7 @@ public class OverlayRenderer{ Vec2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); Building tile = world.buildWorld(vec.x, vec.y); - if(tile != null && tile.team() == player.team()){ + if(tile != null && tile.team == player.team()){ tile.drawSelect(); if(!tile.enabled && tile.block.drawDisabled){ tile.drawDisabled(); diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index dc20f74d8c..dee48a2690 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -126,7 +126,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ Unit unit = player.unit(); Payloadc pay = (Payloadc)unit; - if(tile != null && tile.team() == unit.team && pay.payloads().size < unit.type().payloadCapacity + if(tile != null && tile.team == unit.team && pay.payloads().size < unit.type().payloadCapacity && unit.within(tile, tilesize * tile.block.size * 1.2f)){ //pick up block directly if(tile.block().buildVisibility != BuildVisibility.hidden && tile.block().size <= 2 && tile.canPickup()){ @@ -869,7 +869,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } Building tile = world.buildWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y); - if(tile instanceof ControlBlock && tile.team() == player.team()){ + if(tile instanceof ControlBlock && tile.team == player.team()){ return ((ControlBlock)tile).unit(); } diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 79a7a0c662..24be7b1440 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -77,7 +77,7 @@ public class MobileInput extends InputHandler implements GestureListener{ }else{ Building tile = world.buildWorld(x, y); - if(tile != null && player.team().isEnemy(tile.team())){ + if(tile != null && player.team().isEnemy(tile.team)){ player.miner().mineTile(null); target = tile; }else if(tile != null && player.unit().type().canHeal && tile.team == player.team() && tile.damaged()){ diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index a6a3b8d27d..a63026f827 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -150,7 +150,7 @@ public class Tile implements Position, QuadTreeObject, Displayable{ } public Team team(){ - return build == null ? Team.derelict : build.team(); + return build == null ? Team.derelict : build.team; } public void setTeam(Team team){ diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index 5990dee006..af3a9ac2cc 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -147,7 +147,7 @@ public interface Autotiler{ default boolean blends(Tile tile, int rotation, int direction){ Building other = tile.getNearbyEntity(Mathf.mod(rotation - direction, 4)); - return other != null && other.team() == tile.team() && blends(tile, rotation, other.tileX(), other.tileY(), other.rotation, other.block()); + return other != null && other.team == tile.team() && blends(tile, rotation, other.tileX(), other.tileY(), other.rotation, other.block()); } default boolean blendsArmored(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ diff --git a/core/src/mindustry/world/blocks/defense/Wall.java b/core/src/mindustry/world/blocks/defense/Wall.java index 64f575a254..b08c2c500c 100644 --- a/core/src/mindustry/world/blocks/defense/Wall.java +++ b/core/src/mindustry/world/blocks/defense/Wall.java @@ -91,7 +91,7 @@ public class Wall extends Block{ //create lightning if necessary if(lightningChance > 0){ if(Mathf.chance(lightningChance)){ - Lightning.create(team(), Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength); + Lightning.create(team, Pal.surge, lightningDamage, x, y, bullet.rotation() + 180f, lightningLength); } } diff --git a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java index 3c4bcdb676..59dbc3fbbe 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/LaserTurret.java @@ -65,7 +65,7 @@ public class LaserTurret extends PowerTurret{ bullet = null; } }else if(reload > 0){ - Liquid liquid = liquids().current(); + Liquid liquid = liquids.current(); float maxUsed = consumes.get(ConsumeType.liquid).amount; float used = (cheating() ? maxUsed * Time.delta : Math.min(liquids.get(liquid), maxUsed * Time.delta)) * liquid.heatCapacity * coolantMultiplier; diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index e2d3f4255d..3654f8ba01 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -163,7 +163,7 @@ public class Conveyor extends Block implements Autotiler{ if(front() != null && front() != null){ next = front(); - nextc = next instanceof ConveyorBuild && next.team() == team ? (ConveyorBuild)next : null; + nextc = next instanceof ConveyorBuild && next.team == team ? (ConveyorBuild)next : null; aligned = nextc != null && rotation == next.rotation; } } diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 559ab16f6f..e25c4e0144 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -341,7 +341,7 @@ public class ItemBridge extends Block{ @Override public boolean acceptLiquid(Building source, Liquid liquid, float amount){ - if(team != source.team() || !hasLiquids) return false; + if(team != source.team || !hasLiquids) return false; Tile other = world.tile(link); diff --git a/core/src/mindustry/world/blocks/distribution/Junction.java b/core/src/mindustry/world/blocks/distribution/Junction.java index 324cfaf11d..513f59d959 100644 --- a/core/src/mindustry/world/blocks/distribution/Junction.java +++ b/core/src/mindustry/world/blocks/distribution/Junction.java @@ -49,7 +49,7 @@ public class Junction extends Block{ Building dest = nearby(i); //skip blocks that don't want the item, keep waiting until they do - if(dest == null || !dest.acceptItem(this, item) || dest.team() != team){ + if(dest == null || !dest.acceptItem(this, item) || dest.team != team){ continue; } @@ -73,7 +73,7 @@ public class Junction extends Block{ if(relative == -1 || !buffer.accepts(relative)) return false; Building to = nearby(relative); - return to != null && to.team() == team; + return to != null && to.team == team; } @Override diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index 23c1671e73..4afadbdba8 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -223,7 +223,7 @@ public class MassDriver extends Block{ if(link == other.pos()){ configure(-1); return false; - }else if(other.block() instanceof MassDriver && other.dst(tile) <= range && other.team() == team){ + }else if(other.block() instanceof MassDriver && other.dst(tile) <= range && other.team == team){ configure(other.pos()); return false; } @@ -254,7 +254,7 @@ public class MassDriver extends Block{ float angle = tile.angleTo(target); - Bullets.driverBolt.create(this, team(), + Bullets.driverBolt.create(this, team, x + Angles.trnsx(angle, translation), y + Angles.trnsy(angle, translation), angle, -1f, bulletSpeed, bulletLifetime, data); diff --git a/core/src/mindustry/world/blocks/distribution/OverflowGate.java b/core/src/mindustry/world/blocks/distribution/OverflowGate.java index bbd11bd8c3..44f1b80283 100644 --- a/core/src/mindustry/world/blocks/distribution/OverflowGate.java +++ b/core/src/mindustry/world/blocks/distribution/OverflowGate.java @@ -76,7 +76,7 @@ public class OverflowGate extends Block{ @Override public boolean acceptItem(Building source, Item item){ - return team == source.team() && lastItem == null && items.total() == 0; + return team == source.team && lastItem == null && items.total() == 0; } @Override @@ -91,7 +91,7 @@ public class OverflowGate extends Block{ int from = relativeToEdge(src); if(from == -1) return null; Building to = nearby((from + 2) % 4); - boolean canForward = to != null && to.acceptItem(this, item) && to.team() == team && !(to.block() instanceof OverflowGate); + boolean canForward = to != null && to.acceptItem(this, item) && to.team == team && !(to.block() instanceof OverflowGate); if(!canForward || invert){ Building a = nearby(Mathf.mod(from - 1, 4)); diff --git a/core/src/mindustry/world/blocks/distribution/Router.java b/core/src/mindustry/world/blocks/distribution/Router.java index cc184ac3a9..e58d1a9b45 100644 --- a/core/src/mindustry/world/blocks/distribution/Router.java +++ b/core/src/mindustry/world/blocks/distribution/Router.java @@ -51,7 +51,7 @@ public class Router extends Block{ @Override public boolean acceptItem(Building source, Item item){ - return team == source.team() && lastItem == null && items.total() == 0; + return team == source.team && lastItem == null && items.total() == 0; } @Override diff --git a/core/src/mindustry/world/blocks/distribution/Sorter.java b/core/src/mindustry/world/blocks/distribution/Sorter.java index 81d9cd3a01..f5e9d9b5ec 100644 --- a/core/src/mindustry/world/blocks/distribution/Sorter.java +++ b/core/src/mindustry/world/blocks/distribution/Sorter.java @@ -76,7 +76,7 @@ public class Sorter extends Block{ public boolean acceptItem(Building source, Item item){ Building to = getTileTarget(item, source, false); - return to != null && to.acceptItem(this, item) && to.team() == team; + return to != null && to.acceptItem(this, item) && to.team == team; } @Override diff --git a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java index 2335cb157d..060add232a 100644 --- a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java +++ b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java @@ -26,7 +26,7 @@ public class ArmoredConduit extends Conduit{ // draw the cap when a conduit would normally leak Building next = front(); - if(next != null && next.team() == team && next.block().hasLiquids) return; + if(next != null && next.team == team && next.block().hasLiquids) return; Draw.rect(capRegion, x, y, rotdeg()); } diff --git a/core/src/mindustry/world/blocks/payloads/BlockPayload.java b/core/src/mindustry/world/blocks/payloads/BlockPayload.java index b82fa9dfbc..5690cd46d0 100644 --- a/core/src/mindustry/world/blocks/payloads/BlockPayload.java +++ b/core/src/mindustry/world/blocks/payloads/BlockPayload.java @@ -30,7 +30,7 @@ public class BlockPayload implements Payload{ } public void place(Tile tile, int rotation){ - tile.setBlock(entity.block(), entity.team(), rotation, () -> entity); + tile.setBlock(entity.block(), entity.team, rotation, () -> entity); entity.dropped(); } diff --git a/core/src/mindustry/world/blocks/power/PowerDiode.java b/core/src/mindustry/world/blocks/power/PowerDiode.java index f4a5f21a89..c3f3106a43 100644 --- a/core/src/mindustry/world/blocks/power/PowerDiode.java +++ b/core/src/mindustry/world/blocks/power/PowerDiode.java @@ -53,7 +53,7 @@ public class PowerDiode extends Block{ public void updateTile(){ super.updateTile(); - if(front() == null || back() == null || !back().block().hasPower || !front().block().hasPower || back().team() != front().team()) return; + if(front() == null || back() == null || !back().block().hasPower || !front().block().hasPower || back().team != front().team) return; PowerGraph backGraph = back().power.graph; PowerGraph frontGraph = front().power.graph; diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index aa59d0cab1..0871ef6e87 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -68,7 +68,7 @@ public class PowerNode extends PowerBlock{ power.links.add(other.pos()); } - if(other.team() == entity.team()){ + if(other.team == entity.team){ if(!other.power.links.contains(entity.pos())){ other.power.links.add(entity.pos()); @@ -184,7 +184,7 @@ public class PowerNode extends PowerBlock{ protected void getPotentialLinks(Tile tile, Cons others){ Boolf valid = other -> other != null && other.tile() != tile && other.power != null && ((!other.block().outputsPower && other.block().consumesPower) || (other.block().outputsPower && !other.block().consumesPower) || other.block() instanceof PowerNode) && - overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team() == player.team() + overlaps(tile.x * tilesize + offset, tile.y * tilesize + offset, other.tile(), laserRange * tilesize) && other.team == player.team() && !other.proximity().contains(e -> e.tile() == tile) && !graphs.contains(other.power.graph); tempTileEnts.clear(); @@ -235,7 +235,7 @@ public class PowerNode extends PowerBlock{ } public boolean linkValid(Building tile, Building link, boolean checkMaxNodes){ - if(tile == link || link == null || !link.block().hasPower || tile.team() != link.team()) return false; + if(tile == link || link == null || !link.block().hasPower || tile.team != link.team) return false; if(overlaps(tile, link, laserRange * tilesize) || (link.block() instanceof PowerNode && overlaps(link, tile, ((PowerNode)link.block()).laserRange * tilesize))){ if(checkMaxNodes && link.block() instanceof PowerNode){