• Announcements

    • Keenan

      Server Crossing Issues   03/23/17

      There are issues with server crossing. Please refrain from crossing borders if possible until the issue can be resolved. Thank you!
joedobo

[WIP] Farm barrel mod

12 posts in this topic

I'm working on a mod to add ways to do farming on an area instead of single tiles:

* Sow a square shaped area with seeds. Do this one tile at a time for the action's duration.
* The seeds used for sowing will come from a "Seed barrel" and its a portable bulk storage type container. It can hold any bulk item but it may not work if something other then seeds are in it.
* The seed barrel's weight will change as it's contents change.
* The max size of the square changes with skill: sowRadius=1,2,3,4,5; skillUnlockPoints=0,50,70,90,100. yes, at 100 skill you can sow an 11x11 area (assuming you got enough stamina to do that). And there will be a way to set the size for a seed barrel.
* Harvest crops directly into something like the seed barrel, I'll call it a harvest barrel for now. You activate it and use it on the crop tile to harvest and put the crops directly in the barrel. Given that its a bulk storage bin you can harvest as much as you can carry.
* Change skill gain so the potential skill gain (crop difficulty, skill and tool quality) is the same for sow, rake, and harvest.

 

I'm not sure about these:

* Harvesting an area has an issue I'm not sure how to deal with. Crops don't get ripe at the same time always. I could make it so the harvest barrel only harvests ripe crops...idk
* Raking an area could be done but it's likely the toon would often run out of stamina. I could extend the rake times for area rake to offset the times we'd wait for stamina regeneration...idk.
* I'd like to figure out a way to harvest crops and put them directly into a harvest barrel that is inside a dragged vehicle. Likewise, it would be good if the same thing could be done for the seed barrel, sow with seeds that are in a barrel that's inside a dragged vehicle.

 

 

source: https://github.com/Joedobo27/FarmBarrelMod/blob/master/src/com/Joedobo27/farmbarrelmod/FarmBarrelMod.java

Edited by joedobo

Share this post


Link to post
Share on other sites

I tried to add a new action, Propagate, instead of extending the "Sow" action. This didn't work either.

 

error log:

Spoiler

