Crafttweaker Integration - Lach01298/QMD GitHub Wiki

Quantum Minecraft Dynamics has Crafttweaker (CT) integration for almost all machines, recipes and processes. On this page is the current list of methods and how to use them. This page is up to date for QMD 1.2

Syntax

Since Particles Stacks have more than just an amount associated with them the syntax about that data is slightly different than with Item and Fluid stacks in Normal CT.

In CT item stacks and fluid stacks are defined by objects like <minecraft:stick> or <liquid:water>. There is then a operator on the object like * to modify it. An example is <minecraft:stick>*12 this changes the itemstack to have 12 items. This is same for fluidstacks.

For particle stacks the syntax is like <particle:proton>. But there are more operators to change the different types of data about the particle stacks. The operator * still exist and it does change the amount i.e particle units. But there is also ^ which changes the Energy of the stack and ~ which changes the focus of the stack. By Itself <particle:electron> means a particle stack of electrons with 1 pu and a energy of 0 keV and focus 0 (electron, 1 pu, 0 keV, 0). <particle:electron>^1000 means (electron, 1 pu, 1000 keV, 0) and <particle:electron>~4.2 means (electron, 1 pu, 0 keV, 4.2). Combining all the data together is like ((<particle:electron>*50)^1000)~4.2 which means (electron, 50 pu, 1000 keV, 4.2). Note each time the operation is applied to the thing in () without the () it applies the operator to the numbers which is very different e.g. 1000~4.2 = 10004.2

The rest of the syntax is just like normal Nuclearcraft CT integration e.g null means a empty stack etc.

Notation is the same system as Nuclearcraft. Variables in {} are optional

Methods

Ore leacher

  • mods.qmd.ore_leacher.addRecipe(IIngredient inputItem,IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputfluid3, IIngredient outputItem1, IIngredient outputItem2, IIngredient OutputItem3, {double timeMultiplier, double powerMultiplier, double processRadiation})
  • mods.qmd.ore_leacher.removeAllRecipes()
  • mods.qmd.ore_leacher.removeRecipeWithOutput(IIngredient outputItem1, IIngredient outputItem2, IIngredient outputItem3)
  • mods.qmd.ore_leacher.removeRecipeWithInput(IIngredient inputItem, IIngredient inputFluid1, inputFluid2, IIngredient inputFluid3)

Examples

mods.qmd.ore_leacher.addRecipe(<ore:oreUranium>, <liquid:nitric_acid>*16, <liquid:water>*20, <liquid:sulfuric_acid>*16, <ore:dustUranium>*3,<ore:dustCopper>*2,<ore:dustChromium>, 1.0, 5.0, 0.001);

Irradiator

  • mods.qmd.irradiator.addRecipe(IIngredient inputItem, IIngredient outputItem , {double timeMultiplier, double powerMultiplier, double processRadiation})

Note: powerMultiplier doesn't do anything.

  • mods.qmd.irradiator.removeAllRecipes()
  • mods.qmd.irradiator.removeRecipeWithOutput(IIngredient outputItem)
  • mods.qmd.irradiator.removeRecipeWithInput(IIngredient inputItem)

Irradiator Fuel

  • mods.qmd.irradiator_fuel.addRecipe(IIngredient inputItem, double speedMultiplier)
  • mods.qmd.irradiator_fuel.removeFuel(IIngredient inputItem)
  • mods.qmd.irradiator_fuel.removeAllFuels()

Examples

mods.qmd.irradiator_fuel.addFuel(<qmd:top_canister>,20.0);

Note: inputItem should be a item that is an instance of IItemParticleAmount (i.e. an existing or custom source/cell item) for the item to be used up, otherwise the item lasts forever.

Target Chamber

  • mods.qmd.target_chamber.addRecipe(IIngredient inputItem, IIngredient inputFluid, IIngredient inputParticle, IIngredient outputItem, IIngredient outputFluid, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, long maxEnergy, double crossSection, {long energyReleased})
  • mods.qmd.target_chamber.addRecipe(IIngredient inputItem, IIngredient inputParticle, IIngredient outputItem, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, long maxEnergy, double crossSection, {long energyReleased})
  • mods.qmd.target_chamber.removeRecipeWithInput(IIngredient inputItem, IIngredient inputFluid, IIngredient inputParticle)
  • mods.qmd.target_chamber.removeRecipeWithInput(IIngredient inputItem, IIngredient inputParticle)
  • mods.qmd.target_chamber.removeAllRecipes()

Examples

mods.qmd.target_chamber.addRecipe(<ore:ingotGold>, null, ((<particle:tau>*10000000)^50000)~2.0, <minecraft:diamond>, null, <particle:positron>*2, <particle:higgs_boson>, <particle:electron>*2, 53000, 0.53, -20000);

