Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give baker a chance to return all kinds of bottles #10153

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:cake_batter",
"show-tooltip": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 1,
"result": "minecolonies:flatbread"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/glass_bottle",
"min-building-level": 1,
"result": "minecolonies:lembas_scone"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:milky_bread",
"show-tooltip": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:cake_batter",
"show-tooltip": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:milky_bread",
"show-tooltip": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/glass_bottle",
"min-building-level": 3,
"result": "minecolonies:sugary_bread",
"show-tooltip": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:empty",
"quality": -1,
"weight": 100
},
{
"type": "minecraft:item",
"name": "minecraft:glass_bottle",
"quality": 1,
"weight": 0
}
],
"rolls": 1.0
}
],
"random_sequence": "minecolonies:recipes/glass_bottle"
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ protected void registerRecipes(@NotNull final Consumer<FinishedRecipe> consumer)
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 8)),
new ItemStorage(new ItemStack(Items.HONEY_BOTTLE))))
.result(new ItemStack(ModItems.sugaryBread, 4))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_GLASS_BOTTLE)
.minBuildingLevel(3)
.showTooltip(true)
.build(consumer);
Expand All @@ -84,17 +85,19 @@ protected void registerRecipes(@NotNull final Consumer<FinishedRecipe> consumer)
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 8)),
new ItemStorage(new ItemStack(ModItems.large_milk_bottle))))
.result(new ItemStack(ModItems.milkyBread, 4))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_LARGE_BOTTLE)
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "smilky_bread")
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 8)),
new ItemStorage(new ItemStack(ModItems.large_soy_milk_bottle))))
.result(new ItemStack(ModItems.milkyBread, 4))
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 8)),
new ItemStorage(new ItemStack(ModItems.large_soy_milk_bottle))))
.result(new ItemStack(ModItems.milkyBread, 4))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_LARGE_BOTTLE)
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "golden_bread")
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 8)),
Expand Down Expand Up @@ -149,19 +152,21 @@ protected void registerRecipes(@NotNull final Consumer<FinishedRecipe> consumer)
new ItemStorage(new ItemStack(Items.SUGAR, 2)),
new ItemStorage(new ItemStack(Items.EGG))))
.result(new ItemStack(ModItems.cakeBatter))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_LARGE_BOTTLE)
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "scake_batter")
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 3)),
new ItemStorage(new ItemStack(ModItems.large_soy_milk_bottle, 3)),
new ItemStorage(new ItemStack(Items.SUGAR, 2)),
new ItemStorage(new ItemStack(Items.EGG))))
.result(new ItemStack(ModItems.cakeBatter))
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);
.inputs(List.of(new ItemStorage(new ItemStack(Items.WHEAT, 3)),
new ItemStorage(new ItemStack(ModItems.large_soy_milk_bottle, 3)),
new ItemStorage(new ItemStack(Items.SUGAR, 2)),
new ItemStorage(new ItemStack(Items.EGG))))
.result(new ItemStack(ModItems.cakeBatter))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_LARGE_BOTTLE)
.minBuildingLevel(4)
.showTooltip(true)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_SMELTING, "cake")
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.cakeBatter))))
Expand All @@ -171,60 +176,62 @@ protected void registerRecipes(@NotNull final Consumer<FinishedRecipe> consumer)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "lembas_scone")
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter)),
new ItemStorage(new ItemStack(Items.HONEY_BOTTLE))))
.result(new ItemStack(ModItems.lembas_scone))
.minBuildingLevel(1)
.build(consumer);
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter)),
new ItemStorage(new ItemStack(Items.HONEY_BOTTLE))))
.result(new ItemStack(ModItems.lembas_scone))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_GLASS_BOTTLE)
.minBuildingLevel(1)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "manchet_dough")
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter))))
.result(new ItemStack(ModItems.manchet_dough, 2))
.minBuildingLevel(1)
.build(consumer);
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter))))
.result(new ItemStack(ModItems.manchet_dough, 2))
.minBuildingLevel(1)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "muffin_dough")
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter)),
new ItemStorage(new ItemStack(Items.SUGAR)),
new ItemStorage(new ItemStack(Items.SWEET_BERRIES))))
.result(new ItemStack(ModItems.muffin_dough, 2))
.minBuildingLevel(1)
.build(consumer);
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModItems.butter)),
new ItemStorage(new ItemStack(Items.SUGAR)),
new ItemStorage(new ItemStack(Items.SWEET_BERRIES))))
.result(new ItemStack(ModItems.muffin_dough, 2))
.minBuildingLevel(1)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "flatbread")
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(ModItems.large_water_bottle.getDefaultInstance())))
.result(new ItemStack(ModItems.flatbread, 1))
.minBuildingLevel(1)
.build(consumer);
.inputs(List.of(
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(new ItemStack(ModBlocks.blockDurum)),
new ItemStorage(ModItems.large_water_bottle.getDefaultInstance())))
.result(new ItemStack(ModItems.flatbread, 1))
.lootTable(DefaultRecipeLootProvider.LOOT_TABLE_LARGE_BOTTLE)
.minBuildingLevel(1)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_SMELTING, "muffin")
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.muffin_dough))))
.result(new ItemStack(ModItems.muffin))
.minBuildingLevel(1)
.intermediate(Blocks.FURNACE)
.build(consumer);
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.muffin_dough))))
.result(new ItemStack(ModItems.muffin))
.minBuildingLevel(1)
.intermediate(Blocks.FURNACE)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_SMELTING, "manchet")
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.manchet_dough))))
.result(new ItemStack(ModItems.manchet_bread))
.minBuildingLevel(1)
.intermediate(Blocks.FURNACE)
.build(consumer);
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.manchet_dough))))
.result(new ItemStack(ModItems.manchet_bread))
.minBuildingLevel(1)
.intermediate(Blocks.FURNACE)
.build(consumer);

CustomRecipeBuilder.create(BAKER, MODULE_CRAFTING, "water_jug")
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.large_empty_bottle))))
.result(ModItems.large_water_bottle.getDefaultInstance())
.build(consumer);
.inputs(List.of(new ItemStorage(new ItemStack(ModItems.large_empty_bottle))))
.result(ModItems.large_water_bottle.getDefaultInstance())
.build(consumer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
public class DefaultRecipeLootProvider extends SimpleLootTableProvider
{
public static final ResourceLocation LOOT_TABLE_GLASS_BOTTLE = new ResourceLocation(MOD_ID, "recipes/glass_bottle");
public static final ResourceLocation LOOT_TABLE_LARGE_BOTTLE = new ResourceLocation(MOD_ID, "recipes/large_bottle");
public static final ResourceLocation LOOT_TABLE_GRAVEL = new ResourceLocation(MOD_ID, "recipes/gravel");

Expand All @@ -38,6 +39,11 @@ public String getName()
@Override
protected void registerTables(@NotNull final LootTableRegistrar registrar)
{
registrar.register(LOOT_TABLE_GLASS_BOTTLE, LootContextParamSets.ALL_PARAMS, LootTable.lootTable()
.withPool(LootPool.lootPool()
.add(EmptyLootItem.emptyItem().setWeight(100).setQuality(-1))
.add(LootItem.lootTableItem(Items.GLASS_BOTTLE).setWeight(0).setQuality(1))));

registrar.register(LOOT_TABLE_LARGE_BOTTLE, LootContextParamSets.ALL_PARAMS, LootTable.lootTable()
.withPool(LootPool.lootPool()
.add(EmptyLootItem.emptyItem().setWeight(100).setQuality(-1))
Expand Down