Jump to content

Recommended Posts

Farmland Drops Soil changes the behavior of farmland to drop soil when broken, depending on the nutrients available.

oGpuPlo.thumb.png.c3640cfa189e1bc517f641b4d5fc4d3f.png

This is for those people that got frustrated by losing their precious Terra Preta when wanting to move their farms to a better, fancier place or even their entire base. Well, you can't! Except with the amazing Farmland Drops Soil mod. When you break a farmland block, it will have a chance to drop their respective soil block, depending on the nutrients available. If you wait for the nutrients to fully recover, you always get your soil back. Otherwise, it will pick the lowest nutrient, and adjust the drop chance based on it. For example, a Terra Preta farmland with N=80, P=60, K=40 has a 50% chance to drop the soil block (40 / 80 = 0.5).

[ VSModDB ]
[ GitHub Releases ]
Source code is available on GitHub as well.

Edited by copygirl
  • Like 1
  • Thanks 1
Link to post
Share on other sites
1 minute ago, Tyron said:

Well perhaps more like make the farmland drop soil with a special "was farmland" attribute and when placed it'll remember its state until tilled or so

If you actually make the soil items remember their state, then they won't stack anymore. I still like my idea best 😛

  • Like 1
Link to post
Share on other sites
  • 5 weeks later...
5 hours ago, DrTenabrae said:

or you only get a block back when the tilled land is at 100% nutrient (so you're essentially 'preparing the soil for transport'

That would be confusing for players who don't know about this rule, and frustrating in general. And doesn't make much sense, in my opinion, to drop nothing when you dig up farmland.

Link to post
Share on other sites

What about doing something similar to food regarding the stacking, to follow up on @Tyron's post? Picking up a farmland block with lower than full nutrients will store its nutrients on the item itself. If the nutrients are similar enough to an existent stack in your inventory, they automatically stack. If not, you can still forcefully stack them, like food with varying amounts of freshness. Either way, the nutrients will be averaged.

  • Amazing! 1
Link to post
Share on other sites
  • copygirl changed the title to Farmland Drops Soil v1.2.0

Updated the mod to something more sophisticated and balanced.

- Farmland no longer always drops the soil block, it depends on the nutrients at the time of breaking it. (See first post.)
- It now is once more a mod that's required on both server and client, due to a block behavior being added.

  • Like 1
Link to post
Share on other sites
On 9/27/2019 at 9:20 AM, copygirl said:

If you actually make the soil items remember their state, then they won't stack anymore. I still like my idea best 😛

Can you make a system similar to food? You can stack food with different expiration dates and it will be averaged

Edited by DArkHekRoMaNT
Link to post
Share on other sites
2 minutes ago, DArkHekRoMaNT said:

Can you make a system similar to food? You can stack food with different expiration dates and it will be averaged

It would require the item and soil block to store this additional information. Turning soil blocks into block entities is a no-go.

Link to post
Share on other sites

I seen someones revised version of this, I actaully have it and I like it quite a bit. glad you thought of it. combined with my own mod I can exploit the revised version of this if I really wanted to but don't at least not intentionally.

the way they did it is you will always get a soil block when you break the farmland but the soil block you get will very on the nutrients in the farmland so if its at the default with no usage aka 25, 50, 65, or 80 (I think compost is 65). either way if it has less than it's full nutrients you get the highest soil block that matches the lowest nutrient so if you plant terra pretta and you dig it up and it has all 80s you will get 100% terra pretta soil drop, if its say 90-70-80 (90 due to fertilizer) you will get compost soil back. with my fertilizer mod you can make a super fertilzier that adds a slow release of nutrients 80-80-80 but it is really slow so don't expect to get super soil lol but it will help keep you farming with less rotations and if you take a medium soil block till it fertilize it until it has over 80 in each nutrient you can dig it up and get a terra pretta soil block. takes forever for soil to go up though and I think it drains faster if the nutrient is above the max the farmland naturally has so it's a little hard if you want to really try to exploit it.

either way. I don't mind waiting for it to regen nutrients if it means I can dig it up and move. I'm glad you made this mod.

Link to post
Share on other sites
  • 2 weeks later...
On 2/27/2021 at 7:19 PM, Cjleeh said:

@copygirlNow that 1.14.8 is out, would you please update the mod? It is not working in 1.14.8 stable. So I am just guessing that there were changes that broke something. Thankyou!

I tested it in 1.14.8 and it appears to still work just fine. (Placed down farmland or tilled it with a hoe, broke it in survival, received the soil block.) Perhaps another mod is messing with something, or the mod had an issue being loaded? Can you look at or upload the server-main.txt log file?

Link to post
Share on other sites
1 hour ago, copygirl said:

I tested it in 1.14.8 and it appears to still work just fine. (Placed down farmland or tilled it with a hoe, broke it in survival, received the soil block.) Perhaps another mod is messing with something, or the mod had an issue being loaded? Can you look at or upload the server-main.txt log file?

Here is the file. :D

server-main.txt

Edited by Cjleeh
Link to post
Share on other sites
1 hour ago, Cjleeh said:

Here is the file. :D

Looking at the file, my mod is loaded properly and there doesn't appear to be any errors. Not entirely sure which other mod to look at first. Did you update the game and the mod stopped working, or did you just recently add it? Did you update or add another mod recently? You could see if disabling any of the other mods would suddenly make Farmland Drops Soil work. (Can't offer more debugging at this moment, I could only make sure this worked with the Aura Fury modpack in singleplayer.)

