Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/TileEntity/TileEntityWorkstationRebirth.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

49 lines
1.5 KiB
C#

#nullable disable
public class TileEntityWorkstationRebirth : TileEntityWorkstation
{
public TileEntityWorkstationRebirth(Chunk _chunk)
: base(_chunk)
{
this.fuel = ItemStack.CreateArray(3);
this.tools = ItemStack.CreateArray(3);
this.output = ItemStack.CreateArray(6);
this.input = ItemStack.CreateArray(3);
this.lastInput = ItemStack.CreateArray(3);
this.queue = new RecipeQueueItem[4];
this.materialNames = new string[0];
this.isModuleUsed = new bool[5];
this.currentMeltTimesLeft = new float[this.input.Length];
this.ownerID = (PlatformUserIdentifierAbs)null;
}
[PublicizedFrom(EAccessModifier.Private)]
public PlatformUserIdentifierAbs ownerID;
public void SetOwner(PlatformUserIdentifierAbs _userIdentifier)
{
this.ownerID = _userIdentifier;
this.setModified();
}
public PlatformUserIdentifierAbs GetOwner() => this.ownerID;
public bool IsOwner(PlatformUserIdentifierAbs _userIdentifier)
{
return _userIdentifier != null && _userIdentifier.Equals(this.ownerID);
}
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
{
base.read(_br, _eStreamMode);
this.ownerID = PlatformUserIdentifierAbs.FromStream((BinaryReader)_br);
}
public override void write(PooledBinaryWriter _bw, TileEntity.StreamModeWrite _eStreamMode)
{
base.write(_bw, _eStreamMode);
this.ownerID.ToStream((BinaryWriter)_bw);
}
}