Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.esinia.server;
- import org.slf4j.Logger;
- import org.spongepowered.api.Game;
- import org.spongepowered.api.Sponge;
- import org.spongepowered.api.command.spec.CommandSpec;
- import org.spongepowered.api.event.Listener;
- import org.spongepowered.api.event.game.state.GameStartedServerEvent;
- import org.spongepowered.api.item.inventory.Inventory;
- import org.spongepowered.api.item.inventory.InventoryArchetypes;
- import org.spongepowered.api.item.inventory.property.InventoryDimension;
- import org.spongepowered.api.item.inventory.property.InventoryTitle;
- import org.spongepowered.api.plugin.Plugin;
- import org.spongepowered.api.text.Text;
- import com.esinia.server.commands.EsiniaCoreExecutor;
- import com.esinia.server.events.EventBlockBreak;
- import com.esinia.server.events.EventBlockPlace;
- import com.esinia.server.events.EventDecay;
- import com.esinia.server.events.EventInventoryClick;
- import com.esinia.server.events.EventItemDrop;
- import com.esinia.server.events.EventRightClick;
- import com.esinia.server.events.EventSpawnEntity;
- import com.google.common.collect.Lists;
- import com.google.inject.Inject;
- @Plugin(id = "esiniacore", name = "Esinia Core", version = "1.0")
- public class Esinia {
- @Inject
- Game game;
- @Inject
- private Logger logger;;
- public Logger getLogger(){
- return logger;
- }
- @Listener
- public void onServerStart(GameStartedServerEvent event) {
- this.getLogger().info("Loading...");
- CommandSpec esiniaCommandSpec = CommandSpec.builder()
- .description(Text.of("Says different things based on the source"))
- .executor(new EsiniaCoreExecutor())
- .build();
- Sponge.getCommandManager().register(this, esiniaCommandSpec, Lists.newArrayList("Esinia"));
- game.getEventManager().registerListeners(this, new EventBlockBreak());
- game.getEventManager().registerListeners(this, new EventBlockPlace());
- game.getEventManager().registerListeners(this, new EventDecay());
- game.getEventManager().registerListeners(this, new EventItemDrop());
- game.getEventManager().registerListeners(this, new EventSpawnEntity());
- game.getEventManager().registerListeners(this, new EventRightClick());
- game.getEventManager().registerListeners(this, new EventInventoryClick());
- this.getLogger().info("Hello World");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment