Skip to content

Commit

Permalink
Give baker a chance to return all kinds of bottles (#10153)
Browse files Browse the repository at this point in the history
Give baker a chance to return all kinds of bottles
uecasm authored Aug 25, 2024
1 parent bf48b18 commit a779517
Showing 10 changed files with 99 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:cake_batter",
"show-tooltip": true
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:milky_bread",
"show-tooltip": true
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:cake_batter",
"show-tooltip": true
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/large_bottle",
"min-building-level": 4,
"result": "minecolonies:milky_bread",
"show-tooltip": true
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
}
],
"intermediate": "minecraft:air",
"loot-table": "minecolonies:recipes/glass_bottle",
"min-building-level": 3,
"result": "minecolonies:sugary_bread",
"show-tooltip": true
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
@@ -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);
@@ -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)),
@@ -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))))
@@ -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
@@ -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");

@@ -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))

0 comments on commit a779517

Please sign in to comment.