Note: the input particles amount is the amount of particles needed to convert the item, Its energy is the minimum energy and its focus is the minimum focus. The output particles amount is the max amount/t released per input particle/t. The convention(i.e not required but recommended) is that positive particles are in outputParticle1, neutral particles in outputParticle2 and negative particles in outputParticle3. This is because outputParticle2 can't be steered so will always come out the back of the chamber.

Decay Chamber

  • mods.qmd.decay_chamber.addRecipe(IIngredient inputParticle, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, double crossSection, {long maxEnergy})
  • mods.qmd.decay_chamber.removeRecipeWithInput(IIngredient inputParticle)
  • mods.qmd.decay_chamber.removeAllRecipes()

Examples

mods.qmd.decay_chamber.addRecipe(<particle:tau>, <particle:electron_antineutrino>, <particle:tua_neutrino>, <particle:electron>, 0.5)

Note: the input particles its energy is the minimum energy and its focus is the minimum focus. The output particles amount is the max amount/t released per input particle/t. The convention(i.e not required but recommended) is that positive particles are in outputParticle1, neutral particles in outputParticle2 and negative particles in outputParticle3. This is because outputParticle2 can't be steered so will always come out the back of the chamber.

Collision Chamber

  • mods.qmd.collision_chamber.addRecipe(IIngredient inputParticle1, IIngredient inputParticle2, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, IIngredient outputParticle4, long maxEnergy, double crossSection, {long energyReleased})
  • mods.qmd.collision_chamber.removeRecipeWithInput(IIngredient input1Particle, IIngredient input2Particle)
  • mods.qmd.collision_chamber.removeAllRecipes()

Examples

mods.qmd.collision_chamber.addRecipe((<particle:proton>^137378000)~5, (<particle:proton>^137378000)~5, <particle:higgs_boson>*2, <particle:sigma_plus>, <particle:kaon_plus>, null,3, 0.01,-249778000)

Note: the minimum particle energy in the range is inputParticle1 energy + inputParticle2 energy.

Beam Dump

  • mods.qmd.beam_dump.addRecipe(IIngredient inputParticle, IIngredient outputFluid, {long maxEnergy})
  • mods.qmd.beam_dump.removeRecipeWithInput(IIngredient inputParticle)
  • mods.qmd.beam_dump.removeAllRecipes()

Examples

mods.qmd.beam_dump.addRecipe(<particle:higgs_boson>^50000, <liquid:water>, 100000);

Accelerator cooling

  • mods.qmd.accelerator_cooling.addRecipe(IIngredient inputFluid, IIngredient outputFluid , int heatRemoved)
  • mods.qmd.accelerator_cooling.removeAllRecipes()
  • mods.qmd.accelerator_cooling.removeWithOutput(IIngredient outputFluid)
  • mods.qmd.accelerator_cooling.removeWithInput(IIngredient inputItem)

Examples

mods.qmd.accelerator_cooling.addRecipe(<liquid:liquid_neon>, <liquid:neon>*64,1000);

Note: the temperate the accelerator cools to is dependent on the temperature of the input fluid!

Nucleosynthesis Chamber

  • mods.qmd.nucleosynthesis_chamber.addRecipe(IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputParticle, IIngredient outputFluid1, IIngredient outputFluid2, {long maxEnergy}, {long heatRelased})
  • mods.qmd.nucleosynthesis_chamber.removeRecipeWithInput(IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputParticle)
  • mods.qmd.nucleosynthesis_chamber.removeAllRecipes()

Examples

mods.qmd.nucleosynthesis_chamber.addRecipe(<liquid:deuterium>*100, <liquid:deuterium>*100, <particle:muon>*1000, <liquid:tritium>*100, <liquid:hydrogen>*100, 1000, 4030)

Nucleosynthesis Chamber Heating

  • mods.qmd.nucleosynthesis_chamber_heater.addRecipe(IIngredient inputFluid, IIngredient outputFluid, int heatRemoved)
  • mods.qmd.nucleosynthesis_chamber_heater.removeRecipeWithInput(IIngredient inputFluid)
  • mods.qmd.nucleosynthesis_chamber_heater.removeRecipeWithOutput(IIngredient outputFluid)
  • mods.qmd.nucleosynthesis_chamber_heater.removeAllRecipes()

Examples

mods.qmd.nucleosynthesis_chamber_heater.addRecipe(<liquid:mercury>*1, <liquid:hot_mercury>*1, 1);

Ion Source

  • mods.qmd.accelerator_source.addRecipe(IIngredient inputItem, IIngredient outputParticle)
  • mods.qmd.accelerator_source.removeRecipeWithInput(IIngredient inputItem)
  • mods.qmd.accelerator_source.removeAllRecipes()

