Fixed unit tests
This commit is contained in:
@@ -123,7 +123,7 @@ public class Control implements ApplicationListener{
|
||||
}
|
||||
});
|
||||
|
||||
//autohost for pvp sectors
|
||||
//autohost for pvp maps
|
||||
Events.on(WorldLoadEvent.class, event -> {
|
||||
if(state.rules.pvp && !Net.active()){
|
||||
try{
|
||||
|
||||
@@ -85,13 +85,11 @@ public class World implements ApplicationListener{
|
||||
return tiles == null ? 0 : tiles[0].length;
|
||||
}
|
||||
|
||||
public @Nullable
|
||||
Tile tile(int pos){
|
||||
public @Nullable Tile tile(int pos){
|
||||
return tiles == null ? null : tile(Pos.x(pos), Pos.y(pos));
|
||||
}
|
||||
|
||||
public @Nullable
|
||||
Tile tile(int x, int y){
|
||||
public @Nullable Tile tile(int x, int y){
|
||||
if(tiles == null){
|
||||
return null;
|
||||
}
|
||||
@@ -103,8 +101,7 @@ public class World implements ApplicationListener{
|
||||
return tiles[x][y];
|
||||
}
|
||||
|
||||
public @Nullable
|
||||
Tile tileWorld(float x, float y){
|
||||
public @Nullable Tile tileWorld(float x, float y){
|
||||
return tile(Math.round(x / tilesize), Math.round(y / tilesize));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@ public interface Entity extends MoveTrait{
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
default void add(){
|
||||
targetGroup().add(this);
|
||||
if(targetGroup() != null){
|
||||
targetGroup().add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -122,7 +122,6 @@ public class CrashSender{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static String parseException(Throwable e){
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package io.anuke.mindustry.world.modules;
|
||||
|
||||
import io.anuke.annotations.Annotations.NonNull;
|
||||
import io.anuke.arc.collection.IntArray;
|
||||
import io.anuke.mindustry.world.blocks.power.PowerGraph;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
import java.io.IOException;
|
||||
|
||||
public class PowerModule extends BlockModule{
|
||||
/**
|
||||
@@ -13,10 +14,7 @@ public class PowerModule extends BlockModule{
|
||||
* In case of buffered consumers, this is the percentage of power stored in relation to the maximum capacity.
|
||||
*/
|
||||
public float satisfaction = 0.0f;
|
||||
/** Specifies power which is required additionally, e.g. while a force projector is being shot at. */
|
||||
public float extraUse = 0f;
|
||||
public @NonNull
|
||||
PowerGraph graph = new PowerGraph();
|
||||
public PowerGraph graph = new PowerGraph();
|
||||
public IntArray links = new IntArray();
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user