Line 1: |
Line 1: |
− | {{Under construction}}
| |
− |
| |
| ==The LootTableProvider class== | | ==The LootTableProvider class== |
| First you would need a new class that extends <code>LootTableProvider</code>. In this class you will override the <code>getTables</code> and <code>validate</code> methods. | | First you would need a new class that extends <code>LootTableProvider</code>. In this class you will override the <code>getTables</code> and <code>validate</code> methods. |
Line 22: |
Line 20: |
| @Override | | @Override |
| protected void validate(Map<ResourceLocation, LootTable> map, ValidationContext validationtracker) { | | protected void validate(Map<ResourceLocation, LootTable> map, ValidationContext validationtracker) { |
− | for (Map.Entry<ResourceLocation, LootTable> entry : map.entrySet()) | + | map.forEach((location, lootTable) -> LootTables.validate(validationtracker, location, lootTable); |
− | LootTables.validate(validationtracker, entry.getKey(), entry.getValue());
| |
| } | | } |
| </syntaxhighlight> | | </syntaxhighlight> |
Line 62: |
Line 59: |
| | | |
| ===The LootTable Builder=== | | ===The LootTable Builder=== |
− | This is where you actually make a loottable. You start with an empty <code>LootPool.Builder</code> and add the necessary attributes to it. | + | This is where you actually make a loot table. You start with an empty <code>LootPool.Builder</code> and add the necessary attributes to it. |
| * <code>.name</code> is used for the pool name. | | * <code>.name</code> is used for the pool name. |
| * <code>.setRolls</code> is used for the amount. | | * <code>.setRolls</code> is used for the amount. |