-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87d7ae2
commit 4e5078f
Showing
5 changed files
with
164 additions
and
78 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// 1.21.1 2024-10-12T12:28:23.167856044 Loot Tables | ||
f89288b131086917a8df3e5fdc5fa21884d02965 data/armistice/loot_table/blocks/iron_grate.json |
21 changes: 21 additions & 0 deletions
21
src/generated/resources/data/armistice/loot_table/blocks/iron_grate.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "armistice:iron_grate" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "armistice:blocks/iron_grate" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/main/java/symbolics/division/armistice/datagen/ArmisticeLootTableProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package symbolics.division.armistice.datagen; | ||
|
||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.data.loot.BlockLootSubProvider; | ||
import net.minecraft.data.loot.LootTableProvider; | ||
import net.minecraft.world.flag.FeatureFlags; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; | ||
import org.jetbrains.annotations.NotNull; | ||
import symbolics.division.armistice.registry.ArmisticeBlockRegistrar; | ||
import symbolics.division.armistice.util.registrar.Registrar; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class ArmisticeLootTableProvider extends LootTableProvider { | ||
public ArmisticeLootTableProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> registries) { | ||
super(output, Set.of(), List.of( | ||
new SubProviderEntry( | ||
BlockSubProvider::new, | ||
LootContextParamSets.BLOCK | ||
) | ||
), registries); | ||
} | ||
|
||
public static class BlockSubProvider extends BlockLootSubProvider { | ||
public BlockSubProvider(HolderLookup.Provider lookupProvider) { | ||
super(Set.of(), FeatureFlags.DEFAULT_FLAGS, lookupProvider); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
protected Iterable<Block> getKnownBlocks() { | ||
return Registrar.getObjects(ArmisticeBlockRegistrar.class, Block.class); | ||
} | ||
|
||
@Override | ||
protected void generate() { | ||
dropSelf(ArmisticeBlockRegistrar.IRON_GRATE); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters