#help-development
1 messages · Page 240 of 1
what do u use from vanilla
nothing lol
bru xd
So you mean just redo the damage system and since it's not being used anymore use the damage attribute?
wdym disregard
try {
JsonWriter writer = plugin.getJsonWriter();
writer.beginObject();
writer.name("gui");
writer.beginArray();
writer.beginObject();
writer.name(args[2]).value(ItemStackGsonUtils.write(itemInHand));
writer.endObject();
writer.endArray();
writer.endObject();
writer.close();
} catch (IOException ex) {
ex.printStackTrace();
}
With gson json would anyone know if there is an easier way to type that, for it to appear in the same location with PrettyPrinting applying?
me or miningcow
you
oh no I dont do it with vanilla, I do it with maths
so with custom variables
Tbh those methods should return the writer so you can chain them
I have custom player stats that hold values
How do you store your item attributes?
i think thats better
and use those and ignore vanilla modifiers
if player looks at light block, what will code say the player looks at?
i think nbt tags is the best
will it be ignored?
check how many times a player open a specfic chest
they are NBT values, but I re-calculate the player's total strength every time there is something changed in the inventory not on hit
brb in 5 min
I don't think their is a light material so prob just be air
oh ok
Hi, i am having troubles setting up sql storage for my server as it doesnt let me connect to the local .db file for whatever reason
is anyone somewhat good at sql spigot implementation ? i hope it's not an oversaturated question
Are you using jdbc
yes
And did you follow the jdbc docs for setup
You mean just store NBT tags for every single attribute?
depends
Did you shade jdbc into your plugin?
I was trying to avoid doing that so I would just have 1 PDC
saveDefaultConfig();
File f = new File(getDataFolder() + "/main.db");
if(!f.exists()){
try {
f.createNewFile();
System.out.println(f.getAbsolutePath());
} catch (IOException e) {
e.printStackTrace();
}
}
try {
sql = new DataBase(f.getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
}
This is my onEnable() function
I think we should start a thread
okay
how can i add extra flags to an itemstack?
package dev.relismdev.rcoresync.MySQL;
import java.sql.*;
public class DataBase {
private Connection connection;
public DataBase(String f) throws Exception {
this.connection = DriverManager.getConnection("jdbc:sqlite:" + f);
Class.forName("org.sqlite.JDBC");
createTable();
}
public void closeConnection() {
if(this.connection == null){
return;
} try {
this.connection.close();
} catch(Exception e) {
e.printStackTrace();
} this.connection = null;
System.out.println("Connessione chiusa con successo");
}
public void createTable() throws SQLException {
String sql = "CREATE TABLE IF NOT EXISTS table(Number int, Color varchar(255));";
Statement st = this.connection.createStatement();
st.execute(sql);
System.out.println("Successfully created a table");
}
}```
This is my DataBase class
nbt tags?
Custom item attributes
yes['
Just use PDC or ItemFlags
InventoryOpenEvent help!
?PDC
can you please help me? im losing my mind over this lolol
Your syntax is wrong in your statement
how do the do
String sql = "CREATE TABLE IF NOT EXISTS table(Number int, Color varchar(255));";
if u want nbt tags you either need nms or an api for it
i have a value that magically fucking turns null during an InventoryCloseEvent
i think there is a space
That's wrong
Hold up idk correct syntsx gimme a sec
sure lol
i have 3 checks for that value
- when its assigned by another method
- inventoryclickevent
- inventorycloseevent
it magically disappears on inventorycloseevent
In this tutorial, you will learn how to create a new table in an SQLite database from a Java program using SQLite JDBC Driver.
Example
Like a variable?
It may be cleared by garbage collector
Who knows especially if it's static just learn not to abuse static
its a variable
Can't help more than that without information
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
throws same error
its not mysql
its just a .db file
sqlite
its about all types of databases
hello i have a problem. if you apply setGravity(false) to an armorstand and setVelocity() to make it move, it won't move. I want to turn off the gravity of the
armorstand and apply setVelocity to them.
I understand that I will need to use NMS and I understand that I will need to create my own custom armorstand.
But how do you turn off the movement block with gravity off and spawn that custom armorstand in the world?
can someone help me? i beg.
with
it is saying that my DataBase class is null
Cannot invoke "dev.relismdev.rcoresync.MySQL.DataBase.closeConnection()" because "dev.relismdev.rcoresync.RCoreSync.sql" is null
public DataBase(String f) throws Exception {
this.connection = DriverManager.getConnection("jdbc:sqlite:" + f);
Class.forName("org.sqlite.JDBC");
createTable();
}```
PlayerInteractAtEntityEvent#getClickedPosition() returns the exact position a player clicked on, right?
table is reserved
i think that there's something wrong with "f"
wait wha
where do i need to edit the keyword ?
i see two errors
public void createTable() throws SQLException {
String sql = "CREATE TABLE IF NOT EXISTS table (\n"
+ " number integer PRIMARY KEY,\n"
+ " color text NOT NULL\n"
+ ");";
Statement st = this.connection.createStatement();
st.execute(sql);
System.out.println("Successfully created a table");
}```
this is the createTable function
and that gives an error?
it gives an error when i start the plugin and when i stop the server
the first one says throws org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "table": syntax error)
the second one throws Cannot invoke "dev.relismdev.rcoresync.MySQL.DataBase.closeConnection()" because "dev.relismdev.rcoresync.RCoreSync.sql" is null
it reads it assql create table if not exists table (number int, color text not null)
and it causes an error when disabling cuz onEnable failed and left some fields unitiialized and thereby causes a npe
it reads it in all lowercase ?
no 'table' is a reserved keyword
which means ?
change the damn name
ye, probably want to give it a meaningful name
mainTable
lets test
IT WORKED
GOD I LOVE YOU SO MUCH DUDE
I WANNA KISS YOU EVERYWHERE
lets not
lets not
How can I stop my item frame from being rotated
interact event ig
PlayerInteractAtEntityEvent doesn't seem to work if I cancel
are you sure thats the event?
It's getting called
what are your checks
Question: When I create a ScoreBoard like this and set it a player how would I remove it from the player?
Scoreboard sb = Bukkit.getScoreboardManager().getNewScoreboard();
Objective obj = sb.registerNewObjective("GOG", "score");
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.PacketContainer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.*;
public class createentity implements CommandExecutor {
private String Entity;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
if (sender instanceof Player){
Player p = (Player) sender;
PacketContainer packet = manager.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
packet.getIntegers().write(0, p.getEntityId());
packet.getUUIDs().write(0, p.getUniqueId());
packet.getIntegers().write(1, 44);
manager.broadcastServerPacket(packet);
}
return false;
}
}
Hello everyone ❤️
I was told im doing this wrong because im assigning a player instead to things like the UUID, im brand new to packets. what should i put instead?
What did "they" exactly say?
Just set the scoreboard to a new one to reset it iirc
https://wiki.vg you're packet looks cursed after further inspection, lemme check
A) You should not use the player's UUID for this
B) This packet is not complete at all
@wispy flicker
I am bad at maths, so I need some help with: if I have a number between a and b, how can I put it in the range c to d?
Example
a = -4
b = 4
c = 0
d = 1
how can I convert like n = 2 into the range?
So you have a <= x <= b and c <= x <= d and you want to merge that?
not exactly
oh i know its not complete
so i just shouldnt bother with the UUID at all?
You can use a random UUID, but it may not be the player's UUID given that it is the player's UUID - not the UUID of an item
ah
I have a number which is between a and b, say 0 - 10 and the number is 5, how can I convert it to another scale such as 0 - 1 (in this case it would be 0.5)
do all of these in the list need to be filled?
The 0 - 1 scale is an example, I kind of need to make it work on more than 0 - 1
likely yes
x = (n - a) / (b - a) * (d - c) + c I guess
Not only likely but definitely
Thanks, I'll try it and let you know!
I typed it out without thinking too much about it, but it should be right unless my brain fails me. Doesn't look wrong to me at least
It seems to not be 100% exact (tried 0-128 range as a test and min is 16 and max is 112)
Still closer than what I could come up with lol
how could i hire someone to make a plugin with a custom boss
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
with what kind of values
0-.9
give all five numbers so I can troubleshoot
I'll give the ones I am testing with
Trying it out with
a = 0
b = 10
c = 0.5
d = 1
n = 5
Results in
x = 0.75
Which would be correct
a = -3.75
b = 3.75
n = 0
c = 0
d = 128
I get x = 64. Did you use the correct signs?
i.e. you should be evaluating (0 + 3.75) / (3.75 + 3.75) * (128 - 0) + 0
its doubles remember
ill bump my question, how do i check if player looks at light block?
what do you mean "light block"
the light block
whats one of those
huh, pretty cool
invisible block that emits light at a customizable level
raytrace from the players eyeLocation
How do i get the client version a player joined with?
client version as in , 1.17.1, 1.18.2 or client brand
how do iadd stuff to the extra attributes of itemstacks
trying to setup visual paragram for design practice and studies
not going great
installed plugin into eclipse
For Java?
now idk what is is next
yes
what better?
.
Yeah why do you need that
Your class requires Visual Studio plugin? 
no no visual paragram requires a plugin on ecplise
No just
We used Netbeans in school
Delete Visual Studio you don't need that
so I had to install the visual studio plugin on eclipse
Did you guys do Swing
That's still better than Visual studio
Netbeans is fine for Swing and Swing only 
Yes
Oh LOL
I chose to use two IDEs for my project... Netbeans for the swing menus and Intellij for the rest
brain error
You made the right choice
so like visual paragram
I mean from their website it looks like all you gotta do is click Eclipse Integration and it does everything for you
I mean I don't even really know what Visual Paradigm is
I'm just basing this off what their steps say on the website
i am trying to make a function that takes in input a parameter, and it must return the value in double quotes. I found out that to do that in java you need to use this syntax : java String foo = "\"value\"";
My question is, is there a way i can take the parameter by input and put it instead of value ?
for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
}
}```
makes a square of red wool but i just want to make it a border of red wool, how would i do this
that doesnt help...
should i look for better alterative ?
like :
public void function(String input){
String foo = "\"+ input + \"";
}```
doesnt seem to work
function that takes a string as input, and returns the string double quoted
String foo = "\"" + input + "\""
will output "input"
thanks
public void function(String input){
String foo = "\" + input + "\";
}
thank you
Strings don't use references when asigning them anew.
you need a return, you cant reasign a string, if I remember
misplaced "
doesnt altering a string also change its reference, cause they are immutalbe?
oh yeah sure, i forgot the return
public String function(...)
yeah it is not
public String function(String input){
String foo = "" + input + "";
return foo;
}
org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_NOTNULL] A NOT NULL constraint failed (NOT NULL constraint failed: mainTable.color)
SQL thinks the string from the function is null ?
it doesn't like "\"
public void pushData(String index, String value) throws SQLException {
String formatIndex = "\"" + index + "\"";
String formatValue = "\"" + value + "\"";
System.out.println(formatIndex);
System.out.println(formatValue);
String sql = "INSERT INTO mainTable (" + formatIndex + ")" + "VALUES (" + formatValue + ")";
Statement st = this.connection.createStatement();
st.execute(sql);
}```
this is the function that pushes data and it throws `org.sqlite.SQLiteException: [SQLITE_CONSTRAINT_NOTNULL] A NOT NULL constraint failed (NOT NULL constraint failed: mainTable.color)`
how do i set light level of light item?
you can use javafx with it too
sql syntax :/
maybe discord format is weird
you still didnt read the link i sent
use a try with resources
i did, i am trash at reading docs
any1 here got an idea on how to efficiently get X blocktype within a region?
like i got a cuboid and have to get a list of all the blocks of a certain block type.
I have a function that replaces hex colors:
fun translateColors(str: String): String {
if("&#[0-9a-f]{6}".toRegex().containsMatchIn(str)){
var parsedStr = str
//println(str.replace("&#([0-9a-f]{6})".toRegex(), "\u00A7$1"));
for (x in "&(#[0-9A-f]{6})".toRegex().findAll(str)){
parsedStr = parsedStr.replaceFirst(x.value.toRegex(), net.md_5.bungee.api.ChatColor.of(x.value.slice(
1 until x.value.length
)).toString())
}
return ChatColor.translateAlternateColorCodes('&', parsedStr)
}
return ChatColor.translateAlternateColorCodes('&', str)
}
It was working on my previous works but I can't use it with 1.19, it just doesn't replace hex colors anymore. Did anything change about Hex colors in 1.19?
yes :d
but I don't have any problem with Kotlin, I believe the problem is about Chatcolor.of
ChatColor.of("#0f&e84") or smth would work right
\\
i thought that you need to convert hex to rgb for it to work
works for java
No hex works
"\\ " + input + "\\ "
for(int z = (int) e.getBlockPlaced().getZ() - 11; z <= (int) e.getBlockPlaced().getZ() + 11; z++) {
if (x == e.getBlockPlaced().getX() - 11 || x == e.getBlockPlaced().getZ() - 11 || x == e.getBlockPlaced().getX() + 11 || x == e.getBlockPlaced().getZ() + 11) {
e.getBlock().getWorld().getBlockAt(x, e.getBlock().getY() - 1, z).setType(Material.RED_WOOL);
}
}
}``` i want to make a border of red wool but this only makes 2 lines
Is that the bukkit chatcolor?
i did by adding x == e.getBlockPlaced().getX() + 11 || x == e.getBlockPlaced().getZ() + 11 but it didnt change anything
nah, md5 one
well you got some weird math going on here
?
ok, to get two lines you only need to increase on one axis
so increase 1 axis to get 1 line
and then on the other axis increase that
gets you the second line
now, all you have to do is the reverse of what you did with the first, but you can do it at the same time you do the first ones since its just the inverse
You know the animation that you get while you are mining a block but before it is broken?
As in the block being damaged?
What is that even called
Idk how to google if it's possible to set it
also you are doing unnecessary casts to int
yes
What's it called?
what a good java flowchart manager and source generator?
declaration: package: org.bukkit.event.block, class: BlockDamageEvent
Is there a good like API or library for inventory management I can use
or like
GUI stuff
correct
I just added debug points and now it works lol
PreparedStatement st = this.connection.prepareStatement("INSERT INTO mainTable (?) VALUES (?)");
st.setString(1, index);
st.setString(2, value);
st.execute();```
This wont work why ? first "?" contains index, and second "?" contains value
throws : org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "?": syntax error)
by replacing the "?" with the vars, it should look something like : INSERT INTO mainTable ("color") VALUES ("Orange")
I would use database ORMs for security etc
ORMs ?
not sure why you are asking why it contains index and value unless you are copying this from somewhere else and don't understand it at all
I am going with the latter
i want it to take in input the column and the value to insert, and insert the value in the column
the statement INSERTS INTO mainTable (column) VALUES (value)
the first "?" is the column and the second is the value
last time i checked, you cant have () in sql statement(s)
looking for someone to update a plugin for me. will pay, depending on price
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
INSERT INTO TABLE_NAME (column1, column2, column3,...columnN) VALUES (value1, value2, value3,...valueN);
this is the syntax i think
as you can see, there are parentheses for the column and the values to insert in the table
I'm not sure about you can use setString to set indexes
vaule(?)
use ' ' around your question marks
is there no way i can specify the column with a parameter ?
throws org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (table mainTable has no column named ?)
generally you don't insert onto a specific column like what you are doing
now that I looked at what you were wanting
so how you would do it, is you would make all other columns to insert into null values except the one you want to add to
unless you are trying to update a column
so i need to know how many columns i have beforehand ?
not sure why you wouldn't know before hand as it would be your DB
i need N columns, every column having an entry
and i need a method that takes in input a column and the entry i need to put in, and puts the entry under the desired column
that to me sounds like you are trying to update a cell in a pre-existing row
yeah
PreparedStatement st = this.connection.prepareStatement("INSERT INTO mainTable ('" + index + "') VALUES ('" + value + "')");
this worked out really well
using 'index' and 'value'
because i need to make so many in the way
sounds like you need to learn db design principles if you have no clue how many columns you are going to have
no, respectfully you dont know what the project is about, and i have no idea how to explain it to you without making a paragraph
NEVER do that
how do i prevent that ?
using settring :d
i did it and it didnt work
you are also getting index from user too?
no, only value
Hello, I'm, getting this error all the time and I don't know why, everything looks as the other plugin I did and it doesn't works.
ava.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "mrstreeet.simplesetspawn.SimpleSetSpawn.getCommand(String)" is null
at mrstreeet.simplesetspawn.SimpleSetSpawn.registerCommand(SimpleSetSpawn.java:38) ~[SimpleSetSpawn-1.0.jar:?]
at mrstreeet.simplesetspawn.SimpleSetSpawn.onEnable(SimpleSetSpawn.java:27) ~[SimpleSetSpawn-1.0.jar:?]
It's giving me error in this lines:
public void registerCommand(){
this.getCommand("simplesetspawn").setExecutor(new MainCommand(this));
}
@Override
public void onEnable() {
Bukkit.getConsoleSender().sendMessage(name + ChatColor.GREEN + " It's now working correctly!.");
registerConfig();
registerCommand();
}
Anyone knows?
then do the index like that
and use setString for values
setString doesnt work, it throws errors
String sql = "INSERT INTO mainTable (?) VALUES (?)";
PreparedStatement st = this.connection.prepareStatement(sql);
st.setString(1, index);
st.setString(2, value);
ResultSet result = st.executeQuery();
@quaint mantle
is it in plugin.yml
np lol
Why executequery when insert action won't return anything?
You probably wanted executeUpdate
I'm new coding so I'm having this stupid errors
it returns success or not
it throws org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "?": syntax error)
executeUpdate is for updating rows not inserting
im pretty sure the only way to specify the column is by using this INSERT INTO mainTable ('" + index + "')
Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
did you remember to add command into plugin.yml?
too late
It returns resultSet, which is object wrapping generated result from query
yes you can use the ExecuteQuery for updating, but it is more appropriate to use ExecuteUpdate() for such things
also reffering from docs
Even though we are inserting, a result is still returned to indicate its success
@mystic terrace just wanting to know
how would you check if its success ? 🤔
because MySQL returns an int upon success of inserting
executeUpdate returns int, not executeQuery
ExecuteQuery returns whatever MySQL returns
doesn't matter if its an int or string or a list
and how would you check if its successful later on (just curious, nothing personal)
anyways I was looking and you can't set the column using a ? it would appear
Yep I did, I'm just learning and making this mistakes it's normal
had to fix every tiny bit
declaration: module: java.sql, package: java.sql, interface: ResultSet
do spigot have a flowchart?
curious
would be interesting to see the link between classes
In commands like this:
}else if(args[0].equalsIgnoreCase("reload")){
plugin.reloadConfig();
p.sendMessage(plugin.name + ChatColor.GREEN + " Plugin reloaded correctly!");
I have to put return true/false; always? Because I don't know at all the use of it.
its a boolean so you need to return true/false, true if its valid and passed through false will send the usage defined in plugin.yml
yeah
if your sending a message, return true. If you want it to send the usage on the command in plugin.yml return false
Is there any way to get the autoincrement id when i insert a row in mysql?
yeah one second
If you are returning a message:
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length < 1) {
sender.sendMessage("You must have 1 arg for this command to work!");
return true;
}
}
plugin.yml looking like
commands:
mycommand:
permisson: my.permission
if you want to return the usage in plugin.yml
the class would be
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (args.length < 1) {
return false;
}
}
and plugin.yml would be
commands:
mycommand:
permisson: my.permission
usage: "/<command> arg1
and it would return usage
aaaaa
okey okey
I would take a ss of it
thanks <3
Btw, what it's better for optimization
having one command per class or creating commands in the same one
imagine I want to make a /spawn and /tp command
ive got no idea, most people do 1 command per class
guys how can INSERT into a column, but UPDATE if it exists ?
like if there is no value to insert it, but if there is anything to overwrite it ?
sendTitle it's the class for displaying messages on the actionbar? I can't find it actually
there is on conflict or something like that
you can't use rs.next()
error is thrown before rs.next
on executeQuery line
on conflict ?
imagine i have this db with only one row and N columns
what if, in the same row, i want to insert under one specific column, but if there is already a value to update it ?
imagine i have the number column and color column, i INSERT "red" under the color column, then with the same method i want it to be white instead of red
but i dont want to make a new row, i want to keep the same row with only the color entry updated
how do i give sql an always true condition ?
what
you would use replace for this
if you wanted to insert but ignore duplicate
it just creates a brand new row and i dont want that
you would instead use INSERT IGNORE
i want to insert if it is empty, and update if there is a value that gets overwritten
what db?
Sounds like you didn;t set a unique/primary key
i want to UPDATE regardless of the condition
number is the primary key
sqlite
then it all depends on what type of DB you are using
sqlite, a .db file
sqlite have on conflict clause
SQLite supports on conflict
then use INSERT ON DUPLICATE KEY UPDATE
insert into Members(discordID, apiID) values (?, last_insert_rowid()) on conflict(discordID) do update set apiID = last_insert_rowid()
example of on conflict ^
sqite is like
INSERT INTO t1 (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1;
that is not sqlite syntax
INSERT INTO (column) VALUES (value) ON DUPLICATE KEY UPDATE column = value like this ?
pretty much, what that will do is insert what you are wanting, and if it encounters something already existing, it will update it to whatever you are wanting instead
INSERT INTO mainTable (column) VALUES (?) ON CONFLICT (column) DO UPDATE SET column = value
so both work the same ?
however that is for mysql, if you are using sqlite though you will have to use what Goksi showed
yes, "column" would have to be primary key or unique
and what if i want it to be any column from the db ?
I guess implementation must have changed somewhere with ExecuteQuery() because previously you could use it for insert statements lol
didn't mean to ignore you on that
but thanks for testing that out 🙂
its alright ahahahah i was really confused so have to test it out 👍
? :(
just define column as primary key or unique when creating table
you really need to re-structure your DB design
any1 here got an idea on how to efficiently get X blocktype within a region?
like i got a cuboid and have to get a list of all the blocks of a certain block type.
i want a single row horizontal db
or am i just going to have to loop over every single block
one single row with N columns, and i need the method to insert under a column if its empty, otherwise overwrite it with the new value
there should not be a scenario where you don't know before hand how many columns or tables you are dealing with or have no clue what the Schema is unless you are coding for foreign DB's
i mean, if its single column, what is point in updating on conflict
it will have hundreds of columns, i just need a method that takes the column name and the value to insert as input, and insert if its empty, otherwise update
its multiple columns and single row
tbh you seem to not understand what column is
if this how you are making your DB layout then mysql is not what you want or sqlite
lol what are you on
mysql is not designed to have a single column with an insane amount of columns
in fact you will probably reduce its performance or efficiency in this manner lol
and with sqlite, your queries will most likely take longer
someone has to google how databases work
believe it or not, mysql and sqlite actually do have a limit in how many columns a table can have
:o
seems he is confusing column with data inside of it
or maybe confusing row with column?
something is happening anyway 😄
idk, regardless their layout if that is what they are wanting, goes against SQL principles
i know what a row is, what a column is and what the data is
just dont assume people are complete idiots ig
it sometimes gets offensive, you never know
sorry, didn't mean for it to be offensive
kind of hard to do that when you are designing your DB in a fashion that actually hinders performance and goes against what a RDBMS is for
missclicked the emoji lol
im getting sleepy from this coding shit
ive been on this single method for hours now, im losing hope lol
all I am saying is maybe you might want to look at some other DB system for your layout other then SQL
unfortunately sqlite is all i can use
i already use mongodb
then why are you bothering with SQL?
i am trying to make a web-based dashboard which backend allows the user to edit the plugin's config values from the frontend
sqlite isn't going to allow that
when the user updates the config values, the values get pushed into mongodb, which then clones the data into a local sql table, which is used by the plugin to work properly
why clone it?
wtf
you have a mongodb already which the plugin could just use
i dont want the plugin to use the data directly from mongo, but instead use data from sql
because in case they pirate my plugin they would just need a db and they could change data by hand easily
what?
this way they would have to reverse engineer every single method and command of the plugin if i use sql
the dashboard would become useless as everyone could just update their data from their mongodb dashboard by hand
so you want to control everyones plugin?
if the plugin uses sql, they could not change the data as easily
no, as both the sql db and mongo db are the user's
i just want to make it impossible to update the data by hand as that would make it easy to pirate
im really confused about why two storages are needed
and they can change the data however they please if the DB's are under the users control
if the plugin uses sql it would be way harder for them
no it won't
^^
I don't even need a plugin to change data in a DB
DB Browser when
I can just directly connect and look at it
World world = Bukkit.getWorld(worldname);
Chunk chunky = world.getChunkAt(x, z);
if(!(chunky.isLoaded())){
chunky.load();
}```
I am getting a "may produce NullPointerException" how can I get rid of it
id love to see how many sql injections i can do on public plugins :)
did you think these DB server software didn't allow the ability to inspect and change data or something?
have fun
not that
tho i dont think a plugin could use mongo data as a config
it can
ill try anyways, i just find it weird
do i need the plugin to reload everytime a change is made or is it like hot swappable ?
But, I don't understand where you got the idea that using a DB would stop someone from doing something
it made sense in my mind lol idk
my plugin is using mongo too
^
i dont need a relational database for whatever reason
good, mongo is really nice
ill just drop the dual db thing then
thats what you say
wouldnt i need the data from mongo to be put somewhere for the plugin to be used anyways ?
gave up on my reflective pojo mapper
You could store it in the plugin itself?
in the server's memory ?
well configs are not going to take up massive memory if that is what you are worried about
i would need some kind of socket that alerts the plugin to reload each time a change is pushed from the frontend
so every single variable would need a query ? thats what i think ive understood
So the way you would do it is like so
when the plugin starts, to store in variables all data, or just download one big Document and get the data from there idk
you create an entry that is a boolean that gets set when a change from front end happens
the plugin has a task that checks every so often that entry and if its set, pull the changes and reset that entry
is that frontend per plugin instance?
it would have to be unless they plan on controlling everyones plugin lmao
nope, one laravel website hosted on my servers
nope, handshakes
i cant see their mongouri
gl implementing that
that type of system isn't one that will pass the rules I don't think
@vagrant stratus you are the expert here
should probably go to bed, 12pm
i mean, a lot of services have control over their users data
a plugin should work offline in all circumstances right
ones that are not hosted on spigotmc maybe
i am not doing mischevious stuff with data that looks like "message" : "You are not allowed to break blocks!"
but if you are putting it on spigotmc, all plugins follow the same rules
otherwise it gets evicted
im planning on selling the plugin and the authkeys directly on my website
Yea, your idea's stupidly easy to get around lmao
This is not allowed on spigot, licenses of any kind are forbiddden
keyword "on my website"
In java
create a reflective pojo mapper
What's that
Yes, but if you upload to spigot that's gotta all be removed lmao.
As for your remote DB idea, that can be pirated quite easily. It's just a matter of getting a working copy and the info needed to connect, and then pulling all the tables and shit from it and re-doing it to be local
Damm imagine not having this already
well good luck changing every single entry every single time and reloading every single time you change an entry from a mongodb database that can only be initialized if you press a button on my own frontend
and if you link to your site via spigot, the resource will get removed
tldr; Your resource will most likely be rejected and/or removed
mine was too less flexible
Idk how flexible mine is I barely use sql
then i have no idea how to do it
Can't
Which is
code to map custom types to a database table
some of us here, actually know how to change it to where it won't do this, as well as we don't need the DB to know what it needs. We can just look at the code to see what it requires instead.
You're quite SOL
ill just do it, if someone's so desperate for my plugin that prefers rebuilding a mongodb schema every single time my plugin updates instead of paying 10 bucks good luck to them
Ooo
Fully reflective? No annotations?
Sure, but any resource on spigot linking to it will get removed @quaint mantle
does anyone know how to launch a player in a boat properly? It seems like boats are very limited to how velocity and teleporting works.
I've kind of done it, but sometimes it doesn't launch the player all the way up into the sky and launches them half and then glitches straight back down.
Vector currentVelocity = /*entity.getVelocity*/ new Vector(0.5, 0, 0.5);
boat.setVelocity(new Vector(0, 0, 0));
Bukkit.getScheduler().runTaskLater(BoatRace.getInstance(), () -> {
boat.setVelocity(currentVelocity.multiply(power).setY(1.5D));
}, 2L);
It works just fine if you're in a minecart by just adding a Y to the current minecart velocity. But unfortunately im creating a launchpad for a boat race.
I was thinking maybe i could trick the player they're riding a boat when they hit the launchpad, and make the server know its actually a minecart until they land again
problem is, you can't use spigot services to sell this or advertise it
mhm, got that. Ill make my own marketplace in laravel then
That can't be advertised either 🙂
ive never planned on selling this on spigot
like you are free to sell stuff on your own web sites and stuff, just can't use spigot services to help do so
never planned on advertising it as i know some of spigot's rules
got it lmaoo
You also severely underestimate just how easy it is for people to pirate shit, even more so if they have read AND write access to the DB
just remember Java was never designed to protect against reverse engineering
what if i just host my own mongodb instance and every user gets a document ?
Can't they just get the db credentials and log in?
db is propietary
yeah i noticed
They can still DL their copy of the document lol
atleast, the db is the user's
Pretty much, yea
if you really want something better, you would make a restful API that requires the user to create an account to gain api endpoint access because it needs a keyid for auth
as long as one can read the database they can just take whatever they've got access too @humble tulip
i have a rest api that generates keys on purchase, users must login with discord and provide a valid mongodb uri
it won't stop pirating per-say just more annoying to do so
the backend then uses the uri to create a database that will store the data that gets read by the plugin and updated by the frontend
which can then be pirated easily lol
any1 here got an idea on how to efficiently get X blocktype within a region?
like i got a cuboid and have to get a list of all the blocks of a certain block type.
any plugin can really be pirated really tbh
would love to see how many databases of plugins that could be corrupted by injecting some sql code
or am i just gonna have to loop over every single block in the region
oops wrong reply
iirc as long as you use prepareStatement then you're fine
ill just make one big db, the plugin will get the data via api requests and download documents from it with a simple http request
@quaint mantle can still make those calls manually 🙂
mye thats what they say, dunno about the internal impl tho
the api will need a valid token for the requests to take place
All you need is to reverse engineer a single working plugin and then create a toolkit around that
@quaint mantle
the plugin works via one api call onEnable that gets the data from my backend
Doesn't mean shit
declaration: package: org.bukkit, interface: Chunk
learn to read
Imagine if vault releases an update to drop databases from other plugins
dont premium plugins on spigot need to work without an internet connection
you just rip the needed code out, throw it in a separate java project, and do as needed @quaint mantle
i would guess so?
thats returns a boolean tho. not their locations
the api idea makes sense tho
Yes but it's used in many servers
Of course, but it can still be pirated kek
so it all depends on the impl
If the dev decides ti go rogue he can mess up many servers
fuck its already that late
its a plugin, but doesn't have any functionality apart from an api
like you cant pirate it unless you literally hack my api into giving you the data without the need of a fresh token
Reverse engineer backend via trial/error, modify plugin, leak plugin
Where's your pogo mapper
Again, all you need is one valid plugin that allows generating tokens lmao
So i can look at what u did
generating tokens ?
didnt finish
Fuck, just buy like 10x of them and try to make a token generator
Can i see ur progress?
brute forcing i think they mean
nvm
Keygens aren't new at all
Np
tokens are generated when you purchase my plugin, they are not stored in frontend or in the plugin itself
ill probably forget otherwise
Sure, but the client needs it to some degree for a plugin to function
and that some degree is just enough for pirates to do pirate things
im outta here, gn yall
the client needs a discord account and a valid token
night
gn
Not too difficult for a pirate to do
@humble tulip tag me in a minute so ill se tmrw
for a pirate to login with discord on my frontend ? sure
To get a valid token after that process? Also easy
they can login, but unless their discord account has a token linked to it they can see nothing but a page asking them to buy a license
You'd never even know who the pirate is lmao
bro
how can you pirate something that needs a literal TOKEN that is verified on an API they have no access to ?
By first buying the product 🙂
unless you have a token you cannot read or edit the DATA
you can pirate everything lol
one key per client
I can even pirate US classified documents
Buy the product, generate token, pirate everything needed to make a non-token based plugin
it is ip based lol
yeah sure
for a minecraft plugin
again, if thats worth less than 10 bucks then good luck with your self hosted clone of my api lol
The piracy scene pretty much survives off bragging rights lmao
well you didn't say you needed their locations lol, best way then is to grab a chunksnapshot or snapshots if more then one chunk, then check within your boundaries if your block type exists
recreating an entire api just for a plugin that is worth 10 dollars
As a "Fuck you, I can do it"? I can see a pirate being willing to do that lmao
and recreating it every time the plugin gets updated or be stuck in an outdated version
Pirating groups have done more for less lmao
again, if thats worth less than 10 bucks to them, good luck
why would they need to re-create it?
its only configs
and good luck on doing it every time i update it
And? They just look at the change log from that point forward and go from there
when minecraft updates the plugin stops working for the newer versions
Not too difficult to create a tool just pull everything
they don't need to re-create it
i need to doodle this shit
gimme a second
not sure why you believe the code can't be changed? o.O
then i go to sleep cuz im dying
let me doodle master.
lmao, I think they just assume their ideas fool proof like the thousands of others @wet breach
sorry- imma just bump this
Only way it's 100% fool proof is SaaS that can't get any code client side
I mean if you want to know how sophisticated it can get, they don't even need to decompile your plugin to change how it does something I mean a bit much for such little gain but still
^ I have a tool specifically to deal with DRM attempts just because people think their idea solves piracy entirely lmao
I get a lot of enjoyment showing just how shit their idea actually is
My brand new tool solves piracy I call it
lol
Coping
I don't leak shit, but I'll gladly render your DRM/License system pointless just to prove a point
to further add to this, there is some of us here who actually take enjoyment in breaking peoples obfuscation as well XD
so far our fastest time was like 2-3 minutes
the thing is, you've been here for almost an hour trying to make me look dumb when i was just asking for opinions on how to handle this, hope this (and the slaving yourself to not pay 10 bucks) make you feel like a better person !
How do you break obfuscation?
really? i would have never known tbh
Burner account and $10 just to prove a point? No real downsides besides being out 10
some people use obfuscation to like try to super hide everything where it turns everything into |
there are ways to reverse that
we even had someone use some encryption too
also, the sole fact that you preferred spending 1 hour of your time trying to make me feel and look dumb with arrogance instead of like taking 10 minutes off your being the final coding guru to help me figuring out a secure way to license my plugin shows what your priorities were right there
You can't
think the funniest was when someone used a ceasar cipher
That's the thing
There's no "secure" way, license systems are broken all the time
you're telling me there's not a single paid plugin on spigot that is not pirateable ?
They're all 100% pirateable
yeah pretty much
Including those on MCM and PolyMart
well, ill take this as a challenge, ill figure something out in the following weeks
goodnight for now
Java was never designed to be safe guarded from reverse engineering because Java was designed for more server side then client side
Quick question is it possible to make an explosion enchant for a sword? If so what will help with this task?
i would not surprise me if someone has every plugin on spigot in a db (other than md5 and whoever else can access the spigot db)
kek, good luck. Reverse engineering java's pretty much the one thing I'm good at besides coding in it
you have no idea of what the functionality is like in my plugin, you're just assuming that i dont know what im doing (average programmer on discord)
optic
Yea, me.
well
let me add you, when ill figure something out ill let you try to get around it, deal ?
Just think about how many AAA game companies spend to make their code uncrackable. Its still cracked 5-6 days after release.
who isnt staff here then
lmao
no of course not i do not know what you're doing but you're seriously trying way too hard too program an "anti-pirateable" plugin
pirating is a real issue
Excluding old versions, paid stuff, external links, and some other stuff I've got 34k+ files @remote swallow
then dont assume that someone's software has no good functionality and go on with your day, thanks
i just thought, how big would spigots db be
And people spend millions and 1000s of man hours on it and have teams of 100s to 1000s, and still get bypassed/leaked
My current one's less than 10 GB iirc
dafuq
weird weird industry, enjoyed the talk tho
pirating is not an issue
Spigot's is probably much larger
i never said it had bad functionality, i just said you could spend your time adding better/more functionality for your users
yeah
those who pirate were never your customer to begin with
bad mistake some premium developers on spigot make ^^
optic do you know how many plugins are currently on spigot
you were making fun of me lmao
Not really, they've been attempting to entirely solve it for literally decades, including but not limited to licenses
Quick question is it possible to make an explosion enchant for a sword? If so what will help with this task?
yes, and i think everyone else in this chat is also doing the same
look at your profile picture blud
i feel like 500k seems reasonable but then there is not enough people for thati would expect
there was one day we calculated this because something something hard drive space and how much space spigot requires came up
1970s, roughly. Excluding non-electronic based pirates
please, i would love for you prove our points here though
there is not 500k plugins on spigot
and profile picture has nothing to do with the topic
yeah
you're the irl version of the 🤓 emoji
thats my point
if I remember right, it was like somewhere near 100k at most being on spigot
means he has nothing less to argue thags actually productive
@remote swallow You've got the resource counts, do the math lol
or not more then 100k anyways
so you're making fun of people who can't see properly lmao 😂
also idk whos that chick in the pic but yall made for eachother
so cliche
could anyone help with this question?
im making fun of your being a literal kid on discord acting like he's better than me while looking like that
this is just math and tired brain but idk if its correct but ill say theres 30k plugins, and each plugins has a rough ~10 updates with an average size of like 6mb, thats what 1.8tb?
Yeah but you can't add it to the enchant table that stuff is hard coded
the size is less then 1tb currently to store plugins
Again, you're making assumptions who ever stated i was better? I never said anything to do with anyones skill level, i stated maybe you should focus your time on something else
also the glasses aren't the issue :)
ik, I was gonna try and make an inventory gui that helped with that what would I need to write for this to work
ya can actually. but it will just not display the name ;D
Keep your comments respectful and appropriate, otherwise I'll gladly time you out
on average, plugins are not more then 2mb
you stated everyone is making fun of me after telling me how i should work on my project when nobody asked your opinion
atleast, not the only issue
Think thats what he meant but good point
yeah i was just guessing because i dont have the patience to look at a load of pages to get a rough average
but we did calculate at the max a plugin could be for all plugins, and you wouldn't need more then a single TB harddrive to fit them all if I remember right
@quaint mantle
just responding to provocations, id gladly stop if you warned him aswell
I wonder if Discord implemented quiet time
theres 58,119 spigot plugins on the website, if they are 2mb each thats 1.16tb
ah right, then it was like 3TB needed
and once again how is that anything to do with your skill level. nothing, we're just saying all current plugins on spigot are 100% piratable and i wanna a functional plugin from you which isn't piratable thats all im saying :)
makes inappropriate java method
anyone know how to cancel async task?
sure thing blud, im going now
good night yall
I see nothing about your looks/GF/etc.
You're the only one saying that sort of stuff
my bad then
goodnight
yeah, that drive would cost like 200 US?
either grab the task id when you create it and store it for later or use the cancel() method inside the task itself
Lmao I'll just re-create it instead, much easier
I recently bought a 6TB hard drive for like $100 something
so probably $70
Ok thanks
would it be surprising if spigot stored this on a like 8tb m.2 drive directly in the server
scables the plugins
update me
Most likely not, probably using an external DB/dedi, how exactly I couldn't tell you
I only have XF2, not 1
yeah would guess so
Cost-effective storage upgrade for laptop or desktop computers Store all your games, music, movies and more with up to 4TB of storage SATA 6Gb/s interface optimizes burst performance Seagate Secure models for hardware-based data security Instant Secure Erase allows safe and easy drive retirement,...
I wasn't too far off on price
lol how
would i be correct in saying spigot follows 321
3 copies, 2 different types of media and 1 backup elsewhere
Does remind me though @remote swallow that I need to think of how I'm going to handle the eventual situation of my free tier VPS being filled up lmao
Most likely years before it happens, if ever, but you never know 🤷♂️
Don't worry the Benefactor has you covered for this
it would also run raid i would guess
I still need to look at my available options lmao
that is fine, doesn't mean the benefactor/sponsor doesn't have it covered 😛
spigot if it was stored on 1 drive, running a db on site with no backups: ah shit spigots dead, drive died
I wonder how long I could realistically survive off the free tier VPS if I just moved the attachment storage to a separate server from the start 🤔
well I do know it has a raid setup and I am pretty sure DB server is separate
Current backup's are only 46.1 MB, and it's like 250-ish GB for a free tier or something like that iirc
I wonder if oracle says how much space is taken up 🤔
hey optic fusion if i misuse inventory holder in my prem plugin will it get denied?
just run the du command or whatever it is
would hope so lol
Once I reactivate my phone I might delete my current oracle account and re-do it all proper though lol
that reminds me, i still havent paid the money in to see if i can get oracle free tier with debit card
i think it wont work with my card because it has like 24p on it
and they do temp charge im pretty sure
why would what?
Uhm they've probably seen much worse
.getTitle() probably 😭
@vagrant stratus ^^
Yea, last I remember it wasn't much though
Probably not, but something else might get it denied though
prob like a dollar or something
Less I think
why do you say that like its gonna get denied😭
i just thought of something i dont know how my brain hasnt procced before, you have most likely scanned the only plugin i have on spigot
Cause it's true, there's a bunch of requirements that have to be met lmao
public
yeah it meets all of those
Then it shouldn't get denied
Definitely gonna have to look into ads and such though @wet breach
Gotta be able to pay for the domain and shit lmao
procrastinating is the most productive thing I do
i can agree with that
I highly doubt I'd get enough from other sponsors or donations for it to be self-sustainable lol
one of my friends wanted a plugin and i spent all day trying to figure out how i could convert itremstacks to json, went through all the different options before i gave up, swapped to a yaml file and i havent touched it since
must suck to get banned and lose all access to all resources
Isn't nbt json like?
no idea
imma bumo this again
i was able to convert an itemstack to b64 and save it but then couldnt read it or parse it back to itemstack
then you did it wrong I guess lol
yeah probably
https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ItemSerializer.java this is how I do base64 <> itemstack
could you have told me that earlier smh
sorry lol
its fine lol
already swapped from json to yaml because it works and i dont need to spend 9 hours googling while my pc shits itself because bad computer
check out the toBase64(ItemStack) and fromBase64(String) methods
oh ok
i gave up around the time when i couldnt read from json
yaml is a superset of json just fyi
probably
as long as she doesn't dislike you
I feel like I'm that one weird guy who will never understand Christmas
ja ich I hate it too
oh
Can’t forget about this guy
whats ja ich in english
"Yes I"
yes i i hate it too
I tried to type into a twitch chat but accidentally typed here
I don't hate Christmas just don't get it j feel very indifferent to it
I fucking hate it
because I always have to go to my parents and that's always... erm... not so nice lol
Lol
who can help me get a plugin its quite easy but i need help because i dont know how to make plugins
no you don't :)
you want to make a plugin or commission someone to make one
went to make my passport today because my parents want to travel for christmas
jokes on them I ain't travelling
where are they going to?
you could prob
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Anyone knows how to prevent this type of spaces?
that's there by default
only way to prevent this is to send two messages
brub
not my fault lol
#
Because when I put them, once the plugin loads it doesn't appear
wdym with "doesn't appear"? Usually, you only save your config.yml once
so if it already exists, it will not get overwritten everytime
if you use save() on older versions, comments will get removed
usually you just do saveDefaultConfig()
saveDefaultConfig() should save the file exactly as it is
so instead of saveConfig() should be saveDefaultConfig()?
kinda, yeah
