Upload from upload_mods.ps1
This commit is contained in:
25
Harmony/Harmony_BlockSleepingBag.cs
Normal file
25
Harmony/Harmony_BlockSleepingBag.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using static SleeperVolume;
|
||||
|
||||
namespace Harmony.BlockSleepingBagPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(BlockSleepingBag))]
|
||||
[HarmonyPatch("PlaceBlock")]
|
||||
public class PlaceBlockPatch
|
||||
{
|
||||
public static void Postfix(BlockSleepingBag __instance, WorldBase _world, BlockPlacement.Result _bpResult, EntityAlive _ea)
|
||||
{
|
||||
Vector3i position = _bpResult.blockPos + __instance.rotationToAddVector((int)_bpResult.blockValue.rotation);
|
||||
|
||||
bool isClient = SingletonMonoBehaviour<ConnectionManager>.Instance.IsClient;
|
||||
|
||||
if (isClient)
|
||||
{
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer(NetPackageManager.GetPackage<NetPackageAddChunkObserver>().Setup(position), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChunkManager.ChunkObserver observerRef = GameManager.Instance.AddChunkObserver(position, false, 3, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user