Package net.minecraft.world

Examples of net.minecraft.world.World


  private CombustionGeneratorModel model = new CombustionGeneratorModel();
 
  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {
   
    World world = te.getWorldObj();
    TileCombustionGenerator gen = (TileCombustionGenerator)te;
//    GL11.glEnable(GL11.GL_LIGHTING);
//    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
//    GL11.glDisable(GL11.GL_CULL_FACE);

   
   
   
    float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
    int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
    int l1 = l % 65536;
    int l2 = l / 65536;
    Tessellator.instance.setColorOpaque_F(f, f, f);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);
   
View Full Code Here


  private ModelZombieJar model = new ModelZombieJar();

  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {

    World world = te.getWorldObj();
    TileZombieGenerator gen = (TileZombieGenerator) te;

    float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
    int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
    int l1 = l % 65536;
    int l2 = l / 65536;
    Tessellator.instance.setColorOpaque_F(f, f, f);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) l1, (float) l2);
View Full Code Here

  public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    if(!farm.isOpen(bc)) {
      return false;
    }
    if(requiresFarmland()) {
      World worldObj = farm.getWorldObj();
      if(isGroundTilled(farm, bc)) {
        return plantFromInventory(farm, bc);
      }
      if(farm.hasSeed(getSeeds(), bc)) {
        boolean tilled = tillBlock(farm, bc);
View Full Code Here

  public void setRequiresFarmland(boolean requiresFarmland) {
    this.requiresFarmland = requiresFarmland;
  }

  protected boolean plantFromInventory(TileFarmStation farm, BlockCoord bc) {
    World worldObj = farm.getWorldObj();
    if(canPlant(worldObj, bc) && farm.takeSeedFromSupplies(getSeeds(), bc) != null) {
      return plant(farm, worldObj, bc);
    }
    return false;
  }
View Full Code Here

    if(!farm.hasHoe()) {
      farm.setNotification(TileFarmStation.NOTIFICATION_NO_HOE);
      return null;
    }

    World worldObj = farm.getWorldObj();
    List<EntityItem> result = new ArrayList<EntityItem>();

    ArrayList<ItemStack> drops = block.getDrops(worldObj, bc.x, bc.y, bc.z, meta, farm.getMaxLootingValue());
    farm.damageHoe(1, bc);
    farm.actionPerformed(false);
    boolean removed = false;
    if(drops != null) {
      for (ItemStack stack : drops) {
        if(!removed && stack.isItemEqual(getSeeds())) {
          stack.stackSize--;
          removed = true;
          if(stack.stackSize > 0) {
            result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
          }
        } else {
          result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
        }
      }
    }

    if(removed) {
      if(!plant(farm, worldObj, bc)) {
        result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, getSeeds().copy()));
        worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
      }
    } else {
      worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
    }

    return new HarvestResult(result, bc);
  }
View Full Code Here

  }

 

  protected boolean tillBlock(TileFarmStation farm, BlockCoord plantingLocation) {
    World worldObj = farm.getWorldObj();
    BlockCoord dirtLoc = plantingLocation.getLocation(ForgeDirection.DOWN);
    Block dirtBlock = farm.getBlock(dirtLoc);
    if((dirtBlock == Blocks.dirt || dirtBlock == Blocks.grass) && farm.hasHoe()) {
      farm.damageHoe(1, dirtLoc);
      worldObj.setBlock(dirtLoc.x, dirtLoc.y, dirtLoc.z, Blocks.farmland);
      worldObj.playSoundEffect(dirtLoc.x + 0.5F, dirtLoc.y + 0.5F, dirtLoc.z + 0.5F, Blocks.farmland.stepSound.getStepResourcePath(),
          (Blocks.farmland.stepSound.getVolume() + 1.0F) / 2.0F, Blocks.farmland.stepSound.getPitch() * 0.8F);
      farm.actionPerformed(false);
      return true;
    }
    return false;
View Full Code Here

    }
    return plantFromInventory(farm, bc, block, meta);
  }

  protected boolean plantFromInventory(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
    World worldObj = farm.getWorldObj();
    if(canPlant(worldObj, bc)) {
      ItemStack seed = farm.takeSeedFromSupplies(saplingItem, bc, false);
      if(seed != null) {
        return plant(farm, worldObj, bc, seed);
      }
View Full Code Here

    if(!farm.hasHoe()) {
      farm.setNotification(TileFarmStation.NOTIFICATION_NO_HOE);
      return null;
    }
    EntityPlayerMP player = farm.getFakePlayer();
    World world = farm.getWorldObj();
    player.theItemInWorldManager.activateBlockOrUseItem(player, player.worldObj, null, bc.x, bc.y, bc.z, 0, 0, 0, 0);   
   
    List<EntityItem> drops = new ArrayList<EntityItem>();
   
    ItemStack[] inv = player.inventory.mainInventory;
View Full Code Here

  public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {

    if(!farm.isOpen(bc)) {
      return false;
    }
    World worldObj = farm.getWorldObj();
    BlockCoord grn = bc.getLocation(ForgeDirection.DOWN);
    Block blk = worldObj.getBlock(grn.x, grn.y, grn.z);
   
    return plantFromInventory(farm, bc);
  }
View Full Code Here

    return res;
  }

  @Override
  protected boolean plantFromInventory(TileFarmStation farm, BlockCoord bc) {
    World worldObj = farm.getWorldObj();
    if(canPlant(worldObj, bc) && farm.takeSeedFromSupplies(seeds, bc) != null) {
      return plant(farm, worldObj, bc);
    }
    return false;
  }
View Full Code Here

TOP

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