Examples of TileEntityTreasureChest


Examples of micdoodle8.mods.galacticraft.core.tile.TileEntityTreasureChest

    @Override
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5)
    {
        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
        final TileEntityTreasureChest var6 = (TileEntityTreasureChest) par1World.getTileEntity(par2, par3, par4);

        if (var6 != null)
        {
            var6.updateContainingBlockInfo();
        }
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.tile.TileEntityTreasureChest

    }

    @Override
    public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6)
    {
        final TileEntityTreasureChest var7 = (TileEntityTreasureChest) par1World.getTileEntity(par2, par3, par4);

        if (var7 != null)
        {
            for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8)
            {
                final ItemStack var9 = var7.getStackInSlot(var8);

                if (var9 != null)
                {
                    final float var10 = this.random.nextFloat() * 0.8F + 0.1F;
                    final float var11 = this.random.nextFloat() * 0.8F + 0.1F;
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.tile.TileEntityTreasureChest

    }

    @Override
    public TileEntity createNewTileEntity(World par1World, int metadata)
    {
        return new TileEntityTreasureChest(1);
    }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.tile.TileEntityTreasureChest

                  {
                      final double d3 = tile.xCoord + 0.5D - this.posX;
                      final double d4 = tile.yCoord + 0.5D - this.posY;
                      final double d5 = tile.zCoord + 0.5D - this.posZ;
                      final double dSq = d3 * d3 + d4 * d4 + d5 * d5;
                      TileEntityTreasureChest chest = (TileEntityTreasureChest) tile;
 
                      if (dSq < 10000)
                      {
                        if (!chest.locked)
                          {
                              chest.locked = true;
                          }
 
                          for (int k = 0; k < chest.getSizeInventory(); k++)
                          {
                              chest.setInventorySlotContents(k, null);
                          }
 
                          ChestGenHooks info = ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST);
 
                          // Generate twice, since it's an extra special chest
                          WeightedRandomChestContent.generateChestContents(this.rand, info.getItems(this.rand), chest, info.getCount(this.rand));
                          WeightedRandomChestContent.generateChestContents(this.rand, info.getItems(this.rand), chest, info.getCount(this.rand));
 
                          ItemStack schematic = this.getGuaranteedLoot(this.rand);
                          int slot = this.rand.nextInt(chest.getSizeInventory());
                          chest.setInventorySlotContents(slot, schematic);
 
                          break;
                      }
                  }
              }
View Full Code Here

Examples of micdoodle8.mods.galacticraft.core.tile.TileEntityTreasureChest

            HashSet<ChunkCoordinates> removeList = new HashSet<ChunkCoordinates>();

            for (ChunkCoordinates coords : this.chests)
            {
                this.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, GCBlocks.treasureChestTier1, 0, 3);
                this.worldObj.setTileEntity(coords.posX, coords.posY, coords.posZ, new TileEntityTreasureChest(1));
                removeList.add(coords);
            }

            this.chests.removeAll(removeList);
        }
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.