Fixed #2243
This commit is contained in:
@@ -62,6 +62,9 @@ public class Effects{
|
|||||||
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
|
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
|
||||||
if(headless || region == null || !Core.atlas.isFound(region)) return;
|
if(headless || region == null || !Core.atlas.isFound(region)) return;
|
||||||
|
|
||||||
|
Tile tile = world.tileWorld(x, y);
|
||||||
|
if(tile == null || tile.floor().isLiquid) return;
|
||||||
|
|
||||||
Decal decal = Decal.create();
|
Decal decal = Decal.create();
|
||||||
decal.set(x, y);
|
decal.set(x, y);
|
||||||
decal.rotation(rotation);
|
decal.rotation(rotation);
|
||||||
@@ -74,22 +77,15 @@ public class Effects{
|
|||||||
public static void scorch(float x, float y, int size){
|
public static void scorch(float x, float y, int size){
|
||||||
if(headless) return;
|
if(headless) return;
|
||||||
|
|
||||||
Tile tile = world.tileWorld(x, y);
|
|
||||||
if(tile == null || tile.floor().isLiquid) return;
|
|
||||||
|
|
||||||
size = Mathf.clamp(size, 0, 9);
|
size = Mathf.clamp(size, 0, 9);
|
||||||
|
|
||||||
TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2));
|
TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2));
|
||||||
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void rubble(float x, float y, int blockSize){
|
public static void rubble(float x, float y, int blockSize){
|
||||||
if(headless) return;
|
if(headless) return;
|
||||||
|
|
||||||
Tile tile = world.tileWorld(x, y);
|
|
||||||
if(tile == null || tile.floor().isLiquid) return;
|
|
||||||
|
|
||||||
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + (Core.atlas.has("rubble-" + blockSize + "-1") ? Mathf.random(0, 1) : "0"));
|
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + (Core.atlas.has("rubble-" + blockSize + "-1") ? Mathf.random(0, 1) : "0"));
|
||||||
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ public class ServerControl implements ApplicationListener{
|
|||||||
private static final int maxLogLength = 1024 * 512;
|
private static final int maxLogLength = 1024 * 512;
|
||||||
|
|
||||||
protected static String[] tags = {"&lc&fb[D]", "&lg&fb[I]", "&ly&fb[W]", "&lr&fb[E]", ""};
|
protected static String[] tags = {"&lc&fb[D]", "&lg&fb[I]", "&ly&fb[W]", "&lr&fb[E]", ""};
|
||||||
protected static DateTimeFormatter dateTime = DateTimeFormatter.ofPattern("MM-dd-yyyy HH:mm:ss");
|
protected static DateTimeFormatter dateTime = DateTimeFormatter.ofPattern("MM-dd-yyyy HH:mm:ss"),
|
||||||
|
autosaveDate = DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss");
|
||||||
|
|
||||||
private final CommandHandler handler = new CommandHandler("");
|
private final CommandHandler handler = new CommandHandler("");
|
||||||
private final Fi logFolder = Core.settings.getDataDirectory().child("logs/");
|
private final Fi logFolder = Core.settings.getDataDirectory().child("logs/");
|
||||||
@@ -167,7 +168,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
|
|
||||||
//use map file name to make sure it can be saved
|
//use map file name to make sure it can be saved
|
||||||
String mapName = (state.map.file == null ? "unknown" : state.map.file.nameWithoutExtension()).replace(" ", "_");
|
String mapName = (state.map.file == null ? "unknown" : state.map.file.nameWithoutExtension()).replace(" ", "_");
|
||||||
String date = dateTime.format(LocalDateTime.now()).replace(" ", "_");
|
String date = autosaveDate.format(LocalDateTime.now());
|
||||||
|
|
||||||
Seq<Fi> autosaves = saveDirectory.findAll(f -> f.name().startsWith("auto_"));
|
Seq<Fi> autosaves = saveDirectory.findAll(f -> f.name().startsWith("auto_"));
|
||||||
autosaves.sort(f -> -f.lastModified());
|
autosaves.sort(f -> -f.lastModified());
|
||||||
|
|||||||
Reference in New Issue
Block a user