diff --git a/src/betamindy/BetaMindy.java b/src/betamindy/BetaMindy.java index a2a5f5e1..5cebbcb6 100644 --- a/src/betamindy/BetaMindy.java +++ b/src/betamindy/BetaMindy.java @@ -3,15 +3,14 @@ import arc.*; import arc.func.*; import arc.struct.*; -import arc.util.Log; +import arc.util.*; +import betamindy.content.*; import betamindy.util.*; -import betamindy.util.xelo.XeloUtil; import mindustry.*; import mindustry.ctype.*; import mindustry.game.EventType.*; import mindustry.mod.*; import mindustry.mod.Mods.*; -import betamindy.content.*; import mindustry.net.*; import mindustry.ui.*; import mindustry.world.*; @@ -22,26 +21,24 @@ public class BetaMindy extends Mod{ public static final String githubURL = "https://github.com/sk7725/BetaMindy"; public static final String shortName = "[#b59e72]Demo of Chaos Itself[]"; //do not use bundles unless you want to region-lock the multiplayer experience public static SettingAdder settingAdder = new SettingAdder(); - public static XeloUtil pushUtil = new XeloUtil(); public static MobileFunctions mobileUtil = new MobileFunctions(); public static Seq visibleBlockList = new Seq<>(); //public static UnitGravity gravity = new UnitGravity(); private final ContentList[] mindyContent = { - new OverWriter(), - new MindyStatusEffects(), - new MindyItems(), - new MindyBullets(), - new MindyUnitTypes(), - new MindyBlocks(), - new MindyTechTree(), - new MindyWeathers() + new OverWriter(), + new MindyStatusEffects(), + new MindyItems(), + new MindyBullets(), + new MindyUnitTypes(), + new MindyBlocks(), + new MindyTechTree(), + new MindyWeathers() }; - public BetaMindy() { + public BetaMindy(){ super(); MindySounds.load(); - pushUtil.init(); if(Vars.mobile) mobileUtil.init(); Events.run(DisposeEvent.class, MindySounds::dispose); @@ -75,7 +72,7 @@ public void init(){ //used for block weather Events.run(ClientLoadEvent.class, () -> { - for(Block block : Vars.content.blocks()) { + for(Block block : Vars.content.blocks()){ if((block instanceof ConstructBlock || !block.hasBuilding()) || block.icon(Cicon.medium) == Core.atlas.find("error")) return; visibleBlockList.add(block); } diff --git a/src/betamindy/util/xelo/Movable.java b/src/betamindy/util/xelo/Movable.java index d7965c22..55009f5d 100644 --- a/src/betamindy/util/xelo/Movable.java +++ b/src/betamindy/util/xelo/Movable.java @@ -1,10 +1,10 @@ package betamindy.util.xelo; -import arc.math.geom.Point2; -import arc.util.pooling.Pool; -import mindustry.gen.Building; +import arc.math.geom.*; +import arc.util.pooling.*; +import mindustry.gen.*; -public interface Movable extends Pool.Poolable { +public interface Movable extends Pool.Poolable{ void set(Building building, Point2 direction); diff --git a/src/betamindy/util/xelo/Movables.java b/src/betamindy/util/xelo/Movables.java index 875e1447..eb581329 100644 --- a/src/betamindy/util/xelo/Movables.java +++ b/src/betamindy/util/xelo/Movables.java @@ -1,20 +1,19 @@ package betamindy.util.xelo; -import arc.util.pooling.Pools; -import betamindy.util.xelo.movables.BridgeMovable; -import betamindy.util.xelo.movables.PowerNodeMovable; -import mindustry.gen.Building; -import mindustry.world.blocks.distribution.ItemBridge; -import mindustry.world.blocks.power.PowerNode; +import arc.util.pooling.*; +import betamindy.util.xelo.movables.*; +import mindustry.gen.*; +import mindustry.world.blocks.distribution.*; +import mindustry.world.blocks.power.*; -public class Movables { +public class Movables{ - public static Movable get(Building building) { - if(building instanceof ItemBridge.ItemBridgeBuild) { + public static Movable get(Building building){ + if(building instanceof ItemBridge.ItemBridgeBuild){ // We don't need to check for LiquidBridgeBuild as it extend ItemBridgeBuild return Pools.obtain(BridgeMovable.class, BridgeMovable::new); } - if(building instanceof PowerNode.PowerNodeBuild) { + if(building instanceof PowerNode.PowerNodeBuild){ return Pools.obtain(PowerNodeMovable.class, PowerNodeMovable::new); } diff --git a/src/betamindy/util/xelo/XeloUtil.java b/src/betamindy/util/xelo/XeloUtil.java index bb452abc..dc6a2ae2 100644 --- a/src/betamindy/util/xelo/XeloUtil.java +++ b/src/betamindy/util/xelo/XeloUtil.java @@ -1,44 +1,42 @@ package betamindy.util.xelo; -import arc.func.Boolf; -import arc.math.geom.Point2; -import arc.struct.Seq; -import arc.util.Nullable; -import arc.util.pooling.Pools; -import betamindy.world.blocks.distribution.Piston; -import betamindy.world.blocks.distribution.PistonArm; -import betamindy.world.blocks.distribution.SidedSlimeBlock; -import betamindy.world.blocks.distribution.SlimeBlock; -import betamindy.world.blocks.logic.PushReact; -import mindustry.content.Liquids; -import mindustry.entities.Units; -import mindustry.gen.Building; -import mindustry.world.Block; -import mindustry.world.Tile; -import mindustry.world.blocks.storage.CoreBlock; - -import java.util.PriorityQueue; +import arc.func.*; +import arc.math.geom.*; +import arc.struct.*; +import arc.util.*; +import arc.util.pooling.*; +import betamindy.world.blocks.distribution.*; +import betamindy.world.blocks.logic.*; +import mindustry.content.*; +import mindustry.entities.*; +import mindustry.gen.*; +import mindustry.world.*; +import mindustry.world.blocks.storage.*; + +import java.util.*; import static arc.math.geom.Geometry.d4; import static mindustry.Vars.world; //credit to xelo, modified by me -public class XeloUtil { +public class XeloUtil{ - public Point2[][] origins = new Point2[16][4]; + public static final Point2[][] origins; - public void init() { - for(int size = 1; size <= 16; size++) { + static{ + origins = new Point2[16][4]; + + for(int size = 1; size <= 16; size++){ int originX = 0; int originY = 0; originX += size / 2; originY += size / 2; originY -= (size - 1); - for(int side = 0; side < 4; side++) { + for(int side = 0; side < 4; side++){ int ogx = originX; int ogy = originY; - if(side != 0 && size > 1) { - for(int i = 1; i <= side; i++) { + if(side != 0 && size > 1){ + for(int i = 1; i <= side; i++){ ogx += d4(i).x * (size - 1); ogy += d4(i).y * (size - 1); } @@ -51,45 +49,45 @@ public void init() { /** * returns whether a building is allowed to be pushed. */ - public boolean pushable(Building build) { + public static boolean pushable(Building build){ return !( - build.dead || - (build.block instanceof CoreBlock) || - (build.block instanceof PistonArm) || - ((build.block instanceof Piston) && ((Piston.PistonBuild) build).extended) + build.dead || + (build.block instanceof CoreBlock) || + (build.block instanceof PistonArm) || + ((build.block instanceof Piston) && ((Piston.PistonBuild)build).extended) ); } /** * returns whether a building is allowed to be sticked. */ - public boolean stickable(Building build) { + public static boolean stickable(Building build){ return pushable(build); } /** * returns whether a block is allowed to be on this tile, disregarding existing pushable buildings and team circles */ - public boolean tileAvailableTo(@Nullable Tile tile, Block block) { - if(tile == null) { + public static boolean tileAvailableTo(@Nullable Tile tile, Block block){ + if(tile == null){ return false; } - if(tile.build != null) { + if(tile.build != null){ return pushable(tile.build); } return !( - tile.solid() || - !tile.floor().placeableOn || - (block.requiresWater && tile.floor().liquidDrop != Liquids.water) || - (tile.floor().isDeep() && !block.floating && !block.requiresWater && !block.placeableLiquid) + tile.solid() || + !tile.floor().placeableOn || + (block.requiresWater && tile.floor().liquidDrop != Liquids.water) || + (tile.floor().isDeep() && !block.floating && !block.requiresWater && !block.placeableLiquid) ); } /** * returns whether a tile can be pushed in this direction, disregarding buildings. */ - public boolean canPush(Building build, int direction) { - if(!pushable(build)) { + public static boolean canPush(Building build, int direction){ + if(!pushable(build)){ return false; } @@ -97,9 +95,9 @@ public boolean canPush(Building build, int direction) { Point2 dir = d4(direction); Point2 origin = origins[build.block.size - 1][direction]; - for(int i = 0; i < build.block.size; i++) { // iterate over forward edge. + for(int i = 0; i < build.block.size; i++){ // iterate over forward edge. Tile tile = build.tile.nearby(origin.x + tangent.x * i + dir.x, origin.y + tangent.y * i + dir.y); - if(!tileAvailableTo(tile, build.block)) { + if(!tileAvailableTo(tile, build.block)){ return false; } } @@ -109,31 +107,30 @@ public boolean canPush(Building build, int direction) { /** * pushes units in front of a a single building. - * - * @param build the building to be pushed. + * @param build the building to be pushed. * @param direction number from 0-4 same direction as the block rotation to push the building in. */ - public void pushUnits(Building build, int direction) { + public static void pushUnits(Building build, int direction){ Point2 dir = d4(direction); float ox = dir.x * (build.block.size * 4f + 4f); float oy = dir.y * (build.block.size * 4f + 4f); //grounded units don't experience impulses anyway //boolean bouncy = ((build.block instanceof SlimeBlock) && (!build.block.rotate || build.rotation == direction)); - if(direction % 2 == 0) { + if(direction % 2 == 0){ //tall rectangle float dr = dir.x; Units.nearby(build.x + ox - 4f, build.y + oy - build.block.size * 4f, 8f, build.block.size * 8f, u -> { - if(!u.isFlying() && u.x >= build.x + ox - 4f && u.x <= build.x + ox + 4f) { + if(!u.isFlying() && u.x >= build.x + ox - 4f && u.x <= build.x + ox + 4f){ u.move(build.x + dr * (3.8f + build.block.size * 4f + 8f) - u.x, 0f); //if(bouncy) u.impulse(dr * 40f, 0f); } }); - }else { + }else{ //wide rectangle float dr = dir.y; Units.nearby(build.x + ox - build.block.size * 4f, build.y + oy - 4f, build.block.size * 8f, 8f, u -> { - if(!u.isFlying() && u.y >= build.y + oy - 4f && u.y <= build.y + oy + 4f) { + if(!u.isFlying() && u.y >= build.y + oy - 4f && u.y <= build.y + oy + 4f){ u.move(0f, build.y + dr * (3.8f + build.block.size * 4f + 8f) - u.y); //if(bouncy) u.impulse(0f, dr * 40f); } @@ -154,14 +151,13 @@ public void pushUnits(Building build, int direction) { * update building * } * - * - * @param build the building to be pushed. DO NOT CALL FROM WITHIN THE BUILDING. + * @param build the building to be pushed. DO NOT CALL FROM WITHIN THE BUILDING. * @param direction number from 0-4 same direction as the block rotation to push the building in. * @return if the building has been moved */ - public boolean pushSingle(Building build, int direction) { + public static boolean pushSingle(Building build, int direction){ //don't move the core. >:( BAD BAD BAD BAD - if(build.block instanceof CoreBlock) { + if(build.block instanceof CoreBlock){ return false; } @@ -184,14 +180,14 @@ public boolean pushSingle(Building build, int direction) { world.tile(bx + dir.x, by + dir.y).setBlock(build.block, build.team, build.rotation, () -> build); - if(build instanceof PushReact) { - ((PushReact) build).pushed(direction); + if(build instanceof PushReact){ + ((PushReact)build).pushed(direction); } return true; } //projection of the block's leading edge along a direction. - private int project(Building build, int direction) { + private static int project(Building build, int direction){ Point2 dir = d4(direction); return (origins[build.block.size - 1][direction].x + build.tile.x) * dir.x + (origins[build.block.size - 1][direction].y + build.tile.y) * dir.y; } @@ -199,16 +195,15 @@ private int project(Building build, int direction) { /** * Gets all buildings connected to each other in the push direction sorted. * If group cannot be pushed because its too large or an unpushable block exists it returns null. - * - * @param root the building to be scanned from - * @param direction number from 0-4 same direction as the block rotation to push the building in. - * @param max max number of blocks to scan - * @param pushFilter Boolf consumer as a custom selection criteria for pushing. + * @param root the building to be scanned from + * @param direction number from 0-4 same direction as the block rotation to push the building in. + * @param max max number of blocks to scan + * @param pushFilter Boolf consumer as a custom selection criteria for pushing. * @param stickFilter Boolf consumer as a custom selection criteria for sticking. */ @Nullable - public Seq getAllContacted(Building root, int direction, int max, Boolf pushFilter, - Boolf stickFilter) { + public static Seq getAllContacted(Building root, int direction, int max, Boolf pushFilter, + Boolf stickFilter){ PriorityQueue queue = new PriorityQueue<>(10, (a, b) -> { //require ordering to be projection of the block's leading edge along push direction. return Math.round(project(a, direction) - project(b, direction)); @@ -218,41 +213,43 @@ public Seq getAllContacted(Building root, int direction, int max, Bool queue.add(root); boolean dirty = false; - Point2 tangent = d4(direction + 1); Point2 dir = d4(direction); - while(!queue.isEmpty() && contacts.size <= max) { + while(!queue.isEmpty() && contacts.size <= max){ Building next = queue.poll(); contacts.add(next); + Point2 tangent = d4(direction + 1); Point2 origin = origins[next.block.size - 1][direction]; - if(next.block instanceof SlimeBlock) { + if(next.block instanceof SlimeBlock){ // iterate over forward edge. - for(int i = 0; i < next.block.size; i++) { - Tile t = next.tile.nearby(origin.x + tangent.x * i + dir.x, origin.y + tangent.y * i + dir.y); - if(t == null) return null; - Building b = t.build; - if(b == null || queue.contains(b) || contacts.contains(b)) { + for(int i = 0; i < next.block.size; i++){ + Tile tile = next.tile.nearby(origin.x + tangent.x * i + dir.x, origin.y + tangent.y * i + dir.y); + if(tile == null){ + return null; + } + Building build = tile.build; + if(build == null || queue.contains(build) || contacts.contains(build)){ continue; } - if(!pushable(b) || !pushFilter.get(b)) { + if(!pushable(build) || !pushFilter.get(build)){ return null; // if a single block cannot be pushed then the entire group cannot be pushed from the root. } - queue.add(b); + queue.add(build); } - if(next.block instanceof SidedSlimeBlock) { + if(next.block instanceof SidedSlimeBlock){ // if sided, do the sticky on one side int td = next.rotation; - if(td != direction) { + if(td != direction){ tangent = d4((td + 1) % 4); origin = origins[next.block.size - 1][td]; - for(int i = 0; i < next.block.size; i++) { + for(int i = 0; i < next.block.size; i++){ Tile t = next.tile.nearby(origin.x + tangent.x * i + d4(td).x, origin.y + tangent.y * i + d4(td).y); if(t == null) continue; Building b = t.build; - if(b == null || queue.contains(b) || contacts.contains(b)) { + if(b == null || queue.contains(b) || contacts.contains(b)){ continue; } - if(!stickable(b) || !stickFilter.get(b) || !pushFilter.get(b)) { + if(!stickable(b) || !stickFilter.get(b) || !pushFilter.get(b)){ continue; // ignore blocks that refuse to stick. } // contacts is not ordered; sort at the end @@ -260,21 +257,21 @@ public Seq getAllContacted(Building root, int direction, int max, Bool queue.add(b); } } - }else { + }else{ // if sticky, iterate over all 4 edges, but for 3 sides, ignore non-sticky blocks - for(int k = 0; k < 3; k++) { + for(int k = 0; k < 3; k++){ // iterate over a side edge int td = (direction + k + 1) % 4; tangent = d4((td + 1) % 4); origin = origins[next.block.size - 1][td]; - for(int i = 0; i < next.block.size; i++) { + for(int i = 0; i < next.block.size; i++){ Tile t = next.tile.nearby(origin.x + tangent.x * i + d4(td).x, origin.y + tangent.y * i + d4(td).y); if(t == null) continue; Building b = t.build; - if(b == null || queue.contains(b) || contacts.contains(b)) { + if(b == null || queue.contains(b) || contacts.contains(b)){ continue; } - if(!stickable(b) || !stickFilter.get(b) || !pushFilter.get(b)) { + if(!stickable(b) || !stickFilter.get(b) || !pushFilter.get(b)){ continue; // ignore blocks that refuse to stick. } // contacts is not ordered; sort at the end @@ -284,28 +281,28 @@ public Seq getAllContacted(Building root, int direction, int max, Bool } } } - }else { + }else{ // iterate over forward edge. - for(int i = 0; i < next.block.size; i++) { + for(int i = 0; i < next.block.size; i++){ Tile t = next.tile.nearby(origin.x + tangent.x * i + dir.x, origin.y + tangent.y * i + dir.y); if(t == null) return null; Building b = t.build; - if(b == null || queue.contains(b) || contacts.contains(b)) { + if(b == null || queue.contains(b) || contacts.contains(b)){ continue; } - if(!pushable(b) || !pushFilter.get(b)) { + if(!pushable(b) || !pushFilter.get(b)){ return null; // if a single block cannot be pushed then the entire group cannot be pushed from the root. } queue.add(b); } } } - if(contacts.size <= max) { - if(dirty) { + if(contacts.size <= max){ + if(dirty){ contacts.sort((a, b) -> Math.round(project(a, direction) - project(b, direction))); } return contacts; - }else { + }else{ return null; } } @@ -313,14 +310,14 @@ public Seq getAllContacted(Building root, int direction, int max, Bool /** * Pushes a single building and pushes all blocks behind the pushed block, unlike the previous. */ - public boolean pushBlock(Building build, int direction, int maxBlocks, Boolf pushFilter, Boolf stickFilter) { + public static boolean pushBlock(Building build, int direction, int maxBlocks, Boolf pushFilter, Boolf stickFilter){ Seq pushing = getAllContacted(build, direction, maxBlocks, pushFilter, stickFilter); - if(pushing == null) { + if(pushing == null){ return false; } //scan in reverse - for(int i = pushing.size - 1; i >= 0; i--) { - if(!canPush(pushing.get(i), direction)) { + for(int i = pushing.size - 1; i >= 0; i--){ + if(!canPush(pushing.get(i), direction)){ return false; } } @@ -329,12 +326,12 @@ public boolean pushBlock(Building build, int direction, int maxBlocks, Boolf movables = new Seq<>(); - for(int i = pushing.size - 1; i >= 0; i--) { + for(int i = pushing.size - 1; i >= 0; i--){ Building building = pushing.get(i); Movable movable = Movables.get(building); - if(movable != null) { + if(movable != null){ movables.add(movable); movable.set(building, dir); @@ -342,12 +339,12 @@ public boolean pushBlock(Building build, int direction, int maxBlocks, Boolf pushBool = b -> !(b.block == Blocks.thoriumWall || b.block == Blocks.thoriumWallLarge); + public final Boolf stickBool = b -> !(b.block == Blocks.phaseWall || b.block == Blocks.phaseWallLarge); public boolean sticky; public int maxBlocks = 16; - public Block armBlock; public TextureRegion armRegion, shaftRegion; public TextureRegion[] baseRegion = new TextureRegion[4]; public Sound pushSound = MindySounds.pistonPush, pullSound = MindySounds.pistonPull; - - public static final float extendTicks = 8f; - public final Boolf pushBool = b -> !(b.block == Blocks.thoriumWall || b.block == Blocks.thoriumWallLarge); - public final Boolf stickBool = b -> !(b.block == Blocks.phaseWall || b.block == Blocks.phaseWallLarge); - public String armSprite, baseSprite; public float pushVolume = 0.4f; @@ -65,12 +58,12 @@ public void load(){ super.load(); armRegion = atlas.find(armSprite); shaftRegion = atlas.find(name + "-shaft", "betamindy-piston-shaft"); - for(int i = 0; i<4; i++){ + for(int i = 0; i < 4; i++){ baseRegion[i] = atlas.find(baseSprite + "-" + i, "betamindy-piston-" + i); } } - public class PistonBuild extends Building { + public class PistonBuild extends Building{ public boolean extended; //public float heat; //takes 8 ticks to extend protected Interval heatTimer = new Interval(1); @@ -82,52 +75,32 @@ public boolean isIdle(){ public boolean canExtend(){ return isIdle() && tile.nearby(rotation) != null; } + public boolean canRetract(){ return isIdle() && tile.nearby(rotation) != null; } - /* - public boolean canPush(Block block){ - if(!block.update || !block.synthetic()) return false; - if(block instanceof PistonArm) return false; - return true; - } - public boolean canPull(Block block){ - return canPush(block) && true; - } - - /* Tries to push a single given building - public void pushBuild(Building tile, int r){ - Tile e = tile.tile.nearby(r); - //if(e.block() != Blocks.air) return; - - - //tile.pickedUp(); - int rot = tile.rotation; - tile.tile.remove(); - BuildPayload pay = new BuildPayload(tile); - pay.place(e, rot); - } - public void pullBuild(Building tile, int r){ - pushBuild(tile, (r + 2) % 4); - } - */ - - /** Tries to push blocks and returns its success*/ + /** + * Tries to push blocks and returns its success + */ public boolean push(){ if(tile.nearby(rotation) == null) return false; if(tile.nearbyBuild(rotation) == null) return tile.nearby(rotation).block() == Blocks.air; if(!pushBool.get(tile.nearbyBuild(rotation))) return false; - return BetaMindy.pushUtil.pushBlock(tile.nearbyBuild(rotation), rotation, maxBlocks, b -> (b != this && pushBool.get(b)), stickBool); + + return XeloUtil.pushBlock(tile.nearbyBuild(rotation), rotation, maxBlocks, b -> (b != this && pushBool.get(b)), stickBool); } - /** Tries to pull blocks and returns its success*/ + + /** + * Tries to pull blocks and returns its success + */ public boolean pull(){ if(tile.nearby(rotation) == null || tile.nearby(rotation).nearbyBuild(rotation) == null) return true; if(tile.nearby(rotation).block() == armBlock) tile.nearby(rotation).remove(); Building pullb = tile.nearby(rotation).nearbyBuild(rotation); if(!stickBool.get(pullb) || !pushBool.get(pullb)) return true; //does not care if it actually succeeds to push - BetaMindy.pushUtil.pushBlock(pullb, (rotation + 2) % 4, maxBlocks, b -> (b != this && pushBool.get(b)), stickBool); + XeloUtil.pushBlock(pullb, (rotation + 2) % 4, maxBlocks, b -> (b != this && pushBool.get(b)), stickBool); return true; } @@ -135,18 +108,20 @@ public void extendArm(){ extended = push(); if(extended){ heatTimer.reset(0, 0); - BetaMindy.pushUtil._pushUnits(this, rotation); + XeloUtil.pushUnits(this, rotation); tile.nearby(rotation).setBlock(armBlock, team, (rotation + 2) % 4); ((PistonArmBuild)tile.nearbyBuild(rotation)).piston = this; pushSound.at(x, y, 1f, pushVolume); } } + public void retract(){ if(sticky) extended = !pull(); else extended = false; if(!extended){ heatTimer.reset(0, 0); - if(tile.nearby(rotation) != null && tile.nearby(rotation).block() == armBlock) tile.nearby(rotation).remove(); + if(tile.nearby(rotation) != null && tile.nearby(rotation).block() == armBlock) + tile.nearby(rotation).remove(); pullSound.at(x, y, 1f, pushVolume); } } @@ -155,8 +130,7 @@ public void retract(){ public void updateTile(){ if(extended){ if(!consValid() && canRetract()) retract(); - } - else{ + }else{ if(consValid() && canExtend()) extendArm(); } } @@ -165,7 +139,8 @@ public void updateTile(){ public void draw(){ float heat = Math.min(extendTicks, heatTimer.getTime(0)) / extendTicks; if(!extended) heat = 1f - heat; - if(heat > 0.5f) Draw.rect(shaftRegion, x + heat * Geometry.d4x[rotation] * tilesize, y + heat * Geometry.d4y[rotation] * tilesize, rotation * 90f); + if(heat > 0.5f) + Draw.rect(shaftRegion, x + heat * Geometry.d4x[rotation] * tilesize, y + heat * Geometry.d4y[rotation] * tilesize, rotation * 90f); Draw.rect(armRegion, x + heat * Geometry.d4x[rotation] * tilesize, y + heat * Geometry.d4y[rotation] * tilesize, rotation * 90f); Draw.rect(baseRegion[rotation], x, y); } @@ -174,7 +149,7 @@ public void draw(){ public void read(Reads read, byte revision){ super.read(read); extended = read.bool(); - heatTimer.reset(0, (float)read.b()); + heatTimer.reset(0, read.b()); } @Override @@ -188,5 +163,7 @@ public void write(Writes write){ public boolean conductsTo(Building other){ return tile.nearbyBuild(rotation) != other && super.conductsTo(other); } + } -} \ No newline at end of file + +} diff --git a/src/betamindy/world/blocks/logic/PushReact.java b/src/betamindy/world/blocks/logic/PushReact.java index bba7be2f..93833570 100644 --- a/src/betamindy/world/blocks/logic/PushReact.java +++ b/src/betamindy/world/blocks/logic/PushReact.java @@ -1,6 +1,10 @@ package betamindy.world.blocks.logic; -/** Reacts when pushed (or pulled) by pistons. */ -public interface PushReact { +/** + * Reacts when pushed (or pulled) by pistons. + */ +public interface PushReact{ + void pushed(int dir); + }