Package net.minecraft.server

Examples of net.minecraft.server.MinecraftServer


    }

    public static WorldProvider getProviderForDimension(int id)
    {
      WorldProvider provider = null;
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
      if (theServer != null)
      {
        WorldServer ws = theServer.worldServerForDimension(id);
        if (ws != null)
          provider = ws.provider;
      }
      if (provider == null) provider = WorldProvider.getProviderForDimension(id);
      return provider;
View Full Code Here


    }

    public static void registerSpaceStations(File spaceStationList)
    {
        WorldUtil.registeredSpaceStations = WorldUtil.getExistingSpaceStationList(spaceStationList);
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();

        for (Integer registeredID : WorldUtil.registeredSpaceStations)
        {
            int id = Arrays.binarySearch(ConfigManagerCore.staticLoadDimensions, registeredID);

            if (!DimensionManager.isDimensionRegistered(registeredID))
            {
              if (id >= 0)
              {
                  DimensionManager.registerDimension(registeredID, ConfigManagerCore.idDimensionOverworldOrbitStatic);
                  theServer.worldServerForDimension(registeredID);
                }
              else
              {
                  DimensionManager.registerDimension(registeredID, ConfigManagerCore.idDimensionOverworldOrbit);
              }
View Full Code Here

    {
        if (!world.isRemote)
        {
            //GalacticraftCore.packetPipeline.sendToAll(new PacketSimple(EnumSimplePacket.C_UPDATE_PLANETS_LIST, WorldUtil.getPlanetList()));

            MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance();

            if (mcServer != null)
            {
                final WorldServer var6 = mcServer.worldServerForDimension(dimensionID);

                if (var6 == null)
                {
                    System.err.println("Cannot Transfer Entity to Dimension: Could not get World for Dimension " + dimensionID);
                    return null;
View Full Code Here

        return VersionUtil.getPlayerForUsername(server, username);
    }

    public static EntityPlayerMP getPlayerBaseServerFromPlayerUsername(String username, boolean ignoreCase)
    {
        MinecraftServer server = MinecraftServer.getServer();

        if (server != null)
        {
            if (ignoreCase)
            {
                return getPlayerForUsernameVanilla(server, username);
            }
            else
            {
                Iterator iterator = server.getConfigurationManager().playerEntityList.iterator();
                EntityPlayerMP entityplayermp;

                do
                {
                    if (!iterator.hasNext())
View Full Code Here

        GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_THERMAL_LEVEL, new Object[] { playerStats.thermalLevel }), player);
    }

    public static void sendGearUpdatePacket(EntityPlayerMP player, EnumModelPacket gearType)
    {
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
      if (theServer != null && PlayerUtil.getPlayerForUsernameVanilla(theServer, player.getGameProfile().getName()) != null)
        {
            GalacticraftCore.packetPipeline.sendToAllAround(new PacketSimple(EnumSimplePacket.C_UPDATE_GEAR_SLOT, new Object[] { player.getGameProfile().getName(), gearType.ordinal(), -1 }), new TargetPoint(player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, 50.0D));
        }
    }
View Full Code Here

        }
    }

    public static void sendGearUpdatePacket(EntityPlayerMP player, EnumModelPacket gearType, int subtype)
    {
      MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
      if (theServer != null && PlayerUtil.getPlayerForUsernameVanilla(theServer, player.getGameProfile().getName()) != null)
        {
            GalacticraftCore.packetPipeline.sendToAllAround(new PacketSimple(EnumSimplePacket.C_UPDATE_GEAR_SLOT, new Object[] { player.getGameProfile().getName(), gearType.ordinal(), subtype }), new TargetPoint(player.worldObj.provider.dimensionId, player.posX, player.posY, player.posZ, 50.0D));
        }
    }
View Full Code Here

  @Mod.EventHandler
  public void serverStart(FMLServerStartingEvent event) {
    if (GeneralSettings.consoleCommandsDisabled)
      return;

    MinecraftServer server = MinecraftServer.getServer(); // Gets current server
    ICommandManager command = server.getCommandManager(); // Gets the command
                                                          // manager to use for
                                                          // server
    ServerCommandManager serverCommand = ((ServerCommandManager) command); // Turns
                                                                           // it
                                                                           // into
View Full Code Here

    private boolean isMCPC;
   
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
        MinecraftServer ms = MinecraftServer.getServer();
        isMCPC = (ms != null) && (ms.getServerModName().contains("mcpc"));
        if (isMCPC) {
            DynmapCommonAPIListener.register(new APICallback());
        }
    }
View Full Code Here

    OreDictionaryArbiter.registerOreDictionaryEntry(event.Ore, event.Name);
  }

  public boolean isOp(String playerName) {

    MinecraftServer theServer = FMLCommonHandler.instance().getMinecraftServerInstance();
    playerName = playerName.trim();
    for (String a : theServer.getConfigurationManager().func_152606_n()) {
      if (playerName.equalsIgnoreCase(a)) {
        return true; // TODO: this is completely horrible. needs improvement. will probably still be horrible.
      }
    }
    return false;
View Full Code Here

    }

    @Override
    public void registerCommands(Dispatcher dispatcher)
    {
        final MinecraftServer server = MinecraftServer.getServer();
        if (server == null)
            return;

        for (CommandMapping cmdData : dispatcher.getCommands())
        {
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.