mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-13 00:37:29 +00:00
Update MineTweaker integration to handle delayed run of additions/removals to main recipe registry.
This commit is contained in:
1 parent
40d0b5e228
commit
b4db1b05c8
6 files changed
+40
-14
No files matched your search
+4
-7
@@ -40,10 +40,6 @@ repositories {
|
||||
name 'DVS1 Maven FS'
|
||||
url 'http://dvs1.progwml6.com/files/maven'
|
||||
}
|
||||
maven {
|
||||
name 'TehNut Repo'
|
||||
url 'http://tehnut.info/maven/'
|
||||
}
|
||||
maven {
|
||||
name 'tterrag Repo'
|
||||
url 'http://maven.tterrag.com/'
|
||||
@@ -59,9 +55,10 @@ dependencies {
|
||||
compile "codechicken:CodeChickenLib:" + config.mc_version + "-" + config.cclib_version + ":dev"
|
||||
compile "codechicken:CodeChickenCore:" + config.mc_version + "-" + config.ccc_version + ":dev"
|
||||
compile "codechicken:NotEnoughItems:" + config.mc_version + "-" + config.nei_version + ":dev"
|
||||
compile fileTree(dir: 'libs', include: 'CraftTweaker-Dev-1.7.10-3.2.0-GTNH.4-legacy.jar')
|
||||
compile "codechicken:ForgeMultipart:1.7.10-1.1.0.314:dev"
|
||||
compile "info.amerifrance.guideapi:Guide-API:" + config.mc_version + "-" + config.guideapi_version + ":deobf"
|
||||
compile fileTree(dir: 'libs', include: 'CraftTweaker-Dev-1.7.10-3.2.2-GTNH.4-legacy.jar')
|
||||
compile fileTree(dir: 'libs', include: 'Guide-API-1.7.10-1.0.1-20-deobf.jar')
|
||||
compile "codechicken:ForgeMultipart:1.7.10-1.1.0.314:dev"
|
||||
// compile "guideapi:Guide-API:" + config.mc_version + "-" + config.guideapi_version + ":deobf"
|
||||
compile "team.chisel:Chisel:" + config.chisel_version + ":api"
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#
|
||||
#Sat Oct 24 13:06:30 MSK 2020
|
||||
#Sun Nov 29 17:51:49 PST 2020
|
||||
mod_name=BloodMagic
|
||||
forge_version=10.13.4.1614-1.7.10
|
||||
ccc_version=1.0.7.47
|
||||
@@ -9,7 +9,7 @@ nei_version=1.0.5.111
|
||||
package_group=com.wayoftime.bloodmagic
|
||||
guideapi_version=1.0.1-20
|
||||
mod_version=1.3.3
|
||||
minetweaker_version=Dev-1.7.10-3.2.0-GTNH
|
||||
minetweaker_version=Dev-1.7.10-3.2.2-GTNH
|
||||
chisel_version=2.9.2.8
|
||||
mc_version=1.7.10
|
||||
build_number=39
|
||||
build_number=43
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,7 @@ import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toObjects;
|
||||
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toShapedObjects;
|
||||
import static WayofTime.alchemicalWizardry.common.tweaker.MTHelper.toStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
|
||||
@@ -24,16 +25,30 @@ import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
@ZenClass("mods.bloodmagic.BloodOrb")
|
||||
public class BloodOrb
|
||||
{
|
||||
public static List<IUndoableAction> lateAdditions = new ArrayList<>();
|
||||
public static List<IUndoableAction> lateRemovals = new ArrayList<>();
|
||||
|
||||
public static void applyAdditionsAndRemovals() {
|
||||
for (IUndoableAction toRemove : lateRemovals) {
|
||||
MineTweakerAPI.apply(toRemove);
|
||||
}
|
||||
for (IUndoableAction toAdd : lateAdditions) {
|
||||
MineTweakerAPI.apply(toAdd);
|
||||
}
|
||||
|
||||
lateAdditions.clear();
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addShaped(IItemStack output, IIngredient[][] ingredients)
|
||||
{
|
||||
MineTweakerAPI.apply(new Add(false, toStack(output), toShapedObjects(ingredients)));
|
||||
lateAdditions.add(new Add(false, toStack(output), toShapedObjects(ingredients)));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addShapeless(IItemStack output, IIngredient[] ingredients)
|
||||
{
|
||||
MineTweakerAPI.apply(new Add(true, toStack(output), toObjects(ingredients)));
|
||||
lateAdditions.add((new Add(true, toStack(output), toObjects(ingredients))));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
@@ -89,7 +104,7 @@ public class BloodOrb
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
lateRemovals.add(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
@@ -111,7 +126,6 @@ public class BloodOrb
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().remove(iRecipe);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package WayofTime.alchemicalWizardry.common.tweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.util.IEventHandler;
|
||||
|
||||
/**
|
||||
* MineTweaker3 Integration by joshie *
|
||||
@@ -15,5 +17,18 @@ public class MineTweakerIntegration
|
||||
MineTweakerAPI.registerClass(BloodOrb.class);
|
||||
MineTweakerAPI.registerClass(FallingTower.class);
|
||||
MineTweakerAPI.registerClass(HarvestMoon.class);
|
||||
|
||||
MineTweakerImplementationAPI.onRollbackEvent(new HandleLateAdditionsAndRemovals());
|
||||
MineTweakerImplementationAPI.onPostReload(new HandleLateAdditionsAndRemovals());
|
||||
}
|
||||
public static class HandleLateAdditionsAndRemovals implements IEventHandler<MineTweakerImplementationAPI.ReloadEvent>
|
||||
{
|
||||
@Override
|
||||
public void handle(MineTweakerImplementationAPI.ReloadEvent event)
|
||||
{
|
||||
BloodOrb.applyAdditionsAndRemovals();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user