diff --git a/Dustbin/Dustbin.cs b/Dustbin/Dustbin.cs index 7de428b..fbb07a5 100644 --- a/Dustbin/Dustbin.cs +++ b/Dustbin/Dustbin.cs @@ -5,12 +5,13 @@ using System.Runtime.CompilerServices; using BepInEx; using crecheng.DSPModSave; using NebulaAPI; +using NebulaAPI.Interfaces; namespace Dustbin; [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] [BepInDependency(DSPModSavePlugin.MODGUID)] -[BepInDependency(NebulaModAPI.API_GUID)] +[BepInDependency(NebulaModAPI.API_GUID, BepInDependency.DependencyFlags.SoftDependency)] public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod { public string Version => PluginInfo.PLUGIN_VERSION; @@ -41,14 +42,11 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod } if (storageDustbin) StoragePatch.Enable(true); if (tankDustbin) TankPatch.Enable(true); - - if (storageDustbin || tankDustbin) - { - NebulaModAPI.RegisterPackets(Assembly.GetExecutingAssembly()); - NebulaModAPI.OnPlanetLoadFinished += RequestPlanetDustbinData; - } - if (belgSignalDustbin) BeltSignal.Enable(true); + + if (!BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("dsp.nebula-multiplayer") || (!storageDustbin && !tankDustbin)) return; + NebulaModAPI.RegisterPackets(Assembly.GetExecutingAssembly()); + NebulaModAPI.OnPlanetLoadFinished += RequestPlanetDustbinData; } private void OnDestroy() @@ -178,7 +176,7 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod public void RequestPlanetDustbinData(int planetId) { - if (NebulaModAPI.IsMultiplayerActive && NebulaModAPI.MultiplayerSession.LocalPlayer.IsClient) + if (NebulaModAPI.IsMultiplayerActive && NebulaModAPI.MultiplayerSession.IsClient) NebulaModAPI.MultiplayerSession.Network.SendPacket(new NebulaSupport.Packet.ToggleEvent(planetId, 0, false)); } #endregion diff --git a/Dustbin/Dustbin.csproj b/Dustbin/Dustbin.csproj index 51ff6ee..4e8fb43 100644 --- a/Dustbin/Dustbin.csproj +++ b/Dustbin/Dustbin.csproj @@ -5,7 +5,7 @@ net472 org.soardev.dustbin DSP MOD - Dustbin - 1.3.2 + 1.3.3 true latest Dustbin @@ -18,7 +18,7 @@ - + diff --git a/Dustbin/NebulaSupport/Packets.cs b/Dustbin/NebulaSupport/Packets.cs index 0d0fc56..f6c1f18 100644 --- a/Dustbin/NebulaSupport/Packets.cs +++ b/Dustbin/NebulaSupport/Packets.cs @@ -1,4 +1,6 @@ using NebulaAPI; +using NebulaAPI.Networking; +using NebulaAPI.Packets; namespace Dustbin.NebulaSupport { diff --git a/Dustbin/README.md b/Dustbin/README.md index ae8d21b..a78eb32 100644 --- a/Dustbin/README.md +++ b/Dustbin/README.md @@ -4,6 +4,9 @@ #### 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品) ## Changelog +* 1.3.3 + + Support for NebulaMultiplayerModApi 2.0.0 + * 1.3.2 + Fix a display issue that the dustbin checkbox is overlapped with the filter button in storage UI. @@ -38,6 +41,9 @@ + You can get item ID list [here](https://dsp-wiki.com/Modding:Items_IDs). ## 更新日志 +* 1.3.3 + + 支持NebulaMultiplayerModApi 2.0.0 + * 1.3.2 + 修正了储物仓UI中的垃圾桶勾选框与筛选按钮重叠的显示问题 diff --git a/Dustbin/package/manifest.json b/Dustbin/package/manifest.json index 503d609..5fd8365 100644 --- a/Dustbin/package/manifest.json +++ b/Dustbin/package/manifest.json @@ -1,11 +1,11 @@ { "name": "Dustbin", - "version_number": "1.3.2", + "version_number": "1.3.3", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin", "description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)", "dependencies": [ "xiaoye97-BepInEx-5.4.17", "CommonAPI-DSPModSave-1.1.4", - "nebula-NebulaMultiplayerModApi-1.3.1" + "nebula-NebulaMultiplayerModApi-2.0.0" ] }