Posts by angriff

A new update is now available, introducing seasons and more!
Latest hotfix: 0.8.0.1 (2024-12-20)

    A lot of code lines to determine what people can do and not do. There in lies a problem. for my old java server build at least. It seems to obsolete the ability to provide for an permission rank that lets people have more as they progress. In the concept a miner1 could not mine precious metals but basic metals such as iron. The permission group could be used to turn it on.

    Ok I think maybe I should be creating and reading group name in the permission files. It is not set in the default.json. I was expecting it to come out of the file name like before.



    group

    info

    Determines the "group name" that should be shown in the player list. Other than that, this permission has no relevance


    Question is the group is just the group name not the file.name (Default or Default.json)?

    Interesting tactic to move the player on spawn. Maybe the area defaults are only set when in the area. Did you do the experiment in a defined Area? Area groups are going to change as the players move around the map. There is a method to read the current and old permissions as well as the area permissions. I guess you could check to see if there has been a change with a not-null check.


    That brings up that area permissions must be overriding regular permissions and would interfere with specialized class permissions assigned at spawn. Could an area permission grant specialized powers over standard permissions while in the area, I would guess, Yes. You could not have fly rights, for example, in the main world but be granted them in an area and vice versa. A players home area could be set to not allow PVP while he is in his area as owner while being able to kill those that visit.


    If I remember correctly there was a db that you could edit to set a players permission group by hand edit. Is there still a Db with players IDs and such? I did not find it on my fast search only the definitions db.

    With permission groups changing in Unity and the advent of Areas and groups I am having a little difficulty detecting what group a player is in. I have an old Java routine that parsed the name of the group and decided certain extra keys to map and routines that could be run by them in my code. Also embedded in the permission group name was a number that I could read and again provide for some extra routines they could run. The problem is the currently I cannot seem to know what group the guy is in if he is moving around areas. Mind you this is not an attribute inside the file but the name itself I was trying to read such as farmer1, farmer2 etc. The file itself was a standard permission file but has different attributes turned on or off as sort of an advancement reward. But now I am getting a bunch of [StringOutOfBounds Exceptions(0,-1) out of bounds for length 0 ] and Preconditions for several lines when I thought it would run properly. No Errors in Compile.




    The routine does this onPlayerSpawnEvent() and runs just once to determine the players job. Should I set an player attribute when I read this? I wish there was a permissions name in the permissions.



    Any Thoughts or examples?

    currclass=player.getPermissionGroup();

    String pclass = currclass.substring(0, currclass.length() - 1);

    String lastChar = currclass.substring(currclass.length() - 1)

    lvl1 = Short.parseShort(lastChar);


    PS I am still troubleshooting this as some of the issue is that this maybe expecting Admins to be in a group also. It just is not clear to me where these errors are coming from. Maybe a null detection?

    FYI. If I am in GM 1 Creative Mode and I try to remove some rocks, I get a constant error message that I cannot remove Rock from this area and then the rock is removed every time I click. This is an area that was created by myself prior to installing the Plug in. I have to be in Creative mode (GM 1 F5) to remove in this area created prior to the installs.

    I was looking at some old plugins and I had a routine that told you the moon phase and gave players more power under a full moon. This seems to be no longer an option in Unity.

    The Javadoc contains an example about that ;)


    Basically you need to provide a bitmask of the Layers you want to include in the raycast. Do not use the layers directly, instead create a bitmask with the Layer.getBitmask() method. Other players have the Layer "REMOTEPLAYER", so getting the bitmask or performing the raycast would look like this:

    Java
    //Get collision bitmask
    int bitmask = Layer.getBitmask(Layer.REMOTEPLAYER);
    //Perform raycast
    player.raycast(bitmask, (RaycastResult result) -> {
    //...
    });

    Ok thanks, I read the JAVDOC but it appeared I would have had to go through several layers of looking, getting the Id (which I was not sure of for another player), getting the name and identifying it that way. The .RemotePlayer seems more like the old .Players. Thanks again.


    and for the readers dont forget to;


    import net.risingworld.api.utils.Layer;

    Nevermind I got this to work and likely it was the problem of Properties being set to Java8 or that it tried to pull in the old RisingworldAPI933 that was in the old Netbeans project I was modifying.


    I do have a question on chat colors. Can you still imbed them in chat statements?


    player.sendTextMessage("[#cc0000] Checking");


    What did it change too? Can you force the chat screen open to show messages. Seems when I send them they are not showing unless I hit T.

    To give a new item to the player (e.g. a torch), it could look like this:

    Java
    //Get torch def
    Items.ItemDefinition itemDef = Definitions.getItemDefinition("torch");
    //Add item to player inventory
    player.getInventory().addItem(itemDef.id, 0, 1);

    So to Give a player something I was trying to put it into their equipped hand slot but I keep getting a lossy conversion error with the getQuckslotFocu. I was using the item id (not def) because it allowed for slot


    This was giving back the player some like leather, which had to be in his hands when he was making it, if the routine was not able to make what he was buying for some reason like full inventory.

    player.getInventory().addItemToSlot((short)178, 0, 10, inventory.getQuickslotFocus(), Inventory.SlotType.Quickslot);


    additemtoslot calls for an int for slot number. Are they returned in long or short from getQuickslotFocus()? The API is not clear to me what precision format is returned from getQuickslotFocus().

    This happens if in your project settings (rightclick on the project -> properties -> sources) the "Source/Binary format" is is set to JDK 8. The new Plugin API uses Java 20, so you should change the Source/Binary format to JDK 20 accordingly ;)

    Cool. I did use an older project and was trying to convert it. What about the Profile and Encoding setting?

    When I compiled a Netbeans project I got these warning. Can anybody explain. It still worked.


    warning: [options] bootstrap class path not set in conjunction with -source 8

    warning: [options] source value 8 is obsolete and will be removed in a future release

    warning: [options] target value 8 is obsolete and will be removed in a future release

    warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.

    I am trying to put something in a players hands during an interaction with a sign. The old ID I had for a saddle was 900. Is there are list of the ID numbers anywhere or do I have to make a routine and look at them one by one. Maybe I need to look at a SQLdatabase? If so point me in the right direction. Thanks.

    Hey James1bow, I want to truly thank you. I finally go it to work. Not exactly sure what fixed it (except the big else to nowhere mistake) as I did several things but I took your basic outline and with a slight modification got my (essentially a hello world type exercise) routine to work. It is one of the aspects of this community that I have always loved.


    Now to get the more complicated routines converted.:wacko::drooling: