mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-11 02:06:07 +00:00
rename TerraPlugin to Platform
This commit is contained in:
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.dfsek.terra.api.util.Logger;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.command.CommandManager;
|
||||
import com.dfsek.terra.api.command.exception.MalformedCommandException;
|
||||
@@ -44,11 +44,11 @@ import com.dfsek.terra.util.logging.DebugLogger;
|
||||
|
||||
|
||||
/**
|
||||
* Skeleton implementation of {@link TerraPlugin}
|
||||
* Skeleton implementation of {@link Platform}
|
||||
* <p>
|
||||
* Implementations must invoke {@link #load()} in their constructors.
|
||||
*/
|
||||
public abstract class AbstractTerraPlugin implements TerraPlugin {
|
||||
public abstract class AbstractPlatform implements Platform {
|
||||
private static final MutableBoolean LOADED = new MutableBoolean(false);
|
||||
private final EventManager eventManager = new EventManagerImpl(this);
|
||||
|
||||
@@ -12,9 +12,9 @@ import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
||||
@Author("Terra")
|
||||
@Version("1.0.0")
|
||||
public class InternalAddon extends TerraAddon {
|
||||
private final AbstractTerraPlugin main;
|
||||
private final AbstractPlatform main;
|
||||
|
||||
public InternalAddon(AbstractTerraPlugin main) {
|
||||
public InternalAddon(AbstractPlatform main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
)
|
||||
public class AddonsCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.type.DebugCommand;
|
||||
@@ -19,7 +19,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
)
|
||||
public class GetBlockCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
@@ -15,7 +15,7 @@ import com.dfsek.terra.config.lang.LangUtil;
|
||||
)
|
||||
public class PacksCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
@@ -13,7 +13,7 @@ import com.dfsek.terra.config.lang.LangUtil;
|
||||
)
|
||||
public class ReloadCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandManager;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Argument;
|
||||
@@ -40,13 +40,13 @@ import com.dfsek.terra.inject.InjectorImpl;
|
||||
|
||||
public class TerraCommandManager implements CommandManager {
|
||||
private final Map<String, CommandHolder> commands = new HashMap<>();
|
||||
private final InjectorImpl<TerraPlugin> pluginInjector;
|
||||
private final TerraPlugin main;
|
||||
private final InjectorImpl<Platform> pluginInjector;
|
||||
private final Platform main;
|
||||
|
||||
public TerraCommandManager(TerraPlugin main) {
|
||||
public TerraCommandManager(Platform main) {
|
||||
this.main = main;
|
||||
this.pluginInjector = new InjectorImpl<>(main);
|
||||
pluginInjector.addExplicitTarget(TerraPlugin.class);
|
||||
pluginInjector.addExplicitTarget(Platform.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
@@ -13,7 +13,7 @@ import com.dfsek.terra.config.lang.LangUtil;
|
||||
)
|
||||
public class VersionCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands.profiler;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.type.DebugCommand;
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
@DebugCommand
|
||||
public class ProfileQueryCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands.profiler;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.type.DebugCommand;
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
@DebugCommand
|
||||
public class ProfileResetCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands.profiler;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.type.DebugCommand;
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
@DebugCommand
|
||||
public class ProfileStartCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.dfsek.terra.commands.profiler;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.command.CommandTemplate;
|
||||
import com.dfsek.terra.api.command.annotation.Command;
|
||||
import com.dfsek.terra.api.command.annotation.type.DebugCommand;
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.inject.annotations.Inject;
|
||||
@DebugCommand
|
||||
public class ProfileStopCommand implements CommandTemplate {
|
||||
@Inject
|
||||
private TerraPlugin main;
|
||||
private Platform main;
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.dfsek.tectonic.loading.TypeRegistry;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.block.BlockType;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
@@ -19,9 +19,9 @@ import com.dfsek.terra.config.loaders.RangeLoader;
|
||||
|
||||
|
||||
public class GenericLoaders implements LoaderRegistrar {
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public GenericLoaders(TerraPlugin main) {
|
||||
public GenericLoaders(Platform main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.UncheckedIOException;
|
||||
import java.time.Duration;
|
||||
|
||||
import com.dfsek.terra.api.util.Logger;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@@ -76,7 +76,7 @@ public class PluginConfigImpl implements ConfigTemplate, com.dfsek.terra.api.con
|
||||
private int maxRecursion = 1000;
|
||||
|
||||
@Override
|
||||
public void load(TerraPlugin main) {
|
||||
public void load(Platform main) {
|
||||
Logger logger = main.logger();
|
||||
logger.info("Loading config values");
|
||||
try(FileInputStream file = new FileInputStream(new File(main.getDataFolder(), "config.yml"))) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.dfsek.terra.api.util.Logger;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.lang.Language;
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.dfsek.terra.api.lang.Language;
|
||||
public final class LangUtil {
|
||||
private static Language language;
|
||||
|
||||
public static void load(String langID, TerraPlugin main) {
|
||||
public static void load(String langID, Platform main) {
|
||||
Logger logger = main.logger();
|
||||
File file = new File(main.getDataFolder(), "lang");
|
||||
try {
|
||||
|
||||
@@ -33,7 +33,7 @@ import java.util.function.Supplier;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.config.ConfigFactory;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
@@ -85,7 +85,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
private final AbstractConfigLoader abstractConfigLoader = new AbstractConfigLoader();
|
||||
private final ConfigLoader selfLoader = new ConfigLoader();
|
||||
private final Scope varScope = new Scope();
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
private final Loader loader;
|
||||
|
||||
private final Configuration configuration;
|
||||
@@ -101,7 +101,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
|
||||
private final TreeMap<Integer, List<ImmutablePair<String, ConfigType<?, ?>>>> configTypes = new TreeMap<>();
|
||||
|
||||
public ConfigPackImpl(File folder, TerraPlugin main) throws ConfigException {
|
||||
public ConfigPackImpl(File folder, Platform main) throws ConfigException {
|
||||
try {
|
||||
this.loader = new FolderLoader(folder.toPath());
|
||||
this.main = main;
|
||||
@@ -144,7 +144,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
toWorldConfig(new DummyWorld()); // Build now to catch any errors immediately.
|
||||
}
|
||||
|
||||
public ConfigPackImpl(ZipFile file, TerraPlugin main) throws ConfigException {
|
||||
public ConfigPackImpl(ZipFile file, Platform main) throws ConfigException {
|
||||
try {
|
||||
this.loader = new ZIPLoader(file);
|
||||
this.main = main;
|
||||
@@ -361,7 +361,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
});
|
||||
}
|
||||
|
||||
private void checkDeadEntries(TerraPlugin main) {
|
||||
private void checkDeadEntries(Platform main) {
|
||||
registryMap.forEach((clazz, pair) -> ((OpenRegistryImpl<?>) pair.getLeft()).getDeadEntries()
|
||||
.forEach((id, value) -> main.getDebugLogger()
|
||||
.warning("Dead entry in '" +
|
||||
@@ -372,7 +372,7 @@ public class ConfigPackImpl implements ConfigPack {
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
private void load(long start, TerraPlugin main) throws ConfigException {
|
||||
private void load(long start, Platform main) throws ConfigException {
|
||||
configTypes.values().forEach(list -> list.forEach(pair -> configTypeRegistry.register(pair.getLeft(), pair.getRight())));
|
||||
|
||||
for(Map.Entry<String, Double> var : template.getVariables().entrySet()) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.api.config.WorldConfig;
|
||||
import com.dfsek.terra.api.registry.Registry;
|
||||
@@ -25,7 +25,7 @@ public class WorldConfigImpl implements WorldConfig {
|
||||
|
||||
private final Map<Type, Registry<?>> registryMap = new HashMap<>();
|
||||
|
||||
public WorldConfigImpl(World world, ConfigPackImpl pack, TerraPlugin main) {
|
||||
public WorldConfigImpl(World world, ConfigPackImpl pack, Platform main) {
|
||||
this.world = world;
|
||||
this.pack = pack;
|
||||
this.samplerCache = new SamplerCacheImpl(main, world);
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.dfsek.terra.event;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.event.EventHandler;
|
||||
import com.dfsek.terra.api.event.EventManager;
|
||||
import com.dfsek.terra.api.event.events.Event;
|
||||
@@ -12,9 +12,9 @@ import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
|
||||
|
||||
public class EventManagerImpl implements EventManager {
|
||||
private final Map<Class<?>, EventHandler> handlers = new HashMap<>();
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public EventManagerImpl(TerraPlugin main) {
|
||||
public EventManagerImpl(Platform main) {
|
||||
this.main = main;
|
||||
registerHandler(FunctionalEventHandler.class, new FunctionalEventHandlerImpl(main)); // default handler
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.event.events.Event;
|
||||
import com.dfsek.terra.api.event.events.FailThroughEvent;
|
||||
@@ -23,9 +23,9 @@ import com.dfsek.terra.api.util.reflection.TypeKey;
|
||||
public class FunctionalEventHandlerImpl implements FunctionalEventHandler {
|
||||
private final Map<Type, List<EventContextImpl<?>>> contextMap = new HashMap<>();
|
||||
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public FunctionalEventHandlerImpl(TerraPlugin main) {
|
||||
public FunctionalEventHandlerImpl(Platform main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.dfsek.terra.registry.config;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.config.ConfigType;
|
||||
import com.dfsek.terra.api.util.reflection.ReflectionUtil;
|
||||
import com.dfsek.terra.registry.OpenRegistryImpl;
|
||||
@@ -12,9 +12,9 @@ import com.dfsek.terra.registry.OpenRegistryImpl;
|
||||
public class ConfigTypeRegistry extends OpenRegistryImpl<ConfigType<?, ?>> {
|
||||
private final BiConsumer<String, ConfigType<?, ?>> callback;
|
||||
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public ConfigTypeRegistry(TerraPlugin main, BiConsumer<String, ConfigType<?, ?>> callback) {
|
||||
public ConfigTypeRegistry(Platform main, BiConsumer<String, ConfigType<?, ?>> callback) {
|
||||
super(new LinkedHashMap<>()); // Ordered
|
||||
this.callback = callback;
|
||||
this.main = main;
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.dfsek.terra.addon.AddonClassLoader;
|
||||
import com.dfsek.terra.addon.AddonPool;
|
||||
import com.dfsek.terra.addon.PreLoadAddon;
|
||||
import com.dfsek.terra.addon.exception.AddonLoadException;
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.TerraAddon;
|
||||
import com.dfsek.terra.api.inject.exception.InjectionException;
|
||||
import com.dfsek.terra.api.registry.exception.DuplicateEntryException;
|
||||
@@ -20,13 +20,13 @@ import com.dfsek.terra.registry.OpenRegistryImpl;
|
||||
|
||||
|
||||
public class AddonRegistry extends OpenRegistryImpl<TerraAddon> {
|
||||
private final TerraPlugin main;
|
||||
private final Platform main;
|
||||
|
||||
public AddonRegistry(TerraPlugin main) {
|
||||
public AddonRegistry(Platform main) {
|
||||
this.main = main;
|
||||
}
|
||||
|
||||
public AddonRegistry(TerraAddon addon, TerraPlugin main) {
|
||||
public AddonRegistry(TerraAddon addon, Platform main) {
|
||||
this.main = main;
|
||||
register(addon);
|
||||
}
|
||||
@@ -49,12 +49,12 @@ public class AddonRegistry extends OpenRegistryImpl<TerraAddon> {
|
||||
}
|
||||
|
||||
public boolean loadAll() {
|
||||
return loadAll(TerraPlugin.class.getClassLoader());
|
||||
return loadAll(Platform.class.getClassLoader());
|
||||
}
|
||||
|
||||
public boolean loadAll(ClassLoader parent) {
|
||||
InjectorImpl<TerraPlugin> pluginInjector = new InjectorImpl<>(main);
|
||||
pluginInjector.addExplicitTarget(TerraPlugin.class);
|
||||
InjectorImpl<Platform> pluginInjector = new InjectorImpl<>(main);
|
||||
pluginInjector.addExplicitTarget(Platform.class);
|
||||
|
||||
boolean valid = true;
|
||||
File addonsFolder = new File(main.getDataFolder(), "addons");
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.config.ConfigPack;
|
||||
import com.dfsek.terra.config.pack.ConfigPackImpl;
|
||||
import com.dfsek.terra.registry.OpenRegistryImpl;
|
||||
@@ -16,12 +16,12 @@ import com.dfsek.terra.registry.OpenRegistryImpl;
|
||||
* Class to hold config packs
|
||||
*/
|
||||
public class ConfigRegistry extends OpenRegistryImpl<ConfigPack> {
|
||||
public void load(File folder, TerraPlugin main) throws ConfigException {
|
||||
public void load(File folder, Platform main) throws ConfigException {
|
||||
ConfigPack pack = new ConfigPackImpl(folder, main);
|
||||
register(pack.getID(), pack);
|
||||
}
|
||||
|
||||
public boolean loadAll(TerraPlugin main) {
|
||||
public boolean loadAll(Platform main) {
|
||||
boolean valid = true;
|
||||
File packsFolder = new File(main.getDataFolder(), "packs");
|
||||
packsFolder.mkdirs();
|
||||
@@ -45,7 +45,7 @@ public class ConfigRegistry extends OpenRegistryImpl<ConfigPack> {
|
||||
return valid;
|
||||
}
|
||||
|
||||
public void load(ZipFile file, TerraPlugin main) throws ConfigException {
|
||||
public void load(ZipFile file, Platform main) throws ConfigException {
|
||||
ConfigPackImpl pack = new ConfigPackImpl(file, main);
|
||||
register(pack.getTemplate().getID(), pack);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.google.common.cache.LoadingCache;
|
||||
import net.jafama.FastMath;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.dfsek.terra.api.TerraPlugin;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.util.MathUtil;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
import com.dfsek.terra.api.util.math.Sampler;
|
||||
@@ -15,7 +15,7 @@ import com.dfsek.terra.api.util.math.Sampler;
|
||||
public class SamplerCacheImpl implements com.dfsek.terra.api.world.generator.SamplerCache {
|
||||
private final LoadingCache<Long, Sampler> cache;
|
||||
|
||||
public SamplerCacheImpl(TerraPlugin main, World world) {
|
||||
public SamplerCacheImpl(Platform main, World world) {
|
||||
cache = CacheBuilder.newBuilder().maximumSize(main.getTerraConfig().getSamplerCache())
|
||||
.build(new CacheLoader<>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user