Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,5 @@ ASALocalRun/
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb
healthchecksdb
/_CompiledBinaries
36 changes: 0 additions & 36 deletions AICustomization/Properties/AssemblyInfo.cs

This file was deleted.

36 changes: 0 additions & 36 deletions AedenthornUtils/Properties/AssemblyInfo.cs

This file was deleted.

215 changes: 94 additions & 121 deletions AutoFeed/BepInExPlugin.cs

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions AutoFeed/Properties/AssemblyInfo.cs

This file was deleted.

18 changes: 9 additions & 9 deletions AutoFuel/BepInExPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d
Destroy(item.gameObject);
else
ZNetScene.instance.Destroy(item.gameObject);
znview.InvokeRPC("AddFuel", new object[] { });
znview.InvokeRPC("RPC_AddFuel", new object[] { });
if (distributedFilling.Value)
return;
break;

}

item.m_itemData.m_stack--;
znview.InvokeRPC("AddFuel", new object[] { });
znview.InvokeRPC("RPC_AddFuel", new object[] { });
Traverse.Create(item).Method("Save").GetValue();
if (distributedFilling.Value)
return;
Expand Down Expand Up @@ -236,7 +236,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d

Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one");

znview.InvokeRPC("AddFuel", new object[] { });
znview.InvokeRPC("RPC_AddFuel", new object[] { });

c.GetInventory().RemoveItem(fireplace.m_fuelItem.m_itemData.m_shared.m_name, 1);
typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { });
Expand Down Expand Up @@ -351,14 +351,14 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview,
Destroy(item.gameObject);
else
ZNetScene.instance.Destroy(item.gameObject);
___m_nview.InvokeRPC("AddOre", new object[] { name });
___m_nview.InvokeRPC("RPC_AddOre", new object[] { name });
if (distributedFilling.Value)
ored = true;
break;
}

item.m_itemData.m_stack--;
___m_nview.InvokeRPC("AddOre", new object[] { name });
___m_nview.InvokeRPC("RPC_AddOre", new object[] { name });
Traverse.Create(item).Method("Save").GetValue();
if (distributedFilling.Value)
ored = true;
Expand Down Expand Up @@ -388,15 +388,15 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview,
Destroy(item.gameObject);
else
ZNetScene.instance.Destroy(item.gameObject);
___m_nview.InvokeRPC("AddFuel", new object[] { });
___m_nview.InvokeRPC("RPC_AddFuel", new object[] { });
if (distributedFilling.Value)
fueled = true;
break;

}

item.m_itemData.m_stack--;
___m_nview.InvokeRPC("AddFuel", new object[] { });
___m_nview.InvokeRPC("RPC_AddFuel", new object[] { });
Traverse.Create(item).Method("Save").GetValue();
if (distributedFilling.Value)
{
Expand Down Expand Up @@ -427,7 +427,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview,

Dbgl($"container at {c.transform.position} has {oreItem.m_stack} {oreItem.m_dropPrefab.name}, taking one");

___m_nview.InvokeRPC("AddOre", new object[] { oreItem.m_dropPrefab?.name });
___m_nview.InvokeRPC("RPC_AddOre", new object[] { oreItem.m_dropPrefab?.name });
c.GetInventory().RemoveItem(itemConversion.m_from.m_itemData.m_shared.m_name, 1);
typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { });
typeof(Inventory).GetMethod("Changed", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c.GetInventory(), new object[] { });
Expand Down Expand Up @@ -461,7 +461,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview,

Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one");

___m_nview.InvokeRPC("AddFuel", new object[] { });
___m_nview.InvokeRPC("RPC_AddFuel", new object[] { });

c.GetInventory().RemoveItem(__instance.m_fuelItem.m_itemData.m_shared.m_name, 1);
typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { });
Expand Down
3 changes: 0 additions & 3 deletions BackpackRedux/.gitignore

This file was deleted.

