Update: The standalone should now be available! Sorry for the delay!
-
Hmm by the sounds of it I should just return to using the int then or ignore the warning. As I said, the code does compile and does work correctly. I just dislike seeing the IDE underlining "problems".
I suppose I'm interested in the "why" of the IDE message. Because as far as I can tell the message is wrong not me. Normally, I'm wrong, so there must be a reason for the message. 😂
The message refers to a null constant but the constants are declared with values, so not a null in sight.
If I do b ==1 b == 2 etc. I don't get the "warning message". It appears to be related to me using the named constants.
-
Thanks Minotorious thing is the code compiles and works as expected. But the IDE gives me that strange warning. 
I don't really want to use public static int compare(byte x, byte y) because that by nature is creating another int
byte 1 byte Stores whole numbers from -128 to 127
int 4 bytes Stores whole numbers from -2,147,483,648 to 2,147,483,647
I know I'm saving quite literally bytes of memory, this is more an exercise in optimisation.
-
Hi folk!
So I am rewriting my dice system at the moment, optimizing along the way. In this case changing ints to bytes... and although it appears to be working fine (it is working). I'm getting the IDE underlining telling me something isn't right?
I've pulled out the "offending" code into a test class to show you here without all the unnecessaries.
You'll see I get a message saying "The constant value `null` used in comparison appears earlier in the chained if-else statement. The condition never evaluates to true"
Question; is the IDE wrong or am I wrong? 

-
Thanks for the explanation red51 that makes sense. Glad to hear it's not an issue. 
-
I don't think this happens though with objects. If you place a chair and the event is cancelled, you still have the chair.
IIRC
-
I'm not sure if this should be in this forum? But I don't want to spam the Discussion form with something technical that possibly regards the API.
Currently in RW, if an event such as onPlayerPlaceBlock is cancelled the player placing the block is still "charged" for placing the block. I.e. their block count is decremented by a block, or multiple blocks if multiple block placement.
Will this still be the case in the new version? I.e. I will need to use the API to replace the used (but at the same time not used) blocks?
-
Even making lumber from log in your inventory, with no tool or bench is kind of a cheat also.
Hmm maybe allowed if the player is carrying an axe? You can make lumber from logs anywhere so long as you have an axe 😁 I agree though, without the correct tool it should not be possible.
-
What are you trying to do?
I'm not familiar with any add/subtract commands.
-
I think the main reason against dev blogs, and even more so dev vlogs, is that they take a huge amount of time.
There's a indie developer I follow who makes vlogs on YouTube about the game he's making. Each video takes him a week to script, record, and edit.
I think it's a "not enough hours in the day" kind of problem.
-
I sooo want to reply to this; but it's social suicide.

-
"I Believe In Freedom Of Speech Unless It Offends"

-
-
Inside you RisingWorldDedicatedServer directory where you have the win_startscript.bat post here your most recent error log (something like errorlog_1611843590545.log).
If you are running win_startscript.bat and it closes instantly, it's because the script is failing. The error log will tell us why.
-
The server would not need any graphics card as the server would never do any graphical output.
You could use Windows Server Core for this or a Linux server without the GUI.
The benefit of such a system is that you don't lose any resources to (effectively useless) user interfaces.
-
A headless server is one that does not use a monitor, mouse and keyboard. I.e. it is headless.
You would therefore connect to the server using a terminal and not a RDC (or equivalent).
-
Change shape on a working bench... Yes. Change in inventory... No.
This has my vote. Circumvents problem caused by incorrectly create blocks, sometimes even wrong textures. But maintains immersive survival mode. 
P.s. Maybe option on workbench/blockbench to deconstruct blocks back to stone/wood etc.?
-
Focus on the update 
-
wa130983 I don't think you can add plugins to the demo. I've not tried myself. This is a forum for the new API (Application Programming Interface). I suspect when plugins can be used in the new version a Plugins forum will be created, or if the compatibility is not an issue then the old Plugins forum will remain your go to place to get plugins.
-
Best I can do in a short time - can't spent too long on this. Untested, but above code should work.
FYI you will notice that a lot of plugins use commands like:
/pluginname plugin_command <extra parameters>
This enables you to do something like this:
public void onCommand(PlayerCommandEvent event){
Player player = event.getPlayer();
Server server = getServer();
String[] cmd = event.getCommand().split(" ");
if (!cmd[0].equals("/pluginname"){ //if the command does not equal the pluginname
return; //do not execute any further code and return out of method
Display More
-
package admininvisibility;
import net.risingworld.api.Plugin;
import net.risingworld.api.Server;
import net.risingworld.api.events.player.PlayerCommandEvent;
import net.risingworld.api.objects.Player;
import net.risingworld.api.events.Listener;
import net.risingworld.api.events.EventMethod;
public class AdminInvisibility extends Plugin implements Listener {
//Register event listener
registerEventListener(this);
System.out.println("AdminVis enabled on server startup!");
System.out.println("AdminVis disabled on server shutdown!");
public void onCommand(PlayerCommandEvent event){
Player player = event.getPlayer();
String[] cmd = event.getCommand().split(" ");
//now check if the command starts with "/vishelp"
if(cmd[0].equals("/vishelp") && player.isAdmin()) {
player.sendTextMessage("VisHelp: [#B4B004]/vistatus[#FFFFFF] - Gets your current visibility status (invisible, visible)");
player.sendTextMessage("VisHelp: [#B4B004]/invisible[#FFFFFF] - Make your player invisible to others");
player.sendTextMessage("VisHelp: [#B4B004]/visible[#FFFFFF] - Make your player visible to others");
//now check if the command starts with "/invisible"
else if(cmd[0].equals("/vistatus") && player.isAdmin()) {
player.sendTextMessage("Invisibility status: " + player.isInvisible());
player.playGameSound("warning_proximity");
//now check if the command starts with "/invisible"
else if(cmd[0].equals("/invisible") && player.isAdmin()) {
player.sendTextMessage("You made yourself invisible.");
player.playGameSound("trade_success");
player.setInvisible(true);
//now check if the command starts with "/visible"
else if(cmd[0].equals("/visible") && player.isAdmin()) {
player.sendTextMessage("You made yourself visible.");
player.playGameSound("trade_success");
player.setInvisible(false);
else if((cmd[0].equals("/vistatus") || cmd[0].equals("/invisible") || cmd[0].equals("/visible")) && ! player.isAdmin()){
player.sendTextMessage("[#B4B004]You are not an admin!");
player.showStatusMessage("[#B4B004]" + player.getName() + ", [#FF0000]you are not allowed to use invisibility commands! (You are not an admin!)", 10);
Display More