Package net.minecraft.server

Examples of net.minecraft.server.WorldServer


            boolean mobs = false;
            boolean animals = false;
           
            String worldname="testworld";
            long seed=1234;
            world = new WorldServer(null, new ServerNBTManager(new File("tests"),worldname, true), worldname, hell ? -1 : 0, seed, null, null);
            // TerraBukkit end
            world.a(new WorldManager(null, world));
            world.j = mobs ? 1 : 0;
            world.a(mobs, animals);
            // CraftBukkit end
View Full Code Here


   * @param startLocation to find a spawn from
   * @param createPortals - True to create a portal if not found, False not to
   * @return suitable spawn location, or the input startLocation if this failed
   */
  public static Location findSpawnLocation(Location startLocation, boolean createPortals) {
    WorldServer ws = CommonNMS.getNative(startLocation.getWorld());
    // Use a new travel agent to designate a proper position
    CraftTravelAgent travelAgent = new CraftTravelAgent(ws);
    travelAgent.setCanCreatePortal(createPortals);
    Location exit = travelAgent.findOrCreate(startLocation);
    // Adjust the exit to make it suitable for players
View Full Code Here

   * @param data to set to
   * @return True if a block got changed, False if not
   */
  public static boolean setBlock(org.bukkit.Chunk chunk, int x, int y, int z, Material type, int data) {
    boolean result = y >= 0 && y <= chunk.getWorld().getMaxHeight();
    WorldServer world = CommonNMS.getNative(chunk.getWorld());
    Block typeBlock = CommonNMS.getBlock(type);
    if (result) {
      result = ChunkRef.setBlock(Conversion.toChunkHandle.convert(chunk), x, y, z, typeBlock, data);
            world.methodProfiler.a("checkLight");
            world.z(x, y, z);
            world.methodProfiler.b();
    }
    if (result) {
      world.applyPhysics(x, y, z, typeBlock);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.server.WorldServer

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.