Examples of ChunkPosition


Examples of net.minecraft.world.ChunkPosition

    toInvalidate.clear();
    for (Map.Entry<ChunkPosition, TileEntity> entry : tileMap.entrySet()) {
      TileEntity tileEntity = entry.getValue();
      if ((!tileEntity.canUpdate() && tileEntity.isInvalid()) || tileEntity.getClass() == TileEntity.class) {
        tileEntity.invalidate();
        ChunkPosition position = entry.getKey();
        tileMap.remove(position);
        worldObj.loadedTileEntityList.remove(tileEntity);
        int x = position.x, y = position.y, z = position.z;
        int id = getBlockID(x, y, z);
        int meta = getBlockMetadata(x, y, z);
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

  }

  @Override
  @Declare
  public void setChunkBlockTileEntityWithoutValidate(int x, int y, int z, TileEntity tileEntity) {
    ChunkPosition var5 = new ChunkPosition(x, y, z);
    tileEntity.worldObj = worldObj;
    tileEntity.xCoord = xPosition * 16 + x;
    tileEntity.yCoord = y;
    tileEntity.zCoord = zPosition * 16 + z;

View Full Code Here

Examples of net.minecraft.world.ChunkPosition

    }
  }

  @Override
  public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) {
    ChunkPosition position = new ChunkPosition(par1, par2, par3);
    TileEntity tileEntity = this.tileMap.get(position);

    if (tileEntity != null && tileEntity.isInvalid()) {
      tileMap.remove(position);
      worldObj.loadedTileEntityList.remove(tileEntity);
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

        update();
    }

    public void update(){
        entityItem.age += 4;
        ChunkPosition lastPos = pos;
        pos = drone.getTargetedBlock();
        if(pos != null) {
            if(lastPos == null) {
                oldPos = pos;
            } else if(!pos.equals(lastPos)) {
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

            radioButtons.add(radioButton);
            radioButton.otherChoices = radioButtons;
        }
        if(invSearchGui != null) {
            ProgWidgetArea area = (ProgWidgetArea)widget;
            ChunkPosition pos = invSearchGui.getSearchStack() != null ? ItemGPSTool.getGPSLocation(invSearchGui.getSearchStack()) : null;
            if(pos != null) {
                if(pointSearched == 0) {
                    area.x1 = pos.chunkPosX;
                    area.y1 = pos.chunkPosY;
                    area.z1 = pos.chunkPosZ;
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

        NBTTagCompound compound = gpsTool.stackTagCompound;
        int x = compound.getInteger("x");
        int y = compound.getInteger("y");
        int z = compound.getInteger("z");
        if(x != 0 || y != 0 || z != 0) {
            return new ChunkPosition(x, y, z);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

        this.entity = entity;
    }

    @Override
    public int compare(Object arg0, Object arg1){
        ChunkPosition c1 = (ChunkPosition)arg0;
        ChunkPosition c2 = (ChunkPosition)arg1;
        return Double.compare(PneumaticCraftUtils.distBetween(c1.chunkPosX, c1.chunkPosY, c1.chunkPosZ, entity.posX, entity.posY, entity.posZ), PneumaticCraftUtils.distBetween(c2.chunkPosX, c2.chunkPosY, c2.chunkPosZ, entity.posX, entity.posY, entity.posZ));
    }
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

        }
        if(validDroneStacks.isEmpty()) return false;

        List<IInventory> inventories = new ArrayList<IInventory>();
        for(TileEntity te : (List<TileEntity>)drone.worldObj.loadedTileEntityList) {
            if(te instanceof IInventory && validArea.contains(new ChunkPosition(te.xCoord, te.yCoord, te.zCoord))) {
                inventories.add((IInventory)te);
            }
        }

        Collections.sort(inventories, closestTileEntitySorter);
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

    public static IBlockAccess getCache(Set<ChunkPosition> area, World world){
        if(area.size() == 0) return world;
        int minX, minY, minZ, maxX, maxY, maxZ;
        Iterator<ChunkPosition> iterator = area.iterator();
        ChunkPosition p = iterator.next();
        minX = maxX = p.chunkPosX;
        minY = maxY = p.chunkPosY;
        minZ = maxZ = p.chunkPosZ;
        while(iterator.hasNext()) {
            p = iterator.next();
View Full Code Here

Examples of net.minecraft.world.ChunkPosition

    public static ChunkPosition getEntityLookedBlock(EntityLivingBase entity, float maxDistance){
        MovingObjectPosition hit = getEntityLookedObject(entity, maxDistance);
        if(hit == null || hit.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
            return null;
        }
        return new ChunkPosition(hit.blockX, hit.blockY, hit.blockZ);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.