Link to post
Share on other sites
54 minutes ago, copygirl said:

Looking at the file, my mod is loaded properly and there doesn't appear to be any errors. Not entirely sure which other mod to look at first. Did you update the game and the mod stopped working, or did you just recently add it? Did you update or add another mod recently? You could see if disabling any of the other mods would suddenly make Farmland Drops Soil work. (Can't offer more debugging at this moment, I could only make sure this worked with the Aura Fury modpack in singleplayer.)

I was able to pin point the exact mod that was conflicting with yours. XSkills 0.4.9 by Xandu

I am not sure how to proceed. If I should be talking to you, or if I need to discuss this with Xandu for a possible fix. That is if it can be solved. I have no idea on the complexity of such things, and that is why I am glad to have dedicated people like you do things I can't. 🥰 To elaborate when XSkills is enabled. The farm blocks disappear as if your mod was not enabled. Even when the nutrients are at there full capacity. When I turn XSkills off, I get the soil back as intended by your mod.

Edited by Cjleeh
Link to post
Share on other sites
2 hours ago, Cjleeh said:

I was able to pin point the exact mod that was conflicting with yours. XSkills 0.4.9 by Xandu

I am not sure how to proceed. If I should be talking to you, or if I need to discuss this with Xandu for a possible fix. That is if it can be solved. I have no idea on the complexity of such things, and that is why I am glad to have dedicated people like you do things I can't. 🥰 To elaborate when XSkills is enabled. The farm blocks disappear as if your mod was not enabled. Even when the nutrients are at there full capacity. When I turn XSkills off, I get the soil back as intended by your mod.

At the moment the mods are not compatible. I try to fix this with the help of the Compatibility Lib mod.

Link to post
Share on other sites
2 hours ago, Xandu said:

At the moment the mods are not compatible. I try to fix this with the help of the Compatibility Lib mod.

I have the Compatibility Lib mod installed. From the sounds of it. There has yet to be a solution that would make the two mods compatible.

Link to post
Share on other sites
  • 1 month later...

Hello copygirl, in a server I was playing on the mod crashed me, when I approached my base several times. Most of the farmland is not in use as I had depleted the nutrients, except for a few flax plants. Here is the crash log:

Spoiler

