1.10
1.9.4
1.8.9
1.7.10
1.7.2
1.6.4
Forge
Open Source
Food
Ah crap, I wrote a long edit to my comment and it must have been in one of the tabs I just closed thinking I didn't need it anymore...
Anyway, yeah I looked through it too and gave myself a big ol' headache sifting through the syntax and options and I might have missed it, but I didn't see it in there.
I also saw that there is a white list, but I'm not sure how it would work.
I'd like it if there was a black list for excluding specific items from the diminishing returns system (maybe that's how the white list works, don't know), but with the item still included as having been eaten. That way there's something that can be relied upon in a pinch. So if you eat 6 steaks they diminish in hunger and saturation values, but then you could eat an apple for its full hunger and saturation value as many times as you like and it would still be included as items recently eaten. It's not like apples give you much anyway and you find them only occasionally while chopping trees.
Meanwhile crops on the other hand you can stockpile. So even if it has low values, if you can get a lot of it, it would feel like a cheat to list something like carrots or beets. So another idea is to have apples specifically in the config as a true or false for being affected by diminishing returns.
Posting before this gets longer.
Ice and Fire: Dragons in a whole new light
I think that makes sense. xD my goal is just to make it not quite as hard as it is when full on foods loss total value after a time.
Having a list of smaller items that always give food would be good to, maybe the white list can handle that I am not sure.
If listing is possible I'd also want to add things like the golden foods and special modded foods that you wouldn't want to diminish. That was in the comment edit that I'd accidentally deleted earlier, but I completely forgot about it.
The problem with the white list, which is why I said "black list" and I could be completely wrong about this, is that it looks like if you switch the white list option to true then it's only the items on the list that suffer diminishing returns. As apposed to being able to just list a couple of items to be exempt from the diminishing returns system. So if you only want apples exempt from the system, then you would have to type in a list of every single other edible item with hunger/ saturation values available in order for them to be affected by diminishing returns. That's alright if you only want diminishing returns to affect a few items, like to prevent someone from going nuts with the golden foods or if you want to just list the sweets and prepared foods and I wouldn't want that option removed for those reasons, but a black list would just be easier to work with.
The other reason I was saying apples earlier is that deserts and oceans aside there're oak trees almost everywhere in the overworld if you look hard enough, so it's almost a universal food.
Ice and Fire: Dragons in a whole new light
A black list would be way better then a white list of that is the case.
Pretty easy, actually. To make the nutritional value never go below 20%, you can use MAX(0.2, <your formula>). For example, here's the default formula. modified so that it will never go below 20%:
That should be how the existing black list food groups work. If you add a food group with just apples and make it a black list food group, then apples will still count towards food eaten, but never diminish. For example, if you save the following as apple.json in config/SpiceOfLife/ then you'll have exactly what you are talking about:
Thank you very much!
Thank you very much, but I can't open json files. I've just never known what to do with them or had the ability to do anything with them. Do I make a text file with this in it and save it as .json? And if I want to add more items than just the apple would I use the same spacing and add the other items directly below the apple listing?
Also with the formula that prevents food from falling below 20%, if I switch the 8 with a 4 will it be a 10% minimum instead of a 20% minimum? I'm sorry, but I've just never been very good at syntax.
Ice and Fire: Dragons in a whole new light
Yep, JSON files are just text files with a different extension, and they have a special syntax. You can open them with Notepad on Windows, or any other text editor. To add other items, you'd add a comma after
and then add the name of the other item in the same manner. Read more about JSON here and see config/SpiceOfLife/example-food-group.json for the full options available for defining food groups.
It's not the 8 that sets the minimum, it's the MAX(0.2, ) part. So, if you wanted a 10% minimum you'd do MAX(0.1, ) instead. If you're familiar at all with spreadsheet programs like Excel, then the formula works very similar to the formula in something like that (for example, here's the Excel MAX function, which works exactly the same way as it does in TSoL).
YES! Now I Know What To Do With Json Files! XD
"To add other items, you'd add a comma after". Do you mean on the same line or on the next line?
"minecraft:apple", "minecraft:golden_apple"
Ice and Fire: Dragons in a whole new light
Either will work.
I've just moved from 1.10.2 (where we have thoroughly enjoyed using your mod) to 1.11.2, but I'm seeing an issue with the 1.11.2 version of this mod. It appears to work fineat first, but exiting and rejoining a game in both single player and online appears to clear the food eaten queue and you are effectively reset as if you were a new player. Am I alone in seeing this? :/
I forgot to reply! Thank you very much for everything!
Ice and Fire: Dragons in a whole new light
It's very possible that the 1.11.2 version is buggy; I didn't test it much unfortunately. Will look into it.
Much appreciated. Thank you!
Something I would like to address. Lord of the Rings and this mod crashes whenever you eat something. Here is the crash report.
---- Minecraft Crash Report ----
// Don't do that.
Time: 3/18/17 11:10 PM
Description: Ticking player
java.lang.NullPointerException: Ticking player
at squeek.spiceoflife.foodtracker.FoodHistory.get(FoodHistory.java:224)
at squeek.spiceoflife.foodtracker.FoodModifier.getFoodModifier(FoodModifier.java:116)
at squeek.spiceoflife.foodtracker.FoodModifier.getFoodValues(FoodModifier.java:34)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_119_FoodModifier_getFoodValues_GetPlayerFoodValues.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at squeek.applecore.api_impl.AppleCoreAccessorMutatorImpl.getFoodValuesForPlayer(AppleCoreAccessorMutatorImpl.java:95)
at squeek.applecore.asm.Hooks.onFoodStatsAdded(Hooks.java:36)
at net.minecraft.util.FoodStats.func_151686_a(SourceFile:35)
at net.minecraft.item.ItemFood.func_77654_b(SourceFile:36)
at net.minecraft.item.ItemStack.func_77950_b(ItemStack.java:151)
at net.minecraft.entity.player.EntityPlayer.func_71036_o(EntityPlayer.java:419)
at net.minecraft.entity.player.EntityPlayerMP.func_71036_o(EntityPlayerMP.java:866)
at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:242)
at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:295)
at net.minecraft.network.NetHandlerPlayServer.func_147347_a(NetHandlerPlayServer.java:303)
at lotr.common.LOTRNetHandlerPlayServer.func_147347_a(LOTRNetHandlerPlayServer.java:50)
at net.minecraft.network.play.client.C03PacketPlayer.func_148833_a(SourceFile:137)
at net.minecraft.network.play.client.C03PacketPlayer.func_148833_a(SourceFile:8)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at squeek.spiceoflife.foodtracker.FoodHistory.get(FoodHistory.java:224)
at squeek.spiceoflife.foodtracker.FoodModifier.getFoodModifier(FoodModifier.java:116)
at squeek.spiceoflife.foodtracker.FoodModifier.getFoodValues(FoodModifier.java:34)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_119_FoodModifier_getFoodValues_GetPlayerFoodValues.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
at squeek.applecore.api_impl.AppleCoreAccessorMutatorImpl.getFoodValuesForPlayer(AppleCoreAccessorMutatorImpl.java:95)
at squeek.applecore.asm.Hooks.onFoodStatsAdded(Hooks.java:36)
at net.minecraft.util.FoodStats.func_151686_a(SourceFile:35)
at net.minecraft.item.ItemFood.func_77654_b(SourceFile:36)
at net.minecraft.item.ItemStack.func_77950_b(ItemStack.java:151)
at net.minecraft.entity.player.EntityPlayer.func_71036_o(EntityPlayer.java:419)
at net.minecraft.entity.player.EntityPlayerMP.func_71036_o(EntityPlayerMP.java:866)
at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:242)
at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:295)
-- Player being ticked --
Details:
Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
Entity ID: 234
Entity Name: SchoolRules1
Entity's Exact location: 50.79, 64.00, -85.21
Entity's Block location: World: (50,64,-86), Chunk: (at 2,4,10 in 3,-6; contains blocks 48,0,-96 to 63,255,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Entity's Momentum: 0.00, -0.08, 0.00
Stacktrace:
at net.minecraft.network.NetHandlerPlayServer.func_147347_a(NetHandlerPlayServer.java:303)
at lotr.common.LOTRNetHandlerPlayServer.func_147347_a(LOTRNetHandlerPlayServer.java:50)
at net.minecraft.network.play.client.C03PacketPlayer.func_148833_a(SourceFile:137)
at net.minecraft.network.play.client.C03PacketPlayer.func_148833_a(SourceFile:8)
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:212)
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:165)
-- Ticking connection --
Details:
Connection: net.minecraft.network.NetworkManager@20edf125
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:659)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:547)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:111)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:396)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)
-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Mac OS X (x86_64) version 10.12.1
Java Version: 1.8.0_101, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 1191205696 bytes (1136 MB) / 2781347840 bytes (2652 MB) up to 5726797824 bytes (5461 MB)
JVM Flags: 2 total; -Xms512m -Xmx6144m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 11 mods loaded, 11 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10-universal.jar)
UCHIJAAAA Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10-universal.jar)
UCHIJAAAA CodeChickenCore{1.0.7.47} [CodeChicken Core] (minecraft.jar)
UCHIJAAAA NotEnoughItems{1.0.5.120} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.5.120-universal copy.jar)
UCHIJAAAA FastCraft{1.23} [FastCraft] (fastcraft-1.23.jar)
UCHIJAAAA lotr{Beta v31.3 for Minecraft 1.7.10} [The Lord of the Rings Mod] ([1.7.10] The Lord of the Rings Mod B31.3.jar)
UCHIJAAAA AppleCore{1.3.8} [AppleCore] (AppleCore-mc1.7.10-1.3.8.jar)
UCHIJAAAA DamageIndicatorsMod{3.2.0} [Damage Indicators] (Damage-Indicators-Mod-1.7.10.jar)
UCHIJAAAA SpiceOfLife{1.3.8} [The Spice of Life] (SpiceOfLife-mc1.7.10-1.3.8.jar)
UCHIJAAAA Waila{1.5.10} [Waila] (Waila-1.5.10_1.7.10.jar)
GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['SchoolRules1'/234, l='New World', x=50.79, y=64.00, z=-85.21]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
No, it's not the core. I tested it with only the core. It works fine with the core alone. Can you see what you can do please? (Also, I said this on the LOTR forums) : D
To take the test, check out
https://minecraftnoobtest.com/test.php
Couple of bugs I noticed:
Once I reload the world it seems as if I have eaten nothing at all. I was eating cooked fish to the point where it should not have restored any hunger (0% effectivity) and it restored like 3 bars. So the UI was telling me 0, but it worked as if it was vanilla. I'm pretty sure this is the case with all food. I was using version 1.3.8.
This happens to my on my server
I'm getting irregular loss of my hunger history 1.11.2 - always when I reload the world. Sometimes it wipes my list completely, sometimes it only partly wipes my list, sometimes it resets me to the starting period of the game where I get a "grace period" of (in my config) 10 items.
It looks like the information is getting lost or corrupted between instances of the game.
Can someone please explain to me what this line does exactly? More specifically, what does the number 12 represent? Is it supposed to match the number given for food.history.length? Or is it just coincidence that the default config for this mod has food.history.length = 12, and also has 12 in the formula?
I ask because I have edited the config for the food.history.length to equal 3, and I'm trying to figure out if I need to edit this formula and replace the 12 with a 3 also.