Skip to content

Commit 7fc8acc

Browse files
committed
2 parents 19fe59e + 189c52e commit 7fc8acc

145 files changed

Lines changed: 1173 additions & 4260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AdvancedPortals/AddPortals.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Collections.Generic;
2+
using System.Reflection;
3+
using HarmonyLib;
4+
using JetBrains.Annotations;
5+
6+
namespace AdvancedPortals
7+
{
8+
9+
[HarmonyPatch]
10+
public static class AddPortal
11+
{
12+
public static readonly HashSet<int> Hashes = new HashSet<int>();
13+
14+
[UsedImplicitly]
15+
private static IEnumerable<MethodInfo> TargetMethods() => new[]
16+
{
17+
AccessTools.DeclaredMethod(typeof(Game), nameof(Game.Awake)),
18+
};
19+
20+
[UsedImplicitly]
21+
private static void Prefix(Game __instance)
22+
{
23+
__instance.PortalPrefabHash.AddRange(Hashes);
24+
}
25+
}
26+
}

AdvancedPortals/AdvancedPortals.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ public class AdvancedPortals : BaseUnityPlugin
2929
{
3030
public const string PluginId = "randyknapp.mods.advancedportals";
3131
public const string DisplayName = "Advanced Portals";
32-
public const string Version = "1.0.6";
33-
32+
public const string Version = "1.0.8";
33+
public static readonly string[] _portalPrefabs = { "portal_ancient", "portal_obsidian", "portal_blackmarble" };
34+
3435
public static readonly List<GameObject> RegisteredPrefabs = new List<GameObject>();
3536
public static readonly Dictionary<GameObject, PieceDef> RegisteredPieces = new Dictionary<GameObject, PieceDef>();
3637

@@ -164,6 +165,12 @@ private void Awake()
164165

165166
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), PluginId);
166167

168+
//Add Prefabs to Portal Connections
169+
foreach (var portalPrefab in _portalPrefabs)
170+
{
171+
AddPortal.Hashes.Add(portalPrefab.GetStableHashCode());
172+
}
173+
167174
// Patch TargetPortal's handle click method, since it does not directly call TeleportWorld.Teleport
168175
var targetPortal = gameObject.GetComponent("TargetPortal.TargetPortal");
169176
if (targetPortal)

AdvancedPortals/AdvancedPortals.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@
8282
</Reference>
8383
</ItemGroup>
8484
<ItemGroup>
85+
<Compile Include="AddPortals.cs" />
8586
<Compile Include="AdvancedPortal.cs" />
8687
<Compile Include="AdvancedPortals.cs" />
87-
<Compile Include="ConnectPortals_Patch.cs" />
8888
<Compile Include="Properties\AssemblyInfo.cs" />
8989
<Compile Include="Teleport_Patch.cs" />
9090
</ItemGroup>

AdvancedPortals/ConnectPortals_Patch.cs

Lines changed: 0 additions & 167 deletions
This file was deleted.

AdvancedPortals/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
// You can specify all the values or you can default the Build and Revision Numbers
3232
// by using the '*' as shown below:
3333
// [assembly: AssemblyVersion("1.0.*")]
34-
[assembly: AssemblyVersion("1.0.6")]
35-
[assembly: AssemblyFileVersion("1.0.6")]
34+
[assembly: AssemblyVersion("1.0.8")]
35+
[assembly: AssemblyFileVersion("1.0.8")]

AdvancedPortals/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AdvancedPortals v1.0.4
1+
# AdvancedPortals
22
Author: RandyKnapp
33
Source: [Github](https://github.com/RandyKnapp/ValheimMods/tree/main/AdvancedPortals)
44
Discord: [RandyKnapp's Mod Community](https://discord.gg/randyknappmods)
@@ -51,7 +51,7 @@ Includes ServerSync.
5151
#### 1.0.5
5252
* Updated Portal Connection logic which was preventing Advanced Portals from connecting
5353
#### 1.0.4
54-
* Updates for Valheim 0.216.9
54+
* Updates for Valheim 0.217.5
5555
#### 1.0.3
5656
* Vapok fixed a bug that makes Adventure Backpacks work with Advanced Portals
5757
#### 1.0.2

AdvancedPortals/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "AdvancedPortals",
3-
"version_number": "1.0.6",
3+
"version_number": "1.0.8",
44
"website_url": "https://github.com/RandyKnapp/ValheimMods/tree/main/AdvancedPortals",
55
"description": "Add new, lore-friendly and balanced portals to allow some items to be teleported.",
66
"dependencies": []

EpicLoot-UnityLib/EnchantBonus.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Collections;
22
using UnityEngine;
3-
3+
44
namespace EpicLoot_UnityLib
55
{
66
[RequireComponent(typeof(CanvasGroup))]
@@ -48,4 +48,4 @@ public void Show()
4848
_coroutine = StartCoroutine(FadeOut());
4949
}
5050
}
51-
}
51+
}

0 commit comments

Comments
 (0)