Posts by yahwho

    The main part of this error message is:


    AddressInUseException: Port 4255 (UDP) is already in use!


    Have you forgotten to close down a previously running server?

    Hi fellow plugin dudes (and game devs),


    Bit of Friday night code optimization chat.


    Now on my blog, around three years ago I wrote somthing that goes a little like:


    "So I’ve always done it with the plus (+) operator turns out using a prefix $ is much more efficient in terms of memory usage."

    Java
    //less efficient
    string newString = firstString + " said hello";
    //more efficient
    string newString = $"{firstString} said hello";


    Disclaimer: honesty I can't actually remember posting this.


    So I just tried it (as I still just use the plus operator) as below:

    Java
    String firstString = "foo";
    string newString = $"{firstString} bar";


    But I just get an error message. " ; expected "


    I think, the problem is that this was wrongfully filed under Java (which I'm trying to compile it as), when in fact it may very well be C# code.


    First off, am I right that this is C#?


    Second, and more importantly, what do you think is the most optimal way of string concatination? Using the plus operator or using the String classes concat operator?


    Answers about it being negligable are not accepted. :crazy:


    paulevs I'm interested in knowing your thoughts on this ;)

    Hi,


    I've noticed a few times that the Debug Console gets spammed with NPC X IS FALLING (X, Y Z) events.


    Maybe a counter with a threshold and a npc.destroy() method in required?

    Loading from plugin resources is broken atm unfortunately :/ But we try to get it fixed with the upcoming hotfix ;) However, loading from a file (e.g. from plugins folder), url, asset bundle or raw byte data should still work.

    Oooh so ..

    Code
    ta = TextureAsset.loadFromPlugin(plugin, "res/test.jpg");

    Should work in the future? I would very much like to keep all the assets bundled up in the same jar :saint:


    Thanks for the reply Red 8):thumbup: Legend.

    Hehe I'm a hobbiest programmer, so not sure what gradle is ^^


    In the Java version I did this:


    Java
    ImageInformation ii= new ImageInformation(plugin.getPath() + "\\resources\\gui\\tab01.png");

    I've just had a good with this:


    Java
    TextureAsset image = TextureAsset.loadFromFile(plugin.getPath() + "\\res\\test.jpg");
    style.backgroundImage.set(image);

    Now I don't get an error messages, in fact I get a "Loading asset (Texture) from cache: D:\MR2\Plugins\MedievalRealms\res\test.jpg" from the console, so it finds the file.


    However, when I log into my test server the images are missing (transparent bg).


    :wat:

    Hi paulevs


    You mean like:


    Plugins/PluginFolderName/PluginName

    Plugins/PluginFolderName/PluginName/res/text.jpg


    Hope that makes sense! I will give it a try (that's what I did in the Java version), was just hoping we could have packed it all into one Jar ;(

    Java
    ta = TextureAsset.loadFromPlugin(plugin, "res/test.jpg");

    What path do we need to use for loading images as a texture asset from within the JAR? I would use a path similar to the above in JavaFX but with the plugin I get a "The system cannot find the path specified" error. :|

    Hello,


    So on the Java version, I made it so that players couldn't drop the Primitive Stone Axe - because without it a player is effectively at the mercy of other players offering tools as a gift.


    The recipe for this item is 1x stone and 2x sticks.


    I know that players can now pick up stones (rock), would it also be possible in a future update that players could pick up sticks too or maybe punch a tree several times and eventually get a stick?


    (Think of the realism! Punching trees to get sticks! :crazy:)


    Seriously though, an action key initiated timer on a tree would work? Like the gutting of animals but "Gathering stick".


    This would cure the whole, "no tools" problem.

    The latter.


    I would like this text to always show to players, achieved currently through server.properties file. I don't think this would need changing?


    But I would like to set this text by API calls, as you mention -


    Java
    player.showLocationTicker("Sorry pal, your white socks are giving me a headache");


    Having just said that, what do you think would be the max character count here?