Update: The standalone should now be available! Sorry for the delay!
-
java.lang.reflect.InvocationTargetException
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 pluginapi.PluginEventHandler.triggerEvent(SourceFile:166)
at aF.b.a(SourceFile:171)
at aF.b.messageReceived(SourceFile:121)
at k.e.a(SourceFile:109)
at k.c.run(SourceFile:65)
Caused by: java.lang.IllegalStateException: No serializer found for class l.x
at de.jiw.network.serializing.Serializer.getClone(Serializer.java:125)
at k.c.b(SourceFile:51)
at k.e.a(SourceFile:113)
at k.b.send(SourceFile:48)
at k.b.send(SourceFile:43)
at pluginapi.manager.PluginGuiManager.updateGuiTextField(SourceFile:167)
at net.risingworld.api.gui.GuiTextField.updateTextField(GuiTextField.java:201)
at net.risingworld.api.gui.GuiTextField.setText(GuiTextField.java:53)
at EffNet.EffNet.onCommand(EffNet.java:133)
... 9 more
-
Thank you, and Sorry for double Posting... I honestly forgot i posted the same Thing, all I wanted was to get this stupid database working. I was on the verge of shooting my Computer. thats how fustrated was
-
// Decompiled by DJ v3.12.12.101 Copyright 2016 Atanas Neshkov Date: 10/23/2016 9:06:16 AM
// Home Page: http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: EffNet.java
import static java.awt.Event.INSERT;
import static java.lang.Character.getName;
import java.math.BigInteger;
import java.sql.ResultSet;
import java.sql.SQLException;
import net.risingworld.api.Plugin;
import net.risingworld.api.Server;
import net.risingworld.api.database.Database;
import net.risingworld.api.events.EventMethod;
import net.risingworld.api.events.Listener;
import net.risingworld.api.events.player.PlayerCommandEvent;
import net.risingworld.api.events.player.PlayerConnectEvent;
import net.risingworld.api.events.player.PlayerEvent;
import net.risingworld.api.events.player.PlayerSpawnEvent;
import net.risingworld.api.events.player.gui.PlayerGuiElementClickEvent;
import net.risingworld.api.gui.Font;
import net.risingworld.api.gui.GuiElement;
import net.risingworld.api.gui.GuiLabel;
import net.risingworld.api.gui.GuiPanel;
import net.risingworld.api.gui.GuiTextField;
import net.risingworld.api.gui.PivotPosition;
import net.risingworld.api.objects.Player;
import static sun.audio.AudioPlayer.player;
public class EffNet extends Plugin implements Listener
GuiTextField label = new GuiTextField(0.5f, 0.25f, true, 1.0f, 1.0f,true);
GuiPanel panel = new GuiPanel(0.5f, 0.25f, false, 400, 100, false);
protected Database db = null;
db = getSQLiteConnection(getPath() + "/EffNet.db");
db.execute("CREATE TABLE IF NOT EXISTS `EffNet` (`Player_user` VARCHAR(64), 'PLayer_money' INTEGER);");
// db.executeUpdate("INSERT INTO `EffNet` (Player_user, PLayer_money) VALUES ('Bubba', '2000');");
registerEventListener(this);
public void onConnect(PlayerConnectEvent event) throws SQLException{
Player p = event.getPlayer();
String GetPlayer = p.getName();
String query = "SELECT * FROM EffNet WHERE Player_user = GetPlayer";
try (ResultSet result = db.executeQuery(query))
//String fromwhom = result.getString("player_name");
int PMoney = result.getInt("PLayer_money");
if (event.isNewPlayer()){
db.executeUpdate ("INSERT INTO EffNet ('Player_user','PLayer_money') VALUES ('"+GetPlayer+"',2000);");
db.executeUpdate ("INSERT INTO EffNet ('Player_user','PLayer_money') VALUES ('"+GetPlayer+"',2000);");
public void onSpawn(PlayerSpawnEvent event){
String query = "SELECT * FROM `EffNet` WHERE `Player_user` = 'Bubba'";
try (ResultSet result = db.executeQuery(query))
//String fromwhom = result.getString("player_name");
int PMoney = result.getInt("PLayer_money");
label.setText("$EB:" + PMoney);
// String GetPlayer = player.getName();
// p.setAttribute("whosthePlayer",GetPlayer);
Player p = event.getPlayer();
//GuiPanel panel = new GuiPanel(0.5f, 0.25f, true, 400, 50, false);
// GuiTextField label = new GuiTextField(0.5f, 0.25f, true, 0.5f, 0.5f,true);
// label.setText("$EB:" + PMoney);
public static void main(String[] args) {
// create 3 BigInteger objects
BigInteger bi1, bi2, bi3;
bi1 = new BigInteger("123");
bi2 = new BigInteger("-123");
// assign difference of bi1 and bi2 to bi3
String str = "Subtraction result: " +bi1+ " - " +bi2+ " = " +bi3;
System.out.println( str );
public void onCommand(PlayerCommandEvent event){
BigInteger bi1, bi2, bi3;
bi1 = new BigInteger("2000");
bi2 = new BigInteger("50"); //this method will be called when the "PlayerCommandEvent"
//triggers, i.e. when a player enters a command into chat.
Player p = event.getPlayer();
String WDP = (String) p.getAttribute("whosthePlayer");
String playerName = p.getName();
String command = event.getCommand();
Server server = getServer();
String cmd[] = command.split(" ");
if(cmd[0].equals("/help")){
String helpme = command.substring(6);
p.sendTextMessage(helpme);
if(helpme.equals("mail"))
p.sendTextMessage(helpme);
p.sendTextMessage("/mail (To player) - will allow you to Write a Message to a player");
p.sendTextMessage("/read Reads your messages)");
if(helpme.equals("Effnet"))
p.sendTextMessage("/en Drink Will Quench Your Thirst for 50 EffBucks");
p.sendTextMessage("/en FeedMe will Fill your Hunger for 50 EffBucks");
p.sendTextMessage("@user will send a Private Message to a user)");
p.sendTextMessage("/transfer xx to player will Transfer xx Amt of Effbucks to that Plsyer.");
else if(cmd[0].equals("/en"))
String ECmd = command.substring(4);
p.sendTextMessage("I bet that Hit the spot!");
server.broadcastTextMessage("[#58ca32]" + playerName + "[#6878f5] Drinks up!");
String str = "Subtraction result: " +bi1+ " - " +bi2+ " = " +bi3;
if(ECmd.equals("FeedMe"))
p.sendTextMessage("Yummy!g!");
server.broadcastTextMessage("[#58ca32]" + playerName + "[#6878f5] Odered a Pizza From Mario's Perfect Pizza!");
// GuiPanel panel = new GuiPanel(0.5f, 0.25f, true, 400, 100, false);
Display More
and I did reply to my old topic and no one answered
-
i used your example in the Javadoc,
i'm just Getting Fustrate and Cannot think straight.. this is really draining me
its still giving me the same EXACT error
-
SELECT * FROM XXXXX WHERE Player_user = GetPlayer
db.executeUpdate("INSERT INTO `XXXXX` (Player_user,PLayer_money) VALUES (GetPlayer, 2000);");
(GetPLayer is String GetPlayer = p.getName();)
Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such column: GetPlayer)
at org.sqlite.DB.newSQLException(DB.java:383)
at org.sqlite.DB.newSQLException(DB.java:387)
at org.sqlite.DB.throwex(DB.java:374)
at org.sqlite.NativeDB.prepare(Native Method)
at org.sqlite.DB.prepare(DB.java:123)
at org.sqlite.Stmt.executeQuery(Stmt.java:121)
at pluginapi.objects.SQLiteDatabaseAPI.executeQuery(SourceFile:57)
at EffNet.EffNet.onConnect(EffNet.java:68)
... 8 more
-
actualluy I'm making EffNet its loosely based on Vornet, so if you want to butt heads and collaborate its up to you.
-
thank you , I never know I could define variables outside an event
-
what I am trying to do is
type /XXXX and an editable text field with an OK button pops up
I set the ok button to clickable, but I need the "onGuiElementClickEvent" in order for it to work, I am confused on how to do this.
public void onCommand(PlayerCommandEvent event){
GuiPanel panel = new GuiPanel(0.5f, 0.25f, true, 400, 50, false);
panel.setPivot(PivotPosition.Center); //centered element
panel.setColor(0x000000BB); //rgba int color, transparent black
//Get the player object (the player who connects)
GuiTextField label = new GuiTextField(0.5f, 0.25f, true, 1.5f, 1.5f,true);
GuiLabel okbutton = new GuiLabel("ok",0.5f,1.0f,true);
p.setMouseCursorVisible(true);
label.setText("Default");
label.setClickable(true);
okbutton.setClickable(true);
label.setBackgroundPreset(0);
label.setColor(0x000000BB);
label.setPivot(PivotPosition.Center);
Display More
-
I tried Adding a Text Field and all i got was a white Screen
I tried Adding a database, that gave me errors
What I am trying to do is NOT possible or the API is full of bugs.
//Get the player object (the player who connects)
GuiTextField label = new GuiTextField(0.5f, 0.25f, false, 0.5f, 0.5f,false);
label.setText("Default");
label.setClickable(true);
label.setBackgroundPreset(0);
label.setColor(0x000000BB);
label.setPivot(PivotPosition.Center);
Display More
This Code should NOT make the Screen Completly White
if any one can chat with me on steam, feel free.
-
I'm assuming this is Normal when you add a text Field? i scaled it down and i get a big white screen
GuiPanel panel = new GuiPanel(0.5f, 0.25f, true, 400, 50, false);
panel.setPivot(PivotPosition.Center); //centered element
panel.setColor(0x000000BB); //rgba int color, transparent black
//Get the player object (the player who connects)
GuiTextField label = new GuiTextField(0.5f, 0.25f, false, 0.5f, 0.5f,false);
label.setText("Default");
label.setClickable(true);
label.setBackgroundPreset(0);
panel.setColor(0x000000BB);
label.setPivot(PivotPosition.Center);
Display More

-
thank you. i've been googling the color codes with NO luck.
-
thanks and sorry for the caps, I was just getting frustrated because my database won't work so now I'm working on a different Project and this GUI Thing is getting on my nerves
and when I think of RGBA I think of
this: rgba(255, 0, 0, 0.3)
I don't know where you are coming up with (Oox000000BB) it looks like an extended version of the hexadecimal colors.
-
I read and pulled apart Red's Guestbook Plugin and of course it didn't show up in the game.
all I Want is to place a simple Box on the screen so the player can enter info..
any help would be appreciated.
-
the above code SHOULD work and update the record.
-
the VALUES are variables, not fixed values.
-
import static java.awt.SystemColor.text;
import static java.rmi.server.ObjID.read;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import net.risingworld.api.Plugin;
import net.risingworld.api.Server;
import net.risingworld.api.database.Database;
import net.risingworld.api.events.EventMethod;
import net.risingworld.api.events.Listener;
import net.risingworld.api.events.player.PlayerCommandEvent;
import net.risingworld.api.objects.Player;
public class Mail extends Plugin implements Listener{
registerEventListener(this);
public void onCommand(PlayerCommandEvent event) throws SQLException{
Player player = event.getPlayer();
String command = event.getCommand();
Server server = getServer();
String[] cmd = command.split(" ");
if(cmd[0].equals("/mail")){
//check if player Entered a Recipeant
String Recipiant = command.substring(5);
String fromwhom = command.substring(2);
String timestamp = server.getGameTime();
String body = "I love you." ;
player.sendTextMessage("Sent to:" + Recipiant);
Database db = getSQLiteConnection(getPath() + "/Mail.db");
db.execute("CREATE TABLE IF NOT EXISTS 'MailPeople' ('player_name' CHAR(64) NOT NULL DEFAULT ('[NoName]'),'recipient_name' CHAR(64) NOT NULL DEFAULT ('[NoName]'),'time' CHAR(64) NOT NULL DEFAULT ('[NoName]'),'text' CHAR(64) NOT NULL DEFAULT('[NoTime]'), 'read');");
//Note: if AutoCommit is set to false on this connection (by default it is set to true),
//you'll have to call "prep.commit();" to commit the changes
"INSERT INTO MailPeople ('player_name','recipient_name','time','text','read') VALUES (Recipiant,fromwhom,'booger','Booty Call' ,0);");
//Note: if AutoCommit is set to false on this connection (by default it is set to true),
Display More
Now the console says "Recpiant is a "Column," it is clearly in the VALUES I've tried everything to write a variable, coukd someone please tell me what the heck I am doing wrong?
-
import java.sql.ResultSet;
import java.sql.SQLException;
import net.risingworld.api.Plugin;
import net.risingworld.api.Server;
import net.risingworld.api.database.Database;
import net.risingworld.api.events.EventMethod;
import net.risingworld.api.events.Listener;
import net.risingworld.api.events.player.PlayerCommandEvent;
//import net.risingworld.api.events.player.PlayerConnectEvent;
import net.risingworld.api.events.player.PlayerSpawnEvent;
import net.risingworld.api.objects.Player;
public class Mail extends Plugin implements Listener
protected Database db = null;
db = getSQLiteConnection(getPath() + "/Mail.db");
db.execute("CREATE TABLE IF NOT EXISTS 'MailPeople' ('id' INTEGER PRIMARY KEY, "
+"'player_name' CHAR(64) NOT NULL DEFAULT ('[NoName]'),"
+"'recipient_name' CHAR(64) NOT NULL DEFAULT ('[NoName]'),"
+"'time' CHAR(64) NOT NULL DEFAULT ('[NoTime]'),"
+"'text' CHAR(64) NOT NULL DEFAULT('[NoText]'),"
+"'read' INTEGER NOT NULL DEFAULT ( 0 ));");
registerEventListener(this);
public void OnConnect(PlayerConnectEvent event)
public void onSpawn(PlayerSpawnEvent event) throws SQLException
Player player = event.getPlayer();
player.sendTextMessage("Checking Your Mailbox...");
boolean somethingToRead = false;
String query = "SELECT * FROM 'MailPeople' WHERE 'recipient_name' = '" + player.getName()
try (ResultSet result = db.executeQuery(query))
//String fromwhom = result.getString("player_name");
String fromwhom = result.getString("player_name");
String recipient = result.getString("recipient_name");
String timestamp = result.getString("time");
String body = result.getString("text");
int ifread = result.getInt("read");
// String fromwhom = result.getString("player_name");
player.sendTextMessage("You Got Mail, You Lucky Stiff!");
player.sendTextMessage("Nothing but Dust and Spiders in your Mailbox");
Player sender = event.getPlayer(); // ???
Server server = getServer(); // ???
public void onCommand(PlayerCommandEvent event) throws SQLException
Player player = event.getPlayer();
Player sender = event.getPlayer(); // never used ???
String command = event.getCommand();
Server server = getServer();
String[] cmd = command.split(" ");
if(cmd[0].equals("/mail"))
//check if player Entered a Recipient
String recipient = command.substring(5);
String fromwhom = player.getName();
String timestamp = server.getGameTime();
String body = "I love you." ;
player.sendTextMessage("Sent to:" + recipient);
String query = "INSERT INTO MailPeople ('player_name','recipient_name','time','text','read') VALUES ('"+fromwhom+"','"+recipient+"','"+timestamp+"','"+body+"' ,0);";
if(cmd[0].equals("/read"))
// Database db = getSQLiteConnection(getPath() + "/Mail.db");
// this happens when an SQL exception occurs. You have to catch this
// exception. If you just want to print the error, you could call
String query = "SELECT * FROM 'MailPeople' WHERE 'recipient_name' = '" + player.getName()
try (ResultSet result = db.executeQuery(query))
String fromwhom = result.getString("player_name");
String Recipiant = result.getString("recipient_name");
String timestamp = result.getString("time");
String body = result.getString("text"); // never used ???
int ifread = result.getInt("read"); // never used ???
int id = result.getInt("id");
player.sendTextMessage("I love: " + fromwhom);
player.sendTextMessage("I farted on: " + Recipiant);
player.sendTextMessage("the time: " + timestamp);
db.executeUpdate("UPDATE MailPeople SET UPDATE MailPeople SET 'read' = 1 WHERE 'id' = " + id);
player.sendTextMessage("REad");
Display More
java.lang.reflect.InvocationTargetException
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 pluginapi.PluginEventHandler.triggerEvent(SourceFile:166)
at aF.b.a(SourceFile:171)
at aF.b.messageReceived(SourceFile:121)
at k.e.a(SourceFile:109)
at k.c.run(SourceFile:65)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at Commands.Commands.onCommand(Commands.java:79)
... 9 more
Mirrawe helped me and I still cannont figure this out....
-
Never mind.. I moved the bracket and it worked
-
package Mail;
import net.risingworld.api.Plugin;
import net.risingworld.api.events.EventMethod;
import net.risingworld.api.events.Listener;
import net.risingworld.api.events.player.PlayerCommandEvent;
import net.risingworld.api.objects.Player;
public class Mail extends Plugin implements Listener{
@Override
public void onEnable(){
registerEventListener(this);
}
@Override
public void onDisable(){
//...
}
@EventMethod
public void onPlayerCommand(PlayerCommandEvent event){
Player player = event.getPlayer();
String command = event.getCommand();
//split the command
String[] cmd = command.split(" ");
//check the command
if(cmd[0].equals("/mail")){
//check if player Entered a Recipeant
if(cmd.length > 1){
String towhom = command.substring(5);
player.sendTextMessage("Sent Mail to:" + towhom);
}
}
else{
//inform player that he has to enter the recpiant
player.sendTextMessage("[#FF0000]You Need to Specify Who You are Mailing!");
player.sendTextMessage("[#FF0000]USAGE: /mail UncleBob");
}
}
}
It will say "Mail sent to: XXXX" but when I just type in "/mail" it won't see the Else Command, it doesn't say anything i the chat
-
I was Informed by Yahgiggle that is Possible to make Your own Vehicle with the api?? all you have to do is lock to your screen. that sounds awesome