Posts by red51

    But that's no reason to create multiple topics about the same issue. If you have created a topic, please stick to that topic when you want to post anything that's related to your topic.


    In this case, please post your full code.

    As it has been pointed out in your other topic, you have to put strings into single quotes (INSERT INTO `XXXXX` (Player_user, Player_money) VALUES ('GetPlayer', 2000);), or if "GetPlayer" is a variable, you have to use string concatenation (INSERT INTO `XXXXX` (Player_user, Player_money) VALUES ('" + GetPlayer + "', 2000);)

    Caused by: java.lang.ClassNotFoundException: commons.definitions.Items

    Hmpf, das ist tatsächlich ein Fehler, bzw. liegt an der Obfuscation des Spiels. Das wird in Kürze behoben, vll morgen schon als Nightly in Steam verfügbar, ich sage dann jedenfalls Bescheid :)


    Als letzte Frage : Ist es so, das ich mit der Methode getInventory aus der Klasse Player nur die 5 Items aus meiner Actionbar erhalte?

    Also getInventory() liefert ja das jeweilige Spielerinventar zurück, darin hast du im Grunde Zugriff auf alle Items, die der Spieler besitzt. Das Inventar ist quasi in 4 Kategorien unterteilt, mit den getItem() oder getItems() Funktionen erhälst du das jeweilige Item bzw. die Items des jeweiligen SlotType (Quickslots [Hotbar], Armor, Equipment oder Inventory [Hauptinventar]). Mit getAllItems() wird ein neues Array erstellt, welches sämtliche Items des Inventars enthält. Man muss generell bedenken, dass die zurückgelieferten Arrays immer eine feste Länge haben. Wenn in irgendeinem der Inventarslots kein Item vorhanden ist, ist der entsprechende Slot im Array null

    cannot load coal / planks into the small furnace: a small icon appears in the shape of a flame and the message 'this furnace has no fuel'; when pressing the interaction key nothing happens

    You find a small hatch on the bottom left side of the furnace, you have to open it and put coal or lumber in it in order to fuel the furnace ;)


    when i want to craft or sleep and i press my interaction key 9 times out of 10 a process bar appears stating 'removing shelter/workbench' instead of letting me access the crafting menu / sleep.

    This happens when you keep your interaction key pressed. Then the remove-process will be started (which allows you to pick up objects). If you simply want to interact with them, briefly press your interaction key

    Das Guestbook-Plugin enthält ein Beispiel, wie etwas aus einer Datei ausgelesen werden kann, wenngleich das Beispiel etwas umfangreicher ist (da alle Eventualitäten abgedeckt werden, also geprüft wird, ob der Text in der Textdatei das richtige Format hat, es sich um Zahlen handelt etc).


    Um ganz simpel den Inhalt einer Datei zu erhalten, kann die Hilfsklasse "Utils.FileUtils" herangezogen werden: Diese bietet statische Methoden (d.h. sie sind von überall aus aufrufbar), um bspw. Dateien einzulesen, etwas in eine Datei zu schreiben oder Md5 Checksummen zu erstellen. Mit Utils.FileUtils.readStringFromFile(file) kann ein String aus einer Datei gelesen werden. Also Parameter muss man die entsprechende "File" mitgeben. Beispiel:

    Java
    //Zugriff auf eine Datei "test.txt" im Pluginordner,
    //getPath() liefert den Pfad in den Pluginordner zurück
    File file = new File(getPath() + "/test.txt");
    //Text auslesen
    String text = Utils.FileUtils.readStringFromFile(file);
    //In "text" steht nun der gesamte Text aus der Datei


    Mit den Grund-String-Funktionen wie split(), contains(), startsWith(), matches(), equals() und/oder substring() kann der String dann überprüft und manipuliert werden (zB wenn mehrere Zeilen eingelesen werden usw).

    Das Spiel bietet Hilfsfunktionen, um SQL Abfragen durchzuführen. Die meisten Hilfestellungen im Internet sind also daher umfangreicher und komplexer als das, was du mit der API machst^^


    Das Database Objekt bietet Zugriff auf die Funktionen execute(), executeUpdate() und executeQuery(). "execute()" wird verwendet, wenn du bspw. ein "CREATE" oder "DELETE" Statement durchführen willst. "executeUpdate()" verwendest du, wenn du INSERT, UPDATE oder DELETE durchführen möchtest. "executeQuery()" ist für SELECT Abfragen gedacht, dabei wird auch ein ResultSet zurückgegeben. Das Javadoc enthält dazu auch Beispiele.


    Damit ist quasi alles abgedeckt. Alternativ kann mit "getConnection()" direkten Zugriff auf das Connection Objekt erhalten, womit dann alles, was der JDBC Treiber bereitstellt, gemacht werden kann (zB PreparedStatements verwenden, Tabellenmetadaten auslesen usw). Das ist mächtiger, aber auch komplexer. Das kannst du im Grunde erstmal ignorieren ;)


    Hier ein Beispiel um eine Tabelle zu erstellen und einen Eintrag einzufügen:

    Danke für das Feedback! Ich bin nicht ganz sicher, ob diese Version auch 100%ig kompatibel mit den Servern ist (sollte sie aber eigentlich), und ein Serverupdate möchte ich deswegen nur ungerne forcieren, darum wird die Änderung sicherheitshalber wohl erst in das nächste Update einfließen (das aber vmtl. nicht lange auf sich warten lässt)^^

    Also irgendwie war es mit Lua viel einfacher...

    Das ist eine reine Gewöhnungssache ;) Natürlich ist der Umstieg erstmal ungewohnt, aber wenn man sich erstmal dran gewöhnt hat, läuft eigentlich alles wie geschmiert.
    Wichtig ist, dass du das Javadoc in die IDE einfügst, damit du direkt die Autovervollständigung (inkl. Dokumentation) nutzen kannst (welche das Programmieren ungemein erleichtert)

    That's a strange issue oO But apparently this only affects labels? At least I can't see a difference in the textures/images 8|
    Do you only encounter this issue in combination with plugins, or also with some of the default game texts?

    Kannst du nicht schlafen?

    :saint:


    Aber ne Frage habe ich wirklich.

    Ja genau, Strings müssen mit equals() geprüft werden, ob sie übereinstimmen (ansonsten werden bei der == Variante grundsätzlich zwei Objekte auf Gleichheit geprüft (also ob es sich um das gleiche Objekt handelt), und da ein String ein Objekt ist, würde das == nur dann true ausgeben, wenn du exakt dasselbe String-Objekt [also exakt das selbe Objekt, nicht der Text] überprüfst... anders sieht es lediglich bei primitiven Datentypen wie int, float, boolean etc aus, da kannst du problemlos mit == und != prüfen).


    Um die Abfrage nun zu negieren, musst du lediglich das ! davor setzen, also if(!cmd[1].equals("tmn")) ;)

    It's in the world database. Does the server use MySQL or SQLite? If it's SQLite, the world file is in a subfolder the "Worlds" folder in the server directory (if the world is called "MyWorld", the file is named "MyWorld.db" [in a "MyWorld" subfolder]).
    In the world database there is a table called "Player", just delete the particular row that belongs to @Jon_miner


    The world file can be opened with an SQL editor, like Navicat for example.


    But maybe create a backup of the world (at least a backup of the table or the "world.db" file), just in case something goes wrong.


    Alternatively we can prepare a command for the next update to delete a player from the database ;)


    But if you have access to the serverlogs (they can be found in the "Logs" folder), that would be more preferable (it gives at least an indicator if it's really caused by corrupted player data or maybe something else) :) In this case it would be helpful to shutdown the server and restart it, then let @Jon_miner connect to it, and once that failed, check out the "Logs" folder for the latest log file (either upload it here, or send it via PM to me)

    If the server owner deletes my playerdata will I loose my build progress on the server?

    You will only loose your current inventory, and you will also respawn at the default server spawn (so you have to find the way to your home).
    Alternatively a serverlog would be very helpful (containing the moment when you tried to connect).

    I deleted the entire "steam/steamapps/common/RisingWorld" folder and my single player game still was there after re-install??

    Is Steam Cloud Sync enabled? In this case Steam uploads your world to the cloud and downloads it again if it is missing on your client. By default it is enabled, you can either disable it globally in Steam, or per application (to do that, rightclick on RW in your lib -> Properties -> go to the "Updates" tab -> uncheck "Enable Steam Cloud synchronization for Rising World"

    Log file...

    Thanks for the log file :) Everything seems to be fine there... I'm not sure, but it looks like a serverside issue, maybe your playerdata is corrupted (at least if you can connect to other servers without any issues). If you have contact to the serverowner, you can ask him to delete your playerdata in the database.