Examples

mods.qmd.accelerator_source.addRecipe(<minecraft:dirt>, ((<particle:pion_plus>*30)^500)~0.2);

Note: inputItem needs to be a item that is an instance of IItemParticleAmount (i.e. an existing or custom source/cell item).

Item Source

  • mods.qmd.item_source.setEmptyItem(IIngredient itemSource, IIngredient itemEmpty)

Note: This is used for custom items that are instances of IItemParticleAmount. This sets the item the itemSource turns into when it is used up, for example the Hydrogen Canister turns into an Empty Canister in the accelerator ion source. By default without this IItemParticleAmount items disappear when used up (turn into empty itemstack). This empty item also needs to have a capacity of 0 pu to work properly.

Examples

mods.qmd.item_source.setEmptyItem(<qmd:top_canister>,<qmd:canister>);

Containment Chamber

  • mods.qmd.containment_chamber.addRecipe(IIngredient inputParticle1, IIngredient inputParticle2, IIngredient outputFluid, {long maxEnergy})
  • mods.qmd.nucleosynthesis_chamber.removeRecipeWithInput(IIngredient inputParticle1, IIngredient inputParticle2)
  • mods.qmd.nucleosynthesis_chamber.removeAllRecipes()

Examples

mods.qmd.containment_chamber.addRecipe((<particle:proton>*1000)~1.0,(<particle:neutron>*1000)~1.0,<fluid:dueterium>*1, 1000);

Containment Chamber Cell Filling

  • mods.qmd.containment_chamber_cell_filling.addRecipe(IIngredient inputFluid, IIngredient inputFullCell)

Examples

mods.qmd.containment_chamber_cell_filling.addRecipe(<fluid:lava>*100,<qmd:lava_cell>.withTag({particle_storage: {particle_amount: 100000, particle_capacity: 100000}}));

Note: inputFullCell needs to be a item that is an instance of IItemParticleAmount (i.e. an existing or custom source/cell item) that has a empty item associated with it, for custom items look at mods.qmd.item_source.setEmptyItem. inputFullCell also needs to be a full item with its nbt tag, you can get this by using /ct hand command with the full item in your hand

Mass Spectrometer

  • mods.qmd.mass_spectrometer.addRecipe(IIngredient inputItem, IIngredient inputFluid, IIngredient outputItem1, IIngredient outputItem2, IIngredient outputItem3, IIngredient outputItem4, IIngredient outputFluid1, IIngredient outputFluid2, IIngredient outputFluid3, IIngredient outputFluid4, {double timeMultiplier})
  • mods.qmd.mass_spectrometer.removeRecipeWithInput(IIngredient inputItem, IIngredient inputFluid)
  • mods.qmd.mass_spectrometer.removeRecipeWithOutput(IIngredient outputItem1, IIngredient outputItem2, IIngredient outputItem3, IIngredient outputItem4, IIngredient outputFluid1, IIngredient outputFluid2, IIngredient outputFluid3, IIngredient outputFluid4)
  • mods.qmd.mass_spectrometer.removeAllRecipes()

Examples

mods.qmd.mass_spectrometer.addRecipe(<minecraft:stick>, null, null, <ore:dustGraphite>, null, null, <fluid:hydrogen>*1000, null, <fluid:nitrogen>*1000, <fluid:oxygen>*1000, 2.0);

Particles

Here is a list of the names of particle in QMD:

Quarks
up_quark down_quark charm_quark strange_quark top_quark bottom_quark
antiup_quark antidown_quark anticharm_quark antistrange_quark antitop_quark antibottom_quark
Leptons
electron muon tau electron_neutrino muon_neutrino tau_neutrino
positron antimuon antitau electron_antineutrino muon_antineutrino tau_antineutrino
Bosons
photon gluon w_plus_boson z_boson higgs_boson
w_minus_boson
Baryons
proton neutron delta_plus_plus delta_minus sigma_plus sigma_minus
antiproton antineutron antidelta_plus_plus antidelta_minus antisigma_plus antisigma_minus
Nuclei/Ions
deuteron triton helion alpha boron_ion
antideuteron antitriton antihelion antialpha calcium_48_ion
Mesons
pion_plus kaon_plus eta
pion_naught kaon_naught eta_prime
pion_minus antikaon_naught charmed_eta
kaon_minus bottom_eta
Other
glueball

Adding Custom Particles

For full adding of custom particles You will need contenttweaker also installed.

