#development
1 messages · Page 110 of 1
Invalid how? As in the wrong type?
If you do for eachs loops, will they always go in the same order if you are looping over the same array/list?
Oh yeah that's different
Because you're technically dealing with a map I'm guessing
Yeah
The keys returned by the map won't always be the same order iirc
So well i have this ticketembed, and there are like catagories you can choose. First i need to loop over the catagories for the names and the emoji's and later i have to add the emoji's to the embed
How are you handling it currently?
LinkedHashMap does keep order
Does that order continue on to a keyset though?
I guess
Are persistentdatacontainers in 1.18?
I looped over the keys and put them in a list, then when i needed to loop over the values i used the list
Or should i use a LinkedHashMap
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
Oh that's dope
Probably a linked map
Anyone having trouble with using Vault API?
Econ keeps returning null for some reason 🤔
Vault doesn't provide Economy, it's just a bridge
Yeah I have Essentials installed
Yep I have it on the plugin.yml
What's the difference between Build Artifact and Build Project?
artifact is what is output when built
seems that I need to build artifact to update the jar
rather than build project
Just wonderin now what build project does 🤔
is using enum for configuration recommended?
public enum Class {
PREFIX(plugin.getConfig().getString("general.prefix"));
}
I’d say you’re better off having constants it’s whatever tho
Yeah enums are typically for things that aren't dependent on other things
use matt's config lib
Hey...just a quick doubt...is block#MetaData persistent in Spigot API
player.getEyeLocation().getBlock().setMetadata();
So will the meta data i set to this block, will it go after a server restart?
I think that on older versions it is not persistent =/
is DisplaySlot.PLAYER_LIST tab?
Yes
ok
Is there a way to get the item that would be used with right clicking?
ex if I have a stone block in main hand and snowball in offhand, it would select stone block if I was looking at the ground, but snowball if i was looking in the air
On right click, get the hand used, then get the item stack
PlayerInteractEvent#getItem Or you can do what heychazza says
Oh wew
Hi, how to make this code better if there are better ways? (irrelevant code is commented) https://paste.helpch.at/celukutala.java
Config: https://paste.helpch.at/jepanefaxa.makefile
private final List<String> list = new ArrayList<>();
public SpawnTeleportEvent(FileConfiguration config) {
list.add("UNRANKED-QUEUE");
list.add("RANKED-QUEUE");
list.add("KIT-EDITOR");
list.add("PARTY");
list.add("HOST-EVENTS");
list.add("LEADERBOARDS");
list.add("SETTINGS");
list.add("IDK-YET");
list.add("IDK-YET");
}
why do this?
When you can just:
private final List<String> list;
public SpawnTeleportEvent(FileConfiguration config) {
this.list = Arrays.asList("UNRANKED-QUEUE", "RANKED-QUEUE", etc...);
}
because im noob, thank you
in your loop logic, considering creating an explanatory variable for list.get(i)
Also I recommend using minimessage rather than the dumb & symbols
Lol
👍
So I recently Optimized my server and it caused my portal based farms from despawning when they reach the nether this includes Overworld --> Nether and Nether --> Overworld!
Files I optimized:-
Bukkit.yml
Paper.yml
Spigot.yml
Server properties (Only Edited view distance)
Guides I used for assistance:-
https://www.spigotmc.org/threads/guide-server-optimization⚡.283181/
https://shockbyte.com/billing/knowledgebase/154/Optimizing-bukkityml-to-Reduce-Lag.html
https://shockbyte.com/billing/knowledgebase/155/Optimize-paperyml-to-Reduce-Lag.html
https://shockbyte.com/billing/knowledgebase/153/Optimizing-spigotyml-to-Reduce-Lag.html
hi, this is my first time hooking papi into plugin, can someone help me, i followed the papi hook tutorial but it didn't work.. : D
@EventHandler (priority = EventPriority.HIGH)
public void onJoin(PlayerJoinEvent e) {
String text = plugin.color("&e%player_name% &fjoined the server.");
String nText = PlaceholderAPI.setBracketPlaceholders(e.getPlayer(), text);
e.setJoinMessage(nText);
}
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
Bukkit.getPluginManager().registerEvents(new JoinEvent(this),this);
Bukkit.getPluginManager().registerEvents(new ChatEvent(this), this);
} else {
getLogger().warning("Could not find PlaceholderAPI! This plugin is required.");
Bukkit.getPluginManager().disablePlugin(this);
}
this is my event, and below is the code in main class
thanks in advance!
cannot access net.minecraft.nbt.CompoundTag
im trying to compile using the mojang mappings, but its giving me this, any ideas why?
i have md5's maven plugin so i assumed it would work
Hi guys, I'm getting error
[21:37:29 ERROR]: [Practice] Practice v1.0-SNAPSHOT attempted to register an invalid EventHandler method signature "public void com.kuba256.practice.listeners.spawn.RightClickListener.onRightClick(org.bukkit.event.player.PlayerInteractEvent,java.lang.String)" in class com.kuba256.practice.listeners.spawn.RightClickListener
RightClickListener.java: https://paste.helpch.at/ahicuqufop.java
in main class is
pm.registerEvents(new RightClickListener(this.getConfig()), this);
Why is it happening? 🤔
event handler methods can only have one parameter that's the event itself
i found the issue, was building against java 11 for some reason instead of 17.
you'll have to share a fair bit more code to get to the bottom of the issue, chief
e.g. where is meta coming from exactly and what does getItemStack() do exactly
@tight junco my problem is that i want to gett all paths and if i do .getConfiguration().get("path") that i need to enter the name of the Location
like i want to list them all and print them out with a foreach loop
wait yes
Thank you very much
so I'm bored and wanna try making a game from scratch, I'm looking into opengl but I have got 2 language options:
1.- Java (+ I know a bit more on it / - Bad Performance I guess)
2.- C# (+ Performance / - I dont know a lot of it (will need to learn))
Also if I go for C#, what library should I use? thanks in advance
only of those 2 lmao
not really willing to learn those other 2 Cs
isn't C# actually worse in performance than Java?
Does C# have garbage collection?
Yes
Isn’t garbage collection what makes Java slower than other languages?
Tbh the only performance advantage you'd gain using c# is on unity, but that's because it's only using c# scripts and most of it is running in c++
smh
so java is better?
Better but still not great
Garbage collection is a wonderful thing but it's not applicable everywhere
and minecraft is made in java, so what, lol
but has shitty performance
and hytale ain't even out yet
yeah if ur pc is made from wood
I'll give java a shot
lmao
It’s more just your preference
i mean yeah minecraft does run incredibly well actually
^ for what it is it’s great
And it’s shortcoming are reduced by legends such as akair
LWJGL or LibGDX
1
ok and why?
Won’t ever be out 😳
lwjgl is an opengl wrapper, libgdx is more like an engine @wintry grove
hi, what is easiest way to save text in ItemStack but dont make it visible if its possible?
Nbt?
oh, thanks
Minecraft’s performance is shit because it’s coded like shit not because it’s using java.
There are tons of unity games with shit performance. The server side of hytale is going to be java iirc
yeah
client is C# and server side java
But yea there’s hope for hytale I feel that
Depends on your goal
I was looking to make a game thats good on performance (in the language used for coding terms) and thats easy to setup lmao
Just use unity
And again, still needs to be coded and executed well for good performance
but I want to do it from scratch
2d?
heh
ehhh
that's more of bad architecting
server side performance would be way better if there was better multithreading and stuff
wait now I'm confused
with server side you mean the server program you join for, well servers?
or like that weird internal server in mc
thats why people tend to fork spigot
fix the shite
"""fix""" and scam for $5k
theres adding stupid patches that theoretically do nothing. but theres big changes you can make that are worth
you cant really make full scale optimizations without nms but some fs
unity/c# is much easier
oh so C# with opengl = easier?
you can use what you want
graphics is aids always
i dont think we know what glib they use
yes
prolly wasnt worth it
yeah
some people like making shit themselves tho :3
LMFAO
thats true
I dont really get the point of doing so
in this type of game I would call engine directly the render shit
well add that too
they have a diff approach than mc
so basically their engine is for render shit and manage project
like
hummm
give example lmao
.
yeah
but doesnt really give a lot of meaning to do so but well
sooooo
C# for client will be then :3
at this point I find it easier to use that language because of the way is done
and the stuff you can do
I can literally embed the launcher in the game
or the game in the launcher
now time to setup Visual Studio smh
wait what wrapper should I use?
wrapper?
any docs or guide on how to setup opengl in C#
What's the point of using pure C# for it? I mean if you want it why not just use unity?
Or Java since you're more used to
java will be then lmfao
lol
It's 42
- 5 - 10 / x(10/3098908.2120938019283*shit+life)
haha die shitty visual studio
IJ will take the contract
Yikes visual studio, could have at least used Rider
/nick rider
they never saw my nickname coming
Wait please 
you can learn opengl in any language
i recommend something youre at least familiar with lmao
why is my apache compiler plugin doing some fatal error compiling when i give it java version 16 or 17
Hello can someone explain me this kind of error : java.lang.IllegalAccessError: tried to access class com.zcdevelopment.eurastats.npc.StatNpc$1 from class com.zcdevelopment.eurastats.npc.StatNpc
this error is non-sense
also this
java.lang.IllegalAccessError: tried to access class com.zcdevelopment.eurastats.manager.impl.HologramManager$1 from class com.zcdevelopment.eurastats.manager.impl.HologramManager```
That’s a binary incompatibility
How can I fix it
It’s a bit weird, because you compile against something which allows you to access x thing, but then that something doesn’t allow you to access x thing during runtime. This is caused when the version of something is different from compile time and runtime. Ideally you might just want to recompile and redeploy all your dependencies with the newest versions or make sure to use the same version in the server as well as a dependency.
Ok I will try thanks for explications
you probably need to figure out what the first anonymous class you have in StatNpc is
probably a runnable
I'd suspect that the super class might be not accessible anymore, because an anonymous class should always be visible to its enclosing type (as long as you compiled it in one run)
Yes that's maybe it I will try use a BukkitRunnable instead of normal Runnable
a normal Runnable shouldn't be an issue, that would be very weird
but you can extract the HologramManager$1.class file from your jar and inspect it with javap, that might help to figure out what's going on
Why does
implementation("net.dv8tion:JDA:5.0.0-alpha.3") {
exclude group: 'club.minnced', artifact 'opus-java'
}
Screams at me: 'exclude' in 'org.gradle.api.artifacts.ModuleDependency' cannot be applied to '(['group':java.lang.String], ?)'
ah wait nvm i had to read the docs a bit more xd
implementation("net.dv8tion:JDA:5.0.0-alpha.3") {
exclude module: 'opus-java'
}
Fixed it
any good theme for IntelliJ
Wait there is smth like that
yea
also .ignore, Discord Integration, IntelliJDeodorant, Statistic, and WakaTime
🙃
deodorant looks interesting
Tf is that
But
Butt
How can you use multiple different clickable commands in one line? I want to edit a lore add have it setup like this "[Edit] [Remove] texttexttexttext". So I want to execute one command by clicking on edit, and one by clicking on remove. I know that I can use textcomponents for clickable commands, but I can't combine different commands in one line. How do I do this?
Just append them together
Where can I find the API for autosell?
I don't have access to it
Here you can find the API to hook into Clip's plugin AutoSell, which was made by vk2gpz - https://www.spigotmc.org/resources/62935/
Please do not contact Clip for help with this particular resource.
@uncut elk ^^
that's a staff command... smh. Every user has the ability to recheck their roles tho. /spigot check. That one =check accepts any user as input.
😦
no. I won't. sorry
k. thank you
How do hens stay fit? They always egg-cercise!
Mahatma Gandhi, as you know, walked barefoot most of the time, which produced an impressive set of calluses on his feet.
He also ate very little, which made him rather frail and with his odd diet, he suffered from bad breath.
This made him a super calloused fragile mystic hexed by halitosis.
damn. I'm not reading that
That's so fucking dumb oh my god
I assume that's a chemistry joke?
supercalifragilisticexpialidocious joke
Is there any public jar available so I can test if the API works?
No. AutoSell is not open source and is paid.
I know
which means no public jar exists.
I won't pay 10 bucks to see if an outdated plugin's API works, someone just requested that I add support for it to my plugin.
well then don't do it... lol. You asked, I answered
Oh well, there are other ways ;')
and it is getting updates. slowly. but yes
the other way is to get the person requesting support to test for u
Sure 
#getMultiplier(Player) returns null even if I have a multiplier
Tried it deopped too, same issue
Got it working but by accessing other classes of the plugin instead of the API.
Which is the fastest growing city in the world? Dublin'
So I am trying to return a pointer in Go. If I created my byte array is as so data := make([]byte, length), and I added some values and stuff. Is the proper way to return unsafe.Pointer -> C.CBytes(data)?
idk but I really recommend joining Go Discord for Go questions cuz they are really smart n helpful
Hi, according to this post: https://www.spigotmc.org/threads/beginner-programming-mistakes-and-why-youre-making-them.278876/ (1.1 Singletons)
Using JavaPlugin#getPlugin(Class<T extends JavaPlugin>) instead of DI for accessing JavaPlugin methods is OK?
No
you should still try to use DI. Only use that method if there is no other possible way
Only when you can't use DI
for example, static blocks
ok, it's doing same thing as static getter?
I still don't understand why to not use it 😔
noob explanation please? 😳
It’s a static singleton right?
Honestly I wouldn’t worry too much, both methods are fine
And it’s cuz you don’t want to be using your highest order class in a class of lower order.
Breaks almighty dip
pepeHands
everybody says something else
Want me to be honest? Either method isn't gonna fuck the performance, I've gotten to learn over the years to not care too much, use what works, then refactor later if needed, otherwise you'll waste more time trying to "optimise" every step of the way
I used to do that with web projects, constantly googling finding optimised methods, but you'll end up slowing yourself down massively
I mean it’s just common sense tho
make a working project and then go back and optimize
You don’t give your main class to anything else considering it’s your highest order
How you create coupling
that's not even performance optimization tho 🥲
It can hurt performance at some point cuz it’ll be so shit with tight coupling
Literally this
Even more of the reason to not care for a launch then
Is your end server owner going to notice where you place that code? no?
Except that then yo urealise what you did was fucking shit and you have to rewrite 50% or more of it.
just learn to use best practices from the start. it saves you way more time
Yea exactly lmao
is there any performance difference between DI and JavaPlugin#getPlugin?
It's nothing to do with performance, it's about being concise and organized, only passing what is needed
Xdd di is not getPlugin
i know
and we said DI, then he asked why
The real response is don’t use either
and you said "Don't care about that"
then I will use JavaPlugin#getPlugin cuz its easier and faster
With your main class
If you really need Plugin. Go make a class that implements plugin
Go for it, don't be drawn to having to use a certain way, use what lets you code best, esp as its not a perf thing
People spend too long drooling over code, slows down shipping
chazza you r good smart man 👍
Ship fast, refactor later
I learnt @cinder forum over time, lol
Don't be drawn into spending 100s of years on tidying the tiniest bit, i did that
Id say that’s how you ruin a project
then I never released projects
You'll regret that "refractor later" turns into full rewrite because of becoming confusing
I suppose, but consider that later, if anything
^. Happened to me multiple times before.
not now
LMAO
Use DI keep yourself organized save yourself the problem later
you literally save yourself 3 seconds at most by using javaplugin#getplugin instead of DI
You don’t want to go back and have to fix tight coupling. That’s hell in itself
I'd argue DI is faster, just type the field then alt + insert the constructor lol
For me when building sites, I used to spend so long on small detail like this, I read something online from an engineer at google, and it changed my mindset, ill have to try find it
i say this because ive restarted the same project over 4 times now because i kept hating my own code
and if you come here asking for help, and then just say "wasn't going to do what you recommended anyways", you wasted way more time. so don't see the point
organized? for me this
private final Plugin plugin = JavaPlugin.getPlugin(Plugin.class);
is more organized than this
private final Plugin plugin;
public Class(Plugin plugin) {
this.plugin = plugin;
}
This isn’t proper di lmao
You won't need the plugin everywhere, some places you'll need just the config
Etc
Yeah if you drool over code, you'll end up never finishing
As I said you don’t pass that shit around. I mean you can
There are two kinds of programmers, generally speaking. There are programmers who care more about code, and there are programmers who care more about product. The former – I’ll call them “code-first” programmers – are obsessed with how code is architected, what tools, libraries and languages are used, how much test coverage there is – stuff like that. Code-first programmers are psyched when they check in the perfect abstraction, when they get to use the latest language-feature, when they delete dead code. That is, they love the code they write – the code is the thing.
i started my custom enchant plugin by wanting to make a custom gui for enchantment table
read this]
that i never finished
@rugged bane you must be working on small scale projects then
makes total sense, and changed my mimndset
what?
Nowhere near small scale projects lol
?????
That’s even more reason to not just code it like ass
You make larger scale because you dont waste time on small shit
"oh do I use x over y, makes 0 diff to perf tho"
For larger scale you use a DI framework like Guice
Obviously depends on the project right?
You’d say something like networking you should rush?
If I’m making a python tool I could give zero fucks
as long as it works
😦
like dont pass whole class just what is needed like FileConfiguration?
half the developement process is figuring out why your code doesnt do what you want it to
I wouldn’t use a di framework either. Makes it just as unreadable.
I mean I’m more for that than passing your main class everywhere
remember kids, ; and {} are your frend
kek. java problems
Yes you need the config pass just it, you need something else do just that, don't be throwing around the entire plugin instance when it's not needed
See, security id take seriously, and nt intentionally fucking your performance, but like esp when we are talking about cosmetic stuff, I'd much sooner stick to what I know and build faster, than spend time on something that isnt going to make my business more $$$
time is money at the end of the day
There’s a diff when you’re the boss vs you’re the employee. As an employee I want to make quality.
Gians the only per ive ever accepted to be part of my projects 😂
Let's move the argument to #dev-general and keep this for support
I mean tbf I don’t make my projects for others
In a sense of, I’m not making it so you can write on top of it
well so basically its
organization vs code speed
What
Not at all
What code speed?
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
any idea why I get this when trying to compile a project with gradle? 🤔
xdd. Just so you understand, you say you don't care about micro optimization, and then end up carrying for 2 extra lines.
JavaPlugin#getPlugin = 1 line
DI = 3 lines + typing shit in main class (well only if you need to use main in 1 class, if you pass it in other class params its more annoying)
java ver is diff
Lol
different than what
You're compiling against a lower ver and your project is higher
I think
If you care about "code speed" then don't use Java
I'm sure I have java 17 set everywhere on the IDE
The issue is Gradle vm version is lower than compiling version
Go to your settings build tools gradle then change the Java there
Oh you already have
What gradle version?
7.3.3
Huh sounds like a invalidate caches type issue kek
My homie had that problem I gave up on helping him
I recommend giving up
And never using java again
use skript
Fixed, had to add jdk17 to Path
Oh boom
why is my apache compiler plugin doing some fatal error compiling when i give it java version 16 or 17 but it works when i give it version 1.8
Why is this code not running? It was running but is no longer runnning 🤷♂️ (there are no errors)
player.spigot().sendMessage(player.getUniqueId(),
new ComponentBuilder(plugin.color(settingsManager.get(Config.MESSAGE_CODE).replace("%code%", kods)))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Click to copy your code").create()))
.event(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, kods))
.color(ChatColor.GRAY)
.create()
);
Code before and after this sendMessage thing is running perfectly fine...
@ me if you know why did it stop running
@warm steppe What is the asd from
i added to see if the command is running
that code i showed is running between 3rd and 4th log
Why is it an error?
because i made it so?
Fair enough, just gives the wrong impression. DEBUG log level would be more appropriate
If I were you I would do less of this inline
only if it was active on spigot 🥲
And check the intermediate steps
what do you mean by that? code is running perfectly fine before and after that sendmessage part
I just mean double check to make sure the component is building like you expect it to
Also sending a more simple component could be useful to verify that method works fine as well
also it did work before, now it just somehow stopped and i dont know why
What have you changed?
nothing, that's the thing
You haven't changed the server at all?
What version are you on?
1.18.1
Any reason that you're trying to send the player a message from themself?
Also, can you show more about the player variable and where it's defined?
@warm steppe
Why don’t you just debug better
Anyone knows how to create an NMS block in 1.18?
Maybe split this up more and test case most things
What are you trying to do? iirc you can't create a new block
I would like to change the hardness of a blocj
I don't even know how to nms in 1.18. Idk what they did over the update
that's how you nms in 1.18
if you use maven, md5 has a maven plugin for it too but uh 1. idc enough about spigot or maven to do any research and 2. a lot of people say it only works on 10-lines example plugins, nothing too serious or it breaks lol
Nice, thanks
Is it a Gradle plugin?
paperweight-userdev is
that's an example (bukkit) plugin using paperweight-userdev to use nms
Wait, then how do I use it?
read the readme 🙃
At that point just use reflection and change the strgth
For something so simple
yeah go figure the reobfuscated names
Just copy the gradle files?
I'm probably gonna end up doing that
Not hard to find
What you need
Emily just lazy
i mean if a tool can do the job for me
why would i do it myself lol
seems counterintuitive than just dropping in a few lines of gradle configuration and have it laid out to me with mojmaps
Sorry I only speak in s.r().
If it’s that easy sure. It’s pretty easy to use fern flower. Idk about newer versions
If you're storing a Player then that could be why it stopped working, so that's why I ask about where that variable comes from
Got the plugin, nice. Was confused at first cause it wasn't on Gradle plugin portal
IlIIIIllllIlIIllII
What should i use to like get values out of yaml files when i am not using it for spigot plugin or something
Hmm I usually use just a yaml parser like eo yaml or snake yaml (probably exist others) or something more sophisticated like configurate (: (which uses snakeyaml iirc but yes yes happy Santa’s birthday)
Ahh tysm
that player variable comes from a method parameter
I am using Matt's command framework
Are you storing it in any way?
nope
Can you show the whole method?
Here you go
Hmmm yeah I don't see anything that stands out to me at first glance
I feel like your while loop does nothing
Because you set kods to the same value as before the loop
it checks if there is no came key in the hashmap
Ah you generate a code
yes
So your problem is that the component is not sent?
Yes
Is it sometimes it's not sent? Or after awhile it stops sending?
It did send it when I first implemented it, idk at which point it did stop working but the changes I made are not even linked with spigot...
Try to send a simple message
What about a simple component?
Ok so there is a problem with the main component, because the simple one worked too
Okay, so the COPY_TO_CLIPBOARD action broke the whole thing even though it did work earlier
thanks to everyone who helped! Happy holidays to you guys! ✨
Why is this query throwing error? Parameter at position 1 is clearly being set and it can't be null because you can see it is being added in the log line...
Console Output:
[12:29:52 ERROR]: Error inserting to `registered_users` [UUID: 128a8765-2984-4ea5-a99f-cd1619665761] [Discord ID:924778890545745932]
[12:29:52 ERROR]: Error: (conn=93) Parameter at position 1 is not set
K = UUID
V = String
REGISTERED.forEach((K, V) -> {
try (Connection con = dataSource.getConnection();
PreparedStatement pst = con.prepareStatement("INSERT IGNORE INTO `registered_users` (uuid, discord_id) VALUES (?, ?);")) {
ResultSet rs = pst.executeQuery();
pst.setString(1, K.toString());
pst.setString(2, V);
pst.executeQuery();
rs.close();
con.commit();
log.log(Level.INFO, "Inserting to `registered_users` [UUID: " + K + "] [Discord ID:" + V + "]");
} catch (SQLException exception) {
log.log(Level.SEVERE, "Error inserting to `registered_users` [UUID: " + K + "] [Discord ID:" + V + "]");
log.log(Level.SEVERE, "Error: " + exception.getMessage());
}
});
you start with 69 my guy. not 1
Or am I stupid again
idk frosty. are you?
prepared statements start from 1
Then get good I guess
wouldn't printing the entire stacktrace help?
No
u execute query before setting ur parameters
oh. this ResultSet rs = pst.executeQuery()
👍
I think it is time to learn mysql. where do I start
What is it about?
How much you paying
I agree with frosty
ill make you a minecraft plugin that will let you throw a snowball and tp you when it lands
similar to an enderpearl
ill call it, snowpearl
bet you already made it and never used it so you finally found a "use" for it
not made yet actually, im just extremely creative
so. where do I start?
w3schools?
its about multi core processing
when I get on pc I can link u smth
thank you. will start looking at mysql for now.
w3 is always best
Ic. cool
maria best
piggy. recommend me a tool to make local mysql databases please. am on pop.
dbeaver
thanks
would you be able to help me with this? kek. Does "making a new connection" mean "making a new database"?
making a new connection means making a new connection
yeah. then how do I make a new database from dbeaver?
idk read the docs
How do I get rid of the warning:
[14:25:04 WARN]: Legacy plugin MyPlugin v0.1 does not specify an api-version.
specify an api version in plugin.yml
How do I get the .javaClass of a kotlin data class?
org.bukkit.plugin.java.annotation.plugin.ApiVersion does not have v1_18 :C
new table or new database? since u connect to the database
u prob have to make the database from sql console
new database. since that's what I asked for. a tool to make a new database
or intellij
Class::java.class```
.javaClass is for instances
ah, its been a while
well yeah its a data class but none of the above seems to be working
I feel like ive hadf this issue before
is it something with my SDK potentially
yeah
ive had this problem before
but ages ago, i havent touched kotlin or java in months
val test: KClass<RoomModel> = RoomModel::class
since .java is an extension function
KClass gives an unresolved reference
https://paste.helpch.at/iragefabaw.makefile
- Havent touched it just the one of spring initializr
try adding version 🤷 1.6.10
hm
not sure why its not working tho
do other kt classes work?
ex Unit
yeah
hey can someone help me
?help
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
oh
maybe you'd need kotlin reflect dependency? 
but i remember being able to do basic reflection without it
hmm
blitz
do u know
ok. I had to get mariadb and mariadb server. and I can use cli to create databases
i did select kotlin when making the project with spring initializr
package com.clonkc.killeffects.effects;
import com.clonkc.killeffects.main.Core;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.effect.DnaEffect;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.Plugin;
public class Dna implements Listener {
public Core cM;
public int Heigth = 0;
public Dna(Core core) {
this.cM = core;
core.getServer().getPluginManager().registerEvents(this, (Plugin)core);
}
@EventHandler
public void onPlayerDeath(PlayerDeathEvent playerDeathEvent) {
Player killer;
EffectManager em = new EffectManager((Plugin)this.cM);
Player player = playerDeathEvent.getEntity();
Core core = this.cM;
if (player.getKiller() != null) {
killer = player.getKiller();
} else {
return;
}
if (core.pdEffects.get(killer) != null && ((String)core.pdEffects.get(killer)).equals("dna")) {
Location location = new Location(player.getLocation().getWorld(), player.getLocation().getX(), player.getLocation().getY() + 1.0D, player.getLocation().getZ());
DnaEffect effect = new DnaEffect(em);
effect.setLocation(location);
effect.start();
}
}
}```
Im working with effectlib, but i cant seem to change the yaw or pitch of the effect using effect.yaw = float; and the effect.yawOffset doesnt work either. I was thinking about using a vector and a target location but im not sure how to do that
i couldnt find anything on the wiki but maybe thats because i havent looked into it enough
mind sending code using paste bins instead? https://paste.helpch.at
do you need my core file too?
its the main thing holding the plugin together
https://paste.helpch.at/kupeherisi.java the core file
https://paste.helpch.at/gepugoziwu.java the class file im trying to edit
I need a way to manually convert UUID to an int/long and vice versa (java/kt) using the least/most significant byte byteshifting, what is the easiest way of doing that (looking for resources, if available)
WELL..... invalidate caches fixed it....
logDebugInfo("Checking x: $x, z: $z", print = false)
logDebugInfo("Range ($x, $z): ${min.y..(max.y.coerceAtMost(chunk.getHighestBlockYAt(x % 16, z % 16)))}", print = false)
```So i have this code, `Checking x` prints, but the second line doesn't print (it does for my test server, but not for the server owner I'm developing this for), I suspect that it's unable to run `chunk.getHighestBlockYAt` for some reason?
> ```
> Checking x: -1408
> Checking x: -1408, z: -912
> Range (-1408, -912): 10..10
> Checking x: -1408, y: 10, z: -912
> Not in region
> Checking x: -1408, z: -911
> ```
It works for the other coordinates, but not for these 🤔
anyone have any idea?
It's still stuck on that :/ even after like 5 minutes
How do I combine these TextComponents? https://imgbb.com
How do i save a file like this with the defaults?
So with the # texts too.
I know that you can do saveDefaultConfig with a Bukkit Config File
But i want that too but with a messages.yml
I think there's saveResource
You know that link takes to nothing right? xD
I'll try that
Wot lol, lmao my bad. Here: https://ibb.co/wBQcBgs
chunk.getBlockType(x % 16, y, z % 16)
```this also hangs
saveResource(getDataFolder() + "messages.yml", true);
So something like this would work?
btw chunk is a ChunkSnapshot
Use a ComponentBuilder to append them
Ok, thank you!
Just saveResource ("messages.yml", , check the javadoc for what the second parameter does as im not sure what it is for
oke oke, thanks : )
ah
''if true, the embedded resource will overwrite the contents of an existing file.''
it works.
Does anyone know a way to create an area that only X players at a time can be in it?
Make a region, then on region enter yeet if anymore try to enter
why didn't I think of that before 
I'm using residence plugin for the "region".
I'm storing the players in a map (<String (residence name), List<UUID> (players inside)) and updating the map once they enter/leave
but it's very buggy fsr
sometimes it denies correctly, sometimes it just allows the other player to move in
I wouldn't store them in a map, I would loop through the players in the region, might not be as efficient, but would probably be way more accurate
^. Otherwise you'd have to listen for many many events to make sure you keep track of the player. what if they leave the server, what if they go to the nether, what if they teleport out, what if they walk out, etc.
Then you seem to be doing something wrong lol
well, the plugin has enter/leave events, so players are removed from the map when they leave
Just loop through the people in the region
well I was a bit sleep deprived when I first did it, decided to hop back on to the idea, so I might fix it with fresh head
Just don't overcomplicate it
If the player is already in region and the region is full, dont stop them from moving
Is that allman I'm seeing
yeah I was using player move event, which was kinda dumb now that I think of it
Not really, just take this aspect in consideration
shush
for(CuboidArea arr : entered.getAreaArray())
{
double highX = arr.getHighLoc().getBlockX();
double highZ = arr.getHighLoc().getBlockZ();
double lowX = arr.getLowLoc().getBlockX();
double lowZ = arr.getLowLoc().getBlockZ();
int players = (int)e.getPlayer().getWorld().getEntities().stream().filter(entity -> entity instanceof Player)
.map(entity -> (Player)entity)
.filter(p -> p.getLocation().getBlockX() >= lowX && p.getLocation().getBlockX() <= highX
&& p.getLocation().getBlockZ() >= lowZ && p.getLocation().getBlockZ() <= highZ)
.limit(2).count();
if(players > 1)
{
e.getPlayer().teleport(e.getPlayer().getLocation());
}
}
well let's see if this works
I get warning: The compiler compliance specified is 1.8 but a JRE 17 is used
What should I set to make it go away?
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
you have your JRE set to 17
hey. does anyone know how to logon to a minecraft server with a migrated mojang account (microsoft) on the API level?
the problem: in ye olden days, i would just use authserver.mojang.com. but now microsoft is planning to migrate mojang accounts, meaning i cannot use that authentication server with my details.
hi
please could somerone help
go to File > Project Structure > Project SDK and set to 1.8
heres the pastes
but why can't i use 17 ? isn't it newer
because you have it set to 1.8 lmao
then set both of them to 17
thanks
How do you get the item a player has selected in an inventory? Like if you left click it you can move it around, how do I get that item? Do I have to use a map and store the data or is there a better way?
listen to InventoryClickEvent?
if it's a "special inventory" you can compare the clicked inventory (there's a method in the event for that) with your own (store it in a field) just by using .equals (myInventory.equals(clickedInventory))
Yeah ok, so no good getSelectedItem stuff? Sadge
does anyone know a way how to empty the nametag from a player let's say but still assign them to teams and use the team prefix/suffix (diffrent for each player)? I currently have a way by editing the player add info packet to a name including colourcodes to get rid of the characters but it messes up tabbing, would love any ideas
wat
I mean you got getClickedItem, yes
anyone know effectlib
but you'll want to check the item was clicked in the desired inventory
Yo is there a way method which returns true when a player is the passenger of an armorstand? Player#isInsideVehicle() won't do it for armorstands
Yeah, I was hoping there was such function. Like when you click, you can get the item the player is holding at the moment. But apparently not, thank you anyways
??? what?
?
Yes I know that exists, but I would rather avoid a another variable. I want to a player to place an item in my custom inventory, and the item they place in the inventory should be registered. So I was hoping it existed a way to get the placed item
maybe it's named different, i don't remember it 100% but you definitely can do that?
Yeah you can
mate what kind of meth did you take
Isn't getClickedItem ran before you click the GUI item?
you can also get the item that at the time was being held on the cursor
it's one of these, one is the item inside the slot, the other is the one being held
So: Player clicks with an item -> I get the item in the clicked slot with getClickedItem() -> the item is placed in the GUI?
the naming doesn't really help
Yeah, is that function ran before or after you place an item in an inventory?
Do I get the item I CLICK or the item I PLACE in the inventory?
I think the event is called before the action actually takes place but I mean... if it's not one method it's the other, it's 50/50, there aren't that many options there lol
Oh, I thought both were ran before you click
the event is dispatched before the inventory is modified
getCurrentItem returns the item inside the slot
getCursor returns the item being held on the cursor
^
everything inside the event handler happens before the inventory is modified
well, that event
there are events that happen after the action takes place
and the documentation is so poorly written it's a matter of trial and error for some of them
Yeah lol, well thank you!
Anyone know how to add an external jar as an dependency to maven in intellij? Can't get it to work despite quite many tutorials xD
This: https://paste.helpch.at/atocekukib.java does not work correctly. It does not update the inventory as I want it to. It is like if it set the variable after the inventory is created. When I enter the GUI, I can swap pages and it works. Why does this happen?
Why are you doing new Runnable
Use a lambda
() -> { //Runnable contents here }
Also you're updating the inventory async
No part of the spigot API can be used async unless explicitly stated otherwise
Try wrapping all your logic in a sync delayed task
not super strictly true but if you want to be on the safe side, sure
via Java / Spigot is there a good way to make a decentralized communication system?
I have multiple plugins
and they each contain the same code
but if 2 or more exist
then only one should run the code
so there's no base plugin they can rely on to talk to
packets?
what? how would sending stuff to the client help?
I'm a little confused here Fred. Why do you have 2 plugins with the same code?
also should I use java (JFrame) or C# (.NET Core or framework) for a launcher for a java game lmao
kek
and
kek
nono, like a packet system between both plugins
Basically, I make a ton of small plugins for people, and I am trying to build a patreon verification system
oh
then make a central server
and the others should communicate with that one
and make them comm with it
Okay, have your system save a file to their plugin directory?
Could you register a service that handles that?
^^
Ahh wait I still see the problem here.
yeah
there's no central "manager" per-se
they need to choose one at runtime
if theres multiple
which would probably be the first to load
or something
I mean is it really a big problem if they both verify? Isn't it just a quick http request?
Oh wait
This is so easy
Set a system property
the whole system relies on only one verifying, since if you're sending more than an average of one verification every 5 minutes (besides restarts), then it looks like multiple people
PaperLib does this for the suggestPaper method so it's only shown once if multiple people have a plugin that runs it
😮 system properties
I still don't see why each plugin can't verify itself
hello Star
hey
aren't we all
the whole system relies on only one verifying, since if you're sending more than an average of one verification every 5 minutes (besides restarts), then it looks like multiple people
oh wait I'm stuck with merry starmas bc I stopped boosting
just give me access to your spigot account. ez
nooooo
see I read that
@mental cypress remove his nickname. ty
and I still don't understand what that means
if 5 people use the same patreon code
sure
then I'll get an average of 5 requests per 5 minutes using that code
to verify
and I can notice that someone has shared their code
I definitely don't think that's how it works
how so?
What if I scheduled all 5 of my servers to restart 1 hour after the other
Then bam, no detection from you
Or what if they have a proxy with multiple subservers all running the plugin?
well first, these plugins are being used by people who have a single spigot server, not multiple
then add proxy support
but also, it sends a request every 5 minutes
Why do a keepalive for DRM?
so a steady stream besides a few blips during restarts
what's that?
ah yeah
what purpose does that serve?
so that people can't share their token
surely you only need to verify once at server startup
okay so if you want one token to be one server, just bind it to a UUID for that server
at one point tho
don't let it be a UUID they can change lmao
(ignoring the fact that if they were actually smart they could decompile the plugin)
it would be better is you just made a master server
MAC Address
hm
Yeah if they were smart they would disable your stupid ass DRM
okay
and contact to it for verification and that UUID stuff
I just want something simple to persuade people from sharing the code with tons of people
and a way to detect that easily.
without making it complicated to transfer the code from one server to another
then make it one time use
yea
ez
make it open source
these are just for premium features in free plugins
fremium 😄
how about throw away your whole DRM thing
well how else do I do a premium system that won't instantly get abused?
I know a few other devs doing the same thing I do, but entirely premium instead of free
and they all get their stuff leaked
you cant stop leakers
Everyone gets everything leaked
simple answer
this is true
ohhh
I would legitimately open source all my stuff if it wasn't a ton of work to manage so many git repos
I'd need to have like 50
oh my god are you kidding me lmao
and only make them public after videos were uploaded
not a lot tbh lol
fred... look at #general-plugins . literally banned a guy for using leaked citizens jar...
yes I know
also, I need to make a verification system anyway to differentiate patreons and non patreons
since I'm not releasing multiple jars
thats more work :p
citizens is or was open source lmao
or, consider this again, who cares?
don't segregate
feature withholding sucks
I just want some supporters 🥲
just add "early access"
yeah
dont do extra features
yeah
I tried that
or donations
did not go down well
Im sure this won't either buddy
that's how it currently works
and I have a single patron
who's also staff
take it or leave it
also, fred, im pretty sure we are all poorer than you anyways 🥲
at least you have one lmao
how so?
you work with content creators so you actually get stuff out of the things you do
I don't earn much from them
but, popularity :p
this is true
but apparently popularity doesn't get you donations
and we circle back
yeah so don't muddle your public image by using shitty DRM
kek
well what else am I supposed to do to get a little support 🥲
sell support
or a freemium model
pay to download, but open source for anyone smart enough to compile

all DRM does is make it harder for legitimate customers to get it
I guarantee a ton of firewalls will block your stupid keepalive
close sourced, obfuscated, with that stuff = maaaaaaaaaaaaaybe possible
^ this
But anyone who is determined not to pay can just remove that stupid DRM check
if it can't connect it fails, and allows people
since offline people
what lmfao
eh
so i just firewall block your DRM and it's done?
what the fuck is the point then
LMFAO
All I'll say is I never bothered with DRM given all the problems that came with it.
^^
I guarantee 95% of people who would want the features don't know what a firewall is
be like glare. glare has 2 very successful freemium projects. glare is cool
but I want to make the base products available to everyone who wants them 🥲
it's all or nothing fred
😦
paywalling features is absolutely the worst
I just wanted to add a config for patreons



