Bugfixes
This commit is contained in:
@@ -40,9 +40,10 @@ public class Vars{
|
|||||||
/** URL for Github API for releases */
|
/** URL for Github API for releases */
|
||||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||||
/** URL for Github API for contributors */
|
/** URL for Github API for contributors */
|
||||||
|
//TODO remove and replace with a manually updated list
|
||||||
public static final String contributorsURL = "https://api.github.com/repos/Anuken/Mindustry/contributors";
|
public static final String contributorsURL = "https://api.github.com/repos/Anuken/Mindustry/contributors";
|
||||||
/** URL for sending crash reports to */
|
/** URL for sending crash reports to */
|
||||||
public static final String crashReportURL = "http://mindustry.us.to/report";
|
public static final String crashReportURL = "http://mins.us.to/report";
|
||||||
/** maximum distance between mine and core that supports automatic transferring */
|
/** maximum distance between mine and core that supports automatic transferring */
|
||||||
public static final float mineTransferRange = 220f;
|
public static final float mineTransferRange = 220f;
|
||||||
/** team of the player by default */
|
/** team of the player by default */
|
||||||
|
|||||||
@@ -201,8 +201,8 @@ public class Control implements ApplicationListener{
|
|||||||
public void playMap(Map map, Rules rules){
|
public void playMap(Map map, Rules rules){
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
logic.reset();
|
logic.reset();
|
||||||
state.rules = rules;
|
|
||||||
world.loadMap(map);
|
world.loadMap(map);
|
||||||
|
state.rules = rules;
|
||||||
logic.play();
|
logic.play();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -782,6 +782,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
|||||||
moveTarget = null;
|
moveTarget = null;
|
||||||
spawner = lastSpawner = null;
|
spawner = lastSpawner = null;
|
||||||
health = maxHealth();
|
health = maxHealth();
|
||||||
|
mining = null;
|
||||||
boostHeat = drownTime = hitTime = 0f;
|
boostHeat = drownTime = hitTime = 0f;
|
||||||
mech = Mechs.starter;
|
mech = Mechs.starter;
|
||||||
placeQueue.clear();
|
placeQueue.clear();
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
|
|||||||
Events.on(BuildSelectEvent.class, event -> {
|
Events.on(BuildSelectEvent.class, event -> {
|
||||||
EntityGroup<BaseUnit> group = unitGroups[event.team.ordinal()];
|
EntityGroup<BaseUnit> group = unitGroups[event.team.ordinal()];
|
||||||
|
|
||||||
if(!(event.builder instanceof Player) || !(event.tile.entity instanceof BuildEntity)) return;
|
if(!(event.tile.entity instanceof BuildEntity)) return;
|
||||||
|
|
||||||
for(BaseUnit unit : group.all()){
|
for(BaseUnit unit : group.all()){
|
||||||
if(unit instanceof Drone){
|
if(unit instanceof Drone){
|
||||||
|
|||||||
@@ -199,12 +199,6 @@ public abstract class InputHandler implements InputProcessor{
|
|||||||
frag.inv.hide();
|
frag.inv.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!consumed && player.isBuilding()){
|
|
||||||
player.clearBuilding();
|
|
||||||
block = null;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return consumed;
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class LegacyMapIO{
|
|||||||
tile.setOverlay(block);
|
tile.setOverlay(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(namemap.get(id).equals("part")){
|
if(namemap.get(id, "").equals("part")){
|
||||||
stream.readByte(); //link
|
stream.readByte(); //link
|
||||||
}else if(tile.entity != null){
|
}else if(tile.entity != null){
|
||||||
byte tr = stream.readByte();
|
byte tr = stream.readByte();
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public class TypeIO{
|
|||||||
@ReadClass(Liquid.class)
|
@ReadClass(Liquid.class)
|
||||||
public static Liquid readLiquid(ByteBuffer buffer){
|
public static Liquid readLiquid(ByteBuffer buffer){
|
||||||
short id = buffer.getShort();
|
short id = buffer.getShort();
|
||||||
return id == -1 ? null : content.liquid(buffer.getShort());
|
return id == -1 ? null : content.liquid(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WriteClass(BulletType.class)
|
@WriteClass(BulletType.class)
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import io.anuke.arc.Core;
|
|||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.entities.Entities;
|
import io.anuke.mindustry.entities.Entities;
|
||||||
import io.anuke.mindustry.entities.type.Player;
|
import io.anuke.mindustry.entities.type.Player;
|
||||||
|
import io.anuke.mindustry.game.Rules;
|
||||||
import io.anuke.mindustry.game.Version;
|
import io.anuke.mindustry.game.Version;
|
||||||
import io.anuke.mindustry.gen.Serialization;
|
import io.anuke.mindustry.io.JsonIO;
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
import io.anuke.mindustry.maps.Map;
|
import io.anuke.mindustry.maps.Map;
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ public class NetworkIO{
|
|||||||
public static void writeWorld(Player player, OutputStream os){
|
public static void writeWorld(Player player, OutputStream os){
|
||||||
|
|
||||||
try(DataOutputStream stream = new DataOutputStream(os)){
|
try(DataOutputStream stream = new DataOutputStream(os)){
|
||||||
Serialization.writeRules(stream, state.rules);
|
stream.writeUTF(JsonIO.write(state.rules));
|
||||||
SaveIO.getSaveWriter().writeStringMap(stream, world.getMap().tags);
|
SaveIO.getSaveWriter().writeStringMap(stream, world.getMap().tags);
|
||||||
|
|
||||||
stream.writeInt(state.wave);
|
stream.writeInt(state.wave);
|
||||||
@@ -39,7 +40,7 @@ public class NetworkIO{
|
|||||||
|
|
||||||
try(DataInputStream stream = new DataInputStream(is)){
|
try(DataInputStream stream = new DataInputStream(is)){
|
||||||
Time.clear();
|
Time.clear();
|
||||||
state.rules = Serialization.readRules(stream);
|
state.rules = JsonIO.read(Rules.class, stream.readUTF());
|
||||||
world.setMap(new Map(SaveIO.getSaveWriter().readStringMap(stream)));
|
world.setMap(new Map(SaveIO.getSaveWriter().readStringMap(stream)));
|
||||||
|
|
||||||
state.wave = stream.readInt();
|
state.wave = stream.readInt();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world;
|
package io.anuke.mindustry.world;
|
||||||
|
|
||||||
|
import io.anuke.annotations.Annotations.CallSuper;
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.Graphics.Cursor;
|
import io.anuke.arc.Graphics.Cursor;
|
||||||
import io.anuke.arc.Graphics.Cursor.SystemCursor;
|
import io.anuke.arc.Graphics.Cursor.SystemCursor;
|
||||||
@@ -313,6 +314,7 @@ public class Block extends BlockStorage{
|
|||||||
|
|
||||||
/** Called after all blocks are created. */
|
/** Called after all blocks are created. */
|
||||||
@Override
|
@Override
|
||||||
|
@CallSuper
|
||||||
public void init(){
|
public void init(){
|
||||||
//initialize default health based on size
|
//initialize default health based on size
|
||||||
if(health == -1){
|
if(health == -1){
|
||||||
|
|||||||
@@ -58,6 +58,12 @@ public class GenericCrafter extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(){
|
||||||
|
outputsLiquid = outputLiquid != null;
|
||||||
|
super.init();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
if(drawer == null){
|
if(drawer == null){
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class LiquidSource extends Block{
|
|||||||
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
@Remote(targets = Loc.both, called = Loc.both, forward = true)
|
||||||
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
|
public static void setLiquidSourceLiquid(Player player, Tile tile, Liquid liquid){
|
||||||
LiquidSourceEntity entity = tile.entity();
|
LiquidSourceEntity entity = tile.entity();
|
||||||
entity.source = liquid;
|
if(entity != null) entity.source = liquid;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LiquidSourceEntity extends TileEntity{
|
class LiquidSourceEntity extends TileEntity{
|
||||||
|
|||||||
Reference in New Issue
Block a user