BepInEx Support

This commit is contained in:
Lachlan Leone
2022-11-05 14:52:31 +11:00
parent 1fc7fa477d
commit eb1713a569
8 changed files with 40 additions and 30 deletions
@@ -50,7 +50,6 @@ namespace MMOKitchen
placeSpawnMarker.Invoke(__instance, new object[] { i, array[i] + new Vector3(-1f, 0f, 0f) });
foreach (Entity entity2 in nativeArray)
{
//bool flag = i == base.GetComponent<CPlayer>(entity2).Index;
bool flag = i == ((CPlayer)getComponent.Invoke(__instance, new object[] { entity2 })).Index;
if (flag)
{
-1
View File
@@ -23,7 +23,6 @@ namespace MMOKitchen
garageDecorations.SetActive(false);
create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.GarageDecorations), new Vector3(-8f, 0f, -2f), Vector3.forward});
//Mod.Log(GameData.Main.Get<Appliance>(AssetReference.GarageDecorations).Prefab.name);
Entity entity = default(Entity);
entity = (Entity)create.Invoke(__instance, new object[]{GameData.Main.Get<Appliance>(AssetReference.LoadoutPedestal), new Vector3(-8.5f, 0f, -4f), Vector3.right});
EntityUtils.GetEntityManager().AddComponent<CItemPedestal>(entity);
@@ -9,7 +9,6 @@ namespace MMOKitchen
{
public static bool Prefix(LayoutBuilder __instance, Vector2 tile1, Vector2 tile2)
{
//Mod.Log(tile1.ToString() + "," + tile2.ToString());
if ((tile1 == new Vector2(-11, -5) && tile2 == new Vector2(-10, -5))
|| (tile1 == new Vector2(-11, -6) && tile2 == new Vector2(-10, -6))
|| (tile1 == new Vector2(-11, -7) && tile2 == new Vector2(-10, -7))
@@ -15,7 +15,6 @@ namespace MMOKitchen
{
PlayerManager playerManager = World.DefaultGameObjectInjectionWorld.GetExistingSystem<PlayerManager>();
FieldInfo finfo = typeof(PlayerManager).GetField("MaxPlayers", BindingFlags.Instance | BindingFlags.Public);
if (finfo == null) Mod.Log("finfo is null");
finfo.SetValue(playerManager, 12);
__instance.SourceTexture = ResourceUtils.LoadTextureFromFile(Path.Combine(Application.streamingAssetsPath, "NewFromTexture.png"));
+1 -10
View File
@@ -1,18 +1,9 @@
using HarmonyLib;
using UnityEngine;
using Kitchen.Layouts.Modules;
using Kitchen;
using System.Reflection;
using Unity.Entities;
using KitchenLib.Utils;
using System.IO;
using Steamworks;
using Kitchen.NetworkSupport;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using Kitchen.Transports;
using Steamworks.Data;
namespace MMOKitchen
{
@@ -29,7 +20,7 @@ namespace MMOKitchen
{
Lobby valueOrDefault = task.Result.GetValueOrDefault();
__instance.CurrentInviteLobby = valueOrDefault;
//Reflection Stuff
MethodInfo performSetPermissions = AccessTools.Method(typeof(SteamPlatform), "PerformSetPermissions");
performSetPermissions.Invoke(__instance, new object[] { __instance.Permissions });
callback(true, valueOrDefault);