Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 11:00:04 +01:00
Reduce duplicated singleton objects (#2473)
Dieser Commit ist enthalten in:
Ursprung
36a892eb37
Commit
b8434f891e
@ -60,16 +60,17 @@ import java.util.function.Supplier;
|
|||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
public enum FaweCache implements Trimable {
|
public enum FaweCache implements Trimable {
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #INSTANCE} to get an instance.
|
|
||||||
*/
|
|
||||||
@Deprecated(forRemoval = true, since = "2.0.0")
|
|
||||||
IMP,
|
|
||||||
/**
|
/**
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #INSTANCE} to get an instance.
|
||||||
|
*/
|
||||||
|
@Deprecated(forRemoval = true, since = "2.0.0")
|
||||||
|
public static final FaweCache IMP = INSTANCE;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||||
|
|
||||||
public final int BLOCKS_PER_LAYER = 4096;
|
public final int BLOCKS_PER_LAYER = 4096;
|
||||||
|
@ -19,14 +19,14 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
public class Settings extends Config {
|
public class Settings extends Config {
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
static Settings INSTANCE = new Settings();
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link #settings()} instead to get an instance.
|
* @deprecated Use {@link #settings()} instead to get an instance.
|
||||||
*/
|
*/
|
||||||
@Ignore
|
@Ignore
|
||||||
@Deprecated(forRemoval = true, since = "2.0.0")
|
@Deprecated(forRemoval = true, since = "2.0.0")
|
||||||
public static final Settings IMP = new Settings();
|
public static final Settings IMP = INSTANCE;
|
||||||
@Ignore
|
|
||||||
static Settings INSTANCE = new Settings();
|
|
||||||
@Ignore
|
@Ignore
|
||||||
public boolean PROTOCOL_SUPPORT_FIX = false;
|
public boolean PROTOCOL_SUPPORT_FIX = false;
|
||||||
@Comment("These first 6 aren't configurable") // This is a comment
|
@Comment("These first 6 aren't configurable") // This is a comment
|
||||||
|
@ -13,7 +13,7 @@ public class DBHandler {
|
|||||||
* @deprecated Use {@link #dbHandler()} instead.
|
* @deprecated Use {@link #dbHandler()} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "2.0.0")
|
@Deprecated(forRemoval = true, since = "2.0.0")
|
||||||
public static final DBHandler IMP = new DBHandler();
|
public static final DBHandler IMP = dbHandler();
|
||||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||||
private static DBHandler INSTANCE;
|
private static DBHandler INSTANCE;
|
||||||
private final Map<World, RollbackDatabase> databases = new ConcurrentHashMap<>(8, 0.9f, 1);
|
private final Map<World, RollbackDatabase> databases = new ConcurrentHashMap<>(8, 0.9f, 1);
|
||||||
|
@ -32,7 +32,7 @@ public class WEManager {
|
|||||||
* @deprecated Use {@link #weManager()} instead.
|
* @deprecated Use {@link #weManager()} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated(forRemoval = true, since = "2.0.0")
|
@Deprecated(forRemoval = true, since = "2.0.0")
|
||||||
public static WEManager IMP = new WEManager();
|
public static WEManager IMP = weManager();
|
||||||
private final ArrayDeque<FaweMaskManager> managers = new ArrayDeque<>();
|
private final ArrayDeque<FaweMaskManager> managers = new ArrayDeque<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -201,7 +201,7 @@ public class HistorySubCommands {
|
|||||||
.at(summary.maxX, world.getMaxY(), summary.maxZ)
|
.at(summary.maxX, world.getMaxY(), summary.maxZ)
|
||||||
);
|
);
|
||||||
rollback.setTime(historyFile.lastModified());
|
rollback.setTime(historyFile.lastModified());
|
||||||
RollbackDatabase db = DBHandler.IMP
|
RollbackDatabase db = DBHandler.dbHandler()
|
||||||
.getDatabase(world);
|
.getDatabase(world);
|
||||||
db.logEdit(rollback);
|
db.logEdit(rollback);
|
||||||
actor.print(TextComponent.of("Logging: " + historyFile));
|
actor.print(TextComponent.of("Logging: " + historyFile));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren