Examples of TileEntity


Examples of net.glowstone.block.entity.TileEntity

    private void createEntity(int cx, int cy, int cz, int type) {
        BlockType blockType = ItemTable.instance().getBlock(type);
        if (blockType == null) return;

        try {
            TileEntity entity = blockType.createTileEntity(this, cx, cy, cz);
            if (entity == null) return;

            tileEntities.put(coordToIndex(cx, cz, cy), entity);
        } catch (Exception ex) {
            GlowServer.logger.log(Level.SEVERE, "Unable to initialize tile entity for " + type, ex);
View Full Code Here

Examples of net.minecraft.server.TileEntity

  {
    if(chunk == null || RecipeManager.recipes.furnaceSmelting == null)
      return;
   
    net.minecraft.server.Chunk mcChunk = ((CraftChunk)chunk).getHandle();
    TileEntity tile;
   
    for(Object obj : mcChunk.tileEntities.values())
    {
      if(obj != null && obj instanceof TileEntity)
      {
View Full Code Here

Examples of net.minecraft.src.TileEntity

                    Block block = Block.blocksList[id];

                    if (block != null) {
                      if (renderPass == 0 && block.hasTileEntity()) {
                        TileEntity var20 = chunkCache.getBlockTileEntity(dx, dy, dz);
                        if (TileEntityRenderer.instance.hasSpecialRenderer(var20)) {
                          this.tileEntityRenderers.add(var20);
                        }
                      }
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

  @Override
  public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
    super.writeToWorld(context, x, y, z, stacks);

    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

      cpt.setInteger("x", x);
      cpt.setInteger("y", y);
      cpt.setInteger("z", z);

      if (tile != null) {
        tile.readFromNBT(cpt);
      }
    }
  }
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

  @Override
  public void readFromWorld(IBuilderContext context, int x, int y, int z) {
    super.readFromWorld(context, x, y, z);

    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

      if (tile != null) {
        tile.writeToNBT(cpt);
      }
    }
  }
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

  @Override
  public void readRequirementsFromWorld(IBuilderContext context, int x, int y, int z) {
    super.readRequirementsFromWorld(context, x, y, z);

    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

      if (tile instanceof IInventory) {
        IInventory inv = (IInventory) tile;

        ArrayList<ItemStack> rqs = new ArrayList<ItemStack>();
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

    if (mop == null)
      return itemstack;

    Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ);
    int meta = world.getBlockMetadata(mop.blockX, mop.blockY, mop.blockZ);
        TileEntity tile = world.getTileEntity(mop.blockX, mop.blockY, mop.blockZ);
    ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();

    if (player.canPlayerEdit(mop.blockX, mop.blockY, mop.blockZ, mop.sideHit, itemstack)) {
      ItemStack stack = getPickedBlock(itemstack);
      if (stack != null) {
        if (mop.sideHit == 0)
          --mop.blockY;
        if (mop.sideHit == 1)
          ++mop.blockY;
        if (mop.sideHit == 2)
          --mop.blockZ;
        if (mop.sideHit == 3)
          ++mop.blockZ;
        if (mop.sideHit == 4)
          --mop.blockX;
        if (mop.sideHit == 5)
          ++mop.blockX;

        if (block.canPlaceBlockOnSide(world, mop.blockX, mop.blockY, mop.blockZ, mop.sideHit)) {
          if (!world.isRemote) {
            world.setBlock(mop.blockX, mop.blockY, mop.blockZ, ((ItemBlock) stack.getItem()).field_150939_a, stack.getItemDamage(), 1 | 2);
            block.onBlockPlacedBy(world, mop.blockX, mop.blockY, mop.blockZ, player, itemstack);
            NBTTagCompound tileCmp = getStackTileEntity(itemstack);
            if (tileCmp != null && !tileCmp.hasNoTags()) {
              TileEntity tile1 = TileEntity.createAndLoadEntity(tileCmp);
              tile1.xCoord = mop.blockX;
              tile1.yCoord = mop.blockY;
              tile1.zCoord = mop.blockZ;
              world.setTileEntity(mop.blockX, mop.blockY, mop.blockZ, tile1);
            }
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

    return null;
  }

  @Override
  public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
    TileEntity te = world.getTileEntity(x, y, z);
    if (te != null)
      return getPeripheral(te);
    return null;
  }
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

  @Override
  public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
    if (par3World.isRemote)
      return false;

    TileEntity tile = par3World.getTileEntity(par4, par5, par6);

    if (getY(par1ItemStack) == -1) {
      if (tile != null && (tile instanceof TileTransvector || tile instanceof TileGolemConnector)) {
        setX(par1ItemStack, par4);
        setY(par1ItemStack, par5);
        setZ(par1ItemStack, par6);

        if (par3World.isRemote)
          par2EntityPlayer.swingItem();

        playSound(par3World, par4, par5, par6);
        if (tile instanceof TileTransvector)
          par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.set"));
        else
          par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.golemconnector.set"));
      } else
        par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.notinterf"));
    } else {
      int x = getX(par1ItemStack);
      int y = getY(par1ItemStack);
      int z = getZ(par1ItemStack);

      TileEntity tile1 = par3World.getTileEntity(x, y, z);
      if (tile1 == null || !(tile1 instanceof TileTransvector)) {
        setY(par1ItemStack, -1);

        par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.notpresent"));
      } else {
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity

          return true;
        }
        int x = getX(par1ItemStack);
        int y = getY(par1ItemStack);
        int z = getZ(par1ItemStack);
        TileEntity tile1 = par2EntityPlayer.worldObj.getTileEntity(x, y, z);
        if (tile1 == null || !(tile1 instanceof TileGolemConnector)) {
          setY(par1ItemStack, -1);
          if (par3EntityLivingBase.worldObj.isRemote) {
            return false;
          }
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.