Upload from upload_mods.ps1
This commit is contained in:
45
Scripts/TileEntity/TileEntityAnimalChickenRebirth.cs
Normal file
45
Scripts/TileEntity/TileEntityAnimalChickenRebirth.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
public class TileEntityAnimalChickenRebirth : TileEntity
|
||||
{
|
||||
public TileEntityAnimalChickenRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
private TileEntityAnimalChickenRebirth(TileEntityAnimalChickenRebirth _other) : base(null)
|
||||
{
|
||||
this.bUserAccessing = _other.bUserAccessing;
|
||||
}
|
||||
|
||||
public override TileEntity Clone()
|
||||
{
|
||||
return new TileEntityAnimalChickenRebirth(this);
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
_br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _bw, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(_bw, _eStreamMode);
|
||||
_bw.Write(1);
|
||||
}
|
||||
|
||||
public int GetEntityID()
|
||||
{
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
public void SetEntityID(int _entityID)
|
||||
{
|
||||
this.entityId = _entityID;
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityAnimalChickenRebirth;
|
||||
}
|
||||
|
||||
private const int ver = 1;
|
||||
}
|
||||
41
Scripts/TileEntity/TileEntityChickenCoopRebirth.cs
Normal file
41
Scripts/TileEntity/TileEntityChickenCoopRebirth.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
public class TileEntityChickenCoopRebirth : TileEntity
|
||||
{
|
||||
public ulong GameTimerTicks = 0UL;
|
||||
public ulong AccumulatedTicks = 0UL;
|
||||
public bool hasNest = false;
|
||||
public bool bUpdating = false;
|
||||
|
||||
public TileEntityChickenCoopRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
this.GameTimerTicks = GameTimer.Instance.ticks;
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityChickenCoopRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.GameTimerTicks = _br.ReadUInt64();
|
||||
this.AccumulatedTicks = _br.ReadUInt64();
|
||||
this.hasNest = _br.ReadBoolean();
|
||||
try
|
||||
{
|
||||
this.bUpdating = _br.ReadBoolean();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.GameTimerTicks);
|
||||
stream.Write(this.AccumulatedTicks);
|
||||
stream.Write(this.hasNest);
|
||||
stream.Write(this.bUpdating);
|
||||
}
|
||||
}
|
||||
26
Scripts/TileEntity/TileEntityFarmPlotRebirth.cs
Normal file
26
Scripts/TileEntity/TileEntityFarmPlotRebirth.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
public class TileEntityFarmPlotRebirth : TileEntity
|
||||
{
|
||||
public int waterCount = 0;
|
||||
public int waterMax = 6;
|
||||
|
||||
public TileEntityFarmPlotRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityFarmPlotRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.waterCount = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.waterCount);
|
||||
}
|
||||
}
|
||||
26
Scripts/TileEntity/TileEntityManualLightRebirth.cs
Normal file
26
Scripts/TileEntity/TileEntityManualLightRebirth.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
public class TileEntityManualLightRebirth : TileEntity
|
||||
{
|
||||
public int powerCount = 0;
|
||||
public int powerMax = 120;
|
||||
|
||||
public TileEntityManualLightRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityManualLightRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.powerCount = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.powerCount);
|
||||
}
|
||||
}
|
||||
51
Scripts/TileEntity/TileEntityPlantGrowingRebirth.cs
Normal file
51
Scripts/TileEntity/TileEntityPlantGrowingRebirth.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using static WeatherManager;
|
||||
|
||||
public class TileEntityPlantGrowingRebirth : TileEntity
|
||||
{
|
||||
public ulong GameTimerTicks;
|
||||
public ulong AccumulatedTicks = 0UL;
|
||||
public bool bUpdating = false;
|
||||
public bool bWatered = false;
|
||||
//public int biome = -1;
|
||||
|
||||
public TileEntityPlantGrowingRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
this.GameTimerTicks = GameTimer.Instance.ticks;
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityPlantGrowingRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.GameTimerTicks = _br.ReadUInt64();
|
||||
this.AccumulatedTicks = _br.ReadUInt64();
|
||||
try
|
||||
{
|
||||
this.bUpdating = _br.ReadBoolean();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
/*try
|
||||
{
|
||||
this.biome = _br.ReadInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}*/
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.GameTimerTicks);
|
||||
stream.Write(this.AccumulatedTicks);
|
||||
stream.Write(this.bUpdating);
|
||||
//stream.Write(this.biome);
|
||||
}
|
||||
|
||||
}
|
||||
26
Scripts/TileEntity/TileEntityResourceFeederRebirth.cs
Normal file
26
Scripts/TileEntity/TileEntityResourceFeederRebirth.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
public class TileEntityResourceFeederRebirth : TileEntity
|
||||
{
|
||||
public int FeedCount = 0;
|
||||
public int FeedMax = 200;
|
||||
|
||||
public TileEntityResourceFeederRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityResourceFeederRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.FeedCount = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.FeedCount);
|
||||
}
|
||||
}
|
||||
11
Scripts/TileEntity/TileEntitySecureBlockRebirth.cs
Normal file
11
Scripts/TileEntity/TileEntitySecureBlockRebirth.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
public class TileEntitySecureBlockRebirth : TileEntitySecure
|
||||
{
|
||||
public TileEntitySecureBlockRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntitySecureBlockRebirth;
|
||||
}
|
||||
}
|
||||
189
Scripts/TileEntity/TileEntitySecureLootContainerRebirth.cs
Normal file
189
Scripts/TileEntity/TileEntitySecureLootContainerRebirth.cs
Normal file
@@ -0,0 +1,189 @@
|
||||
using Platform;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class TileEntitySecureLootContainerRebirth : TileEntityLootContainer, ILockable
|
||||
{
|
||||
public int EntityId { get; set; }
|
||||
|
||||
public TileEntitySecureLootContainerRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-TileEntitySecureLootContainerRebirth START");
|
||||
this.allowedUserIds = new List<PlatformUserIdentifierAbs>();
|
||||
this.isLocked = true;
|
||||
this.ownerID = null;
|
||||
this.password = "";
|
||||
this.bPlayerPlaced = false;
|
||||
this.isLootGatheringActivated = false;
|
||||
}
|
||||
|
||||
public bool IsLocked()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-IsLocked START");
|
||||
return this.isLocked;
|
||||
}
|
||||
|
||||
public void SetLootGatheringActivated(bool _isLootGatheringActivated)
|
||||
{
|
||||
this.isLootGatheringActivated = _isLootGatheringActivated;
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-SetLootGatheringActivated this.isLootGatheringActivated: " + this.isLootGatheringActivated);
|
||||
this.setModified();
|
||||
}
|
||||
|
||||
public void SetLocked(bool _isLocked)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-SetLocked START");
|
||||
this.isLocked = _isLocked;
|
||||
this.setModified();
|
||||
}
|
||||
|
||||
public void SetOwner(PlatformUserIdentifierAbs _userIdentifier)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-SetOwner START");
|
||||
this.ownerID = _userIdentifier;
|
||||
this.setModified();
|
||||
}
|
||||
|
||||
public bool IsUserAllowed(PlatformUserIdentifierAbs _userIdentifier)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-IsUserAllowed START");
|
||||
return (_userIdentifier != null && _userIdentifier.Equals(this.ownerID)) || this.allowedUserIds.Contains(_userIdentifier);
|
||||
}
|
||||
|
||||
public bool LocalPlayerIsOwner()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-LocalPlayerIsOwner START");
|
||||
return this.IsOwner(PlatformManager.InternalLocalUserIdentifier);
|
||||
}
|
||||
|
||||
public bool IsOwner(PlatformUserIdentifierAbs _userIdentifier)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-IsOwner START");
|
||||
return _userIdentifier != null && _userIdentifier.Equals(this.ownerID);
|
||||
}
|
||||
|
||||
public PlatformUserIdentifierAbs GetOwner()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-GetOwner START");
|
||||
return this.ownerID;
|
||||
}
|
||||
|
||||
public bool HasPassword()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-HasPassword START");
|
||||
return !string.IsNullOrEmpty(this.password);
|
||||
}
|
||||
|
||||
public string GetPassword()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-GetPassword START");
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public bool CheckPassword(string _password, PlatformUserIdentifierAbs _userIdentifier, out bool changed)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-CheckPassword START");
|
||||
changed = false;
|
||||
if (_userIdentifier != null && _userIdentifier.Equals(this.ownerID))
|
||||
{
|
||||
if (Utils.HashString(_password) != this.password)
|
||||
{
|
||||
changed = true;
|
||||
this.password = Utils.HashString(_password);
|
||||
this.allowedUserIds.Clear();
|
||||
this.setModified();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (Utils.HashString(_password) == this.password)
|
||||
{
|
||||
this.allowedUserIds.Add(_userIdentifier);
|
||||
this.setModified();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-GetTileEntityType START");
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntitySecureLootContainerRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-read START");
|
||||
base.read(_br, _eStreamMode);
|
||||
_br.ReadInt32();
|
||||
this.isLootGatheringActivated = _br.ReadBoolean();
|
||||
this.bPlayerPlaced = _br.ReadBoolean();
|
||||
this.isLocked = _br.ReadBoolean();
|
||||
this.ownerID = PlatformUserIdentifierAbs.FromStream(_br, false, false);
|
||||
this.password = _br.ReadString();
|
||||
this.allowedUserIds = new List<PlatformUserIdentifierAbs>();
|
||||
int num = _br.ReadInt32();
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
this.allowedUserIds.Add(PlatformUserIdentifierAbs.FromStream(_br, false, false));
|
||||
}
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _bw, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-write START");
|
||||
base.write(_bw, _eStreamMode);
|
||||
_bw.Write(1);
|
||||
_bw.Write(this.isLootGatheringActivated);
|
||||
_bw.Write(this.bPlayerPlaced);
|
||||
_bw.Write(this.isLocked);
|
||||
this.ownerID.ToStream(_bw, false);
|
||||
_bw.Write(this.password);
|
||||
_bw.Write(this.allowedUserIds.Count);
|
||||
for (int i = 0; i < this.allowedUserIds.Count; i++)
|
||||
{
|
||||
this.allowedUserIds[i].ToStream(_bw, false);
|
||||
}
|
||||
}
|
||||
|
||||
public int GetEntityID()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-GetEntityID START");
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
public void SetEntityID(int _entityID)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-SetEntityID START");
|
||||
this.entityId = _entityID;
|
||||
}
|
||||
|
||||
public override void UpgradeDowngradeFrom(TileEntity _other)
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-UpgradeDowngradeFrom START");
|
||||
base.UpgradeDowngradeFrom(_other);
|
||||
if (_other is ILockable)
|
||||
{
|
||||
ILockable lockable = _other as ILockable;
|
||||
this.SetEntityID(lockable.EntityId);
|
||||
this.SetLocked(lockable.IsLocked());
|
||||
this.SetOwner(lockable.GetOwner());
|
||||
this.allowedUserIds = new List<PlatformUserIdentifierAbs>(lockable.GetUsers());
|
||||
this.password = lockable.GetPassword();
|
||||
this.setModified();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PlatformUserIdentifierAbs> GetUsers()
|
||||
{
|
||||
//Log.Out("TileEntitySecureLootContainerRebirth-GetUsers START");
|
||||
return this.allowedUserIds;
|
||||
}
|
||||
|
||||
private const int ver = 1;
|
||||
protected bool isLocked;
|
||||
protected PlatformUserIdentifierAbs ownerID;
|
||||
protected List<PlatformUserIdentifierAbs> allowedUserIds;
|
||||
public float PickTimeLeft = -1f;
|
||||
protected string password;
|
||||
protected bool bPlayerPlaced;
|
||||
public bool isLootGatheringActivated = false;
|
||||
}
|
||||
31
Scripts/TileEntity/TileEntitySpawnPOIEntityRebirth.cs
Normal file
31
Scripts/TileEntity/TileEntitySpawnPOIEntityRebirth.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
public class TileEntitySpawnPOIEntityRebirth : TileEntity
|
||||
{
|
||||
public int entityID;
|
||||
public Vector3i blockPos;
|
||||
|
||||
public TileEntitySpawnPOIEntityRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
this.entityID = -1;
|
||||
this.blockPos = new Vector3i(0, 0, 0);
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntitySpawnPOIEntityRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.entityID = _br.ReadInt16();
|
||||
this.blockPos = StreamUtils.ReadVector3i(_br);
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.entityID);
|
||||
StreamUtils.Write(stream, this.blockPos);
|
||||
}
|
||||
|
||||
}
|
||||
25
Scripts/TileEntity/TileEntitySpawnPoint.cs
Normal file
25
Scripts/TileEntity/TileEntitySpawnPoint.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
public class TileEntitySpawnPoint : TileEntity
|
||||
{
|
||||
public int used = 0;
|
||||
|
||||
public TileEntitySpawnPoint(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntitySpawnPoint;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.used = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.used);
|
||||
}
|
||||
}
|
||||
50
Scripts/TileEntity/TileEntitySurvivorRebirth.cs
Normal file
50
Scripts/TileEntity/TileEntitySurvivorRebirth.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
public class TileEntitySurvivorRebirth : TileEntity
|
||||
{
|
||||
public TileEntitySurvivorRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
private TileEntitySurvivorRebirth(TileEntitySurvivorRebirth _other) : base(null)
|
||||
{
|
||||
this.bUserAccessing = _other.bUserAccessing;
|
||||
}
|
||||
|
||||
public override TileEntity Clone()
|
||||
{
|
||||
return new TileEntitySurvivorRebirth(this);
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
_br.ReadInt32();
|
||||
this.strSerialize = _br.ReadString();
|
||||
//Log.Out("TileEntitySurvivorRebirth-read strSerialize: " + strSerialize);
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter _bw, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(_bw, _eStreamMode);
|
||||
_bw.Write(1);
|
||||
_bw.Write(this.strSerialize);
|
||||
//Log.Out("TileEntitySurvivorRebirth-write strSerialize: " + strSerialize);
|
||||
}
|
||||
|
||||
public int GetEntityID()
|
||||
{
|
||||
return this.entityId;
|
||||
}
|
||||
|
||||
public void SetEntityID(int _entityID)
|
||||
{
|
||||
this.entityId = _entityID;
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntitySurvivorRebirth;
|
||||
}
|
||||
|
||||
private const int ver = 1;
|
||||
public string strSerialize = "";
|
||||
}
|
||||
25
Scripts/TileEntity/TileEntityTimedBlockRebirth.cs
Normal file
25
Scripts/TileEntity/TileEntityTimedBlockRebirth.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
public class TileEntityTimedBlockRebirth : TileEntity
|
||||
{
|
||||
public int duration = 0;
|
||||
|
||||
public TileEntityTimedBlockRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityTimedBlockRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.duration = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.duration);
|
||||
}
|
||||
}
|
||||
29
Scripts/TileEntity/TileEntityWaterTankRebirth.cs
Normal file
29
Scripts/TileEntity/TileEntityWaterTankRebirth.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
public class TileEntityWaterTankRebirth : TileEntity
|
||||
{
|
||||
public int waterCount = 0;
|
||||
public int waterMax = 100;
|
||||
public int timeLapsed = 0;
|
||||
|
||||
public TileEntityWaterTankRebirth(Chunk _chunk) : base(_chunk)
|
||||
{
|
||||
}
|
||||
|
||||
public override TileEntityType GetTileEntityType()
|
||||
{
|
||||
return (TileEntityType)RebirthUtilities.TileEntityRebirth.TileEntityWaterTankRebirth;
|
||||
}
|
||||
|
||||
public override void read(PooledBinaryReader _br, TileEntity.StreamModeRead _eStreamMode)
|
||||
{
|
||||
base.read(_br, _eStreamMode);
|
||||
this.waterCount = _br.ReadInt32();
|
||||
this.timeLapsed = _br.ReadInt32();
|
||||
}
|
||||
|
||||
public override void write(PooledBinaryWriter stream, TileEntity.StreamModeWrite _eStreamMode)
|
||||
{
|
||||
base.write(stream, _eStreamMode);
|
||||
stream.Write(this.waterCount);
|
||||
stream.Write(this.timeLapsed);
|
||||
}
|
||||
}
|
||||
48
Scripts/TileEntity/TileEntityWorkstationRebirth.cs
Normal file
48
Scripts/TileEntity/TileEntityWorkstationRebirth.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
#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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user