36 changes: 0 additions & 36 deletions BuildPieceReplace/Properties/AssemblyInfo.cs

This file was deleted.

36 changes: 0 additions & 36 deletions BuildingRepairRequiresMats/Properties/AssemblyInfo.cs

This file was deleted.

18 changes: 13 additions & 5 deletions CartSupport/BepInExPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using HarmonyLib;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SocialPlatforms;

namespace CartSupport
{
Expand Down Expand Up @@ -61,12 +62,19 @@ static void Prefix(Vagon __instance, ZNetView ___m_nview, ref float mass)

float before = mass;

List<Player> players = new List<Player>();
Player.GetPlayersInRange(__instance.gameObject.transform.position, playerRange.Value, players);
if(players.Count > (includePuller.Value ? 0 : 1))
mass = Mathf.Max(0, mass - mass * playerMassReduction.Value * Mathf.Min(maxPlayers.Value, players.Count - (includePuller.Value ? 0 : 1)));
List<Player> s_players = Player.GetAllPlayers();
int playerCount = 0;
foreach (Player s_player in s_players)
{
if (Vector3.Distance(s_player.transform.position, __instance.gameObject.transform.position) < playerRange.Value)
{
playerCount++;
}
}
if(playerCount > (includePuller.Value ? 0 : 1))
mass = Mathf.Max(0, mass - mass * playerMassReduction.Value * Mathf.Min(maxPlayers.Value, playerCount - (includePuller.Value ? 0 : 1)));

//Dbgl($"mass players {players.Count} distance {Vector3.Distance(__instance.gameObject.transform.position, Player.m_localPlayer.transform.position)} before {before} after {mass} is owner {___m_nview.IsOwner()}");
Dbgl($"mass players {playerCount} distance {Vector3.Distance(__instance.gameObject.transform.position, Player.m_localPlayer.transform.position)} before {before} after {mass} is owner {___m_nview.IsOwner()}");
}
}

Expand Down
36 changes: 0 additions & 36 deletions CartSupport/Properties/AssemblyInfo.cs

This file was deleted.

13 changes: 9 additions & 4 deletions CartographyTableMapRestrict/BepInExPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using System;
using System.Reflection;
using UnityEngine;

Expand All @@ -11,10 +12,8 @@ public class BepInExPlugin : BaseUnityPlugin
{
private static readonly bool isDebug = true;

public static ConfigEntry<string> hotKey;
public static ConfigEntry<bool> modEnabled;
public static ConfigEntry<float> attachDistance;
public static ConfigEntry<bool> allowOutOfPlaceAttach;
public static ConfigEntry<bool> suppressMessage;
public static ConfigEntry<int> nexusID;

private static BepInExPlugin context;
Expand All @@ -29,6 +28,7 @@ private void Awake()
context = this;

modEnabled = Config.Bind<bool>("General", "Enabled", true, "Enable this mod");
suppressMessage = Config.Bind<bool>("General", "SupressMessage", true, "Supresses message on read");
nexusID = Config.Bind<int>("General", "NexusID", 1739, "Nexus mod ID for updates");

Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), null);
Expand All @@ -45,9 +45,14 @@ static void Postfix(Minimap __instance, Minimap.MapMode ___m_mode)
__instance.SetMapMode(Minimap.MapMode.None);
}
}
[HarmonyPatch(typeof(MapTable), "OnRead")]
[HarmonyPatch(typeof(MapTable), "OnRead", new Type[] { typeof(Switch), typeof(Humanoid), typeof(ItemDrop.ItemData), typeof(bool) })]
static class MapTable_OnRead_Patch
{
static void Prefix(MapTable __instance, ref bool showMessage)
{
showMessage = showMessage && !suppressMessage.Value;
}

static void Postfix(MapTable __instance, ItemDrop.ItemData item)
{
if (!modEnabled.Value || Player.m_localPlayer == null || item != null)
Expand Down
Loading