fix commit

This commit is contained in:
sainagh
2026-07-25 16:20:42 -05:00
parent 9396611ce0
commit c6df59caf7
3226 changed files with 209810 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
#priority 10
import native.hellfirepvp.modularmachinery.common.crafting.command.ControllerCommandSender;
import native.hellfirepvp.modularmachinery.common.tiles.base.TileMultiblockMachineController;
import crafttweaker.command.ICommandSender;
import crafttweaker.world.IBlockPos;
import mods.modularmachinery.IMachineController;
/*
Utility functions for properly executing commands from a MMCE event.
*/
zenClass Offset {
val yOffset as int;
val facingOffset as int;
zenConstructor(y as int, facing as int) {
yOffset = y;
facingOffset = facing;
}
/*
Return the position of the center to use.
*/
function getCenter(ctrl as IMachineController) as IBlockPos {
return ctrl.pos.getOffset(up, yOffset).getOffset(ctrl.facing, facingOffset);
}
}
/*
Return a command sender based on the MMCE controller.
Required in order to provide dimension context to commands.
*/
function getControllerSender(controller as IMachineController) as ICommandSender {
var sender = ControllerCommandSender(controller as TileMultiblockMachineController) as native.net.minecraft.command.ICommandSender;
return sender.wrapper;
}
/*
Schedule a task to run on the main thread.
You should use this for anything that modifies in-world objects.
The passed task must be `function() as void {...}`.
*/
function scheduleTask(controller as IMachineController, task as function()void) {
controller.world.native.getMinecraftServer().addScheduledTask(task);
}
+15
View File
@@ -0,0 +1,15 @@
#priority 20
#loader crafttweaker lateAddTC
import native.com.blamejared.compat.thaumcraft.handlers.ThaumCraft;
import native.thaumcraft.api.ThaumcraftApiHelper;
import crafttweaker.item.IItemStack;
import thaumcraft.aspect.CTAspectStack;
/*
Easily make a vis crystal for a specified aspect. Stack returned is size 1.
*/
global makeVisCrystal as function(CTAspectStack)IItemStack = function (aspect as CTAspectStack) as IItemStack {
return ThaumcraftApiHelper.makeCrystal(ThaumCraft.getAspect(aspect)).wrapper;
};