Package se.llbit.chunky.world

Examples of se.llbit.chunky.world.World


    synchronized (chunky) {
    synchronized (this) {
      ChunkView mapView = chunky.getMapView();

      WorldRenderer renderer = chunky.getWorldRenderer();
      World world = chunky.getWorld();
      ChunkSelectionTracker selection = chunky.getChunkSelection();

      renderer.render(world, mapBuffer, Chunk.biomeRenderer, selection);
      mapBuffer.renderBuffered(g);

      renderer.renderPlayer(world, g, view, true);
      renderer.renderSpawn(world, g, view, true);

      // draw view rectangle
      g.setColor(Color.orange);
      g.drawRect(
          (int) FastMath.round(mapView.x0 - view.x0),
          (int) FastMath.round(mapView.z0 - view.z0),
          FastMath.round(mapView.width / (float) mapView.scale),
          FastMath.round(mapView.height / (float) mapView.scale));

      // draw North indicator
      g.setFont(font);
      g.setColor(Color.red);
      g.drawString("N", view.width/2-4, 12);

      g.setColor(Color.black);
      g.drawString(world.levelName(), 10, view.height-10);
    }
    }
  }
View Full Code Here


      if (World.isWorldDir(worldDirectory)) {
        if (loadedWorld == null ||
            loadedWorld.getWorldDirectory() == null ||
            !loadedWorld.getWorldDirectory().getAbsolutePath().equals(worldPath)) {

          loadedWorld = new World(worldDirectory, true);
          loadedWorld.setDimension(worldDimension);

        } else if (loadedWorld.currentDimension() != worldDimension) {

          loadedWorld.setDimension(worldDimension);
View Full Code Here

    worlds.clear();
    if (worldSavesDir != null) {
      for (File dir: worldSavesDir.listFiles()) {
        if (World.isWorldDir(dir)) {
          worlds.add(new World(dir, false));
        }
      }
    }
    Collections.sort(worlds);
    for (World world : worlds) {
View Full Code Here

        JFileChooser fileChooser = new JFileChooser(MinecraftFinder.getSavesDirectory());
        fileChooser.setDialogTitle(Messages.getString("WorldSelector.0")); //$NON-NLS-1$
        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int result = fileChooser.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
          chunky.loadWorld(new World(fileChooser.getSelectedFile(), false));
          WorldSelector.this.dispose();
        }
      }
    });
View Full Code Here

   * Start Chunky normally.
   */
  private void startNormally() {
    // load the world
    if (options.worldDir != null && World.isWorldDir(options.worldDir)) {
      loadWorld(new World(options.worldDir, false));
    } else {
      File lastWorldDir = PersistentSettings.getLastWorld();
      if (lastWorldDir != null && World.isWorldDir(lastWorldDir)) {
        loadWorld(new World(lastWorldDir, false));
      }
    }

    // Start the worker threads
    RegionParser[] regionParsers = new RegionParser[3];
View Full Code Here

    // we access ChunkMap via Chunky but here we also need to lock Chunky
    synchronized (chunky) {
    synchronized (this) {
      super.paintComponent(g);

      World world = chunky.getWorld();

      chunky.getWorldRenderer().render(world, mapBuffer,
              chunky.getChunkRenderer(), chunky.getChunkSelection());
      mapBuffer.renderBuffered(g);
      chunky.getWorldRenderer().renderHUD(world, chunky, g, mapBuffer);
View Full Code Here

TOP

Related Classes of se.llbit.chunky.world.World

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.