コード例 #1
0
    /**
     * Helper method to add and set up a tile entity for the block.
     */

    protected override void addTileEntity(WorldBase world, Chunk _chunk, Vector3i _blockPos, BlockValue _blockValue)
    {
        Log.Out("Nearby Blocks needed? " + transformationPropertyParser.requireNearbyBlocks.ToString());
        TileEntityBlockTransformer tileEntityBlockTransformer = new TileEntityBlockTransformer(_chunk);

        tileEntityBlockTransformer.localChunkPos = World.toBlock(_blockPos);
        tileEntityBlockTransformer.lootListIndex = (int)((ushort)this.lootList);
        tileEntityBlockTransformer.SetContainerSize(LootContainer.lootList[this.lootList].size, true);
        tileEntityBlockTransformer.SetTransformationCollection(this.transformationPropertyParser.collection);
        tileEntityBlockTransformer.SetRequirePower(
            this.transformationPropertyParser.requirePower,
            this.transformationPropertyParser.powerSources
            );
        tileEntityBlockTransformer.SetRequireHeat(
            this.transformationPropertyParser.requireHeat,
            this.transformationPropertyParser.heatSources
            );
        tileEntityBlockTransformer.SetRequireNearbyBlocks(
            this.transformationPropertyParser.requireNearbyBlocks,
            this.transformationPropertyParser.nearbyBlockNames,
            this.transformationPropertyParser.nearbyBlockTags,
            this.transformationPropertyParser.requireAllTags,
            this.transformationPropertyParser.nearbyBlockRange,
            this.transformationPropertyParser.nearbyBlockCount
            );
        tileEntityBlockTransformer.SetRequireUserAccess(
            this.transformationPropertyParser.requireUserAccess
            );
        tileEntityBlockTransformer.CalculateLookupCoordinates();
        _chunk.AddTileEntity(tileEntityBlockTransformer);
    }
コード例 #2
0
    /**
     * Helper method to add and set up a tile entity for the block.
     */

    protected override void addTileEntity(WorldBase world, Chunk _chunk, Vector3i _blockPos, BlockValue _blockValue)
    {
        TileEntityBlockTransformer tileEntityBlockTransformer = new TileEntityBlockTransformer(_chunk);

        tileEntityBlockTransformer.localChunkPos = World.toBlock(_blockPos);
        tileEntityBlockTransformer.lootListIndex = (int)((ushort)this.lootList);
        tileEntityBlockTransformer.SetContainerSize(LootContainer.lootList[this.lootList].size, true);
        tileEntityBlockTransformer.SetTransformationCollection(this.collection);
        tileEntityBlockTransformer.SetRequirePower(this.requirePower, this.powerSources);
        tileEntityBlockTransformer.SetRequireHeat(this.requireHeat, this.heatSources);
        _chunk.AddTileEntity(tileEntityBlockTransformer);
    }