[02:47:11 PM] INFO com.Joedobo27.clayshards4concrete.ClayNShards4ConcreteMod: Mortar + Lye removed and Concrete creation modded.
[02:47:11 PM] SEVERE org.gotti.wurmunlimited.modloader.server.Listeners: ServerStartedListener handler for mod FarmBarrelMod failed
java.lang.RuntimeException: java.lang.IllegalAccessException: Can not set static final [Lcom.wurmonline.server.behaviours.ActionEntry; field com.wurmonline.server.behaviours.Actions.actionEntrys to [Lcom.wurmonline.server.behaviours.ActionEntry;
    at org.gotti.wurmunlimited.modsupport.actions.ModActions.registerAction(ModActions.java:51)
    at com.Joedobo27.farmbarrelmod.PropagateAction.<init>(PropagateAction.java:44)
    at com.Joedobo27.farmbarrelmod.FarmBarrelMod.onServerStarted(FarmBarrelMod.java:110)
    at org.gotti.wurmunlimited.modloader.server.ServerHook.lambda$fireOnServerStarted$2(ServerHook.java:45)
    at org.gotti.wurmunlimited.modloader.server.Listeners.lambda$fire$0(Listeners.java:35)
    at java.util.concurrent.CopyOnWriteArrayList.forEach(Unknown Source)
    at org.gotti.wurmunlimited.modloader.server.Listeners.fire(Listeners.java:33)
    at org.gotti.wurmunlimited.modloader.server.ServerHook.fireOnServerStarted(ServerHook.java:45)
    at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$1$1.invoke(ProxyServerHook.java:56)
    at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:302)
    at com.wurmonline.server.ServerLauncher.runServer(ServerLauncher.java)
    at com.wurmonline.server.gui.WurmServerGuiController.StartOfflineButtonClicked(WurmServerGuiController.java:341)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.reflect.misc.Trampoline.invoke(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(Unknown Source)
    at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
    at javafx.event.Event.fireEvent(Unknown Source)
    at javafx.scene.Node.fireEvent(Unknown Source)
    at javafx.scene.control.Button.fire(Unknown Source)
    at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
    at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
    at com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
    at javafx.event.Event.fireEvent(Unknown Source)
    at javafx.scene.Scene$MouseHandler.process(Unknown Source)
    at javafx.scene.Scene$MouseHandler.access$1500(Unknown Source)
    at javafx.scene.Scene.impl_processMouseEvent(Unknown Source)
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(Unknown Source)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
    at com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
    at com.sun.glass.ui.View.notifyMouse(Unknown Source)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$149(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalAccessException: Can not set static final [Lcom.wurmonline.server.behaviours.ActionEntry; field com.wurmonline.server.behaviours.Actions.actionEntrys to [Lcom.wurmonline.server.behaviours.ActionEntry;
    at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source)
    at sun.reflect.UnsafeFieldAccessorImpl.throwFinalFieldIllegalAccessException(Unknown Source)
    at sun.reflect.UnsafeQualifiedStaticObjectFieldAccessorImpl.set(Unknown Source)
    at java.lang.reflect.Field.set(Unknown Source)
    at org.gotti.wurmunlimited.modloader.ReflectionUtil.setPrivateField(ReflectionUtil.java:58)
    at org.gotti.wurmunlimited.modsupport.actions.ModActions.registerAction(ModActions.java:49)
    ... 81 more

[02:47:11 PM] INFO com.Joedobo27.fishingignoresrange.FishingIgnoresRange: Disabling fishing targeting proximity requirements SUCCESS

 

Has anyone got these interfaces to work in server modLoader: ModAction, BehaviourProvider, ActionPerformer?

 

I'm about ready to give up on them and insert code with JA.

 

 

edit...

I needed "ModActions.init();" in the init() section of the main class.

Edited by joedobo

Share this post


Link to post
Share on other sites

i haven't a clue on any of this, but I just wanted to say thanks for your mods, it sure is making life a lot simpler,

 

so just a note of gratitude that's all.

Share this post


Link to post
Share on other sites

Noob mistake on my part. I didn't take into consideration the entire class structure for the examples on Ago's actiondemo. I just took the action class and didn't look at the mod's main class. Its necessary to do a "ModActions.init();" and a "ModActions.registerAction(new PropagateAction());" in main because it won't work otherwise.

 

Getting familiar with using the BehaviourProvider and ActionPerformer will greatly expand what's possible.

 

@ozmodsThank you.

And I'd like to thank Ago. Without modlauncher we'd still be changing decompiled code (kinda-source) and dropping modified java files into the server/client.jar files.

1 person likes this

Share this post


Link to post
Share on other sites

@joedoboHow is this mod coming along? I would love to have it on the server I am on. Thank you in advance for making it.

Share this post


Link to post
Share on other sites

On hold until 1.3 is out and It's a high priority to finish. I'll likely have to fix my other mods first. I updated the github with my most recent changes.

It's missing some code regarding this:

private static WeakHashMap<Action, SowActionData> actionListener;

Which is a way to remember data for the whole action's duration.

 

 

Share this post


Link to post
Share on other sites

I'm stuck on the ConfigureSeedBarrelQuestion.class and that the answer() method never gets called. I know the question is asked because the UI pops up in game. The log file printing in the question constructor are the only ones that print:

[12:17:09 AM] INFO com.wurmonline.server.questions.Question: construct Item [ID: 12883496594178, name: seed barrel, QL: 76.716446, Tile: 491,767]
[12:17:09 AM] INFO com.wurmonline.server.questions.Question: id 501

 

Here is the question class:

https://github.com/Joedobo27/FarmBarrelMod/blob/master/src/com/wurmonline/server/questions/ConfigureSeedBarrelQuestion.java

 

Here is the action performer that calls it:

https://github.com/Joedobo27/FarmBarrelMod/blob/master/src/com/joedobo27/farmbarrelmod/ConfigureSeedBarrelAction.java

 

Thank you, if someone want's to take a look at this.

 

Share this post


Link to post
Share on other sites

Sorry, i don't see anything that would cause it to not work at a quick glance... did you try using the new ModQuestions stuff ago added?

 

Also your decoding in decodeRadius and decodeSupplyQuantity is wrong, you need to shift the bits right, or you'll always get 0 from the second &.

Share this post


Link to post
Share on other sites

Thanks @bdew

 

I've started to convert this over to use the ModQuestions modloader tools. I feel bad asking for examples because Ago already does so much with writing the tools. It's just hard for me to understand things without examples. Anyone know of  some examples that use the ModQuestions tools?

 

Everything except the answer part seems to be working. 

Share this post


Link to post
Share on other sites

Joe I put a note for you on discord. I don't see a sendQuestion in your answer, and everything I can rip outa the wurm code questions has a sendQuestion at the end of the answers.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now