Skip to content
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
5 changes: 5 additions & 0 deletions ItemsAdder/tfmc_cooking/contents/categories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ categories:
- tfmc_cooking:cutting_knife
- tfmc_cooking:flour
- tfmc_cooking:flour_rotten
- tfmc_cooking:flour_heap
- tfmc_cooking:flour_heap_rotten
- tfmc_cooking:roux
- tfmc_cooking:roux_burnt
- tfmc_cooking:roux_rotten
- tfmc_cooking:flour_model
- tfmc_cooking:flour_rotten_model
- tfmc_cooking:yeast
Expand Down
36 changes: 36 additions & 0 deletions ItemsAdder/tfmc_cooking/contents/intermediates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,42 @@ items:
generate: false
model_path: item/intermediate/flour_rotten

# Thick sauce: the heap flour shows as in the frying pan, and the roux it cooks into there.
flour_heap:
display_name: "Flour Heap"
resource:
material: PAPER
generate: false
model_path: item/intermediate/flour_heap

flour_heap_rotten:
display_name: "Flour Heap Musty"
resource:
material: PAPER
generate: false
model_path: item/intermediate/flour_heap_rotten

roux:
display_name: "Roux"
resource:
material: PAPER
generate: false
model_path: item/intermediate/roux

roux_burnt:
display_name: "Roux Burnt"
resource:
material: PAPER
generate: false
model_path: item/intermediate/roux_burnt

roux_rotten:
display_name: "Roux Rotten"
resource:
material: PAPER
generate: false
model_path: item/intermediate/roux_rotten

