-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove terrastorage from sophiscated UIs
- Loading branch information
1 parent
9188daa
commit 35ccad9
Showing
15 changed files
with
81 additions
and
6 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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
2 changes: 1 addition & 1 deletion
2
...dcelestials/EnhancedCelestialsCompat.java → ...dcelestials/EnhancedCelestialsCompat.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
12 changes: 12 additions & 0 deletions
12
common/src/main/java/abeshutt/staracademy/compat/terrastorage/TerraStorageCompat.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,12 @@ | ||
package abeshutt.staracademy.compat.terrastorage; | ||
|
||
import net.p3pp3rf1y.sophisticatedbackpacks.client.gui.BackpackScreen; | ||
import net.p3pp3rf1y.sophisticatedstorage.client.gui.StorageScreen; | ||
|
||
public class TerraStorageCompat { | ||
|
||
public static boolean shouldBlock(Object object) { | ||
return object instanceof BackpackScreen || object instanceof StorageScreen; | ||
} | ||
|
||
} |
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
2 changes: 0 additions & 2 deletions
2
fabric/src/main/java/abeshutt/staracademy/fabric/StarAcademyFabricMod.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
22 changes: 22 additions & 0 deletions
22
...src/main/java/abeshutt/staracademy/fabric/mixin/terrastorage/MixinHandledScreenMixin.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,22 @@ | ||
package abeshutt.staracademy.fabric.mixin.terrastorage; | ||
|
||
import abeshutt.staracademy.compat.terrastorage.TerraStorageCompat; | ||
import com.bawnorton.mixinsquared.TargetHandler; | ||
import net.minecraft.client.gui.screen.ingame.HandledScreen; | ||
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; | ||
|
||
@Mixin(value = HandledScreen.class, priority = 1500) | ||
public class MixinHandledScreenMixin { | ||
|
||
@TargetHandler(mixin = "me.timvinci.mixin.client.HandledScreenMixin", name = "onInit") | ||
@Inject(method = "@MixinSquared:Handler", at = @At("HEAD")) | ||
public void onInit(CallbackInfo oci, CallbackInfo ci) { | ||
if(TerraStorageCompat.shouldBlock(this)) { | ||
oci.cancel(); | ||
} | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
...c/main/java/abeshutt/staracademy/fabric/mixin/terrastorage/MixinInventoryScreenMixin.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,22 @@ | ||
package abeshutt.staracademy.fabric.mixin.terrastorage; | ||
|
||
import abeshutt.staracademy.compat.terrastorage.TerraStorageCompat; | ||
import com.bawnorton.mixinsquared.TargetHandler; | ||
import net.minecraft.client.gui.screen.ingame.InventoryScreen; | ||
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; | ||
|
||
@Mixin(value = InventoryScreen.class, priority = 1500) | ||
public class MixinInventoryScreenMixin { | ||
|
||
@TargetHandler(mixin = "me.timvinci.mixin.client.InventoryScreenMixin", name = "onInit") | ||
@Inject(method = "@MixinSquared:Handler", at = @At("HEAD")) | ||
public void onInit(CallbackInfo oci, CallbackInfo ci) { | ||
if(TerraStorageCompat.shouldBlock(this)) { | ||
oci.cancel(); | ||
} | ||
} | ||
|
||
} |
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,15 @@ | ||
{ | ||
"required": true, | ||
"package": "abeshutt.staracademy.fabric.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"minVersion": "0.8", | ||
"client": [ | ||
"terrastorage.MixinHandledScreenMixin", | ||
"terrastorage.MixinInventoryScreenMixin" | ||
], | ||
"mixins": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
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