- #loader contenttweaker
- #modloaded tconstruct
- import mods.contenttweaker.tconstruct.Material;
- import mods.contenttweaker.tconstruct.MaterialBuilder;
- import mods.contenttweaker.tconstruct.Trait;
- import mods.contenttweaker.tconstruct.TraitBuilder;
- function rgb(r as int, g as int, b as int) as int{
- return (r % 256 * 0x010000) + (g % 256 * 0x000100) + (b % 256);
- };
- // Why can't we use dirt to make tools?
- val dirt_color = rgb(150, 108, 74);
- val m_dirt as MaterialBuilder = MaterialBuilder.create("dirt");
- m_dirt.color = dirt_color;
- m_dirt.craftable = true;
- m_dirt.castable = false;
- m_dirt.addItem(<item:minecraft:dirt>);
-
- myMaterial.addMaterialTrait("cheap");
-
- m_dirt.addMaterialTrait("cheapskate", "head");
- m_dirt.addHeadMaterialStats(3, 0.2, 0.2, 1);
-
- m_dirt.addMaterialTrait("cheapskate","handle");
- m_dirt.addHandleMaterialStats(0.2, 3);
-
- m_dirt.addExtraMaterialStats(1);
- m_dirt.addMaterialTrait("cheapskate", "bow");
-
- m_dirt..addBowMaterialStats(0.05, 5.0, 0.0);
-
- m_dirt.representativeItem = <minecraft:dirt>;
- m_dirt.register();
复制代码
|
|