yeast:
display_name: "Yeast"
resource:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tfmc_cooking:item/intermediate/flour_heap"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tfmc_cooking:item/intermediate/flour_heap_rotten"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tfmc_cooking:item/intermediate/roux"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tfmc_cooking:item/intermediate/roux_burnt"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "tfmc_cooking:item/intermediate/roux_rotten"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Cooking makes food an interactive part of everyday life. Players grow and gather
- **Pizzas** — place a pizza peel, put dough on it, spread a paste and add cheese, vegetables, fruit, sausage and spices, then carry the peel into a lit oven to bake. A baked pizza is taken off a slice at a time. Its toppings name it, and its food, quality and freshness come from its layers (`pizzas.yml`). Its toppings also earn it bonuses such as Saucy, Extra Cheesy or Well Seasoned (`bonuses` in `pizzas.yml`).
- **Salads** — right-click a placed bowl with chopped or cooked veg, fruit, cheese or meat, add a dressing or seasoning, and toss it with an empty hand. Each ingredient lies in the bowl as a small heap of its pieces, in its own look for every origin and state (`models` and `spread-radius`); the tossed salad stays in the bowl with them and is eaten from it. Its ingredients name it, its kind (fruit, greek, carrot, mixed) gives it its look, and it earns bonuses such as Dressed or Crisp (`salads.yml`).
- **Stock and mashed potatoes** — boil two bones in a cup of water in the saucepan and bottle the stock (`condiments.yml`); a soup started with stock instead of water is Rich. Put four boiled cut potatoes and a butter (with milk or salt if you like) in an empty pot, mash them without water or heat, and ladle the mash onto a plate beside the other food (`pot.yml`).
- **Thick sauce** — cook flour in a buttered frying pan until it turns into a roux (without butter it burns, and a burnt roux spoils a sauce). A roux put into a saucepan of water, milk or a brew takes one of its two ingredient places and makes the sauce Thick: the tag names it (Thick Garlic Sauce), so a dish it is ladled onto lists a Thick sauce too. Raw flour is refused with a hint (`types.yml` flour `output`, `naming.yml` `thickener`, `tags.yml` `sauce_thickness`).
- **Pies** — line a pie tin with dough, fill it with fruit, meat, mashed potato, vegetables or cheese, and bake it in the oven like the bread tray. The whole pie comes out of the tin with an empty hand and is cut into four slices on the cutting board. Its fillings make its kind (Apple, Key Lime, Mixed Berry, Pumpkin, Meat, Shepherd's) and name, and its food, quality and freshness come from its dough and fillings (`pies.yml`).
- **Sweet berries, sugar cane and beetroot** — sweet berries become Cooking fruit on pickup (`conversions.yml`), so they go into salads, pies (Mixed Berry) and jam sandwiches (Sweet Berry Jam). The milling stone holds several recipes (`milling-recipes.yml`): 8 wheat grind into flour, and 8 sugar cane into 8 sugar, the same sweetener vanilla sugar becomes on pickup; each recipe sets its result's category, origin and amount, what the stone shows, and what a broken stone gives back. A soup that is at least half beetroot is ladled as Borscht: `pot.yml` `kinds` name a soup from its boiled pieces, as `pies.yml` kinds name pies.
- **Pumpkin** — a pie of nothing but cut or chopped pumpkin bakes into a Pumpkin Pie (`pies.yml` kinds), and a soup that is at least half pumpkin is ladled as Pumpkin Soup (`pot.yml` kinds).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private static Map<String, Set<String>> defaultCategories() {
map.put("sweetener", Set.of("sweetener"));
map.put("addon", Set.of("garnish", "spice"));
map.put("dough-filler", Set.of("fruit"));
map.put("thickener", Set.of("thickener"));
return map;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ public List<String> getIngredients() {

String category = fi.getCategory().toLowerCase();

if (NamingConfig.isCategory("seasoning", category)) {
// A seasoning or a thickener (a roux) doesn't name the dish; Seasoned and Thick tags say it's there.
if (NamingConfig.isCategory("seasoning", category) || NamingConfig.isCategory("thickener", category)) {
continue;
}

Expand Down
49 changes: 17 additions & 32 deletions src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,26 @@ public boolean canAdd(Player player, ItemStack i) {



if (StationAddonRules.isThickenerCategory(category)) {

return StationAddonRules.canAcceptThickener(slots, fi, player);

}



if (category.equals("alcohol")) return true;



// What a bottling recipe for this liquid still needs (tomato paste in vinegar for catsup).
return bottlingTakes(fi);
if (bottlingTakes(fi)) return true;

// Raw flour doesn't thicken a sauce; a roux does.
if (ItemCache.isFlour(i) && player != null) {
player.sendMessage("§7Cook the flour in a buttered frying pan first: a roux thickens the sauce.");
}
return false;

}

Expand All @@ -241,26 +255,10 @@ public void scoop(Player p, ItemStack ladle) {



int flourCount = 0;

boolean hasMilk = false;



for (FoodItem fi : slots.values()) {

String category = fi.getCategory().toLowerCase();

if (category.equals("flour")) {

flourCount++;

}

}



for (String c : colours) {

// A white brew (vodka) is not milk.
Expand All @@ -284,21 +282,8 @@ public void scoop(Player p, ItemStack ladle) {

StationAddonRules.applySweetTag(sauce, slots);



TagTrack thickTrack = new TagTrack(TrackLoader.getByString("sauce_thickness"));

if (flourCount >= 1) {

thickTrack.setValue(1);

} else {

thickTrack.setValue(0);

}

sauce.addOrModifyTrack(thickTrack);
// A roux makes it Thick, which also names it (naming.yml prefix-tracks), so dishes it's ladled onto say so.
StationAddonRules.applyThickTag(sauce, slots);



Expand Down
49 changes: 49 additions & 0 deletions src/main/java/net/tfminecraft/cooking/utils/StationAddonRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.bukkit.entity.Player;

import net.tfminecraft.cooking.cache.NamingConfig;
import net.tfminecraft.cooking.enums.Tag;
import net.tfminecraft.cooking.item.FoodItem;
import net.tfminecraft.cooking.item.tag.TagTrack;
import net.tfminecraft.cooking.loader.TrackLoader;
Expand All @@ -34,6 +35,54 @@ public static boolean isSweetenerCategory(String category) {
return NamingConfig.isCategory("sweetener", category);
}

/** A thickener (naming.yml categories: thickener), a roux cooked from flour in a buttered frying pan. */
public static boolean isThickenerCategory(String category) {
return NamingConfig.isCategory("thickener", category);
}

public static boolean hasThickener(Map<String, FoodItem> slots) {
for (FoodItem item : slots.values()) {
if (item != null && isThickenerCategory(item.getCategory())) {
return true;
}
}
return false;
}

/** One thickener per batch, and never a burnt one. */
public static boolean canAcceptThickener(Map<String, FoodItem> slots, FoodItem incoming, Player player) {
if (incoming == null || !isThickenerCategory(incoming.getCategory())) {
return false;
}
String refusal = null;
if (incoming.hasTag(Tag.BURNT)) {
refusal = "§cThat roux is burnt. It would spoil the sauce.";
} else if (hasThickener(slots)) {
refusal = "§cThere's already a roux in there.";
}
if (refusal == null) {
return true;
}
if (player != null) {
player.sendMessage(refusal);
}
return false;
}

/** A thickener makes the sauce Thick (tags.yml sauce_thickness); without one the sauce gets no thickness tag. */
public static void applyThickTag(FoodItem product, Map<String, FoodItem> slots) {
if (!hasThickener(slots)) {
return;
}
TagTrack track = TrackLoader.getByString("sauce_thickness");
if (track == null) {
return;
}
track = new TagTrack(track);
track.setValue(1);
product.addOrModifyTrack(track);
}

public static boolean hasSweetener(Map<String, FoodItem> slots) {
for (FoodItem item : slots.values()) {
if (item != null && isSweetenerCategory(item.getCategory())) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/composition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ context-overrides:
- pepper
- sweetener
- flour
- thickener
SOUP_SCOOP:
extra:
- salt
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ colours:
- origin.pistachio 93c47d
- origin.rhubarb c45c6a
- origin.garlic f5f0e6
- origin.roux d9a95b


dictionary:
Expand All @@ -180,6 +181,7 @@ dictionary:
sauce: "#997950Sauce"
garnish: "#0b5394Garnish"
liquid: "#3d85c6Liquid"
thickener: "#d9a95bThickener"
snack: "#e8c56bSnack"

sauce-dict:
Expand Down
53 changes: 53 additions & 0 deletions src/main/resources/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3116,6 +3116,17 @@ melon_slice:
y: -0.25

flour:
# In the frying pan (types.yml flour's roux output) flour shows as a flat heap, placed like the roux it becomes.
display-data-furniture:
frying_pan:
rotation:
x: 90
scale:
x: 0.45
y: 0.45
z: 0.45
position:
y: -0.26
fresh:
weight: 1
tags:
Expand All @@ -3124,6 +3135,8 @@ flour:
item: ia.tfmc_cooking:flour
display:
item: ia.tfmc_cooking:flour_model
furniture:
- frying_pan ia.tfmc_cooking:flour_heap
stale:
weight: 1
tags:
Expand All @@ -3132,6 +3145,8 @@ flour:
item: ia.tfmc_cooking:flour
display:
item: ia.tfmc_cooking:flour_model
furniture:
- frying_pan ia.tfmc_cooking:flour_heap
rotten:
weight: 1
tags:
Expand All @@ -3140,6 +3155,44 @@ flour:
item: ia.tfmc_cooking:flour_rotten
display:
item: ia.tfmc_cooking:flour_rotten_model
furniture:
- frying_pan ia.tfmc_cooking:flour_heap_rotten

# Roux (types.yml roux), flour cooked in a buttered frying pan. In the pan it lies flat like popcorn, lowered to the pan
# floor, at 45% so two round puddles fit side by side.
roux:
display-data-furniture:
frying_pan:
rotation:
x: 90
scale:
x: 0.45
y: 0.45
z: 0.45
position:
y: -0.26
cooked:
weight: 1
gui:
item: ia.tfmc_cooking:roux
display:
item: ia.tfmc_cooking:roux
burnt:
weight: 2
tags:
- burnt
gui:
item: ia.tfmc_cooking:roux_burnt
display:
item: ia.tfmc_cooking:roux_burnt
rotten:
weight: 3
tags:
- rotten
gui:
item: ia.tfmc_cooking:roux_rotten
display:
item: ia.tfmc_cooking:roux_rotten

yeast:
fresh:
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/naming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ prefix-tracks:
- topping_sugar
- topping_salt
- topping_caramel
# A sauce with a roux: Thick Garlic Sauce, which is also how a dish it's ladled onto lists it.
- sauce_thickness

# Max filler origins shown in a composed name
fillers:
Expand Down Expand Up @@ -37,6 +39,9 @@ categories:
- spice
dough-filler:
- fruit
# What thickens a sauce in the saucepan (one per batch): a roux.
thickener:
- thickener

# Per-category tag step display overrides (fallback after per-type tag-labels)
tag-label-defaults:
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ sauce_creamy:
value: 0
nutrition-mult: 1.1
food-mult: 1.05
# A sauce with a roux in it (SauceReference) is Thick; without one it gets no thickness tag. Thin is kept for food strings.
sauce_thickness:
thin:
name: "#bfb999Thin"
Expand Down
Loading
Loading