NO MORE MULTIPLAYER. This is my last stardew wish and I'll make what I can.

This commit is contained in:
JoshuaNavarro 2019-09-22 02:32:59 -07:00
parent 0d373b5d83
commit 4eda84e57d
8 changed files with 101 additions and 69 deletions

View File

@ -186,22 +186,6 @@ namespace Revitalize.Framework.Objects.CraftingTables
}
/// <summary>
///Used to manage graphics for chairs that need to deal with special "layering" for transparent chair backs. Otherwise the player would be hidden.
/// </summary>
public void checkForSpecialUpSittingAnimation()
{
if (this.info.facingDirection == Enums.Direction.Up && Revitalize.ModCore.playerInfo.sittingInfo.SittingObject == this.containerObject)
{
string animationKey = "Sitting_" + (int)Enums.Direction.Up;
if (this.animationManager.animations.ContainsKey(animationKey))
{
this.animationManager.setAnimation(animationKey);
}
}
}
/// <summary>What happens when the object is drawn at a tile location.</summary>
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
{

View File

@ -741,7 +741,7 @@ namespace Revitalize.Framework.Objects
public override void updateWhenCurrentLocation(GameTime time, GameLocation environment)
{
this.updateInfo();
//this.updateInfo();
if (this.location == null)
{
this.location = environment;

View File

@ -117,6 +117,11 @@ namespace Revitalize.Framework.Objects.Machines
//return base.minutesElapsed(minutes, environment);
}
public override void rebuild(Dictionary<string, string> additionalSaveData, object replacement)
{
base.rebuild(additionalSaveData, replacement);
}
public override bool rightClicked(Farmer who)
{
if (this.location == null)
@ -130,38 +135,51 @@ namespace Revitalize.Framework.Objects.Machines
public override Item getOne()
{
Grinder component = new Grinder(this.data, this.info.Copy(), this.TileLocation, this.offsetKey, this.producedResources, ModCore.Configs.machinesConfig.grinderEnergyConsumption, this.timeToProduce, this.updatesContainerObjectForProduction, this.craftingRecipeBook, this.containerObject);
Grinder component = new Grinder(this.data, this.info.Copy(), this.TileLocation, this.offsetKey, this.producedResources, ModCore.Configs.machinesConfig.grinderEnergyConsumption, this.timeToProduce, this.updatesContainerObjectForProduction, this.craftingRecipeBook);
component.containerObject = this.containerObject;
component.offsetKey = this.offsetKey;
return component;
return component;
}
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
{
//instead of using this.offsetkey.x use get additional save data function and store offset key there
Vector2 offsetKey = new Vector2(Convert.ToInt32(additionalSaveData["offsetKeyX"]), Convert.ToInt32(additionalSaveData["offsetKeyY"]));
string GUID = additionalSaveData["GUID"];
Grinder self = Revitalize.ModCore.Serializer.DeserializeGUID<Grinder>(additionalSaveData["GUID"]);
if (self == null)
if (ModCore.IsNullOrDefault<Machine>(self)) return null;
try
{
return null;
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
{
MultiTiledObject obj = (MultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<MultiTiledObject>(additionalSaveData["ParentGUID"]);
self.containerObject = obj;
self.containerObject.removeComponent(offsetKey);
self.containerObject.addComponent(offsetKey, self);
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], obj);
}
else
{
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
self.containerObject.removeComponent(offsetKey);
self.containerObject.addComponent(offsetKey, self);
}
}
catch (Exception err)
{
ModCore.log(err);
}
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
{
//Get new container
MultiTiledObject obj = (MultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<MultiTiledObject>(additionalSaveData["ParentGUID"]);
self.containerObject = obj;
obj.addComponent(offsetKey, self);
//Revitalize.ModCore.log("ADD IN AN OBJECT!!!!");
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], (MultiTiledObject)obj);
}
else
{
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
Revitalize.ModCore.ObjectGroups[additionalSaveData["GUID"]].addComponent(offsetKey, self);
//Revitalize.ModCore.log("READD AN OBJECT!!!!");
}
return self;
}
public override Dictionary<string, string> getAdditionalSaveData()
{
Dictionary<string, string> saveData = base.getAdditionalSaveData();
Revitalize.ModCore.Serializer.SerializeGUID(this.containerObject.childrenGuids[this.offsetKey].ToString(), this);
this.containerObject.getAdditionalSaveData();
return saveData;
return (ICustomObject)self;
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)

View File

@ -20,6 +20,8 @@ using StardustCore.UIUtilities.MenuComponents.ComponentsV2.Buttons;
namespace Revitalize.Framework.Objects.Machines
{
// Every machine needs a recreate, a rebuild, a get additional save data,and a getOne function.
public class Machine : MultiTiledComponent
{
@ -369,38 +371,47 @@ namespace Revitalize.Framework.Objects.Machines
public override Item getOne()
{
Machine component = new Machine(this.data, this.info.Copy(), this.TileLocation, this.offsetKey, this.producedResources, this.energyRequiredPer10Minutes, this.timeToProduce, this.updatesContainerObjectForProduction, this.craftingRecipeBook, this.containerObject);
Machine component = new Machine(this.data, this.info.Copy(), this.producedResources, this.energyRequiredPer10Minutes, this.timeToProduce, this.updatesContainerObjectForProduction, this.craftingRecipeBook);
component.containerObject = this.containerObject;
component.offsetKey = this.offsetKey;
return component;
return component;
}
public override ICustomObject recreate(Dictionary<string, string> additionalSaveData, object replacement)
{
//instead of using this.offsetkey.x use get additional save data function and store offset key there
Vector2 offsetKey = new Vector2(Convert.ToInt32(additionalSaveData["offsetKeyX"]), Convert.ToInt32(additionalSaveData["offsetKeyY"]));
string GUID = additionalSaveData["GUID"];
Machine self = Revitalize.ModCore.Serializer.DeserializeGUID<Machine>(additionalSaveData["GUID"]);
if (self == null)
if (ModCore.IsNullOrDefault<Machine>(self)) return null;
try
{
return null;
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
{
MultiTiledObject obj = (MultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<MultiTiledObject>(additionalSaveData["ParentGUID"]);
self.containerObject = obj;
self.containerObject.removeComponent(offsetKey);
self.containerObject.addComponent(offsetKey, self);
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], obj);
}
else
{
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
self.containerObject.removeComponent(offsetKey);
self.containerObject.addComponent(offsetKey, self);
}
}
catch (Exception err)
{
ModCore.log(err);
}
if (!Revitalize.ModCore.ObjectGroups.ContainsKey(additionalSaveData["ParentGUID"]))
{
//Get new container
MultiTiledObject obj = (MultiTiledObject)Revitalize.ModCore.Serializer.DeserializeGUID<MultiTiledObject>(additionalSaveData["ParentGUID"]);
self.containerObject = obj;
obj.addComponent(offsetKey, self);
//Revitalize.ModCore.log("ADD IN AN OBJECT!!!!");
Revitalize.ModCore.ObjectGroups.Add(additionalSaveData["ParentGUID"], (MultiTiledObject)obj);
}
else
{
self.containerObject = Revitalize.ModCore.ObjectGroups[additionalSaveData["ParentGUID"]];
Revitalize.ModCore.ObjectGroups[additionalSaveData["GUID"]].addComponent(offsetKey, self);
//Revitalize.ModCore.log("READD AN OBJECT!!!!");
}
return self;
}
return (ICustomObject)self;
public override void rebuild(Dictionary<string, string> additionalSaveData, object replacement)
{
base.rebuild(additionalSaveData, replacement);
}
public override void draw(SpriteBatch spriteBatch, int x, int y, float alpha = 1f)
@ -505,6 +516,7 @@ namespace Revitalize.Framework.Objects.Machines
public override void updateInfo()
{
return;
if (this.info == null || this.containerObject == null)
{
this.ItemInfo = this.text;
@ -517,12 +529,21 @@ namespace Revitalize.Framework.Objects.Machines
//this.ItemInfo = this.text;
this.text = this.ItemInfo;
this.info.cleanAfterUpdate();
this.containerObject.updateInfo();
//this.containerObject.updateInfo();
//ModCore.log("Force an update for machine: " + this.info.name);
MultiplayerUtilities.RequestUpdateSync(this.guid);
}
}
public override Dictionary<string, string> getAdditionalSaveData()
{
Dictionary<string, string> saveData = base.getAdditionalSaveData();
Revitalize.ModCore.Serializer.SerializeGUID(this.containerObject.childrenGuids[this.offsetKey].ToString(), this);
this.containerObject.getAdditionalSaveData();
return saveData;
}
}
}

