Beispiel #1
0
  public EntityPlayerMP(
      MinecraftServer par1MinecraftServer,
      World par2World,
      String par3Str,
      ItemInWorldManager par4ItemInWorldManager) {
    super(par2World, par3Str);
    par4ItemInWorldManager.thisPlayerMP = this;
    this.theItemInWorldManager = par4ItemInWorldManager;
    this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
    ChunkCoordinates var5 = par2World.getSpawnPoint();
    int var6 = var5.posX;
    int var7 = var5.posZ;
    int var8 = var5.posY;

    if (!par2World.provider.hasNoSky
        && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) {
      int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6);
      var6 += this.rand.nextInt(var9 * 2) - var9;
      var7 += this.rand.nextInt(var9 * 2) - var9;
      var8 = par2World.getTopSolidOrLiquidBlock(var6, var7);
    }

    this.mcServer = par1MinecraftServer;
    this.stepHeight = 0.0F;
    this.yOffset = 0.0F;
    this.setLocationAndAngles(
        (double) var6 + 0.5D, (double) var8, (double) var7 + 0.5D, 0.0F, 0.0F);

    while (!par2World.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) {
      this.setPosition(this.posX, this.posY + 1.0D, this.posZ);
    }
  }
 private void getServerStats(ICommandSender sender) {
   MinecraftServer tmp = ServerUtil.getServerInstance();
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "==================================================");
   ChatHelper.sendMessage(sender, TextFormatting.BLUE + "                    Server Status");
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "==================================================");
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "Server: " + TextFormatting.AQUA + tmp.getServerModName());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD + "Server Version: " + TextFormatting.AQUA + tmp.getMinecraftVersion());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Online Mode: "
           + TextFormatting.AQUA
           + tmp.isServerInOnlineMode());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD + "Server Owner: " + TextFormatting.AQUA + tmp.getServerOwner());
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "Server MOTD: " + TextFormatting.AQUA + tmp.getMOTD());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server IP: "
           + TextFormatting.AQUA
           + tmp.getServerHostname()
           + ":"
           + tmp.getServerPort());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Max Allowed Players: "
           + TextFormatting.AQUA
           + tmp.getMaxPlayers());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Spawn Protection Size: "
           + TextFormatting.AQUA
           + tmp.getSpawnProtectionSize());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server View Distance: "
           + TextFormatting.AQUA
           + tmp.getPlayerList().getViewDistance());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server World: "
           + TextFormatting.AQUA
           + tmp.getEntityWorld().getWorldInfo().getWorldName());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD + "Server Allow Nether: " + TextFormatting.AQUA + tmp.getAllowNether());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Allow Flight: "
           + TextFormatting.AQUA
           + tmp.isFlightAllowed());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Default Gamemode: "
           + TextFormatting.AQUA
           + tmp.getGameType().getName());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Generate Structure: "
           + TextFormatting.AQUA
           + tmp.canStructuresSpawn());
   ChatHelper.sendMessage(
       sender,
       TextFormatting.GOLD
           + "Server Whitelist: "
           + TextFormatting.AQUA
           + tmp.getPlayerList().isWhiteListEnabled());
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "Hardcore Mode: " + TextFormatting.AQUA + tmp.isHardcore());
   ChatHelper.sendMessage(
       sender, TextFormatting.GOLD + "==================================================");
 }
Beispiel #3
0
	@Override
	public int getSpawnRadius() {

		return theServer.getSpawnProtectionSize();
	}