SaveFormatComparator .java

net.minecraft.world.storage.SaveFormatComparator (class, 90 lines): members: getCheatsEnabled, getEnumGameType, theEnumGameType, cheatsEnabled, sizeOnDisk.

net.minecraft.world.storageclass90 linescommon2.3 KB

Implements

API Surface (9)

String getFileName()
String getDisplayName()
long getSizeOnDisk()
boolean requiresConversion()
long getLastTimePlayed()
int compareTo(SaveFormatComparator p_compareTo_1_)
WorldSettings.GameType getEnumGameType()
boolean isHardcoreModeEnabled()
boolean getCheatsEnabled()

Fields & Constants (8)

fileName
displayName
lastTimePlayed
sizeOnDisk
requiresConversion
theEnumGameType
hardcore
cheatsEnabled

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

SaveFormatComparator.java90 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.world.storage;
2
3
import net.minecraft.world.WorldSettings;
4
5
public class SaveFormatComparator implements Comparable<SaveFormatComparator>
6
{
7
    /** the file name of this save */
8
    private final String fileName;
9
10
    /** the displayed name of this save file */
11
    private final String displayName;
12
    private final long lastTimePlayed;
13
    private final long sizeOnDisk;
14
    private final boolean requiresConversion;
15
16
    /** Instance of EnumGameType. */
17
    private final WorldSettings.GameType theEnumGameType;
18
    private final boolean hardcore;
19
    private final boolean cheatsEnabled;
20
21
    public SaveFormatComparator(String fileNameIn, String displayNameIn, long lastTimePlayedIn, long sizeOnDiskIn, WorldSettings.GameType theEnumGameTypeIn, boolean requiresConversionIn, boolean hardcoreIn, boolean cheatsEnabledIn)
22
    {
23
        this.fileName = fileNameIn;
24
        this.displayName = displayNameIn;
25
        this.lastTimePlayed = lastTimePlayedIn;
26
        this.sizeOnDisk = sizeOnDiskIn;
27
        this.theEnumGameType = theEnumGameTypeIn;
28
        this.requiresConversion = requiresConversionIn;
29
        this.hardcore = hardcoreIn;
30
        this.cheatsEnabled = cheatsEnabledIn;
31
    }
32
33
    /**
34
     * return the file name
35
     */
36
    public String getFileName()
37
    {
38
        return this.fileName;
39
    }
40
41
    /**
42
     * return the display name of the save
43
     */
44
    public String getDisplayName()
45
    {
46
        return this.displayName;
47
    }
48
49
    public long getSizeOnDisk()
50
    {
51
        return this.sizeOnDisk;
52
    }
53
54
    public boolean requiresConversion()
55
    {
56
        return this.requiresConversion;
57
    }
58
59
    public long getLastTimePlayed()
60
    {
61
        return this.lastTimePlayed;
62
    }
63
64
    public int compareTo(SaveFormatComparator p_compareTo_1_)
65
    {
66
        return this.lastTimePlayed < p_compareTo_1_.lastTimePlayed ? 1 : (this.lastTimePlayed > p_compareTo_1_.lastTimePlayed ? -1 : this.fileName.compareTo(p_compareTo_1_.fileName));
67
    }
68
69
    /**
70
     * Gets the EnumGameType.
71
     */
72
    public WorldSettings.GameType getEnumGameType()
73
    {
74
        return this.theEnumGameType;
75
    }
76
77
    public boolean isHardcoreModeEnabled()
78
    {
79
        return this.hardcore;
80
    }
81
82
    /**
83
     * @return {@code true} if cheats are enabled for this world
84
     */
85
    public boolean getCheatsEnabled()
86
    {
87
        return this.cheatsEnabled;
88
    }
89
}
90

Deobfuscated MCP 1.8.9 source of SaveFormatComparator from Marcelektro/MavenMCP-1.8.9 (net/minecraft/world/storage/SaveFormatComparator.java), stored verbatim.