forked from squeek502/AppleCore
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust CCL Mixin based on Version (#32)
- Loading branch information
1 parent
aa68618
commit 770ecf7
Showing
6 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Add your dependencies here | ||
|
||
dependencies { | ||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.3.9:dev") | ||
compileOnly("com.github.GTNewHorizons:Natura:2.7.4:dev") { transitive = false } | ||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.3.10:dev") | ||
compileOnly("com.github.GTNewHorizons:Natura:2.7.5:dev") { transitive = false } | ||
compileOnly(deobfCurse("pams-harvestcraft-221857:2270206")) | ||
|
||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.42-GTNH:dev") | ||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.46-GTNH:dev") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/squeek/applecore/helpers/CCLLegacyHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package squeek.applecore.helpers; | ||
|
||
import codechicken.core.launch.CodeChickenCorePlugin; | ||
import cpw.mods.fml.common.versioning.ComparableVersion; | ||
|
||
public class CCLLegacyHelper { | ||
|
||
public static boolean useLegacyMixin() { | ||
return !useNewMixin(); | ||
} | ||
|
||
@SuppressWarnings("deprecation") | ||
public static boolean useNewMixin() { | ||
String version; | ||
try { | ||
version = CodeChickenCorePlugin.version; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
return new ComparableVersion("1.3.10").compareTo(new ComparableVersion(version)) <= 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/squeek/applecore/mixins/early/codechickenlib/GuiDrawMixinLegacy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package squeek.applecore.mixins.early.codechickenlib; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import codechicken.lib.gui.GuiDraw; | ||
import squeek.applecore.client.TooltipOverlayHandler; | ||
|
||
@Mixin(GuiDraw.class) | ||
public class GuiDrawMixinLegacy { | ||
|
||
@Inject(method = "drawTooltipBox(IIII)V", at = @At("HEAD"), remap = false) | ||
private static void onDrawTooltipBoxLegacy(int x, int y, int w, int h, CallbackInfo callbackInfo) { | ||
TooltipOverlayHandler.toolTipX = x; | ||
TooltipOverlayHandler.toolTipY = y; | ||
TooltipOverlayHandler.toolTipW = w; | ||
TooltipOverlayHandler.toolTipH = h; | ||
} | ||
} |