Package net.minecraft.src

Examples of net.minecraft.src.World


      player.sendChatMessage("Cleared " + removedDrops + " item drop(s).");
   }

   public static int removeItemDrops(Player player, int radius) {
      Coordinate pos = player.getPosition();
      World world = player.getWorld().getMinecraftWorld();
      AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(
               pos.getX() - radius, pos.getY() - radius, pos.getZ() - radius,
               pos.getX() + radius, pos.getY() + radius, pos.getZ() + radius
      );
      List<?> nearbyEntities = world.getEntitiesWithinAABBExcludingEntity(
               player.getMinecraftPlayer(), boundingBox
      );
      int removedDrops = 0;
      for(int entityIndex = 0; entityIndex < nearbyEntities.size(); entityIndex++) {
         Entity entity = (Entity)nearbyEntities.get(entityIndex);
View Full Code Here


      catch (InterruptedException e1) {}
      if (onLogin) {
        doLogin();
        onLogin = false;
      }
      World world = SpoutClient.getHandle().theWorld;
      if (world != null) {
        if (!runOnce) {
          multiplayer = world.isRemote;
          runOnce = true;
          onRunOnce();
View Full Code Here

  private void mapCalc() {
    if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null)
      return;
    try {
      final boolean square = MinimapConfig.getInstance().isSquare();
      final World data = Minecraft.getMinecraft().theWorld;
      int renderSize;
      int startX;
      int startZ;
      synchronized (map) {
        if (map.zoom != MinimapConfig.getInstance().getZoom()) {
          map.zoom = MinimapConfig.getInstance().getZoom();
          switch (map.zoom) {
            case 0:
              map.renderSize = Map.ZOOM_0;
              break;
            case 1:
              map.renderSize = Map.ZOOM_1;
              break;
            case 2:
              map.renderSize = Map.ZOOM_2;
              break;
            default:
              map.renderSize = Map.ZOOM_2;
              break;
          }
          map.renderOff = map.renderSize / 2;
          map.clear();
        }
        map.square = square;

        map.update(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posZ);
        renderSize = map.renderSize;
        startX = (int) (map.getPlayerX() - map.renderOff);
        startZ = (int) (map.getPlayerZ() - map.renderOff);
      }

      for (int worldX = startX; worldX < startX + renderSize; worldX++) {
        for (int worldZ = startZ; worldZ < startZ + renderSize; worldZ++) {
          int worldY = getBlockHeight(data, worldX, worldZ);

          int pixelX = worldX - startX;
          if (pixelX >= renderSize) {
            pixelX -= renderSize;
          }

          int pixelZ = worldZ - startZ;
          pixelZ = renderSize - pixelZ;
          if (pixelZ >= renderSize) {
            pixelZ -= renderSize;
          }

          if (square || MinimapUtils.insideCircle(startX + renderSize / 2, startZ + renderSize / 2, renderSize / 2, worldX, worldZ)) {
            int color = getBlockColor(data, worldX, worldY, worldZ);
            if (color == 0) {
              map.clearColorPixel(pixelX, pixelZ);
            } else {
              map.setColorPixel(pixelX, pixelZ, color);
            }

            short height = (short) data.getHeightValue(worldX, worldZ);
            short reference = (short) data.getHeightValue(worldX + 1, worldZ + 1);
            map.heightimg.setARGB(pixelZ, pixelX, getHeightColor(height, reference));
            map.setLightPixel(pixelX, pixelZ, getBlockLight(data, worldX, worldY, worldZ));

          } else {
            map.clearColorPixel(pixelX, pixelZ);
View Full Code Here

    output.writeInt(y);
    output.writeInt(z);
  }

  public void run(int playerId) {
    World world = SpoutClient.getHandle().theWorld;
    TileEntity te = world.getBlockTileEntity(x, y, z);
    if (te != null && te instanceof TileEntitySign) {
      TileEntitySign sign = (TileEntitySign)te;
      GuiEditSign gui = new GuiEditSign(sign);
      SpoutClient.getHandle().displayGuiScreen(gui);
    }
View Full Code Here

  @Override
  public void run() {
    while (!this.isInterrupted()) {
      try {
        LightingData data = queue.take();
        World world = SpoutClient.getHandle().theWorld;
        if (world != null && world.chunkProvider.chunkExists(data.cx, data.cz)) {
          for (int i = 0; i < data.ids.length; i++) {
            CustomBlock cb = MaterialData.getCustomBlock(data.ids[i]);
            if (cb != null && cb.getLightLevel() != 0) {
              int bx = (i >> 12) & 0xF;
              int by = i & 0xFF;
              int bz = (i >> 8) & 0xF;
              world.updateLightByType(lightingBlockList, EnumSkyBlock.Sky, data.cx * 16 + bx, by, data.cz * 16 + bz);
              world.updateLightByType(lightingBlockList, EnumSkyBlock.Block, data.cx * 16 + bx, by, data.cz * 16 + bz);
            }
          }
        }
      } catch (InterruptedException e) {
        return;
View Full Code Here

      }

      @Override
      public void run() {
        try {
          World world = e.worldObj;
          double x = e.posX, y = e.posY, z = e.posZ;
          for (int i = 0; i < duration; i++) {
            try {
              if (e.isDead)
                return;
              Thread.sleep(1000);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
          e.setDead();
          x = e.posX;
          y = e.posY;
          z = e.posZ;
          for (int k = 0; k < 10000; k++)
            world.spawnParticle("portal", x + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), y
                + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), z
                + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), 0, 0, 0);
View Full Code Here

      }

      @Override
      public void run() {
        try {
          World world = e.worldObj;
          double x = e.posX, y = e.posY, z = e.posZ;
          for (int i = 0; i < duration * 1000; i++) {
            try {
              if (e.isDead)
                return;
              x = e.posX;
              y = e.posY;
              z = e.posZ;
              if (e.motionX == 0 && e.motionY == 0 && e.motionZ == 0)
                continue;
              new Thread(new BlockWatcher(world, x, y, z, mod_Dragon.lightId, 2))
                  .start();
              Thread.sleep(1);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
          e.setDead();
          x = e.posX;
          y = e.posY;
          z = e.posZ;
          for (int k = 0; k < 10000; k++)
            world.spawnParticle("portal", x + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), y
                + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), z
                + (world.rand.nextDouble() * 3.0)
                * (world.rand.nextBoolean() ? -1 : 1), 0, 0, 0);
View Full Code Here

    GL11.glTranslatef(0.0F, 0.0F, -2000F);
  }

  public void update() {
    EntityPlayer p = ModLoader.getMinecraftInstance().thePlayer;
    World world = p.worldObj;
    Location loc = new Location((int) p.posX, (int) p.posY, (int) p.posZ);
    if (mod_Dragon.holdManager == null || mod_Dragon.holdManager.world != world)

      mod_Dragon.holdManager = new HoldManager(world);
    if (world != null && mod_Dragon.holdManager.world != null) {
View Full Code Here

                loadingScreen.printText(StatCollector.translateToLocal("menu.switchingLevel"));
                loadingScreen.displayLoadingString("");
            }

            net.minecraft.src.ISaveHandler isavehandler = saveLoader.getSaveLoader(par1Str, false);
            World world = null;
            world = new World(isavehandler, par2Str, par3WorldSettings);

            if (world.isNewWorld)
            {
                statFileWriter.readStat(StatList.createWorldStat, 1);
                statFileWriter.readStat(StatList.startGameStat, 1);
View Full Code Here

            if (thePlayer.isEntityAlive())
            {
                theWorld.updateEntityWithOptionalForce(thePlayer, false);
            }

            World world = null;
            world = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
            changeWorld(world, "Entering the Nether", thePlayer);
        }
        else if (thePlayer.dimension == 0)
        {
            if (thePlayer.isEntityAlive())
            {
                thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
                theWorld.updateEntityWithOptionalForce(thePlayer, false);
            }

            World world1 = null;
            world1 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));

            if (i == -1)
            {
                changeWorld(world1, "Leaving the Nether", thePlayer);
            }
            else
            {
                changeWorld(world1, "Leaving the End", thePlayer);
            }
        }
        else
        {
            World world2 = null;
            world2 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
            ChunkCoordinates chunkcoordinates = world2.getEntrancePortalLocation();
            d = chunkcoordinates.posX;
            thePlayer.posY = chunkcoordinates.posY;
            d1 = chunkcoordinates.posZ;
            thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, 90F, 0.0F);

            if (thePlayer.isEntityAlive())
            {
                world2.updateEntityWithOptionalForce(thePlayer, false);
            }

            changeWorld(world2, "Entering the End", thePlayer);
        }
View Full Code Here

TOP

Related Classes of net.minecraft.src.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.