Added some more data gen to the ore and crystal cluster blocks

It's not perfect as fortune doesn't effect it.
This commit is contained in:
Michael Hillcox 2020-11-29 18:23:50 +00:00
parent 1c97d71946
commit 6baac03f6d
No known key found for this signature in database
GPG key ID: 971C5B254742488F
9 changed files with 417 additions and 13 deletions

View file

@ -631,6 +631,12 @@ e0629b02f20d4767a3e97f189e8b7631a0d008cb data/actuallyadditions/loot_tables/bloc
28198fbeacb8c322f3a346cb565d08b0494707a5 data/actuallyadditions/loot_tables/blocks/coffee_machine_block.json 28198fbeacb8c322f3a346cb565d08b0494707a5 data/actuallyadditions/loot_tables/blocks/coffee_machine_block.json
594b68290b3fdb1623bce0d78f292329c4e0549e data/actuallyadditions/loot_tables/blocks/crusher_block.json 594b68290b3fdb1623bce0d78f292329c4e0549e data/actuallyadditions/loot_tables/blocks/crusher_block.json
94ed5804eaeaeb2fe016b88f3f18abcb9a0e42a9 data/actuallyadditions/loot_tables/blocks/crusher_double_block.json 94ed5804eaeaeb2fe016b88f3f18abcb9a0e42a9 data/actuallyadditions/loot_tables/blocks/crusher_double_block.json
b128719ea6a3176dd4d1d30e31293b6b7b1d5a7b data/actuallyadditions/loot_tables/blocks/crystal_cluster_diamatine_block.json
e3e94acccbd092d79799f234aa1879794a5a7307 data/actuallyadditions/loot_tables/blocks/crystal_cluster_emeradic_block.json
b727c4d64e5fe625567455a3d44eb316fec95ea6 data/actuallyadditions/loot_tables/blocks/crystal_cluster_enori_block.json
ce26fb4414f5f206b236789bb83675d995d95fcc data/actuallyadditions/loot_tables/blocks/crystal_cluster_palis_block.json
7029332fccb22d21c1b40075861ec8ad26a5301f data/actuallyadditions/loot_tables/blocks/crystal_cluster_restonia_block.json
8c69a610104ef1f773533573a9777334c0fe1472 data/actuallyadditions/loot_tables/blocks/crystal_cluster_void_block.json
07466c216f63eda8003edc7e9160f6b5310d5ca4 data/actuallyadditions/loot_tables/blocks/crystal_diamatine_block.json 07466c216f63eda8003edc7e9160f6b5310d5ca4 data/actuallyadditions/loot_tables/blocks/crystal_diamatine_block.json
c415e78fec5eefef316ede25fdbeccf48b7b8271 data/actuallyadditions/loot_tables/blocks/crystal_diamatine_empowered_block.json c415e78fec5eefef316ede25fdbeccf48b7b8271 data/actuallyadditions/loot_tables/blocks/crystal_diamatine_empowered_block.json
39e8c1f3951fbe6ac750cac348a157c2c0ec010d data/actuallyadditions/loot_tables/blocks/crystal_emeradic_block.json 39e8c1f3951fbe6ac750cac348a157c2c0ec010d data/actuallyadditions/loot_tables/blocks/crystal_emeradic_block.json
@ -696,6 +702,7 @@ ef15618a97a225579537d405ce09e46c4511ca3c data/actuallyadditions/loot_tables/bloc
c499ca40026612cf3e584deadc44b19fa92760b9 data/actuallyadditions/loot_tables/blocks/leaf_generator_block.json c499ca40026612cf3e584deadc44b19fa92760b9 data/actuallyadditions/loot_tables/blocks/leaf_generator_block.json
e893ec3bfe12c6a5621f0d4ae4ce159b64615bb2 data/actuallyadditions/loot_tables/blocks/miner_block.json e893ec3bfe12c6a5621f0d4ae4ce159b64615bb2 data/actuallyadditions/loot_tables/blocks/miner_block.json
7afdd219e8bb504319602d5872ef8ce03cd7133a data/actuallyadditions/loot_tables/blocks/oil_generator_block.json 7afdd219e8bb504319602d5872ef8ce03cd7133a data/actuallyadditions/loot_tables/blocks/oil_generator_block.json
47d4ee1751937bf282c6b9c6befc6dd146ec5cdf data/actuallyadditions/loot_tables/blocks/ore_black_quartz_block.json
0319f141c88b3c86724b099780904e42e10dada4 data/actuallyadditions/loot_tables/blocks/phantom_booster_block.json 0319f141c88b3c86724b099780904e42e10dada4 data/actuallyadditions/loot_tables/blocks/phantom_booster_block.json
5cdb345ccd91445542e7d638c215a104c397fe8c data/actuallyadditions/loot_tables/blocks/phantom_breaker_block.json 5cdb345ccd91445542e7d638c215a104c397fe8c data/actuallyadditions/loot_tables/blocks/phantom_breaker_block.json
ad1cd45abb06291112610b7e74001895682a7d93 data/actuallyadditions/loot_tables/blocks/phantom_energyface_block.json ad1cd45abb06291112610b7e74001895682a7d93 data/actuallyadditions/loot_tables/blocks/phantom_energyface_block.json

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_diamatine_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:light_blue_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_emeradic_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:green_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_enori_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:white_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_palis_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:blue_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_restonia_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:red_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,56 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:crystal_cluster_void_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:set_count",
"count": {
"min": 2.0,
"max": 8.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:black_crystal_shard"
}
]
}
]
}
]
}

