Skip to content

Commit bf6c8cf

Browse files
committed
Update for game version 1.13.4
1 parent af6de15 commit bf6c8cf

6 files changed

Lines changed: 12 additions & 48 deletions

File tree

Configuration/PluginConfiguration.cs

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

Patches/PlayerHeightDetectorPatch.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,26 @@
33
using System.Reflection;
44
using System.Reflection.Emit;
55
using HarmonyLib;
6-
using RevertPlayerHeightDetection;
76

87
namespace BeatTogether.Patches
98
{
109
[HarmonyPatch(typeof(PlayerHeightDetector), "LateUpdate")]
1110
public static class LateUpdatePatch
1211
{
12+
private static FieldInfo _headPosToPlayerHeightOffset = typeof(PlayerHeightDetector.InitData)
13+
.GetField("headPosToPlayerHeightOffset", BindingFlags.Instance | BindingFlags.Public);
1314
private static FieldInfo _computedPlayerHeight = typeof(PlayerHeightDetector)
14-
.GetField("_computedPlayerHeight", BindingFlags.Instance | BindingFlags.NonPublic);
15+
.GetField("_computedPlayerHeight", BindingFlags.Instance | BindingFlags.NonPublic);
1516

1617
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
1718
{
18-
if (!Plugin.Configuration.Enabled)
19-
return instructions;
20-
2119
var instructionList = instructions.ToList();
2220
for (var i = 0; i < instructionList.Count; i++)
2321
{
24-
if (instructionList[i].opcode == OpCodes.Ldc_R4 &&
25-
instructionList[i + 1].opcode == OpCodes.Add)
22+
if (instructionList[i].opcode == OpCodes.Add &&
23+
instructionList[i - 1].LoadsField(_headPosToPlayerHeightOffset))
2624
{
27-
instructionList.RemoveRange(i, 2);
25+
instructionList.RemoveRange(i - 3, 4);
2826
break;
2927
}
3028
}

Plugin.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
using System.Reflection;
22
using HarmonyLib;
33
using IPA;
4-
using IPA.Config;
5-
using IPA.Config.Stores;
6-
using RevertPlayerHeightDetection.Configuration;
74
using IPALogger = IPA.Logging.Logger;
85

96
namespace RevertPlayerHeightDetection
@@ -15,16 +12,12 @@ public class Plugin
1512
private const string _harmonyId = "com.Python.RevertPlayerHeightDetection";
1613

1714
internal static Harmony Harmony { get; private set; }
18-
internal static PluginConfiguration Configuration { get; private set; }
1915
internal static IPALogger Logger { get; private set; }
2016

2117
[Init]
22-
public void Init(
23-
IPALogger logger,
24-
Config config)
18+
public void Init(IPALogger logger)
2519
{
2620
Harmony = new Harmony(_harmonyId);
27-
Configuration = config.Generated<PluginConfiguration>();
2821
Logger = logger;
2922
}
3023

Properties/AssemblyInfo.cs

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

RevertPlayerHeightDetection.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
<ItemGroup>
9999
<Compile Include="Patches\PlayerHeightDetectorPatch.cs" />
100100
<Compile Include="Plugin.cs" />
101-
<Compile Include="Configuration\PluginConfiguration.cs" />
102101
<Compile Include="Properties\AssemblyInfo.cs" />
103102
</ItemGroup>
104103
<ItemGroup>

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"id": "RevertPlayerHeightDetection",
44
"name": "RevertPlayerHeightDetection",
55
"author": "Python",
6-
"version": "1.0.0",
6+
"version": "1.0.1",
77
"description": "Reverts the changes made to player height detection in 1.13.2.",
8-
"gameVersion": "1.13.2",
8+
"gameVersion": "1.13.4",
99
"dependsOn": {
1010
"BSIPA": "^4.0.0"
1111
},
1212
"features": []
13-
}
13+
}

0 commit comments

Comments
 (0)