View File

@ -451,7 +451,7 @@ namespace Revitalize.Framework.Objects
{
Dictionary<string, string> saveData = base.getAdditionalSaveData();
saveData.Add("GUID", this.guid.ToString());
//Revitalize.ModCore.Serializer.SerializeGUID(this.guid.ToString(), this);
Revitalize.ModCore.Serializer.SerializeGUID(this.guid.ToString(), this);
return saveData;
}

View File

@ -258,10 +258,10 @@ namespace Revitalize.Framework.Objects
MultiTiledObject grinder= new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(0, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)));
Grinder grinder_0_0 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(0, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)),null,ModCore.Configs.machinesConfig.grinderEnergyConsumption,ModCore.Configs.machinesConfig.grinderTimeToGrind,true,"");
Grinder grinder_1_0 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(16, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
Grinder grinder_0_1 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(0, 16, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
Grinder grinder_1_1 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(16, 16, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
Grinder grinder_0_0 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(Grinder), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(0, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)),null,ModCore.Configs.machinesConfig.grinderEnergyConsumption,ModCore.Configs.machinesConfig.grinderTimeToGrind,true,"");
Grinder grinder_1_0 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(Grinder), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(16, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
Grinder grinder_0_1 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(Grinder), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(0, 16, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
Grinder grinder_1_1 = new Grinder(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.Grinder", TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), typeof(Grinder), Color.White, true), new BasicItemInformation("Grinder", "Omegasis.Revitalize.Objects.Machines.Grinder", "Grinds up ores and rocks.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "Grinder"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "Grinder"), new Animation(16, 16, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), null, ModCore.Configs.machinesConfig.grinderEnergyConsumption, ModCore.Configs.machinesConfig.grinderTimeToGrind, false, "");
grinder.addComponent(new Vector2(0, 0), grinder_0_0);
grinder.addComponent(new Vector2(1, 0), grinder_1_0);
grinder.addComponent(new Vector2(0, 1), grinder_0_1);
@ -269,7 +269,7 @@ namespace Revitalize.Framework.Objects
this.AddItem("Grinder", grinder);
MultiTiledObject miningDrillMachine = new MultiTiledObject(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.MiningDrillV1", TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Mining Drill", "Omegasis.Revitalize.Objects.Machines.MiningDrill", "Digs up rocks and ores. Requires energy to run.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new Animation(0, 0, 16, 16)), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)));
Machine miningDrillMachine_0_0 = new Machine(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.MiningDrillV1", TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Mining Drill", "Omegasis.Revitalize.Objects.Machines.MiningDrill", "Digs up rocks and ores. Requires energy to run.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new Animation(0, 0, 16, 16), new Dictionary<string, List<Animation>>() {
Machine miningDrillMachine_0_0 = new Machine(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.MiningDrillV1", TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), typeof(Machine), Color.White, true), new BasicItemInformation("Mining Drill", "Omegasis.Revitalize.Objects.Machines.MiningDrill", "Digs up rocks and ores. Requires energy to run.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new Animation(0, 0, 16, 16), new Dictionary<string, List<Animation>>() {
{"Default",new List<Animation>(){new Animation(0,0,16,16) } },
{ "Mining",new List<Animation>(){
new Animation(0,0,16,16,30),
@ -279,7 +279,7 @@ namespace Revitalize.Framework.Objects
} }
}, "Mining"), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), ModCore.ObjectManager.resources.miningDrillResources.Values.ToList(), ModCore.Configs.machinesConfig.miningDrillEnergyConsumption, ModCore.Configs.machinesConfig.miningDrillTimeToMine, true, "");
Machine miningDrillMachine_0_1 = new Machine(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.MiningDrillV1", TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), typeof(MultiTiledObject), Color.White, true), new BasicItemInformation("Mining Drill", "Omegasis.Revitalize.Objects.Machines.MiningDrill", "Digs up rocks and ores. Requires energy to run.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new Animation(0, 16, 16, 16),new Dictionary<string, List<Animation>>() {
Machine miningDrillMachine_0_1 = new Machine(PyTKHelper.CreateOBJData("Omegasis.Revitalize.Objects.Machines.MiningDrillV1", TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), typeof(Machine), Color.White, true), new BasicItemInformation("Mining Drill", "Omegasis.Revitalize.Objects.Machines.MiningDrill", "Digs up rocks and ores. Requires energy to run.", "Machine", Color.SteelBlue, -300, 0, false, 4000, true, true, TextureManager.GetTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "Machines", "MiningDrillMachine"), new Animation(0, 16, 16, 16),new Dictionary<string, List<Animation>>() {
{"Default",new List<Animation>(){new Animation(0,16,16,16) } },
{ "Mining",new List<Animation>(){
new Animation(0,16,16,16,30),
@ -287,7 +287,7 @@ namespace Revitalize.Framework.Objects
new Animation(32,16,16,16,30),
new Animation(48,16,16,16,30),
} }
}, "Mining"), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), ModCore.ObjectManager.resources.miningDrillResources.Values.ToList(), ModCore.Configs.machinesConfig.miningDrillEnergyConsumption, ModCore.Configs.machinesConfig.miningDrillTimeToMine, false, "");
}, "Mining"), Color.White, false, new InventoryManager(18, 3, 6), null, new Energy.EnergyManager(1000, Enums.EnergyInteractionType.Consumes)), ModCore.ObjectManager.resources.miningDrillResources.Values.ToList(), ModCore.Configs.machinesConfig.miningDrillEnergyConsumption, ModCore.Configs.machinesConfig.miningDrillTimeToMine, true, "");
miningDrillMachine.addComponent(new Vector2(0, 0), miningDrillMachine_0_0);
miningDrillMachine.addComponent(new Vector2(0, 1), miningDrillMachine_0_1);
miningDrillMachine_0_0.animationManager.setAnimation("Mining");

