Skip to content

Commit

Permalink
Check on overflow destruction card
Browse files Browse the repository at this point in the history
Closes #61
  • Loading branch information
ramidzkh committed Jul 7, 2024
1 parent 49b96ac commit 54ca7c2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
8 changes: 0 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://maven.neoforged.net/releases' }
}
}

rootProject.name = "Applied-Mekanistics"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package me.ramidzkh.mekae2.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

import me.ramidzkh.mekae2.ae2.MekanismKey;
import mekanism.api.chemical.attribute.ChemicalAttributeValidator;

import appeng.api.stacks.AEKey;
import appeng.me.storage.MEInventoryHandler;

@Mixin(MEInventoryHandler.class)
public class MEInventoryHandlerMixin {

@ModifyExpressionValue(method = "insert", at = @At(value = "FIELD", target = "Lappeng/me/storage/MEInventoryHandler;voidOverflow:Z"))
private boolean voidOverflow(boolean original, AEKey what) {
if (what instanceof MekanismKey key) {
if (!ChemicalAttributeValidator.DEFAULT.process(key.getStack())) {
return false;
}
}

return original;
}
}
2 changes: 1 addition & 1 deletion src/main/resources/appmek.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8.5",
"package": "me.ramidzkh.mekae2.mixin",
"mixins": ["CondenserMEStorageMixin"],
"mixins": ["CondenserMEStorageMixin", "MEInventoryHandlerMixin"],
"injectors": {
"defaultRequire": 1
}
Expand Down

0 comments on commit 54ca7c2

Please sign in to comment.