mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 09:47:24 +07:00
Various bugfixes
This commit is contained in:
@ -21,11 +21,11 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
health = 70;
|
health = 70;
|
||||||
result = Items.carbide;
|
result = Items.carbide;
|
||||||
craftTime = 45f;
|
craftTime = 45f;
|
||||||
burnDuration = 45f;
|
burnDuration = 46f;
|
||||||
useFlux = true;
|
useFlux = true;
|
||||||
|
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.tungsten, 3)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.tungsten, 3)});
|
||||||
consumes.item(Items.coal);
|
consumes.item(Items.coal).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
arcsmelter = new PowerSmelter("arc-smelter"){{
|
arcsmelter = new PowerSmelter("arc-smelter"){{
|
||||||
|
@ -144,7 +144,7 @@ public class MinimapRenderer implements Disposable{
|
|||||||
|
|
||||||
private int colorFor(Tile tile){
|
private int colorFor(Tile tile){
|
||||||
tile = tile.target();
|
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
|
@Override
|
||||||
|
@ -182,7 +182,7 @@ public class Sectors{
|
|||||||
|
|
||||||
GenResult result = world.generator().generateTile(sector.x, sector.y, toX, toY, false);
|
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);
|
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ import static io.anuke.mindustry.Vars.world;
|
|||||||
public class Packets{
|
public class Packets{
|
||||||
|
|
||||||
public enum KickReason{
|
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;
|
public final boolean quiet;
|
||||||
|
|
||||||
KickReason(){
|
KickReason(){
|
||||||
|
@ -82,7 +82,7 @@ public class GenViewDialog extends FloatingDialog{
|
|||||||
for(int i = 0; i < sectorSize; i++){
|
for(int i = 0; i < sectorSize; i++){
|
||||||
for(int j = 0; j < sectorSize; j++){
|
for(int j = 0; j < sectorSize; j++){
|
||||||
world.generator().generateTile(result, wx, wy, i, j, true, null);
|
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)));
|
Gdx.app.postRunnable(() -> map.put(wx, wy, new Texture(pixmap)));
|
||||||
|
@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.ObjectIntMap;
|
|||||||
import io.anuke.mindustry.game.Content;
|
import io.anuke.mindustry.game.Content;
|
||||||
import io.anuke.mindustry.game.Team;
|
import io.anuke.mindustry.game.Team;
|
||||||
import io.anuke.mindustry.type.ContentList;
|
import io.anuke.mindustry.type.ContentList;
|
||||||
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class ColorMapper implements ContentList{
|
public class ColorMapper implements ContentList{
|
||||||
private static IntMap<Block> blockMap = new IntMap<>();
|
private static IntMap<Block> blockMap = new IntMap<>();
|
||||||
@ -21,7 +22,7 @@ public class ColorMapper implements ContentList{
|
|||||||
return colorMap.get(block, 0);
|
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()){
|
if(wall.synthetic()){
|
||||||
return team.intColor;
|
return team.intColor;
|
||||||
}
|
}
|
||||||
@ -33,6 +34,9 @@ public class ColorMapper implements ContentList{
|
|||||||
tmpColor.set(color);
|
tmpColor.set(color);
|
||||||
float maxMult = 1f/Math.max(Math.max(tmpColor.r, tmpColor.g), tmpColor.b) ;
|
float maxMult = 1f/Math.max(Math.max(tmpColor.r, tmpColor.g), tmpColor.b) ;
|
||||||
float mul = Math.min(1.1f + elevation / 4f, maxMult);
|
float mul = Math.min(1.1f + elevation / 4f, maxMult);
|
||||||
|
if((cliffs & Mathf.pow2(6)) != 0){
|
||||||
|
mul -= 0.5f;
|
||||||
|
}
|
||||||
tmpColor.mul(mul, mul, mul, 1f);
|
tmpColor.mul(mul, mul, mul, 1f);
|
||||||
color = Color.rgba8888(tmpColor);
|
color = Color.rgba8888(tmpColor);
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ public class Conveyor extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public synchronized int acceptStack(Item item, int amount, Tile tile, Unit source){
|
public synchronized int acceptStack(Item item, int amount, Tile tile, Unit source){
|
||||||
ConveyorEntity entity = tile.entity();
|
ConveyorEntity entity = tile.entity();
|
||||||
return (int)(entity.minitem / itemSpace);
|
return Math.min((int)(entity.minitem / itemSpace), amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,7 +38,7 @@ import java.io.DataOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class UnitPad extends Block{
|
public class UnitPad extends Block{
|
||||||
protected float gracePeriodMultiplier = 16f;
|
protected float gracePeriodMultiplier = 19f;
|
||||||
protected float speedupTime = 60f * 60f * 19;
|
protected float speedupTime = 60f * 60f * 19;
|
||||||
protected float maxSpeedup = 7f;
|
protected float maxSpeedup = 7f;
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
</resources>
|
</resources>
|
||||||
<forceLinkClasses>
|
<forceLinkClasses>
|
||||||
<pattern>io.anuke.ucore.scene.**</pattern>
|
<pattern>io.anuke.ucore.scene.**</pattern>
|
||||||
|
<pattern>io.anuke.mindustry.gen.Call</pattern>
|
||||||
<pattern>io.anuke.mindustry.net.**</pattern>
|
<pattern>io.anuke.mindustry.net.**</pattern>
|
||||||
<pattern>com.android.okhttp.HttpHandler</pattern>
|
<pattern>com.android.okhttp.HttpHandler</pattern>
|
||||||
<pattern>com.android.okhttp.HttpsHandler</pattern>
|
<pattern>com.android.okhttp.HttpsHandler</pattern>
|
||||||
|
@ -41,7 +41,8 @@ public class ServerControl extends Module{
|
|||||||
Settings.defaultList(
|
Settings.defaultList(
|
||||||
"shufflemode", "normal",
|
"shufflemode", "normal",
|
||||||
"bans", "",
|
"bans", "",
|
||||||
"admins", ""
|
"admins", "",
|
||||||
|
"sectorid", 0
|
||||||
);
|
);
|
||||||
|
|
||||||
mode = ShuffleMode.valueOf(Settings.getString("shufflemode"));
|
mode = ShuffleMode.valueOf(Settings.getString("shufflemode"));
|
||||||
|
Reference in New Issue
Block a user