Skip to content

Commit

Permalink
delete IBugFix interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexdoru committed Sep 23, 2024
1 parent 8a5dfb9 commit 40ea614
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
6 changes: 0 additions & 6 deletions src/main/java/gtPlusPlus/plugin/fixes/interfaces/IBugFix.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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(
Expand All @@ -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");
}
}
}

0 comments on commit 40ea614

Please sign in to comment.