Guest User

Untitled

a guest
Aug 19th, 2017
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package mod.mcreator;
  2.  
  3. import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
  4. import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
  5. import net.minecraftforge.fml.common.event.FMLInitializationEvent;
  6.  
  7. import net.minecraft.world.WorldServer;
  8. import net.minecraft.world.World;
  9. import net.minecraft.util.text.TextComponentString;
  10. import net.minecraft.util.math.BlockPos;
  11. import net.minecraft.server.MinecraftServer;
  12. import net.minecraft.item.ItemStack;
  13. import net.minecraft.entity.player.EntityPlayer;
  14. import net.minecraft.command.ICommandSender;
  15. import net.minecraft.command.ICommand;
  16.  
  17. import java.util.Random;
  18.  
  19. public class mcreator_test {
  20.  
  21. public static Object instance;
  22.  
  23. public mcreator_test() {
  24. }
  25.  
  26. public void load(FMLInitializationEvent event) {
  27. }
  28.  
  29. public void generateNether(World world, Random random, int chunkX, int chunkZ) {
  30. }
  31.  
  32. public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
  33. }
  34.  
  35. public int addFuel(ItemStack fuel) {
  36. return 0;
  37. }
  38.  
  39. public void registerRenderers() {
  40. }
  41.  
  42. public void serverLoad(FMLServerStartingEvent event) {
  43.  
  44. event.registerServerCommand(new Commandtest());
  45.  
  46. }
  47.  
  48. public void preInit(FMLPreInitializationEvent event) {
  49. }
  50.  
  51. class Commandtest implements ICommand {
  52. public boolean isUsernameIndex(int var1) {
  53. return false;
  54. }
  55.  
  56. public boolean checkPermission(MinecraftServer server, ICommandSender var1) {
  57. return true;
  58. }
  59.  
  60. public java.util.List getAliases() {
  61. return (java.util.List) (new java.util.ArrayList());
  62. }
  63.  
  64. public java.util.List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) {
  65. return (java.util.List) (new java.util.ArrayList());
  66. }
  67.  
  68. public boolean isUsernameIndex(String[] string, int index) {
  69. return true;
  70. }
  71.  
  72. public String getName() {
  73. return "test";
  74. }
  75.  
  76. public String getUsage(ICommandSender var1) {
  77. return "/test Test";
  78. }
  79.  
  80. @Override
  81. public void execute(MinecraftServer server, ICommandSender var1, String[] cmd) {
  82. int i = var1.getPosition().getX();
  83. int j = var1.getPosition().getY();
  84. int k = var1.getPosition().getZ();
  85. EntityPlayer entity = (EntityPlayer) var1;
  86.  
  87. int x = i;
  88. int y = j;
  89. int z = k;
  90.  
  91. World world = null;
  92. WorldServer[] list = server.worlds;
  93. for (WorldServer ins : list) {
  94. if (ins.provider.getDimension() == entity.world.provider.getDimension())
  95. world = ins;
  96. }
  97. if (world == null)
  98. world = list[0];
  99.  
  100. TextFormatting.RED+("I am a pretty red text!");
  101.  
  102. if (true) {
  103. System.out.println("&aCommands Working!");
  104. }
  105.  
  106. }
  107.  
  108. public int compareTo(ICommand c) {
  109. return getName().compareTo(c.getName());
  110. }
  111.  
  112. }
  113.  
  114. }
RAW Paste Data