minecraft server init
This commit is contained in:
315
scripts/crafttweaker/classes/resources/metals.zs
Normal file
315
scripts/crafttweaker/classes/resources/metals.zs
Normal file
@ -0,0 +1,315 @@
|
||||
#priority 2751
|
||||
|
||||
/*
|
||||
SevTech: Ages Metals Processing Script
|
||||
|
||||
TODO:
|
||||
|
||||
Note: These scripts are created and for the usage in SevTech: Ages and other
|
||||
modpacks curated by DarkPacks. You can use these scripts for reference and for
|
||||
learning but not for copying and pasting and claiming as your own.
|
||||
*/
|
||||
import crafttweaker.item.IItemStack;
|
||||
import crafttweaker.item.IIngredient;
|
||||
import crafttweaker.liquid.ILiquidStack;
|
||||
import crafttweaker.oredict.IOreDictEntry;
|
||||
|
||||
import scripts.crafttweaker.utils;
|
||||
|
||||
zenClass Metals {
|
||||
var defaultArcEnergyPerTick as int = 512;
|
||||
var defaultArcTickTime as int = 100;
|
||||
var arcGivesSlag as bool = false;
|
||||
var immersivePressEnergy as int = 2400;
|
||||
var packingMold as IItemStack = <immersiveengineering:mold:6>;
|
||||
var unpackingMold as IItemStack = <immersiveengineering:mold:7>;
|
||||
var packingInputCount as int = 9;
|
||||
var packingOutputCount as int = 1;
|
||||
var unpackingInputCount as int = 1;
|
||||
var unpackingOutputCount as int = 9;
|
||||
|
||||
var wires as IItemStack[string] = {
|
||||
aluminum: <immersiveengineering:material:22>,
|
||||
copper: <immersiveengineering:material:20>,
|
||||
electrum: <immersiveengineering:material:21>,
|
||||
steel: <immersiveengineering:material:23>
|
||||
};
|
||||
|
||||
/*
|
||||
Secondary Output mapping for Ores.
|
||||
|
||||
This should link/be to/an OreDict entry always!
|
||||
*/
|
||||
var secondaryOutputs as IOreDictEntry[string] = {
|
||||
copper: metals.gold.dust,
|
||||
iron: metals.nickel.dust,
|
||||
lead: metals.silver.dust,
|
||||
nickel: metals.platinum.dust,
|
||||
platinum: metals.nickel.dust,
|
||||
silver: metals.lead.dust,
|
||||
uranium: metals.lead.dust
|
||||
};
|
||||
|
||||
zenConstructor() {
|
||||
}
|
||||
|
||||
function handleTinkers(preferredMetalItem as IItemStack, metalName as string, metalPartName as string, metalLiquid as ILiquidStack) {
|
||||
var fluidAmount as int = utils.getFluidAmount(metalPartName);
|
||||
|
||||
// ==============================
|
||||
// Melting
|
||||
tinkers.removeMelting(metalLiquid * 1, preferredMetalItem);
|
||||
if (fluidAmount != 0) {
|
||||
tinkers.addMelting(metalLiquid * fluidAmount, preferredMetalItem);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Casting
|
||||
if (metalPartName == "block") {
|
||||
tinkers.removeCastingBasin(preferredMetalItem);
|
||||
tinkers.addCastingBasin(preferredMetalItem, null, metalLiquid, fluidAmount, false);
|
||||
} else {
|
||||
var tinkersCast as IItemStack = utils.getCast(metalPartName);
|
||||
if (tinkersCast as bool) {
|
||||
tinkers.removeCastingTable(preferredMetalItem);
|
||||
tinkers.addCastingTable(preferredMetalItem, tinkersCast, metalLiquid, fluidAmount, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleDirtyDust(preferredMetalItem as IItemStack, metalName as string, metal as IOreDictEntry[string]) {
|
||||
mekanism.removeEnrichment(preferredMetalItem);
|
||||
if (metalItems[metalName].dust as bool) {
|
||||
mekanism.addEnrichment(preferredMetalItem, metalItems[metalName].dust.items[0]);
|
||||
}
|
||||
// Handle the dirtyDust set in the map to force change the outcome. (Fixes an issue with Meka registration)
|
||||
mekanism.removeEnrichment(metal.dirtyDust.firstItem);
|
||||
mekanism.addEnrichment(metal.dirtyDust.firstItem, metal.dust.firstItem);
|
||||
}
|
||||
|
||||
function handleDust(preferredMetalItem as IItemStack, metalName as string, metalPartName as string, metal as IOreDictEntry[string]) {
|
||||
immersiveEngineering.addArcFurn(
|
||||
metalItems[metalName].ingot.items[0],
|
||||
metal[metalPartName],
|
||||
arcGivesSlag ? <ore:itemSlag>.firstItem : null,
|
||||
defaultArcTickTime,
|
||||
defaultArcEnergyPerTick
|
||||
);
|
||||
// Later Stage Smelting.
|
||||
mekanism.addSmelter(preferredMetalItem, metalItems[metalName].ingot.items[0]);
|
||||
}
|
||||
|
||||
function handleIngot(preferredMetalItem as IItemStack, metalName as string, metalPartName as string) {
|
||||
// Remove ingot recipes, mainly for preventing ore doubling recipes.
|
||||
immersiveEngineering.removeArcFurn(preferredMetalItem);
|
||||
|
||||
// ==============================
|
||||
// Nugget
|
||||
if (metalItems[metalName].nugget as bool) {
|
||||
// Packing
|
||||
immersiveEngineering.addPress(
|
||||
preferredMetalItem * packingOutputCount,
|
||||
metalItems[metalName].nugget.items[0],
|
||||
packingMold,
|
||||
immersivePressEnergy,
|
||||
packingInputCount
|
||||
);
|
||||
|
||||
// Unpacking
|
||||
immersiveEngineering.addPress(
|
||||
metalItems[metalName].nugget.items[0] * unpackingOutputCount,
|
||||
preferredMetalItem,
|
||||
unpackingMold,
|
||||
immersivePressEnergy,
|
||||
unpackingInputCount
|
||||
);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Block
|
||||
if (metalItems[metalName].block as bool) {
|
||||
// Packing
|
||||
immersiveEngineering.addPress(
|
||||
metalItems[metalName].block.items[0] * packingOutputCount,
|
||||
preferredMetalItem,
|
||||
packingMold,
|
||||
immersivePressEnergy,
|
||||
packingInputCount
|
||||
);
|
||||
|
||||
// Unpacking
|
||||
immersiveEngineering.addPress(
|
||||
preferredMetalItem * unpackingOutputCount,
|
||||
metalItems[metalName].block.items[0],
|
||||
unpackingMold,
|
||||
immersivePressEnergy,
|
||||
unpackingInputCount
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function handlePlate(preferredMetalItem as IItemStack, metalName as string) {
|
||||
mods.primaltech.StoneAnvil.addRecipe(preferredMetalItem, metalItems[metalName].ingot.items[0]);
|
||||
// Plates should also be used in place of ingots for wire.
|
||||
if (metalName == "copper" | metalName == "electrum" | metalName == "aluminum" | metalName == "steel") {
|
||||
immersiveEngineering.addPress(
|
||||
wires[metalName] * 2,
|
||||
preferredMetalItem,
|
||||
<immersiveengineering:mold:4>,
|
||||
immersivePressEnergy,
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function handleBlock(preferredMetalItem as IItemStack, metalName as string) {
|
||||
mods.primaltech.StoneAnvil.addRecipe(metalItems[metalName].ingot.items[0] * 9, preferredMetalItem);
|
||||
}
|
||||
|
||||
function handleRod(preferredMetalItem as IItemStack, metalName as string) {
|
||||
mods.primaltech.StoneAnvil.addRecipe(preferredMetalItem, metalItems[metalName].plate.items[0]);
|
||||
}
|
||||
|
||||
function handlePress(preferredMetalItem as IItemStack, metalName as string, metalPartName as string) {
|
||||
var pressMold as IItemStack = utils.getMold(metalPartName);
|
||||
|
||||
if (pressMold as bool) {
|
||||
immersiveEngineering.removePress(preferredMetalItem);
|
||||
immersiveEngineering.addPress(
|
||||
preferredMetalItem * utils.getPressOutputCount(metalPartName),
|
||||
metalItems[metalName].ingot.items[0],
|
||||
pressMold,
|
||||
immersivePressEnergy,
|
||||
utils.getPressInputCount(metalPartName)
|
||||
);
|
||||
}
|
||||
|
||||
if (metalPartName != "plate" & metalItems[metalName].plate as bool) {
|
||||
immersiveEngineering.addPress(
|
||||
preferredMetalItem * utils.getPressOutputCount(metalPartName),
|
||||
metalItems[metalName].plate.items[0],
|
||||
pressMold,
|
||||
immersivePressEnergy,
|
||||
utils.getPressInputCount(metalPartName)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Ore Processing/Handling
|
||||
|
||||
/*
|
||||
Remove all the current recipes for the ore and mods processing so we can add back in our tier system.
|
||||
|
||||
(Some of these are not really needed but it flushes the system and ensures for compat with our forced dusts)
|
||||
*/
|
||||
function removeOreRecipes(metalType as IOreDictEntry[string]) {
|
||||
// Remove Ore recipes from mods which support IIngredient.
|
||||
mekanism.removeEnrichment(metalType.ore);
|
||||
// Remove Starlight Ingot Conversion.
|
||||
astralSorcery.removeStarlight(metalType.ingot.firstItem);
|
||||
// Remove the Ingot -> Dust recipe from Applied Energistics.
|
||||
appliedEnergistics.removeGrindstone(metalType.ingot.firstItem);
|
||||
|
||||
// Remove all Dust recipes.
|
||||
for dust in metalType.dust.items {
|
||||
// Remove the dust from Actually Additions.
|
||||
actuallyAdditions.removeCrusher(dust);
|
||||
// Remove the dust from Astral Sorcery.
|
||||
astralSorcery.removeGrindstone(dust);
|
||||
astralSorcery.removeStarlight(dust);
|
||||
// Remove the dust from IE Crusher.
|
||||
immersiveEngineering.removeCrusher(dust);
|
||||
// Remove the dust from Mekanism.
|
||||
mekanism.removeCrusher(dust);
|
||||
}
|
||||
// Remove all Ore recipes.
|
||||
for ore in metalType.ore.items {
|
||||
// Remove the ore from Applied Energistics.
|
||||
appliedEnergistics.removeGrindstone(ore);
|
||||
// Remove the ore from Blood Magic.
|
||||
bloodMagic.removeAlchemyTable([ore, <bloodmagic:cutting_fluid:0>] as IItemStack[]);
|
||||
// Remove the ore from AbyssalCraft.
|
||||
abyssalcraft.removeCrystallization(ore);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Add the recipes following our tier system back to the game.
|
||||
|
||||
These are added using our tier system, along with tweaks to how progression works each tier
|
||||
is noted below and self explained with the method calling to the mods.
|
||||
*/
|
||||
function createOreRecipes(metalType as IOreDictEntry[string], oreSecondOutput as IOreDictEntry) {
|
||||
// Add recipes for mods which support input by IIngredient.
|
||||
if (!isNull(oreSecondOutput)) {
|
||||
// Tier 2 Recipes
|
||||
immersiveEngineering.addCrusher(metalType.dust.firstItem * 2, metalType.ore, immersiveEngineering.default_energy, oreSecondOutput.firstItem, 0.25);
|
||||
} else {
|
||||
// Tier 2 Recipes
|
||||
immersiveEngineering.addCrusher(metalType.dust.firstItem * 2, metalType.ore);
|
||||
}
|
||||
|
||||
for ore in metalType.ore.items {
|
||||
// Tier 1 Recipes
|
||||
appliedEnergistics.addGrindstone(metalType.dust.firstItem, ore);
|
||||
astralSorcery.addGrindstone(ore, metalType.dust.firstItem);
|
||||
|
||||
// Tier 3 Recipes
|
||||
mekanism.addCrusher(ore, metalType.dust.firstItem * 2);
|
||||
|
||||
if (!isNull(oreSecondOutput)) {
|
||||
// Tier 3 Recipes
|
||||
actuallyAdditions.addCrusher(metalType.dust.firstItem * 2, ore, oreSecondOutput.firstItem, 50);
|
||||
} else {
|
||||
// Tier 3 Recipes
|
||||
actuallyAdditions.addCrusher(metalType.dust.firstItem * 2, ore);
|
||||
}
|
||||
}
|
||||
|
||||
// Tier 4 Recipes
|
||||
createTier4Recipes(metalType, oreSecondOutput);
|
||||
}
|
||||
|
||||
/*
|
||||
Add the conversion recipes for the ore sub items.
|
||||
|
||||
This adds the processing such as Ingot -> Dust or other conversions needed for the Ore outputs which are removed
|
||||
in process with cleaning up via the `removeRecipes` Function.
|
||||
*/
|
||||
function createConversionRecipes(metalName as string, metalType as IOreDictEntry[string]) {
|
||||
// Handle the Ingot -> Dust conversion.
|
||||
if (metalType has "dust" & !isNull(metalItems[metalName].dust)) {
|
||||
immersiveEngineering.addCrusher(metalType.dust.firstItem, metalItems[metalName].ingot.items[0], 256);
|
||||
appliedEnergistics.addGrindstone(metalType.dust.firstItem, metalItems[metalName].ingot.items[0]);
|
||||
astralSorcery.addGrindstone(metalItems[metalName].ingot.items[0], metalType.dust.firstItem);
|
||||
actuallyAdditions.addCrusher(metalType.dust.firstItem, metalItems[metalName].ingot.items[0]);
|
||||
mekanism.addCrusher(metalItems[metalName].ingot.items[0], metalType.dust.firstItem);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Add the recipes to the Modular Machine for processing Ores.
|
||||
|
||||
This is a custom machine using various gases/fluids to tie with Mekanism but allow the
|
||||
player to explore with other options and to improve efficiency with autocrafting/autoprocessing.
|
||||
*/
|
||||
function createTier4Recipes(metalType as IOreDictEntry[string], oreSecondOutput as IOreDictEntry) {
|
||||
// Add the ore to the OreMatic 5000.
|
||||
orematic.addAllTiers(metalType.ore, metalType.dust.firstItem, oreSecondOutput);
|
||||
}
|
||||
|
||||
/*
|
||||
Handle Ores by removing all recipes which are created from the Ore. Then re-add them using our logic/changes.
|
||||
Also add processing for the Ore Matic to enable faster Ore Processing in later Ages.
|
||||
*/
|
||||
function handleOre(metalName as string, metalType as IOreDictEntry[string]) {
|
||||
var secondaryOutput as IOreDictEntry = secondaryOutputs[metalName];
|
||||
// Remove all the old recipes for the ore conversion.
|
||||
removeOreRecipes(metalType);
|
||||
// Add back the recipes needed for the Tier'd Ore Processing.
|
||||
createOreRecipes(metalType, secondaryOutput);
|
||||
// Add back the conversion recipes which are removed by the script (Due to how the removals work).
|
||||
createConversionRecipes(metalName, metalType);
|
||||
}
|
||||
}
|
146
scripts/crafttweaker/classes/resources/resources.zs
Normal file
146
scripts/crafttweaker/classes/resources/resources.zs
Normal file
@ -0,0 +1,146 @@
|
||||
#priority 2650
|
||||
|
||||
/*
|
||||
SevTech: Ages Resources Script
|
||||
|
||||
It does things and stuff which some of us understand?
|
||||
|
||||
Note: These scripts are created and for the usage in SevTech: Ages and other
|
||||
modpacks curated by DarkPacks. You can use these scripts for reference and for
|
||||
learning but not for copying and pasting and claiming as your own.
|
||||
*/
|
||||
import crafttweaker.data.IData;
|
||||
import crafttweaker.item.IIngredient;
|
||||
import crafttweaker.item.IItemStack;
|
||||
import crafttweaker.liquid.ILiquidStack;
|
||||
import crafttweaker.oredict.IOreDictEntry;
|
||||
|
||||
import mods.zenstages.ZenStager;
|
||||
|
||||
import scripts.crafttweaker.craftingUtils;
|
||||
import scripts.crafttweaker.stages.metalStages;
|
||||
|
||||
zenClass Resources {
|
||||
var partsToSkip as string[] = [
|
||||
"clump",
|
||||
"crystal",
|
||||
"shard"
|
||||
];
|
||||
|
||||
zenConstructor() {
|
||||
}
|
||||
|
||||
/*
|
||||
Returns liquid if it exists for that metal if not return null.
|
||||
*/
|
||||
function getMetalLiquid(metalName as string) as ILiquidStack {
|
||||
return metalItems[metalName].liquid as bool ? metalItems[metalName].liquid.liquids[0] : null;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns item if it exists for that metal if not return null.
|
||||
*/
|
||||
function getPreferredMetalItem(metalName as string, metalPartName as string) as IItemStack {
|
||||
return metalItems[metalName][metalPartName] as bool ? metalItems[metalName][metalPartName].items[0] : null;
|
||||
}
|
||||
|
||||
/*
|
||||
This method will handle the part being passed. This will perform the magic required to make the magic happen!
|
||||
*/
|
||||
function processPart(metalName as string, metalPartName as string, metal as IOreDictEntry[string], preferredMetalItem as IItemStack, metalLiquid as ILiquidStack, doFurnace as bool, metalStage as string, hasLiquid as bool) {
|
||||
recipes.remove(preferredMetalItem);
|
||||
furnace.remove(preferredMetalItem);
|
||||
|
||||
if (hasLiquid) {
|
||||
metalProc.handleTinkers(preferredMetalItem, metalName, metalPartName, metalLiquid);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Process the part via their own handlers.
|
||||
if (metalPartName == "dirtyDust") {
|
||||
metalProc.handleDirtyDust(preferredMetalItem, metalName, metal);
|
||||
} else if (metalPartName == "dust") {
|
||||
metalProc.handleDust(preferredMetalItem, metalName, metalPartName, metal);
|
||||
} else if (metalPartName == "ingot") {
|
||||
metalProc.handleIngot(preferredMetalItem, metalName, metalPartName);
|
||||
} else if (metalPartName == "plate") {
|
||||
metalProc.handlePlate(preferredMetalItem, metalName);
|
||||
} else if (metalPartName == "block") {
|
||||
metalProc.handleBlock(preferredMetalItem, metalName);
|
||||
} else if (metalPartName == "rod") {
|
||||
metalProc.handleRod(preferredMetalItem, metalName);
|
||||
}
|
||||
// ==============================
|
||||
// Handle Press Recipes
|
||||
metalProc.handlePress(preferredMetalItem, metalName, metalPartName);
|
||||
}
|
||||
|
||||
/*
|
||||
This method is called to init the loop over metals to change how the processing mechanics work for the pack.
|
||||
TLDR: Removes/Adds/Changes recipes/usages for the metal being handled.
|
||||
*/
|
||||
function processMetal(metalName as string, metal as IOreDictEntry[string]) {
|
||||
var metalLiquid = getMetalLiquid(metalName);
|
||||
var hasLiquid = metalLiquid as bool;
|
||||
var metalStage = (metalStages has metalName) ? metalStages[metalName] : "";
|
||||
|
||||
// Log as a warn is the metal has no Stage. As ALL metals should have been staged!
|
||||
// I.E. Could be a new metal or change to a name which we missed in a mod update etc...
|
||||
if (metalStage == "") {
|
||||
logger.logWarning("[Metals] No stage found for " ~ metalName);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Stage the Liquid
|
||||
if (metalStage != "" & hasLiquid) {
|
||||
ZenStager.getStage(metalStage).addLiquid(metalLiquid);
|
||||
ZenStager.getStage(metalStage).addIngredient(craftingUtils.getBucketIngredient(metalLiquid));
|
||||
}
|
||||
// ==============================
|
||||
// Loop over the parts for the Metal and handle each part for correcting/changing processing recipes/mechanics.
|
||||
for partName, part in metal {
|
||||
if (part as bool & partName != "ore") {
|
||||
var preferredMetalItem = getPreferredMetalItem(metalName, partName);
|
||||
unifier.unify(part, preferredMetalItem, metalLiquid);
|
||||
|
||||
if (preferredMetalItem as bool) {
|
||||
// Stage the part.
|
||||
if (metalStage != "") {
|
||||
ZenStager.getStage(metalStage).addIngredient(preferredMetalItem);
|
||||
}
|
||||
|
||||
if (!(partsToSkip has partName)) {
|
||||
processPart(metalName, partName, metal, preferredMetalItem, metalLiquid, partName == "ingot", metalStage, hasLiquid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ==============================
|
||||
// Ore Processing
|
||||
if (metal has "ore" & !isNull(metal.dust)) {
|
||||
metalProc.handleOre(metalName, metal);
|
||||
}
|
||||
}
|
||||
|
||||
function processCluster(metal as string, cluster as IItemStack) {
|
||||
// ==============================
|
||||
// Crushing Recipes
|
||||
if (metal == "titanium") {
|
||||
immersiveEngineering.addCrusher(metals[metal].dust.firstItem * 2, cluster, metals.iron.dust.firstItem, 0.50);
|
||||
actuallyAdditions.addCrusher(metals[metal].dust.firstItem * 2, cluster, metals.iron.dust.firstItem, 50);
|
||||
} else {
|
||||
immersiveEngineering.addCrusher(metals[metal].dust.firstItem * 2, cluster);
|
||||
actuallyAdditions.addCrusher(metals[metal].dust.firstItem * 2, cluster);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// Smelting Recipes
|
||||
mekanism.addEnrichment(cluster, metals[metal].dust.firstItem * 2);
|
||||
|
||||
// ==============================
|
||||
// Tinkers Melting
|
||||
if (!isNull(metalItems[metal].liquid)) {
|
||||
tinkers.addMelting(metalItems[metal].liquid.liquids[0] * 144, cluster);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user