Package net.minecraft.server

Examples of net.minecraft.server.MinecraftServer


  }

  @EventHandler
  public void serverStart(FMLServerStartingEvent event) {
    MinecraftServer server = MinecraftServer.getServer();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
        manager.registerCommand(new SetTendencyCommand());
        manager.registerCommand(new MaxResearchCommand());
    manager.registerCommand(new KamiUnlockedCommand());
  }
View Full Code Here


    this.z = tile.zCoord;
    this.dim = tile.getWorldObj().provider.dimensionId;
  }

  public IMessage onMessage(PacketTile message, MessageContext ctx) {
    MinecraftServer server = MiscHelper.server();
    if (ctx.side.isClient())
      message.player = TTClientProxy.getPlayer();
    else {
      message.player = ctx.getServerHandler().playerEntity;
    }
    if (server != null) {
      World world = server.worldServerForDimension(message.dim);

      if (world == null) {
        MiscHelper.printCurrentStackTrace("No world found for dimension " + message.dim + "!");
        return null;
      }
View Full Code Here

  }

  public void travelToDimension(int par1, Entity e) {
    if (!e.worldObj.isRemote && !e.isDead) {
      e.worldObj.theProfiler.startSection("changeDimension");
      MinecraftServer minecraftserver = MinecraftServer.getServer();
      int j = e.dimension;
      WorldServer worldserver = minecraftserver.worldServerForDimension(j);
      WorldServer worldserver1 = minecraftserver.worldServerForDimension(par1);
      e.dimension = par1;

      if (j == 1 && par1 == 1) {
        worldserver1 = minecraftserver.worldServerForDimension(0);
        e.dimension = 0;
      }

      e.worldObj.removeEntity(e);
      e.isDead = false;
      e.worldObj.theProfiler.startSection("reposition");
      minecraftserver.getConfigurationManager().transferEntityToWorld(e, j, worldserver, worldserver1, new TeleporterBedrock(worldserver));
      e.worldObj.theProfiler.endStartSection("reloading");
      Entity entity = EntityList.createEntityByName(EntityList.getEntityString(e), worldserver1);

      if (entity != null) {
        entity.copyDataFrom(e, true);
View Full Code Here

    int toDimension = reciever.getWorldObj().provider.dimensionId;
    int toX = reciever.xCoord;
    int toY = reciever.yCoord + 1;
    int toZ = reciever.zCoord;

    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver1 = minecraftserver.worldServerForDimension(toDimension);
    EntityMinecart newCart = (EntityMinecart) EntityList.createEntityByName(EntityList.getEntityString(cart), worldserver1);
    if(newCart == null) {
      return null;
    }
View Full Code Here

      for (int i = 0; i < cont.getSizeInventory(); i++) {
        cont.setInventorySlotContents(i, null);
      }
    }

    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);

    Entity passenger = cart.riddenByEntity;
    if(passenger != null && !(passenger instanceof EntityPlayer)) {
      worldserver.removeEntity(passenger);
      passenger.isDead = true;
View Full Code Here

  }

  public static void spawn(World world, Entity entity) {
    if(entity != null) {
      MinecraftServer minecraftserver = MinecraftServer.getServer();
      WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
      worldserver.spawnEntityInWorld(entity);
    }
  }
View Full Code Here

      return;
    }
    double oX = entity.posX;
    double oZ = entity.posZ;
    World world = transciever.getWorldObj();
    MinecraftServer minecraftserver = MinecraftServer.getServer();
    WorldServer worldserver = minecraftserver.worldServerForDimension(world.provider.dimensionId);
    for (int i = 0; i < 4; i++) {
      int x = transciever.xCoord + randOffset(2);
      int y = transciever.yCoord + 1;
      int z = transciever.zCoord + randOffset(2);
      Block b = world.getBlock(x, y, z);
View Full Code Here

   * @param username
   * @author King_Lemming
   */
  public boolean isOp(String username)
  {
    MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();

    if (theServer != null)
    {
      return theServer.getConfigurationManager().getOps().contains(username.trim().toLowerCase());
    }

    return false;
  }
View Full Code Here

  public int getDimension(ItemStack stack) {
    return ItemNBTHelper.getInt(stack, TAG_DIM, 0);
  }

  public IManaPool getManaPool(ItemStack stack) {
    MinecraftServer server = MinecraftServer.getServer();
    if(server == null)
      return new DummyPool();

    ChunkCoordinates coords = getPoolCoords(stack);
    if(coords.posY == -1)
View Full Code Here

  static int getTimeInCoords(String key) {
    return coordsToCheck.get(key);
  }

  static Block getBlockAt(String key) {
    MinecraftServer server = MinecraftServer.getServer();
    if(server == null)
      return Blocks.air;

    String[] tokens = key.split(":");
    int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
    World world = server.worldServerForDimension(worldId);
    return world.getBlock(x, y, z);
  }
View Full Code Here

TOP

Related Classes of net.minecraft.server.MinecraftServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.