View File

@ -134,6 +134,7 @@ namespace Revitalize.Framework.Utilities
/// </summary>
public void afterLoad()
{
ModCore.log("WHAT");
this.deleteAllUnusedFiles();
//this.removeNullObjects();
this.restoreModObjects();
@ -144,6 +145,7 @@ namespace Revitalize.Framework.Utilities
/// </summary>
public void restoreModObjects()
{
ModCore.log("Restore all mod objects!");
//Replace all items in the world.
List<CustomObject> objsToRestore = new List<CustomObject>();
foreach (var v in ModCore.ObjectGroups)
@ -162,6 +164,7 @@ namespace Revitalize.Framework.Utilities
//Replace all held items or items in inventories.
foreach (GameLocation loc in LocationUtilities.GetAllLocations())
{
ModCore.log("Looking at location: " + loc);
foreach (StardewValley.Object c in loc.Objects.Values)
{
if (c is Chest)
@ -188,6 +191,11 @@ namespace Revitalize.Framework.Utilities
(c as Chest).items.Add(I);
}
}
else if(c is Chest && c.Name != "Chest")
{
loc.objects[c.TileLocation] = (StardewValley.Object)this.GetItemFromChestName(c.Name);
ModCore.log("Found a custom item that is a chest!");
}
else if (c is CustomObject)
{
if ((c as CustomObject).info.inventory == null) continue;

View File

@ -8,6 +8,7 @@
"MinimumApiVersion": "2.10.1",
"UpdateKeys": [],
"Dependencies": [
{ "UniqueID": "Omegasis.StardustCore" }
{ "UniqueID": "Omegasis.StardustCore" },
{ "UniqueID": "Platonymous.Toolkit" }
]
}