Running on 64 bit Windows with 16 GB RAM 
Version: v1.14.8 (Stable)4/8/2021 7:29:21 PM: Critical error occurred
System.NullReferenceException: Object reference not set to an instance of an object.
   at FarmlandDropsSoil.FarmlandDropsSoilBehavior.OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, EnumHandling& handling)
   at Vintagestory.API.Common.Block.OnBlockBroken(IWorldAccessor world, BlockPos pos, IPlayer byPlayer, Single dropQuantityMultiplier)
   at Vintagestory.Common.BlockAccessorBase.BreakBlock(BlockPos pos, IPlayer byPlayer, Single dropQuantityMultiplier)
   at EntityEarthworm.OnGameTick(Single dt) in C:\vsmods\mods\primitivesurvival\src\entity\entityearthworm.cs:line 107
   at Vintagestory.Client.NoObf.ClientSystemEntities.OnGameTick(Single dt)
   at Vintagestory.Common.EventManager.TriggerGameTick(Int64 ellapsedMilliseconds, IWorldAccessor world)
   at Vintagestory.Client.NoObf.ClientMain.MainRenderLoop(Single dt)
   at Vintagestory.Client.NoObf.ClientMain.MainGameLoop(Single deltaTime)
   at _jeEziyUSYl0BpbOxT46FYwj5VWL._t25VgrofhlXMw6hHEZh8JHhJz1A(Single )
   at _idIkJkIueHHf3Oz2WNlBdD0E1XR._DvzT6D0wN3fMakeuDyljJJ09hok(Single )
   at _idIkJkIueHHf3Oz2WNlBdD0E1XR._V5piYzG7beYPldE6UVxY58dqacE(Single )
   at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame(Object sender, FrameEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at OpenTK.GameWindow.RaiseRenderFrame(Double elapsed, Double& timestamp)
   at OpenTK.GameWindow.DispatchRenderFrame()
   at OpenTK.GameWindow.Run(Double updates_per_second, Double frames_per_second)
   at _YrS2W1MoaeqC4xqH8ItdZB6vADN._8t1BmEWVlCT9mjx5M0vFIzU9tif(_7T00Rjby4si0wyEBez5dXNqLm7h , String[] )
   at _ejKuc6cg0k8V39o8jDIzquyczbO._8t1BmEWVlCT9mjx5M0vFIzU9tif(ThreadStart )
-------------------------------

Event Log entries containing Vintagestory.exe, the latest 3
==================================
{ TimeGenerated = 3/20/2021 9:25:51 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 1564561481470198046, type 5
Event Name: RADAR_PRE_LEAK_64
Response: Not available
Cab Id: 0

Problem signature:
P1: Vintagestory.exe
P2: 1.14.8.0
P3: 10.0.19041.2.0.0
P4: 
P5: 
P6: 
P7: 
P8: 
P9: 
P10: 

Attached files:
\\?\C:\Users\jakec\AppData\Local\Temp\RDR7237.tmp\empty.txt
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7248.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7259.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER7276.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER72A6.tmp.txt

These files may be available here:


Analysis symbol: 
Rechecking for solution: 0
Report Id: 1b890296-790c-44b3-9f3f-b3d39004e503
Report Status: 268435456
Hashed bucket: 2422f0d2706eedebe5b67060c44a411e
Cab Guid: 0 }
--------------
{ TimeGenerated = 2/18/2021 7:39:22 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 1941784971470830743, type 5
Event Name: RADAR_PRE_LEAK_64
Response: Not available
Cab Id: 0

Problem signature:
P1: Vintagestory.exe
P2: 1.14.7.0
P3: 10.0.19041.2.0.0
P4: 
P5: 
P6: 
P7: 
P8: 
P9: 
P10: 

Attached files:
\\?\C:\Users\jakec\AppData\Local\Temp\RDR1F3A.tmp\empty.txt
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER1F3B.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER1F4B.tmp.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER1F66.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER1F86.tmp.txt

These files may be available here:


Analysis symbol: 
Rechecking for solution: 0
Report Id: f5388a9a-e76b-4982-a7ae-ae762721a01c
Report Status: 268435456
Hashed bucket: 4ff6173b155534146af29b24beb5fc97
Cab Guid: 0 }
--------------
{ TimeGenerated = 1/30/2021 6:23:06 PM, Site = , Source = Windows Error Reporting, Message = Fault bucket 1894811367828615521, type 4
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: Vintagestory.exe
P2: 1.14.7.0
P3: 6006d010
P4: KERNELBASE.dll
P5: 10.0.19041.662
P6: ec58f015
P7: c0020001
P8: 000000000002d759
P9: 
P10: 

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER8CB5.tmp.WERInternalMetadata.xml

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Vintagestory.exe_985a0129f5f352f67983459ff99ca46b6c7d62_8d93c905_ceace742-31c1-4838-9403-9a8183d0ecba

Analysis symbol: 
Rechecking for solution: 0
Report Id: b00cd180-dd85-4f6e-b832-5915d5bf6bf0
Report Status: 268435456
Hashed bucket: 374eecc803555100aa4bb8e65fcbf161
Cab Guid: 0 }

 

Link to post
Share on other sites
5 hours ago, jakecool19 said:

Hello copygirl, in a server I was playing on the mod crashed me, when I approached my base several times. Most of the farmland is not in use as I had depleted the nutrients, except for a few flax plants. Here is the crash log:

An earthworm from another mod is trying to break the farmland block. I suppose I did not write the mod anticipating that. You could remove the other mod for now. I will work on an update.

  • Mind=blown 1
Link to post
Share on other sites
  • copygirl changed the title to Farmland Drops Soil v1.3.0

It should be relatively easy to keep earthworms away from farmland in the interim.  They can't climb at all (so even a simple 1 high block wall should keep them out) and do not spawn naturally, only when you pick up a rock or stick.  And of course you can just pick them up if you happen to see one.  It also takes quite a while for an earthworm to convert farmland into worm castings.

Side note:  I've made a number of changes to Primitive Survival to make it Carry Capacity friendly, so these sorts of issues seem...inevitable.  :)

 

Edited by Spear and Fang
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.