<commit_before># MaterialSystem

The MaterialSystem is used to create new or retrieve existing Materials from within CT.

## Importing the package
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.  
`import mods.contenttweaker.MaterialSystem;` 

## [IPartType](/Mods/ContentTweaker/Materials/Parts/PartType/)
### Create 
```JAVA
createPartType(String name, IRegisterMaterialPart registerMaterialPart)
```

Required Parameters:

- String name: The part type's name → e.g. "dense_gear"
- [IRegisterMaterialPart](/Mods/ContentTweaker/Materials/Materials/Functions/IRegisterMaterialPart/) registerMaterialPart → A function that handles how the Material parts will be created.

### Retrieve 
```JAVA
getPartType(String name);
```

Required Parameters:

- String name: The part type's name → e.g. "gear"
For a list of all available part types check [the part type page](/Mods/ContentTweaker/Materials/Parts/PartType/).


## [IMaterial](/Mods/ContentTweaker/Materials/Materials/Material/)
### Create
Unlike the PartType, you cannot directly create a Material, instead you need to use a MaterialBuilder. Check the [MaterialBuilder entry](/Mods/ContentTweaker/Materials/Materials/Material_Builder/) for info on what exactly to do with these.
```JAVA
val MB MaterialSystem.getMaterialBuilder();
MB.setName("Urubuntium");
MB.setColor(0);
MB.setHasEffect(false);
var builtMaterial = MB.build();
```

### Retrieve
```JAVA
getMaterial(String name);
```

Required Parameters:

- String name: The Material's name → e.g. "Platinum"

## [IPart](/Mods/ContentTweaker/Materials/Parts/Part/)
### Create
Unlike the PartType, you cannot directly create a Part, instead you need to use a PartBuilder. Check the [Part entry](IPart](/Mods/ContentTweaker/Materials/Parts/Part/) for info on what exactly to do with these.
```JAVA
val PB = MaterialSystem.getPartBuilder();
```

### Retrieve
```JAVA
getPart(String name);
```
<commit_msg>Fix for broken part link on MaterialSystem page.<commit_after># MaterialSystem

The MaterialSystem is used to create new or retrieve existing Materials from within CT.

## Importing the package
It might be required for you to import the package if you encounter any issues, so better be safe than sorry and add the import.  
`import mods.contenttweaker.MaterialSystem;` 

## [IPartType](/Mods/ContentTweaker/Materials/Parts/PartType/)
### Create 
```JAVA
createPartType(String name, IRegisterMaterialPart registerMaterialPart)
```

Required Parameters:

- String name: The part type's name → e.g. "dense_gear"
- [IRegisterMaterialPart](/Mods/ContentTweaker/Materials/Materials/Functions/IRegisterMaterialPart/) registerMaterialPart → A function that handles how the Material parts will be created.

### Retrieve 
```JAVA
getPartType(String name);
```

Required Parameters:

- String name: The part type's name → e.g. "gear"
For a list of all available part types check [the part type page](/Mods/ContentTweaker/Materials/Parts/PartType/).


## [IMaterial](/Mods/ContentTweaker/Materials/Materials/Material/)
### Create
Unlike the PartType, you cannot directly create a Material, instead you need to use a MaterialBuilder. Check the [MaterialBuilder entry](/Mods/ContentTweaker/Materials/Materials/Material_Builder/) for info on what exactly to do with these.
```JAVA
val MB MaterialSystem.getMaterialBuilder();
MB.setName("Urubuntium");
MB.setColor(0);
MB.setHasEffect(false);
var builtMaterial = MB.build();
```

### Retrieve
```JAVA
getMaterial(String name);
```

Required Parameters:

- String name: The Material's name → e.g. "Platinum"

## [IPart](/Mods/ContentTweaker/Materials/Parts/Part/)
### Create
Unlike the PartType, you cannot directly create a Part, instead you need to use a PartBuilder. Check the [Part entry](/Mods/ContentTweaker/Materials/Parts/Part/) for info on what exactly to do with these.
```JAVA
val PB = MaterialSystem.getPartBuilder();
```

### Retrieve
```JAVA
getPart(String name);
```

{'fraction_non_alphanumeric': 0.11269365317341329, 'fraction_numerical': 0.0004997501249375312, 'mean_word_length': 5.3438985736925515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3309409', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1153, 'n_words': 411}