Fix support of 20-digit numeric seeds
Minetest 64 bit seeds were being listed signed instead of unsigned in some places. E.g. with seed 14105561135541706857, "Copy Seed" used to put -4341182938167844759 in the clipboardmaster
parent
dffe29e2d1
commit
049a030144
|
@ -248,7 +248,7 @@ public class Actions {
|
|||
public void copySeedToClipboard() {
|
||||
ViewerFacade viewerFacade = viewerFacadeSupplier.get();
|
||||
if (viewerFacade != null) {
|
||||
String seed = "" + viewerFacade.getWorldSeed().getLong();
|
||||
String seed = viewerFacade.getWorldSeed().getLongAsString();
|
||||
StringSelection selection = new StringSelection(seed);
|
||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class Actions {
|
|||
if (viewerFacade != null) {
|
||||
BufferedImage image = viewerFacade.createScreenshot();
|
||||
String suggestedFilename = "screenshot_" + viewerFacade.getWorldType().getFilenameText() + "_"
|
||||
+ viewerFacade.getWorldSeed().getLong() + ".png";
|
||||
+ viewerFacade.getWorldSeed().getLongAsString() + ".png";
|
||||
File file = dialogs.askForScreenshotSaveFile(suggestedFilename);
|
||||
if (file != null) {
|
||||
file = appendPNGFileExtensionIfNecessary(file);
|
||||
|
|
|
@ -72,9 +72,9 @@ public class SeedHistoryLogger {
|
|||
private String getSeedString(WorldSeed worldSeed) {
|
||||
String text = worldSeed.getText();
|
||||
if (text != null) {
|
||||
return worldSeed.getLong() + ", " + text;
|
||||
return worldSeed.getLongAsString() + ", " + text;
|
||||
} else {
|
||||
return worldSeed.getLong() + "";
|
||||
return worldSeed.getLongAsString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -72,11 +72,13 @@ public class WorldSeed {
|
|||
private final String text;
|
||||
private final WorldSeedType type;
|
||||
private final String label;
|
||||
private final GameEngineType gameEngineType;
|
||||
|
||||
private WorldSeed(long seed, String text, WorldSeedType type, GameEngineType game_engine_type) {
|
||||
this.seed = seed;
|
||||
this.text = text;
|
||||
this.type = type;
|
||||
this.gameEngineType = game_engine_type;
|
||||
this.label = type.getLabel(seed, text, game_engine_type);
|
||||
}
|
||||
|
||||
|
@ -84,6 +86,10 @@ public class WorldSeed {
|
|||
return seed;
|
||||
}
|
||||
|
||||
public String getLongAsString() {
|
||||
return (gameEngineType == GameEngineType.MINETEST) ? Long.toUnsignedString(seed) : Long.toString(seed);
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -93,8 +93,8 @@ public enum TestWorldDeclaration {
|
|||
"testworld",
|
||||
"storage",
|
||||
recognisedVersion.getName(),
|
||||
"" + worldSeed.getLong()).toFile();
|
||||
this.directoryString = RESOURCE_PREFIX + recognisedVersion.getName() + "/" + worldSeed.getLong() + "/";
|
||||
worldSeed.getLongAsString()).toFile();
|
||||
this.directoryString = RESOURCE_PREFIX + recognisedVersion.getName() + "/" + worldSeed.getLongAsString() + "/";
|
||||
}
|
||||
|
||||
public RecognisedVersion getRecognisedVersion() {
|
||||
|
|
Loading…
Reference in New Issue