-
Notifications
You must be signed in to change notification settings - Fork 26
CT Machine Upgrades
Frinn38 edited this page Jul 22, 2021
·
5 revisions
Custom Machine upgrades can be made with Crafttweaker.
Create a .zs file in the script folder (ex: custom_machine_upgrades.zs) and look at the example below to see all the available methods to create a Custom Machine upgrade with Crafttweaker.
If you're not familiar about custom machine upgrades see the wiki page.
//Create the upgrade builder and give it the item that will act as upgrade and the max amount of this upgrade that can be used in a machine.
mods.custommachinery.CMUpgradeBuilder.create(Item item, @Optional(64) int maxAmount)
//Add a machine that will accept this upgrade, the machine ID must be "namespace:id" like "custommachinery:my_machine" if the json is located in (my_datapack)/data/custommachinery/machines/my_machine.json
.machine(String machineID)
//Add a modifier with mode input and operation addition
.addInput(CTRequirementType type, double value, @Optional("") String target, @Optional(1.0) double chance)
//Add a modifier with mode input and operation multiplication
.mulInput(CTRequirementType type, double value, @Optional("") String target, @Optional(1.0) double chance)
//Add a modifier with mode output and operation addition
.addOutput(CTRequirementType type, double value, @Optional("") String target, @Optional(1.0) double chance)
//Add a modifier with mode output and operation multiplication
.mulOutput(CTRequirementType type, double value, @Optional("") String target, @Optional(1.0) double chance)
//Finish (don't forget the semicolon ';')
.build();- All parameters with
@Optional(defaultValue)in front of it can be omitted, the default value will be used instead. - If a method have several @Optional parameters and you want to specify one, all before that one must also be specified.
(Example :.addInput(<requirementtype:custommachinery:speed>, 5, 0.5)is invalid because the@Optional("") double targetparameter must also be specified. - CTRequirementType is specified with:
<requirementtype:namespace:requirement_type_id>ex:<requirementtype:custommachinery:item>
A gold ingot put inside the Power Crusher will double it's energy comsumption but also speed it by 50%
mods.custommachinery.CMUpgradeBuilder.create(<item:minecraft:gold_ingot>)
.machine("custommachinery:power_crusher")
.mulInput(<requirementtype:custommachinery:energy>, 2)
.mulInput(<requirementtype:custommachinery:speed>, 1.5)
.build();3. Machine GUI
- Dump Element
- Energy Element
- Fluid Element
- Fuel Element
- Player Inventory Element
- Progress Bar Element
- Reset Element
- Slot Element
- Status Element
- Text Element
- Texture Element
5. Catalysts
- Biome Requirement
- Block Requirement
- Command Requirement
- Dimension Requirement
- Drop Requirement
- Durability Requirement
- Effect Requirement
- Energy Requirement
- Energy Per Tick Requirement
- Entity Requirement
- Fluid Requirement
- Fluid Per Tick Requirement
- Fuel Requirement
- Item Requirement
- Light Requirement
- Loot Table Requirement
- Position Requirement
- Structure Requirement
- Redstone Requirement
- Time Requirement
- Weather Requirement