Skip to content

Commit

Permalink
Fix loot modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaxydog committed May 26, 2024
1 parent a88126c commit e4b9b72
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/jaxydog/content/block/CustomBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class CustomBlocks {
Settings.copy(Blocks.SPONGE).mapColor(MapColor.PALE_YELLOW).hardness(1.0f).sounds(BlockSoundGroup.SLIME)
);

public static final TomatoesBlock TOMATOES = new TomatoesBlock(Settings.copy(Blocks.BEETROOTS)
public static final TomatoesBlock TOMATOES = new TomatoesBlock(Settings.copy(Blocks.POTATOES)
.breakInstantly()
.noCollision()
.sounds(BlockSoundGroup.CROP)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/jaxydog/utility/LootModifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void registerMain() {
Main.super.registerMain();

LootTableEvents.MODIFY.register((key, tableBuilder, source) -> {
if (key.equals(this.TABLE_ID) || !source.isBuiltin()) return;
if (!key.equals(this.TABLE_ID) || !source.isBuiltin()) return;

for (final LootNumberProvider provider : this.PROVIDERS) {
final Builder<? extends Builder<?>> entry = ItemEntry.builder(this.ITEM.get());
Expand Down
97 changes: 49 additions & 48 deletions src/main/resources/data/cheese/loot_tables/blocks/tomatoes.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
{
"type": "minecraft:block",
"functions": [
{
"function": "minecraft:explosion_decay"
}
],
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "cheese:tomato"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"block": "cheese:tomatoes",
"condition": "minecraft:block_state_property",
"properties": {
"age": "3"
}
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 3,
"probability": 0.5714286
}
}
],
"name": "cheese:tomato"
}
],
"rolls": 1.0
}
]
"type": "minecraft:block",
"functions": [
{
"function": "minecraft:explosion_decay"
}
],
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "cheese:tomato"
}
],
"rolls": 1.0
},
{
"bonus_rolls": 0.0,
"conditions": [
{
"block": "cheese:tomatoes",
"condition": "minecraft:block_state_property",
"properties": {
"age": "3"
}
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"enchantment": "minecraft:fortune",
"formula": "minecraft:binomial_with_bonus_count",
"function": "minecraft:apply_bonus",
"parameters": {
"extra": 3,
"probability": 0.5714286
}
}
],
"name": "cheese:tomato"
}
],
"rolls": 1.0
}
],
"random_sequence": "cheese:blocks/tomatoes"
}

0 comments on commit e4b9b72

Please sign in to comment.