mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
Finish event system
This commit is contained in:
@@ -2,6 +2,8 @@ package com.dfsek.terra.bukkit;
|
||||
|
||||
import com.dfsek.tectonic.loading.TypeRegistry;
|
||||
import com.dfsek.terra.api.core.TerraPlugin;
|
||||
import com.dfsek.terra.api.core.event.EventManager;
|
||||
import com.dfsek.terra.api.core.event.TerraEventManager;
|
||||
import com.dfsek.terra.api.platform.block.BlockData;
|
||||
import com.dfsek.terra.api.platform.block.MaterialData;
|
||||
import com.dfsek.terra.api.platform.handle.ItemHandle;
|
||||
@@ -56,6 +58,8 @@ public class TerraBukkitPlugin extends JavaPlugin implements TerraPlugin {
|
||||
private final GenericLoaders genericLoaders = new GenericLoaders(this);
|
||||
private DebugLogger debugLogger;
|
||||
|
||||
private final EventManager eventManager = new TerraEventManager(this);
|
||||
|
||||
public static final Version BUKKIT_VERSION;
|
||||
|
||||
static {
|
||||
@@ -111,6 +115,11 @@ public class TerraBukkitPlugin extends JavaPlugin implements TerraPlugin {
|
||||
return debugLogger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return eventManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
BukkitChunkGeneratorWrapper.saveAll();
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.dfsek.terra.fabric;
|
||||
|
||||
import com.dfsek.tectonic.loading.TypeRegistry;
|
||||
import com.dfsek.terra.api.core.TerraPlugin;
|
||||
import com.dfsek.terra.api.core.event.EventManager;
|
||||
import com.dfsek.terra.api.core.event.TerraEventManager;
|
||||
import com.dfsek.terra.api.platform.block.BlockData;
|
||||
import com.dfsek.terra.api.platform.block.MaterialData;
|
||||
import com.dfsek.terra.api.platform.handle.ItemHandle;
|
||||
@@ -68,6 +70,8 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
||||
private final Map<Long, TerraWorld> worldMap = new HashMap<>();
|
||||
private static TerraFabricPlugin instance;
|
||||
|
||||
private final EventManager eventManager = new TerraEventManager(this);
|
||||
|
||||
public static TerraFabricPlugin getInstance() {
|
||||
return instance;
|
||||
}
|
||||
@@ -285,4 +289,9 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return eventManager;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.dfsek.terra;
|
||||
|
||||
import com.dfsek.tectonic.loading.TypeRegistry;
|
||||
import com.dfsek.terra.api.core.TerraPlugin;
|
||||
import com.dfsek.terra.api.core.event.EventManager;
|
||||
import com.dfsek.terra.api.core.event.TerraEventManager;
|
||||
import com.dfsek.terra.api.platform.block.BlockData;
|
||||
import com.dfsek.terra.api.platform.block.MaterialData;
|
||||
import com.dfsek.terra.api.platform.handle.ItemHandle;
|
||||
@@ -26,6 +28,7 @@ public class StandalonePlugin implements TerraPlugin {
|
||||
private final ConfigRegistry registry = new ConfigRegistry();
|
||||
private final PluginConfig config = new PluginConfig();
|
||||
private final RawWorldHandle worldHandle = new RawWorldHandle();
|
||||
private final EventManager eventManager = new TerraEventManager(this);
|
||||
|
||||
@Override
|
||||
public WorldHandle getWorldHandle() {
|
||||
@@ -115,4 +118,9 @@ public class StandalonePlugin implements TerraPlugin {
|
||||
registry.loadAll(this);
|
||||
config.load(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return eventManager;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user