From 91552a3a2bbfe8bb7bf8b12fd2805f7b8de0191a Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 8 Aug 2018 12:22:47 -0400 Subject: [PATCH] Various bugfixes --- .../io/anuke/mindustry/content/blocks/CraftingBlocks.java | 4 ++-- core/src/io/anuke/mindustry/graphics/MinimapRenderer.java | 2 +- core/src/io/anuke/mindustry/maps/Sectors.java | 2 +- core/src/io/anuke/mindustry/net/Packets.java | 2 +- core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java | 2 +- core/src/io/anuke/mindustry/world/ColorMapper.java | 6 +++++- .../anuke/mindustry/world/blocks/distribution/Conveyor.java | 2 +- core/src/io/anuke/mindustry/world/blocks/units/UnitPad.java | 2 +- ios/robovm.xml | 1 + server/src/io/anuke/mindustry/server/ServerControl.java | 3 ++- 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index 9a7a9fdabd..c8e7a9f40d 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -21,11 +21,11 @@ public class CraftingBlocks extends BlockList implements ContentList{ health = 70; result = Items.carbide; craftTime = 45f; - burnDuration = 45f; + burnDuration = 46f; useFlux = true; consumes.items(new ItemStack[]{new ItemStack(Items.tungsten, 3)}); - consumes.item(Items.coal); + consumes.item(Items.coal).optional(true); }}; arcsmelter = new PowerSmelter("arc-smelter"){{ diff --git a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java index 8386538d65..89bb5ede2f 100644 --- a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java @@ -144,7 +144,7 @@ public class MinimapRenderer implements Disposable{ private int colorFor(Tile tile){ tile = tile.target(); - return ColorMapper.colorFor(tile.floor(), tile.block(), tile.getTeam(), tile.getElevation()); + return ColorMapper.colorFor(tile.floor(), tile.block(), tile.getTeam(), tile.getElevation(), tile.getCliffs()); } @Override diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index 94087161fb..0bcdbffee9 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -182,7 +182,7 @@ public class Sectors{ GenResult result = world.generator().generateTile(sector.x, sector.y, toX, toY, false); - int color = ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation); + int color = ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation, (byte)0); pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color); } } diff --git a/core/src/io/anuke/mindustry/net/Packets.java b/core/src/io/anuke/mindustry/net/Packets.java index e42e26f73b..1e77dce5d8 100644 --- a/core/src/io/anuke/mindustry/net/Packets.java +++ b/core/src/io/anuke/mindustry/net/Packets.java @@ -22,7 +22,7 @@ import static io.anuke.mindustry.Vars.world; public class Packets{ public enum KickReason{ - kick, invalidPassword, clientOutdated, serverOutdated, banned, gameover(true), recentKick, nameInUse, idInUse, fastShoot, nameEmpty, customClient; + kick, invalidPassword, clientOutdated, serverOutdated, banned, gameover(true), recentKick, nameInUse, idInUse, fastShoot, nameEmpty, customClient, sectorComplete(true); public final boolean quiet; KickReason(){ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java index 830f2003b4..622f22f646 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java @@ -82,7 +82,7 @@ public class GenViewDialog extends FloatingDialog{ for(int i = 0; i < sectorSize; i++){ for(int j = 0; j < sectorSize; j++){ world.generator().generateTile(result, wx, wy, i, j, true, null); - pixmap.drawPixel(i, sectorSize - 1 - j, ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation)); + pixmap.drawPixel(i, sectorSize - 1 - j, ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation, (byte)0)); } } Gdx.app.postRunnable(() -> map.put(wx, wy, new Texture(pixmap))); diff --git a/core/src/io/anuke/mindustry/world/ColorMapper.java b/core/src/io/anuke/mindustry/world/ColorMapper.java index 20d0067f58..83e3cbbd82 100644 --- a/core/src/io/anuke/mindustry/world/ColorMapper.java +++ b/core/src/io/anuke/mindustry/world/ColorMapper.java @@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.ObjectIntMap; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.type.ContentList; +import io.anuke.ucore.util.Mathf; public class ColorMapper implements ContentList{ private static IntMap blockMap = new IntMap<>(); @@ -21,7 +22,7 @@ public class ColorMapper implements ContentList{ return colorMap.get(block, 0); } - public static int colorFor(Block floor, Block wall, Team team, int elevation){ + public static int colorFor(Block floor, Block wall, Team team, int elevation, byte cliffs){ if(wall.synthetic()){ return team.intColor; } @@ -33,6 +34,9 @@ public class ColorMapper implements ContentList{ tmpColor.set(color); float maxMult = 1f/Math.max(Math.max(tmpColor.r, tmpColor.g), tmpColor.b) ; float mul = Math.min(1.1f + elevation / 4f, maxMult); + if((cliffs & Mathf.pow2(6)) != 0){ + mul -= 0.5f; + } tmpColor.mul(mul, mul, mul, 1f); color = Color.rgba8888(tmpColor); } diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java index b8373fc3b7..53bace015a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/Conveyor.java @@ -305,7 +305,7 @@ public class Conveyor extends Block{ @Override public synchronized int acceptStack(Item item, int amount, Tile tile, Unit source){ ConveyorEntity entity = tile.entity(); - return (int)(entity.minitem / itemSpace); + return Math.min((int)(entity.minitem / itemSpace), amount); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/units/UnitPad.java b/core/src/io/anuke/mindustry/world/blocks/units/UnitPad.java index dbfb60dcb3..40f241a84d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/UnitPad.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/UnitPad.java @@ -38,7 +38,7 @@ import java.io.DataOutputStream; import java.io.IOException; public class UnitPad extends Block{ - protected float gracePeriodMultiplier = 16f; + protected float gracePeriodMultiplier = 19f; protected float speedupTime = 60f * 60f * 19; protected float maxSpeedup = 7f; diff --git a/ios/robovm.xml b/ios/robovm.xml index 31ffe9e1f2..851c59da6f 100644 --- a/ios/robovm.xml +++ b/ios/robovm.xml @@ -19,6 +19,7 @@ io.anuke.ucore.scene.** + io.anuke.mindustry.gen.Call io.anuke.mindustry.net.** com.android.okhttp.HttpHandler com.android.okhttp.HttpsHandler diff --git a/server/src/io/anuke/mindustry/server/ServerControl.java b/server/src/io/anuke/mindustry/server/ServerControl.java index bbf42811e3..8c52ba2314 100644 --- a/server/src/io/anuke/mindustry/server/ServerControl.java +++ b/server/src/io/anuke/mindustry/server/ServerControl.java @@ -41,7 +41,8 @@ public class ServerControl extends Module{ Settings.defaultList( "shufflemode", "normal", "bans", "", - "admins", "" + "admins", "", + "sectorid", 0 ); mode = ShuffleMode.valueOf(Settings.getString("shufflemode"));