mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-08 16:56:07 +00:00
Make logging actually work
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
This commit is contained in:
@@ -94,45 +94,18 @@ public abstract class AbstractPlatform implements Platform {
|
||||
|
||||
private final Registry<BaseAddon> lockedAddonRegistry = new LockedRegistryImpl<>(addonRegistry);
|
||||
|
||||
@Override
|
||||
public void register(TypeRegistry registry) {
|
||||
loaders.register(registry);
|
||||
public ConfigRegistry getRawConfigRegistry() {
|
||||
return configRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginConfig getTerraConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Language getLanguage() {
|
||||
return LangUtil.getLanguage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckedRegistry<ConfigPack> getConfigRegistry() {
|
||||
return checkedConfigRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registry<BaseAddon> getAddons() {
|
||||
return lockedAddonRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return eventManager;
|
||||
public CommandManager getManager() {
|
||||
return manager;
|
||||
}
|
||||
|
||||
protected Optional<BaseAddon> platformAddon() {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Profiler getProfiler() {
|
||||
return profiler;
|
||||
}
|
||||
|
||||
protected void load() {
|
||||
if(LOADED.get()) {
|
||||
throw new IllegalStateException(
|
||||
@@ -257,11 +230,38 @@ public abstract class AbstractPlatform implements Platform {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
public ConfigRegistry getRawConfigRegistry() {
|
||||
return configRegistry;
|
||||
@Override
|
||||
public void register(TypeRegistry registry) {
|
||||
loaders.register(registry);
|
||||
}
|
||||
|
||||
public CommandManager getManager() {
|
||||
return manager;
|
||||
@Override
|
||||
public PluginConfig getTerraConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Language getLanguage() {
|
||||
return LangUtil.getLanguage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckedRegistry<ConfigPack> getConfigRegistry() {
|
||||
return checkedConfigRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registry<BaseAddon> getAddons() {
|
||||
return lockedAddonRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return eventManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Profiler getProfiler() {
|
||||
return profiler;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.io.UncheckedIOException;
|
||||
import java.time.Duration;
|
||||
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.util.Logger;
|
||||
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.Objects;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.entity.CommandSender;
|
||||
import com.dfsek.terra.api.lang.Language;
|
||||
import com.dfsek.terra.api.util.Logger;
|
||||
|
||||
|
||||
public final class LangUtil {
|
||||
|
||||
@@ -65,8 +65,8 @@ public class FunctionalEventHandlerImpl implements FunctionalEventHandler {
|
||||
if(context.isFailThrough() && event instanceof FailThroughEvent)
|
||||
throw e; // Rethrow if it's fail-through.
|
||||
// else warn
|
||||
logger.warn("Exception occurred during event handling. Report this to the maintainers of {}, {}",
|
||||
context.getAddon().getID(), context.getAddon().getAuthor(), e);
|
||||
logger.warn("Exception occurred during event handling. Report this to the maintainers of {}@{}",
|
||||
context.getAddon().getID(), context.getAddon().getVersion().getFormatted(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user