Update to 0.18.3

This commit is contained in:
ZHAY10086
2025-11-16 21:53:25 +08:00
parent f6faf3fb2c
commit a9af77df03
893 changed files with 22505 additions and 6173 deletions
@@ -0,0 +1,58 @@
import native.net.minecraft.item.Item;
import native.net.minecraft.item.ItemStack;
import crafttweaker.block.IBlockState;
import crafttweaker.command.ICommandSender;
import crafttweaker.world.IBlockPos;
import mods.modularmachinery.RecipeBuilder;
import mods.modularmachinery.MachineTickEvent;
import mods.modularmachinery.RecipeStartEvent;
import mods.modularmachinery.MMEvents;
import mods.modularmachinery.IMachineController;
import crafttweaker.world.IFacing;
import crafttweaker.util.Position3f;
// Shared code
import scripts.util.ModularEventUtils as Util;
static offset as Util.Offset = Util.Offset(2, 0);
var nukeenvironmentboom = RecipeBuilder.newBuilder("nukeenvironmentboom","safe_nuke_environment",500);
nukeenvironmentboom.addStartHandler(function(event as RecipeStartEvent) {
NukeEnvironmentRecipeStart(event.controller, "techreborn:nuke");
}
)
.addRecipeTooltip(["在控制器下方放置核弹后,多方块内部所有具备有效配方的流体都将被转换"])
.build();
// "techreborn:nuke", "contenttweaker:polonium_molten", "contenttweaker:areated_molten_californium_250", "contenttweaker:unholy_nuke_catalyst", "contenttweaker:californium_256", "contenttweaker:cold_plasma"
function NukeEnvironmentRecipeStart(controller as IMachineController, explosiveBlock as string) {
var pos = offset.getCenter(controller).asPosition3f();
var posOffset = offset.getCenter(controller).asPosition3f();
posOffset.y = pos.y - 3;
var sender = Util.getControllerSender(controller);
Util.scheduleTask(controller, function() as void {
var currentBoomBlock = controller.world.getBlockState(posOffset);
//server.commandManager.executeCommand(sender, "say controller position: " + (pos.x) + " " + (pos.y) + " " + (pos.z) + " ");
//server.commandManager.executeCommand(sender, "say nuke position: " + (posOffset.x) + " " + (posOffset.y) + " " + (posOffset.z) + " ");
if (currentBoomBlock == IBlockState.getBlockState(explosiveBlock,"")) {
server.commandManager.executeCommand(sender, "fill " + (posOffset.x - 2) + " " + (posOffset.y - 2) + " " + (posOffset.z - 2) + " " + (posOffset.x + 2) + " " + (posOffset.y + 2) + " " + (posOffset.z + 2) + " " + "air" + " 0 replace " + "techreborn:nuke");
server.commandManager.executeCommand(sender, "fill " + (posOffset.x - 2) + " " + (posOffset.y - 6) + " " + (posOffset.z - 2) + " " + (posOffset.x + 2) + " " + (posOffset.y) + " " + (posOffset.z + 2) + " " + "contenttweaker:californium_256" + " 0 replace " + "contenttweaker:polonium_molten 0");
server.commandManager.executeCommand(sender, "fill " + (posOffset.x - 2) + " " + (posOffset.y - 6) + " " + (posOffset.z - 2) + " " + (posOffset.x + 2) + " " + (posOffset.y) + " " + (posOffset.z + 2) + " " + "contenttweaker:californium_256" + " 0 replace " + "contenttweaker:areated_molten_californium_250 0");
server.commandManager.executeCommand(sender, "fill " + (posOffset.x - 2) + " " + (posOffset.y - 6) + " " + (posOffset.z - 2) + " " + (posOffset.x + 2) + " " + (posOffset.y) + " " + (posOffset.z + 2) + " " + "contenttweaker:cold_plasma" + " 0 replace " + "contenttweaker:unholy_nuke_catalyst 0");
server.commandManager.executeCommand(sender, "playsound minecraft:block.end_portal.spawn block @a " + pos.x + " " + pos.y + " " + pos.z + " 1 1");
server.commandManager.executeCommand(sender, "particle hugeexplosion " + pos.x + " " + (pos.y - 3) + " " + pos.z + " 1 1 1 0.1 1000");
}
});
}
@@ -9,6 +9,10 @@ import mods.modularmachinery.MachineTickEvent;
import mods.modularmachinery.RecipeStartEvent;
import mods.modularmachinery.MMEvents;
import mods.modularmachinery.IMachineController;
import crafttweaker.world.IFacing;
import crafttweaker.util.Position3f;
// Shared code
import scripts.util.ModularEventUtils as Util;
@@ -32,7 +36,11 @@ megeliumboomdraconium.addBiomeInput("minecraft:sky")
function megeliumDetonatorRecipeStart(controller as IMachineController, initialBlock as string, finalBlock as string) {
var pos = offset.getCenter(controller);
var posunshifted = offset.getCenter(controller).asPosition3f();
var pos = offset.getCenter(controller).asPosition3f();
var posCenter = offset.getCenter(controller).asPosition3f();
pos.y = posunshifted.y + 9;
posCenter.y = pos.y - 1;
var sender = Util.getControllerSender(controller);
Util.scheduleTask(controller, function() as void {
var currentBoomBlock = controller.world.getBlockState(pos);
@@ -50,5 +58,11 @@ function megeliumDetonatorRecipeStart(controller as IMachineController, initialB
// replace blocks around reactor
function replaceBoomBlock(controller as IMachineController, initialBlock as string, finalBlock as string, pos as IBlockPos, sender as ICommandSender) {
var facing = controller.facing;
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y - 1) + " " + (pos.z - 1) + " " + (pos.x + 1) + " " + (pos.y) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y - 1) + " " + (pos.z - 1) + " " + (pos.x + 1) + " " + (pos.y + 1) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x + 2) + " " + (pos.y - 1) + " " + (pos.z - 1) + " " + (pos.x + 2) + " " + (pos.y + 1) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 2) + " " + (pos.y - 1) + " " + (pos.z - 1) + " " + (pos.x - 2) + " " + (pos.y + 1) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y + 2) + " " + (pos.z - 1) + " " + (pos.x + 1) + " " + (pos.y + 2) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y - 2) + " " + (pos.z - 1) + " " + (pos.x + 1) + " " + (pos.y - 2) + " " + (pos.z + 1) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y - 1) + " " + (pos.z - 2) + " " + (pos.x + 1) + " " + (pos.y + 1) + " " + (pos.z - 2) + " " + finalBlock + " 0 replace " + initialBlock);
server.commandManager.executeCommand(sender, "fill " + (pos.x - 1) + " " + (pos.y - 1) + " " + (pos.z + 2) + " " + (pos.x + 1) + " " + (pos.y + 1) + " " + (pos.z + 2) + " " + finalBlock + " 0 replace " + initialBlock);
}