mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
wine cellar sync
This commit is contained in:
parent
4e556248a0
commit
88023725b9
@ -0,0 +1,8 @@
|
|||||||
|
using QSB.Messaging;
|
||||||
|
|
||||||
|
namespace QSB.EchoesOfTheEye.WineCellar.Messages;
|
||||||
|
|
||||||
|
internal class WineCellarSwitchMessage : QSBWorldObjectMessage<QSBWineCellarSwitch>
|
||||||
|
{
|
||||||
|
public override void OnReceiveRemote() => WorldObject.AttachedObject.OnPressInteract();
|
||||||
|
}
|
25
QSB/EchoesOfTheEye/WineCellar/Patches/WineCellarPatches.cs
Normal file
25
QSB/EchoesOfTheEye/WineCellar/Patches/WineCellarPatches.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using QSB.EchoesOfTheEye.WineCellar.Messages;
|
||||||
|
using QSB.Messaging;
|
||||||
|
using QSB.Patches;
|
||||||
|
using QSB.WorldSync;
|
||||||
|
|
||||||
|
namespace QSB.EchoesOfTheEye.WineCellar.Patches;
|
||||||
|
|
||||||
|
internal class WineCellarPatches : QSBPatch
|
||||||
|
{
|
||||||
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
||||||
|
|
||||||
|
[HarmonyPostfix]
|
||||||
|
[HarmonyPatch(typeof(WineCellarSwitch), nameof(WineCellarSwitch.OnPressInteract))]
|
||||||
|
public static void OnPressInteract(WineCellarSwitch __instance)
|
||||||
|
{
|
||||||
|
if (Remote)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var worldObject = __instance.GetWorldObject<QSBWineCellarSwitch>();
|
||||||
|
worldObject.SendMessage(new WineCellarSwitchMessage());
|
||||||
|
}
|
||||||
|
}
|
5
QSB/EchoesOfTheEye/WineCellar/QSBWineCellarSwitch.cs
Normal file
5
QSB/EchoesOfTheEye/WineCellar/QSBWineCellarSwitch.cs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
using QSB.WorldSync;
|
||||||
|
|
||||||
|
namespace QSB.EchoesOfTheEye.WineCellar;
|
||||||
|
|
||||||
|
internal class QSBWineCellarSwitch : WorldObject<WineCellarSwitch> { }
|
14
QSB/EchoesOfTheEye/WineCellar/WineCellarManager.cs
Normal file
14
QSB/EchoesOfTheEye/WineCellar/WineCellarManager.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using Cysharp.Threading.Tasks;
|
||||||
|
using QSB.WorldSync;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace QSB.EchoesOfTheEye.WineCellar;
|
||||||
|
|
||||||
|
internal class WineCellarManager : WorldObjectManager
|
||||||
|
{
|
||||||
|
public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem;
|
||||||
|
public override bool DlcOnly => true;
|
||||||
|
|
||||||
|
public async override UniTask BuildWorldObjects(OWScene scene, CancellationToken ct)
|
||||||
|
=> QSBWorldSync.Init<QSBWineCellarSwitch, WineCellarSwitch>();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user