Ghaz-ranka

Untitled

May 17th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. package com.esinia.server;
  2.  
  3. import org.slf4j.Logger;
  4. import org.spongepowered.api.Game;
  5. import org.spongepowered.api.Sponge;
  6. import org.spongepowered.api.command.spec.CommandSpec;
  7. import org.spongepowered.api.event.Listener;
  8. import org.spongepowered.api.event.game.state.GameStartedServerEvent;
  9. import org.spongepowered.api.item.inventory.Inventory;
  10. import org.spongepowered.api.item.inventory.InventoryArchetypes;
  11. import org.spongepowered.api.item.inventory.property.InventoryDimension;
  12. import org.spongepowered.api.item.inventory.property.InventoryTitle;
  13. import org.spongepowered.api.plugin.Plugin;
  14. import org.spongepowered.api.text.Text;
  15.  
  16. import com.esinia.server.commands.EsiniaCoreExecutor;
  17. import com.esinia.server.events.EventBlockBreak;
  18. import com.esinia.server.events.EventBlockPlace;
  19. import com.esinia.server.events.EventDecay;
  20. import com.esinia.server.events.EventInventoryClick;
  21. import com.esinia.server.events.EventItemDrop;
  22. import com.esinia.server.events.EventRightClick;
  23. import com.esinia.server.events.EventSpawnEntity;
  24. import com.google.common.collect.Lists;
  25. import com.google.inject.Inject;
  26.  
  27. @Plugin(id = "esiniacore", name = "Esinia Core", version = "1.0")
  28. public class Esinia {
  29.  
  30. @Inject
  31. Game game;
  32.  
  33. @Inject
  34. private Logger logger;;
  35.  
  36. public Logger getLogger(){
  37. return logger;
  38.  
  39.  
  40. }
  41.  
  42. @Listener
  43. public void onServerStart(GameStartedServerEvent event) {
  44.  
  45. this.getLogger().info("Loading...");
  46.  
  47. CommandSpec esiniaCommandSpec = CommandSpec.builder()
  48. .description(Text.of("Says different things based on the source"))
  49. .executor(new EsiniaCoreExecutor())
  50. .build();
  51.  
  52. Sponge.getCommandManager().register(this, esiniaCommandSpec, Lists.newArrayList("Esinia"));
  53.  
  54. game.getEventManager().registerListeners(this, new EventBlockBreak());
  55. game.getEventManager().registerListeners(this, new EventBlockPlace());
  56. game.getEventManager().registerListeners(this, new EventDecay());
  57. game.getEventManager().registerListeners(this, new EventItemDrop());
  58. game.getEventManager().registerListeners(this, new EventSpawnEntity());
  59. game.getEventManager().registerListeners(this, new EventRightClick());
  60. game.getEventManager().registerListeners(this, new EventInventoryClick());
  61.  
  62. this.getLogger().info("Hello World");
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment