-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Make food stack more often when removed from firmalife devices - Added new textures for some prepared foods - Fix plates not giving effects / not returning the bowl / not acting as expected - Make food traits configurable - Allow composting nightshade
- Loading branch information
1 parent
06ed163
commit f5e9469
Showing
30 changed files
with
178 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 106 additions & 17 deletions
123
src/main/java/com/eerussianguy/firmalife/common/items/FLFoodTraits.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,118 @@ | ||
package com.eerussianguy.firmalife.common.items; | ||
|
||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.function.Supplier; | ||
import com.eerussianguy.firmalife.common.FLHelpers; | ||
import com.eerussianguy.firmalife.config.FLConfig; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.chat.MutableComponent; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import net.dries007.tfc.common.capabilities.food.FoodTrait; | ||
import net.dries007.tfc.util.Helpers; | ||
|
||
public class FLFoodTraits | ||
{ | ||
public enum Default | ||
{ | ||
DRIED(0.5f), | ||
FRESH(1.1f), | ||
AGED(0.9f), | ||
VINTAGE(0.6f), | ||
OVEN_BAKED(0.9f), | ||
SMOKED(0.7f), | ||
RANCID_SMOKED(2.0f), | ||
RAW(1f), | ||
SHELVED(0.4f), | ||
SHELVED_2(0.35f), | ||
SHELVED_3(0.25f), | ||
HUNG(0.35f), | ||
HUNG_2(0.3f), | ||
HUNG_3(0.25f) | ||
; | ||
|
||
private final float mod; | ||
private final String name; | ||
|
||
Default(float mod) | ||
{ | ||
this.mod = mod; | ||
this.name = name().toLowerCase(Locale.ROOT); | ||
} | ||
|
||
public String getName() | ||
{ | ||
return name; | ||
} | ||
|
||
public String getCapitalizedName() | ||
{ | ||
return name.substring(0, 1).toUpperCase(Locale.ROOT) + name.substring(1); | ||
} | ||
|
||
public float getMod() | ||
{ | ||
return mod; | ||
} | ||
} | ||
|
||
public static void init() { } | ||
|
||
public static final FoodTrait DRIED = register("dried", 0.5f); | ||
public static final FoodTrait FRESH = register("fresh", 1.1f); | ||
public static final FoodTrait AGED = register("aged", 0.9f); | ||
public static final FoodTrait VINTAGE = register("vintage", 0.6f); | ||
public static final FoodTrait OVEN_BAKED = register("oven_baked", 0.9f); | ||
public static final FoodTrait SMOKED = register("smoked", 0.7f); | ||
public static final FoodTrait RANCID_SMOKED = register("rancid_smoked", 2.0f); | ||
public static final FoodTrait RAW = register("raw", 1f); | ||
public static final FoodTrait SHELVED = register("shelved", 0.4f); | ||
public static final FoodTrait SHELVED_2 = register("shelved_2", 0.35f); | ||
public static final FoodTrait SHELVED_3 = register("shelved_3", 0.25f); | ||
public static final FoodTrait HUNG = register("hung", 0.35f); | ||
public static final FoodTrait HUNG_2 = register("hung_2", 0.3f); | ||
public static final FoodTrait HUNG_3 = register("hung_3", 0.25f); | ||
|
||
private static FoodTrait register(String name, float mod) | ||
public static final FoodTrait DRIED = register(Default.DRIED); | ||
public static final FoodTrait FRESH = register(Default.FRESH); | ||
public static final FoodTrait AGED = register(Default.AGED); | ||
public static final FoodTrait VINTAGE = register(Default.VINTAGE); | ||
public static final FoodTrait OVEN_BAKED = register(Default.OVEN_BAKED); | ||
public static final FoodTrait SMOKED = register(Default.SMOKED); | ||
public static final FoodTrait RANCID_SMOKED = register(Default.RANCID_SMOKED); | ||
public static final FoodTrait RAW = register(Default.RAW); | ||
public static final FoodTrait SHELVED = register(Default.SHELVED); | ||
public static final FoodTrait SHELVED_2 = register(Default.SHELVED_2); | ||
public static final FoodTrait SHELVED_3 = register(Default.SHELVED_3); | ||
public static final FoodTrait HUNG = register(Default.HUNG); | ||
public static final FoodTrait HUNG_2 = register(Default.HUNG_2); | ||
public static final FoodTrait HUNG_3 = register(Default.HUNG_3); | ||
|
||
private static FoodTrait register(FLFoodTraits.Default trait) | ||
{ | ||
return FoodTrait.register(FLHelpers.identifier(name), new FoodTrait(mod, "firmalife.tooltip.food_trait." + name)); | ||
return FoodTrait.register(FLHelpers.identifier(trait.name), new WrappedFT(() -> FLConfig.SERVER.foodTraits.get(trait).get().floatValue(), "firmalife.tooltip.food_trait." + trait.name)); | ||
} | ||
|
||
private static class WrappedFT extends FoodTrait | ||
{ | ||
private final Supplier<Float> decayModifier; | ||
@Nullable private final String translationKey; | ||
|
||
public WrappedFT(Supplier<Float> decayModifier, @Nullable String translationKey) | ||
{ | ||
super(1f, translationKey); | ||
this.decayModifier = decayModifier; | ||
this.translationKey = translationKey; | ||
} | ||
|
||
@Override | ||
public float getDecayModifier() | ||
{ | ||
return decayModifier.get(); | ||
} | ||
|
||
@Override | ||
public void addTooltipInfo(ItemStack stack, List<Component> text) | ||
{ | ||
if (this.translationKey != null) | ||
{ | ||
MutableComponent component = Helpers.translatable(this.translationKey); | ||
if (this.decayModifier.get() > 1.0F) | ||
{ | ||
component.withStyle(ChatFormatting.RED); | ||
} | ||
|
||
text.add(component); | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+399 Bytes
src/main/resources/assets/firmalife/textures/item/food/cooked_apple_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.01 KB
(6.4%)
src/main/resources/assets/firmalife/textures/item/food/cooked_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.82 KB
(6.0%)
src/main/resources/assets/firmalife/textures/item/food/cooked_pizza.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.19 KB
(6.0%)
src/main/resources/assets/firmalife/textures/item/food/cooked_pumpkin_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-458 Bytes
(40%)
src/main/resources/assets/firmalife/textures/item/food/dark_chocolate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.74 KB
(4.9%)
src/main/resources/assets/firmalife/textures/item/food/dark_chocolate_blend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.07 KB
(5.8%)
src/main/resources/assets/firmalife/textures/item/food/filled_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.51 KB
(19%)
src/main/resources/assets/firmalife/textures/item/food/milk_chocolate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.75 KB
(5.8%)
src/main/resources/assets/firmalife/textures/item/food/milk_chocolate_blend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+386 Bytes
src/main/resources/assets/firmalife/textures/item/food/raw_apple_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.61 KB
(6.0%)
src/main/resources/assets/firmalife/textures/item/food/raw_pizza.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-6.3 KB
(4.9%)
src/main/resources/assets/firmalife/textures/item/food/raw_pumpkin_pie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.48 KB
(22%)
src/main/resources/assets/firmalife/textures/item/food/shredded_cheese.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.47 KB
(18%)
src/main/resources/assets/firmalife/textures/item/food/white_chocolate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.66 KB
(5.7%)
src/main/resources/assets/firmalife/textures/item/food/white_chocolate_blend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.64 KB
(3.4%)
src/main/resources/assets/firmalife/textures/item/pie_pan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ | |
"feta" | ||
], | ||
[ | ||
"rayja_metok" | ||
"rajya_metok" | ||
], | ||
[ | ||
"shosha" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"__comment__": "This file was automatically created by mcresources", | ||
"replace": false, | ||
"values": [ | ||
"firmalife:food/nightshade_berry" | ||
] | ||
} |