View file

@ -0,0 +1,48 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "actuallyadditions:ore_black_quartz_block"
},
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:apply_bonus",
"enchantment": "minecraft:fortune",
"formula": "minecraft:ore_drops"
},
{
"function": "minecraft:explosion_decay"
}
],
"name": "actuallyadditions:black_quartz"
}
]
}
]
}
]
}

View file

@ -4,11 +4,16 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
import de.ellpeck.actuallyadditions.common.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.common.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.common.items.ActuallyItems;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator; import net.minecraft.data.DataGenerator;
import net.minecraft.data.LootTableProvider; import net.minecraft.data.LootTableProvider;
import net.minecraft.data.loot.BlockLootTables; import net.minecraft.data.loot.BlockLootTables;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.Item;
import net.minecraft.loot.*; import net.minecraft.loot.*;
import net.minecraft.loot.functions.ApplyBonus;
import net.minecraft.loot.functions.SetCount;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.RegistryObject;
@ -150,25 +155,33 @@ public class GeneratorLoot extends LootTableProvider {
this.registerDropSelfLootTable(ActuallyBlocks.CRYSTAL_EMPOWERED_VOID.get()); this.registerDropSelfLootTable(ActuallyBlocks.CRYSTAL_EMPOWERED_VOID.get());
this.registerDropSelfLootTable(ActuallyBlocks.CRYSTAL_EMPOWERED_EMERADIC.get()); this.registerDropSelfLootTable(ActuallyBlocks.CRYSTAL_EMPOWERED_EMERADIC.get());
// Special this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_RESTONIA, ActuallyItems.RED_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_RESTONIA this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_PALIS, ActuallyItems.BLUE_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_PALIS this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_DIAMATINE, ActuallyItems.LIGHT_BLUE_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_DIAMATINE this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_VOID, ActuallyItems.BLACK_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_VOID this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_EMERADIC, ActuallyItems.GREEN_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_EMERADIC this.registerCrystal(ActuallyBlocks.CRYSTAL_CLUSTER_ENORI, ActuallyItems.WHITE_CRYSTAL_SHARD);
// CRYSTAL_CLUSTER_ENORI
// ORE_BLACK_QUARTZ this.registerLootTable(ActuallyBlocks.ORE_BLACK_QUARTZ.get(), ore -> droppingItemWithFortune(ore, ActuallyItems.BLACK_QUARTS.get()));
}
// This isn't quite right :cry: fortune doesn't change it
private void registerCrystal(RegistryObject<Block> crystalCluster, RegistryObject<Item> crystalShard) {
this.registerLootTable(crystalCluster.get(), (crystal) ->
droppingWithSilkTouch(crystal,
withExplosionDecay(crystal, ItemLootEntry.builder(crystalShard.get())
.acceptFunction(ApplyBonus.oreDrops(Enchantments.FORTUNE))
.acceptFunction(SetCount.builder(RandomValueRange.of(2f, 8f)))
)
)
);
} }
@Nonnull @Nonnull
@Override @Override
protected Iterable<Block> getKnownBlocks() { protected Iterable<Block> getKnownBlocks() {
final Set<Block> ignoreForNow = ImmutableSet.of( final Set<Block> ignoreForNow = ImmutableSet.of(
ActuallyBlocks.RICE.get(), ActuallyBlocks.CANOLA.get(), ActuallyBlocks.FLAX.get(), ActuallyBlocks.RICE.get(), ActuallyBlocks.CANOLA.get(), ActuallyBlocks.FLAX.get(), ActuallyBlocks.COFFEE.get()
ActuallyBlocks.COFFEE.get(), ActuallyBlocks.CRYSTAL_CLUSTER_RESTONIA.get(),
ActuallyBlocks.CRYSTAL_CLUSTER_PALIS.get(), ActuallyBlocks.CRYSTAL_CLUSTER_DIAMATINE.get(),
ActuallyBlocks.CRYSTAL_CLUSTER_VOID.get(), ActuallyBlocks.CRYSTAL_CLUSTER_EMERADIC.get(),
ActuallyBlocks.CRYSTAL_CLUSTER_ENORI.get(), ActuallyBlocks.ORE_BLACK_QUARTZ.get()
); );
return ActuallyBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(e -> !ignoreForNow.contains(e)).collect(Collectors.toList()); return ActuallyBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get).filter(e -> !ignoreForNow.contains(e)).collect(Collectors.toList());