For adding a custom particle the addParticle method must be triggered in preinit for it not to have any errors this is done by creating a separate script that has '#loader preinit' at the top. In this script add your particles with:

  • mods.qmd.particle.addParticle(String custom_name, String textureLocation, double mass, double charge, double spin, { boolean weakCharged, boolean coloured})

The texture location is in \resources\contenttweaker\textures\particles\ plus the textureLocation e.g 'particle.png' Once created your particle can be used in other scripts via particle:custom_name

For setting the in game name and description it can be done by a .lang file in \resources\contenttweaker\lang\ with the variables : qmd.particle.custom_name.name and qmd.particle.custom_name.desc

Other information can be add to the particle after creation like what component particles it is made of:

  • mods.qmd.particle.addComponentParticle(IIngredient particle, IIngredient componentParticle)

or what its antiparticle is (otherwise it is its own antiparticle):

  • mods.qmd.particle.addAntiParticle(IIngredient particle, IIngredient antiParticle)

Example

If you wanted to add a uranium 238 ion and its antiparticle you could do:

In one script:

#loader preinit

mods.qmd.particle.addParticle("u_238_ion", "uranium_238_ion.png", 221740.92, 1.0, 0.0);        

mods.qmd.particle.addParticle("a_u_238_ion", "antiuranium_238_ion.png", 221740.92, -1.0, 0.0);

In another script:

mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:proton>*92);
mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:neutron>*146);
mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:electron>*91);

mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:antiproton>*92);
mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:antineutron>*146);
mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:positron>*91);

mods.qmd.particle.addAntiParticle(<particle:u_238_ion>, <particle:a_u_238_ion>);

Advanced features

Other things you can do in a script is access some parameters of ParticleStacks:

  • particle:name.definition
  • particle:name.NAME
  • particle:name.displayName
  • particle:name.meanEnergy
  • particle:name.amount
  • particle:name.focus

or Particles via:

  • particle:name.definition.NAME
  • particle:name.definition.displayName
  • particle:name.definition.mass
  • particle:name.definition.charge
  • particle:name.definition.spin

Adding Custom Items and Multiblock Parts

This uses the same system as NC custom items and multiblock parts and thus all methods need to be in a script with #loader nc_preinit at the top. The textures, blockstates and lang file should go into \resources\qmd in their respected folders.

Custom Accelerator Parts

  • mods.qmd.Registration.registerAcceleratorCooler(String coolerID, int cooling, String rule) rule is in the form of a string the same as in the config.

  • mods.qmd.Registration.registerAcceleratorRFCavity(String name, int voltage, double efficiency, int heat, int basePower, int maxTemp)

  • mods.qmd.Registration.registerAcceleratorMagnet(String name, double strength, double efficiency, int heat, int basePower, int maxTemp)

  • mods.qmd.Registration.registerIonSource(String name, double particleOutputMultiplier, double outputFocus, int basePower)

Voltage is in kV, strength is in Tesla (T), maxTemp is in Kelvin (K), efficiency is between 0 and 1.

Examples

mods.qmd.Registration.registerAcceleratorCooler("steel", 125, "three iron coolers"); mods.qmd.Registration.registerAcceleratorRFCavity("steel", 300, 0.5, 770, 800, 300); mods.qmd.Registration.registerAcceleratorMagnet("steel", 0.1, 0.5, 0, 0, 300);

Custom Particle Chamber Parts

  • mods.qmd.Registration.registerParticleChamberDetector(String name, double efficiency, int basePower, int distance, boolean within)

Efficiency is any decimal e.g. 1.1 = 110%. The boolean within toggles whether the placement of the detector must be within (less than or equal to) the int distance of a particle chamber block or outside (greater than or equal to) the distance.

Examples

mods.qmd.Registration.registerParticleChamberDetector("a", 0.5, 100, 3, true);

Custom Vacuum Chamber Parts

  • mods.qmd.Registration.registerVaccuumChamberHeater(String coolerID, int cooling, String rule)

Examples

mods.qmd.Registration.registerVaccuumChamberHeater("steel", 444, "two iron heaters");

Custom Source Items

  • mods.qmd.Registration.registerItemSource(String name, int capacity, int stackSize)
  • mods.qmd.Registration.registerItemSource(String name, int capacity, int stackSize, double explosionSize, double radiation)

Examples

mods.qmd.Registration.registerItemSource("top_canister", 3000000, 16); mods.qmd.Registration.registerItemSource("antioxygen_cell", 100000, 16, 8.0, 800.0);

The second method is to create a source item that explodes when left on the ground like a cell, explosionSize is the minecraft explosion size for reference 1 TNT block is 4.0, radiation is the peak amount of radiation released in the gamma flash (the actual radiation depends on the distance from the explosion using the inverse square law).

⚠️ **GitHub.com Fallback** ⚠️