Exemple #1
0
 static bool Prefix(ref TileEntity __result, TileEntityType type, Chunk _chunk)
 {
     if ((int)type == 0x17)
     {
         __result = new ImprovedTileEntitySecureLootContainer(_chunk);
         return(false);
     }
     return(true);
 }
Exemple #2
0
 public override void OnBlockAdded(WorldBase world, Chunk _chunk, Vector3i _blockPos, BlockValue _blockValue)
 {
     base.OnBlockAdded(world, _chunk, _blockPos, _blockValue);
     if (_blockValue.ischild)
     {
         return;
     }
     if (!(world.GetTileEntity(_chunk.ClrIdx, _blockPos) is ImprovedTileEntitySecureLootContainer))
     {
         ImprovedTileEntitySecureLootContainer tileEntitySecureLootContainer = new ImprovedTileEntitySecureLootContainer(_chunk);
         tileEntitySecureLootContainer.localChunkPos = World.toBlock(_blockPos);
         tileEntitySecureLootContainer.lootListIndex = (int)((ushort)this.lootList);
         tileEntitySecureLootContainer.SetContainerSize(LootContainer.lootList[this.lootList].size, true);
         _chunk.AddTileEntity(tileEntitySecureLootContainer);
     }
 }