From c4725b78b0fe27dd396d94c5f8e6f97c9f76ca9f Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Mon, 23 Sep 2024 23:02:49 +0200 Subject: [PATCH] delete IBugFix interface --- .../gtPlusPlus/plugin/fixes/interfaces/IBugFix.java | 6 ------ .../plugin/fixes/vanilla/VanillaBedHeightFix.java | 13 ++----------- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java diff --git a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java b/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java deleted file mode 100644 index b35ad2c0634..00000000000 --- a/src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java +++ /dev/null @@ -1,6 +0,0 @@ -package gtPlusPlus.plugin.fixes.interfaces; - -public interface IBugFix { - - boolean isFixValid(); -} diff --git a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java index 5a8a0b96517..8e21773b4ac 100644 --- a/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java +++ b/src/main/java/gtPlusPlus/plugin/fixes/vanilla/VanillaBedHeightFix.java @@ -12,10 +12,9 @@ import gregtech.asm.GTCorePlugin; import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.plugin.fixes.interfaces.IBugFix; // TODO move this as a mixin in hodgepodge -public class VanillaBedHeightFix implements IBugFix { +public class VanillaBedHeightFix { private final Method mSleepInBedAt; @@ -37,11 +36,6 @@ public VanillaBedHeightFix(IPlugin minstance) { } } - @Override - public boolean isFixValid() { - return mSleepInBedAt != null; - } - /** * Fix created by deNULL - * https://github.com/deNULL/BugPatch/blob/master/src/main/java/ru/denull/BugPatch/mod/ClientEvents.java#L45 @@ -51,7 +45,7 @@ public boolean isFixValid() { @SubscribeEvent(priority = EventPriority.HIGHEST) public void playerSleepInBed(PlayerSleepInBedEvent evt) { Logger.WARNING("Sleep Event Detected. Player is sleeping at Y: " + evt.y); - if (evt.y <= 0 && isFixValid()) { + if (evt.y <= 0) { int correctY = 256 + evt.y; if (correctY <= 0) { Logger.WARNING( @@ -72,9 +66,6 @@ public void playerSleepInBed(PlayerSleepInBedEvent evt) { Logger.WARNING("Encountered an error trying to sleep."); } } - } else if (!isFixValid()) { - Logger.WARNING( - "Method sleepInBedAt was not found in EntityPlayer (wrong MC and/or Forge version?), unable to fix"); } } }