-
Notifications
You must be signed in to change notification settings - Fork 367
Tool Property Page for the Wiki #3827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 55 commits
9fd0cf3
5c6f159
2ca506d
73f7737
943c7f6
1b69fee
972fcf9
94bebbf
c036745
deaadbe
d8ff5f2
59a1d9e
a290b05
f985e10
2630284
9311a59
0dd6d19
461a6a9
2b05017
48924af
a66c09b
806ad6a
9a2a822
9890e70
d47e43c
f312b1f
5151778
7fb1ebc
23b9d2e
e38ca64
59960db
093b8f7
835879d
92c7372
5e1f2b3
19f8b91
820b558
251604e
2fafe98
302eb56
1b24d37
4d5a092
215e7f9
75a5d19
af9d8b8
4faf294
01b765a
1195458
fe2891c
6e01f9a
cb113df
f3c21f8
fc0971e
a1a72d3
f3f4a56
c8f8b42
6c2d77d
71bc9b5
39c4542
3a64852
04f8bc8
e89f4b7
d794c67
ae255c7
336a2fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,17 @@ You can change the properties of the material by adding any combination of the f | |
| - `.secondaryColor(int colorCode)` gives the material a secondary color. If this is not being called, the secondary value will default to white(0xffffff). | ||
| - `.flags(flag1, flag2, ...)` can be used to select certain properties of the material, like generating gears, or disabling decomposition. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need a list of valid Flags
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those flags are in the flags page, the whole mat creation page needs reworked but that's a separate pr, only removed the tool part in it right now.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Linked the page that shows examples. |
||
| - `.element(element)` -> similar to `.components()`, but is used when the material represents an element. | ||
| - `.rotorStats(speed, damage, durability)` -> this will create a turbine rotor from this material. | ||
| - `.rotorStats(/* int */ power, /* int */ efficiency, /* float */ damage, /* int */ durability)` -> this will create a turbine rotor from this material | ||
| 1. Power is the EU/t and fuel consumption multiplier the turbine gets when equipped with this rotor. | ||
| This output varies depending on speed of turbine and rotor holder. | ||
| 3. Efficiency is how well it handles fuel. | ||
| A smaller number will make it consume more fuel while a bigger number means it uses less fuel. | ||
|
Phoenixvine32908 marked this conversation as resolved.
|
||
| Actual efficiency: rotorEfficiency * holder Efficiency / 100 | ||
| 4. Damage is the amount of damage that happens to the player when opening the ui of a running turbine's rotor holder. | ||
| 5. Durability is how much base durability it has. | ||
| - Here are some examples of base gt rotors | ||
|
Phoenixvine32908 marked this conversation as resolved.
Outdated
|
||
| 1. Titanium Rotor: .rotorStats(130, 115, 3.0, 1600) | ||
| 2. Tungsten Rotor .rotorStats(130, 115, 3.0, 2560) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tungsten feels like a poor choice because 3 of its 4 stats are the same as Titanium. How about HSS-S?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HSS-S does sound good, but gonna fix that in the material creation page pr probably.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nevermind, simple thing I can fix now |
||
| - `.blastTemp()` is meant to be paired together with `.ingot()`. Will generate a EBF recipe (and an ABS recipe) based on the parameters you give it: | ||
| 1. temperature -> dictates what coil tier it will require (check the coil tooltips for their max temperature). | ||
| If the temperature is below 1000, it will also generate a PBF recipe. | ||
|
|
@@ -51,7 +61,6 @@ You can change the properties of the material by adding any combination of the f | |
| 1. Voltage, amperage, loss per block | ||
| 2. Voltage, amperage, loss per block, is superconductor -> for a super conductor, set loss as 0 and is super conductor as true | ||
| 3. Voltage, amperage, loss per block, is super conductor, critical temperature | ||
| - `.toolProperties()` | ||
| - `.fluidPipeProperties()` | ||
| - `.itemPipeProperties()` | ||
| - `.addDefaultEnchant()` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| --- | ||
| title: Tool Creation | ||
| --- | ||
|
|
||
| You can make tools out of materials you create by calling toolStats inside your material's code. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switch the writing tone in this file from 2nd person ("You can make...") to no-person ("Tools can be made...")
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
|
|
||
| When working with tools you will need to load these classes at the top of your file. | ||
| ```js | ||
| const $PropertyKey = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.PropertyKey'); | ||
| const $ToolProperty = Java.loadClass('com.gregtechceu.gtceu.api.data.chemical.material.properties.ToolProperty'); | ||
| ``` | ||
|
|
||
| - `.toolStats(float harvestSpeed, float attackDamage, int durability, int harvestLevel, GTToolType[] types)` | ||
| 1. harvestSpeed is how fast the tool actually breaks blocks in world. | ||
| - Takes a decimal number eg.(5.6). | ||
| 2. attackDamage is the amount of damage per hit you deal to mobs/players. | ||
| - Also takes a decimal number. | ||
| 3. durability is how long it takes of use to breaks. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Durability is the number of times the tool can be used before it breaks"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, that does help clarify. |
||
| - This applies to the durability towards both crafting use and normal use. | ||
| Takes a whole number up to 2.147 billion eg.(700). | ||
| Going up to max integer is not recommended. | ||
| 4. harvestLevel is the tier of block it can break. | ||
| - Can take a number between 1-6 with 1 being wood, 6 being neutronium. | ||
| 5. GtToolType is a group of tools in an object. | ||
| - Must pass these into the [] brackets. | ||
|
|
||
| An example of this being actually used is included below | ||
| ```js title="example_tool_material.js" | ||
| GTCEuStartupEvents.registry('gtceu:material', event => { | ||
| event.create('aluminfrost') | ||
| .ingot() | ||
| .color(0xadd8e6).secondaryColor(0xc0c0c0).iconSet(GTMaterialIconSet.DULL) | ||
| .toolStats(new ToolProperty(12, 7, 3072, 6, | ||
| [ | ||
| GTToolType.DRILL_LV, | ||
| GTToolType.MINING_HAMMER | ||
| ] | ||
| )) | ||
| }); | ||
| ``` | ||
| You can also add further arguments onto your tools such as: | ||
| - `.unbreakable()` | ||
| - Makes electric tools bypass durability effectively making them never break. | ||
| - `.magnetic()` | ||
| - Makes mined blocks and mob drops teleport to player inventory. | ||
| - `attackSpeed(float)` | ||
| - Set the attack speed of a tool made from this Material (animation time). | ||
| Takes a decimal number. | ||
| - `ignoreCraftingTools()` | ||
| - Disable crafting tools being made from this Material. | ||
| - `addEnchantmentForTools(enchantment, level)` | ||
| - Enchantment is the default enchantment applied on tool creation. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add that onto the example that shows unbreakable tools, if that works.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to extra tool flags example. |
||
| Level is the level of said enchantment. | ||
| - `enchantability(int enchantability)` | ||
| - Set the base enchantability of a tool made from this Material. | ||
| Iron is 14, Diamond is 10, Stone is 5. | ||
| Takes a whole number. | ||
|
|
||
| Here is an example of using them in your material: | ||
| ```js title="example_tool_material.js" | ||
| GTCEuStartupEvents.registry('gtceu:material', event => { | ||
| event.create('aluminfrost') | ||
| .ingot() | ||
| .color(0xadd8e6).secondaryColor(0xc0c0c0).iconSet(GTMaterialIconSet.DULL) | ||
| .toolStats($ToolProperty.Builder.of(1.8, 1.7, 700, 3, | ||
| [GTToolType.SWORD, | ||
| GTToolType.PICKAXE, | ||
| GTToolType.SHOVEL, | ||
| ]) | ||
| .unbreakable() | ||
| .build()) | ||
| }); | ||
| ``` | ||
|
|
||
| You can also add more tool types to a GT material that already has a tool property. You do, however, have to remove the current tool property as it is immutable (not changeable). | ||
| ```js title="tool_replacement.js" | ||
| GTCEuStartupEvents.materialModification(event => { | ||
| if (GTMaterials.Iron.hasProperty($PropertyKey.TOOL)) { | ||
| GTMaterials.Iron.removeProperty($PropertyKey.TOOL); | ||
| } | ||
| GTMaterials.Neutronium.setProperty($PropertyKey.TOOL, new $ToolProperty.Builder.of(180, 5.9, 2147483647, 6, | ||
| [GTToolType.SOFT_MALLET, | ||
| GTToolType.DRILL_LV | ||
| ]) | ||
| .build()); | ||
|
Phoenixvine32908 marked this conversation as resolved.
Outdated
|
||
| }); | ||
| ``` | ||
| Here is a list of all the GtToolTypes | ||
| - SWORD, | ||
| - PICKAXE, | ||
| - SHOVEL, | ||
| - AXE, | ||
| - HOE, | ||
| - MINING_HAMMER, | ||
| - SPADE, | ||
| - SAW, | ||
| - HARD_HAMMER, | ||
| - SOFT_MALLET, | ||
| - WRENCH, | ||
| - FILE, | ||
| - CROWBAR, | ||
| - SCREWDRIVER, | ||
| - MORTAR, | ||
| - WIRE_CUTTER, | ||
| - SCYTHE, | ||
| - KNIFE, | ||
| - BUTCHERY_KNIFE, | ||
| - PLUNGER, | ||
| - DRILL_LV, | ||
| - DRILL_MV, | ||
| - DRILL_HV, | ||
| - DRILL_EV, | ||
| - DRILL_IV, | ||
| - CHAINSAW_LV, | ||
| - WRENCH_LV, | ||
| - WRENCH_HV, | ||
| - WRENCH_IV, | ||
| - BUZZSAW, | ||
| - SCREWDRIVER_LV, | ||
| - WIRE_CUTTER_LV, | ||
| - WIRE_CUTTER_HV, | ||
| - WIRE_CUTTER_IV, | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes SecondaryColor different from Primary, where does that color get used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% should be explained in the material creation page pr, will make a note.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a placeholder explanation for now.