public override string GetActivationText(global::WorldBase _world, global::BlockValue _blockValue, int _clrIdx, global::Vector3i _blockPos, global::EntityAlive _entityFocusing) { return("Press <E> to remove the wood from this block."); }
public override global::BlockActivationCommand[] GetBlockActivationCommands(global::WorldBase _world, global::BlockValue _blockValue, int _clrIdx, global::Vector3i _blockPos, global::EntityAlive _entityFocusing) { bool flag = _world.IsMyLandProtectedBlock(_blockPos, _world.GetGameManager().GetPersistentLocalPlayer(), false); this.blockActivationCommand[0].enabled = (this.CanPickup && flag && this.TakeDelay > 0f); return(this.blockActivationCommand); }
public override string GetActivationText(global::WorldBase _world, global::BlockValue _blockValue, int _clrIdx, global::Vector3i _blockPos, global::EntityAlive _entityFocusing) { return(string.Format(Localization.Get("takeandreplace", string.Empty), Localization.Get(_blockValue.Block.GetBlockName(), string.Empty))); // return "Press <E> to remove the wood from this block."; }
public override string GetActivationText(global::WorldBase _world, global::BlockValue _blockValue, int _clrIdx, global::Vector3i _blockPos, global::EntityAlive _entityFocusing) { // If this.CanPickup is enabled, we don't want to be bothered by the pickup text when in the middle of a blood moon return(string.Empty); }
public override void OnBlockRemoved(global::WorldBase world, global::Chunk _chunk, global::Vector3i _blockPos, global::BlockValue _blockValue) { if (_blockValue.damage > 0) { // Only remove TileEntity and wire when block is removed because it's destroyed, not when picked up by player, or upgraded to Fire version. // Removal of TileEntity and wire when player is picking it up is done in TakeBlock() base.OnBlockRemoved(world, (Chunk)world.GetChunkFromWorldPos(_blockPos), _blockPos, _blockValue); } else { this.shape.OnBlockRemoved(world, _chunk, _blockPos, _blockValue); } }
public override bool OnBlockActivated(int _indexInBlockActivationCommands, global::WorldBase _world, int _cIdx, global::Vector3i _blockPos, global::BlockValue _blockValue, global::EntityAlive _player) { global::BlockValue block = _world.GetBlock(_blockPos.x, _blockPos.y - 1, _blockPos.z); if (global::Block.list[block.type].HasTag(global::BlockTags.Door)) { _blockPos = new global::Vector3i(_blockPos.x, _blockPos.y - 1, _blockPos.z); return(this.OnBlockActivated(_indexInBlockActivationCommands, _world, _cIdx, _blockPos, _blockValue, _player)); } if (_indexInBlockActivationCommands != 0) { return(false); } this.TakeItemWithTimer2(_cIdx, _blockPos, _blockValue, _player); return(true); }
// Call the PlantUpdate tick to control upgrades, and the base UpdateTick to allow water flow. public override bool UpdateTick(global::WorldBase world, int _clrIdx, global::Vector3i _blockPos, global::BlockValue _blockValue, bool _bRandomTick, ulong _ticksIfLoaded, System.Random _rnd) { PlantUpdateTick(world, _clrIdx, _blockPos, _blockValue, _bRandomTick, _ticksIfLoaded, _rnd); return(base.UpdateTick(world, _clrIdx, _blockPos, _blockValue, _bRandomTick, _ticksIfLoaded, _rnd)); }
public override void OnBlockRemoved(global::WorldBase world, global::Chunk _chunk, global::Vector3i _blockPos, global::BlockValue _blockValue) { // Don't remove TileEntity and wire when block is removed because it's destroyed, we keep it for the downgrade version of the block so wires stay connected this.shape.OnBlockRemoved(world, _chunk, _blockPos, _blockValue); }