#help-development
1 messages · Page 2274 of 1
Too late now
Everyone mad at chat reporting and new chat mad at the wrong thing it's too late to reverse better off looking to crack the system
I just modified my patch and it should work correctly and broadcast as a system message now
Honestly I don't see the problem with 1.19.1 chat. You're not a racist or terrorist or doing illeagal things. You'll be fine
Microsoft has been doing moderation on other games
You say that right now:)
It's okay, until it isn't.
This isn't something new
Its a slow move towards Face recognition to login and then your social credit score to be able to play
Oh will we get china edition of Minecraft
They'll probably add text filtering like bedrock next lol
Tbh yea
It already exists on realms, yes
Mojang are silently working on text filtering, find out all about it!
me when i get banned for saying amongus
Amongus
If someone speaks with their friends about going out on the weekend and drinking then you are technically violating the chat terms already. I think
this chat restriction is unnecessary and stupid.
At first, you're right, it will probably only be the most serious offences.
Until they start to automate and scale up.
me and the boys talk about legal drugs for fun
I doubt they'll ban you for that
Also mojangs terms have "All caps can be read as yelling and that's rude" in them ahaha
Have you ever used the chat on any of their other games
but in any other game chat isn't that important
but in minecraft chat is essential
Roblox is proof that this system doesn't work anyways lol
Roblox chat makes me wanna impale myself with a spear
luckily we can mod the shit out of MC and remove any CCP style crap
@eternal oxide found the solution, after saving the default config I actually had to load it. A simple plugin.reloadConfig() solved the problem. Comments are finally saved now
Good to know. Must be a paper issue though as it doesn;t happen on spigot
spigot probably manually reloading the config after saving the default one
probably
So true
Can you connect with such a modification to a vanilla server?
Probably not unless you do some weird shit
You should be able to. Many mods require no server component
Worst case, we mod all chat to go through PMC
What is pmc
Plugin Messaging channels
even if, for example, mojang banned everyone who launched 1.20, the community would just go back on some version, mod the shit out of it, and continue having fun
Mojang should just recode the game in a language that can't be easily decompiled so they can enforce their bullshit and nobody can do anything
imagine the community forking minecraft because the maintainer is shit
Don't know about you but I'd rather have child predators and nazis banned from all servers
Literally every other platform has moderation from the platform itself
Why are we acting like this is the worst thing ever
Personally I think the game NEEDS some kind of moderation like that as long as it's handled well
Whether it will be handled well remains to be seen, but I have no reason to assume they're going to overdo it
The community response has been pretty embarrassing honestly, the amount of fearmongering and alarmism is off the charts
A measured response is "we only want this if you use it strictly to ban the worst of the worst people, but if you take away the agency of servers to moderate themselves by banning minor offenders we're going to have a problem"
Child predators and nazis SHOULD be banned, it's pretty essential for a game played by a huge portion of children to be (as close as possible to) free of predators
Decentralized moderation is not effective against them
They will just hop to another server
It's a bit like the vaccine mandate
The paradigm could be problematic if misused
But much like making people get a life-saving vaccine that saves them and others from a deadly disease is a good thing, making servers subject to moderation that removes the most dangerous people from the platform is also a good thing
You can remove the real-world context to make either of these things sound authoritarian and threatening, but by leaving the details out you intentionally obscure their purpose to fight them on ideological grounds where you can hand-wave the context away or make a slippery slope fallacy
It's a really annoying right wing tactic and I'm frustrated to see it have so much traction here. Yes, there is reason for concern, but the response has been so extremely negative it's like people don't think it's worth getting rid of child predators if it means being subject to any amount of moderation from mojang
try learning java before you continue with spigot
scope should be something you learn pretty early on
myeh
This isn't really an issue with not knowing java
This is more of an issue that this is a seriously dumb idea
Whatever you want to do - there is a better way
for what?
Also, all-caps is often read as YELLING! And yelling at someone is usually not very nice. - Mojang Community Guidelines
And what command?
discord command to execute console commands
Do you really think anyone's going to be banned for that?
every command
That just sounds like a guideline
hey you have to follow the guidelines to keep playing
otherwise your out
What am i coming back to? Redempt ranting about sacrificing privacy for security.
How about we implement a moderation system for all messaging services then? Lets
spy on every form of communication. This will surely get rid of all illegal conversations XD
Privacy is already dead
Yeah no, this system will do absolutely nothing to catch child predators
it doesn't exist anymore
To a certain degree yes, to another no
Every other platform is subject to moderation
Privacy is not the issue there really
#general
eh its part of it imo
It's not like every single message is being sent to mojang
can sb help spawn Particles, this is my code
player.spawnParticle(Particle.FLAME, event.getBlock().getLocation(),15);
Only reported messages are sent
just use DiscordSRV don't bother remaking the wheel
no
It's more that the server admins have less control
mfw they literally don't but okay
If it's just you and your friends running a server you're not going to be reporting each other
To some degree you could try to use a custom command sender or whatever cursed shit
not necesarily some people think they are hillarious
that is not the issue there
Mojang isn't gonna come in and ban you for your jokes
not necessarily
It's more the public servers - those where you don't know the admins or other players of it
Because we still haven't seen how they're going to use this yet
I say give it a chance
why give it a chance when the outcome is already clear from other reporting systems out there
I am also not entirely convinced that it would catch predatory acts
So there are zero platforms that are moderated effectively?
Someone that would report these messages would not fall for these acts
if I'm a predator why keep it on minecraft and not goat people onto other platforms
It starts on minecraft
I haven't played much on the more problematic servers, but I have yet to see that happening
Didnt know this was a problem on mc to be honest. Do we have any statistics on that?
I'd also like to see stats ^
How could we have statistics without reporting
Though I estimate this is going to happen mostly on the DMs so eh
Chat logs being dumped and similar
i'd figure someone would speak out
if its such a huge issue
I am sure that the logs of some big servers have been leaked in the past
Then you would need to independently contact tons of servers and convince them to give you their chat logs to conduct such a study
And to be fair it's not just child predators
What I am saying is that there are already chat logs out there most likely
Nazis should go too
the worst thing thats happened to me on a minecraft server is someone called me a bad word
Should the commies get banned too?
someone has leaked my address and stuff too but I don't really care about that
tthey just got banned
Are they advocating genocide?
If not then no
From history I can say yes
lol
They are the most genocidial ideology out there
By far
That's a hell of a stretch
You can make that argument for tankies
But not for communists as a whole
I say we get rid of everyone who doesn't agree with my political ideology problem solved tbh
I love how it always turns into this whenever you say "we should ban the Nazis"
Is banning Nazis really such a bad idea?
We want to keep them around?
banning them from minecraft doesn't really do much
if you wanna go around killing them to get rid of them go ahead I'm sure thats much your style
Thanks for putting words in my mouth
wtf is this
Deplatform Nazis = kill them all
While sure, I can agree that it makes sense to limit these extremists in every way possible - but it is particularly hard to do that without damaging the very basis of democracy
rubn
Not as if democracy works anyways
Perhaps we can all chill a bit, also #general would be more suitable
You're not wrong
It's difficult
But if you don't do it then...
Well
But i agree that any form of (objectively) fanatic ideology should be banned.
Not sure if i would in put nazis in todays world as the poster child for this but the general idea is reasonable.
🙏
It's on the rise in a lot of places
oh shit I forgot to turn off the water 💀
The topic would just do so well in general
I like #general
Ya
I gotta go to work anyway
But then people would get development help... Why would you do something so cruel?
Cannot make a static reference to the non-static method getDataFolder() from the type JavaPlugin
Dont make a non-static reference then...
(or just lazily populate that field)
But it’s not a rule that political discussions are strictly forbidden, all we have is that people must be respectful when approaching one
almost like java is object oriented and static state might not be the best 🤔
(e.g. in the consutrctor)
dont make non-static reference = make static reference = im doing that exactly
time to start a heated debate about OOP
getDataFolder is a non-static method however
but if i dont make it static i cant use it in next method what should i do?
You must have an object to call it on
Im tiered. What i meant is: You cant call a non-static method from a static context. You need an instance first.
You can just leave it uninitialized
And initialise it as soon as you have an instance of the class (in that case your plugin)
i dont need dir?
Well when do you need it?
but sometimes it might just simplify the architecture
You need it after the plugin was initalized
no maybe?
So just do it when your plugin was initialized
So you have something like
public class MyPlugin extends JavaPlugin {
private static File dir;
public MyPlugin() {
dir = getDataFolder();
}
(of course you'd need to move everything that uses dir directly)
nvm i dont need dir
For this however I'd really follow the advice of everyone else and not make that field static
isnt r.read(); returns size of lines?
might wanna read the javadocs
no, it returns the byte that was read
and what returns size of lines?\
nothing
yea you basically wait for EOF
or just, use any of the 1 million utils
to read a file completely
throw a uuid at the item pdc
Depends
i dont think thats reason why it returns la1
instead of bla1
why
because you read the first byte ?
afterwards that byte is read
e.g. readLine will not include it
Yeah, it discards that byte from the stream
reads all line's first char?
Let's be honest here - it is quite obvious that .read is NOT a getter method
how
Like you are reading now ? but like, please just use any of the existing methods
there are only a few reasons to read a file manually like this
which methods
[18:12] LynxPlay: there is literally Files.readAllLines(Path, Charset)
how does that work?
why ?
i need it
why
because whatever you are doing sounds pretty dumb ?
and instead of you going down a dumb path, maybe someone here knows a better solution
int lineCount = 0;
for (String readLine = br.readLine(); readLine != null; readLine = br.readLine()) {
lineCount++;
}
It's easy as this
long lineCount;
try (Stream<String> stream = Files.lines(path, StandardCharsets.UTF_8)) {
lineCount = stream.count();
}
or this
but like
hard to explain
whatever you are doing with a line count for storing things sounds pretty not good
im making JDA bot
in plugin
and i need storing things
in
Discord's temp ban
okay ? How does that need the line count tho
or are you trying to count bans
like, how many bans exist rn
Can someone give me a cool faction server spawn
its like
member_id: sys.time.when.it.was.banned
member_id: sys.time.when.it.was.banned
member_id: sys.time.when.it.was.banned
in config
and
REEEE
i need to check every line
to check for bans ??
yes
I-
Just use DataOutputStream/DataInputStream
But not yml
what you call "indexed"
Well, for yaml you have to load the entire thing into memory
or read through it all
im not making extra large community where 5k users are banned lol
Well, if you want to stick to yaml, the read line by line method is still not clever
why not just use like, the bukkit yaml api
i cant get line in bukkit yml api
I've hashmap, if i put the an existant key and value it will update that?
What I mean like disc space can be saved by using DataOutputStream/DataInputStream
what the fuck do you need the line for xD
depends on the circumstance
i already told you
object delimiter I assume
im checking every line
that is not how yaml works 😭
Player, Integer
and if sysoldtime in that line - sys.now.time is bigger than user's ban time ill unban em
and if you just wanna check every line, even then you don't need the total line number
ok
how to check every line then
scroll up and check mine and geols answers
reply it
you are trolling right ? XD
ill use that
Yes but do you see how like
that thing already reads each line
and how using that to getting the line count just to then read it all again is dumb
If you don't do anything else with the HashMap, invoking #put again will update the values
#putIfAbsent will not however
uh
i understand now
xd
me dumb
thanks 😅 I was about to loose hope
how does System.currentTimeMillis() work?
does any1 know what could this error be? ```# A fatal error has been detected by the Java Runtime Environment:
Internal Error (sharedRuntime.cpp:2370), pid=8919, tid=8997
Error: ShouldNotReachHere()
JRE version: OpenJDK Runtime Environment (17.0.3+7) (build 17.0.3+7-Debian-1deb11u1)
Java VM: OpenJDK 64-Bit Server VM (17.0.3+7-Debian-1deb11u1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
Problematic frame:
V [libjvm.so+0xcb8b5c]
Core dump will be written. Default location: /home/minerlands/skyblock/core
An error report file with more information is saved as:
/home/minerlands/skyblock/hs_err_pid8919.log
If you would like to submit a bug report, please visit:
https://bugs.debian.org/openjdk-17
#```
Why wouldnt you use that? Latest LTS version. Everyone should be on it.
Java 17 is the Latest LTS and its awesome and has cool ass features
run an apt-get update and make sure your system is up to date
how i can create a for loop for a hashmap?
either use the map's for each method
Map#forEach
alrdy did it
use a lambda
thanks
or iterate over the entry set
it's debian, it won't be up to date
geol uses arch btw 
Just use latest Adoptium/Zulu/JBR etc
nah, fedora
updated and upgraded so idk whats the problem
can you send a example for a hashmap like this? HashMap<Player, Integer>
💀 please don't use player objects
Debian is always 6 months behind by design
No, use WeakHashMap
is there any way to fix this problem tho?
I have no clue what he's doing and using a player object in a hashmap is just 💀
just gimme a for loop example
Yes, change your JRE and hope for the best
kay
From my experience vendor JDKs have serious issues
Zulu is stable as shit and Adoptium is meh
The official OpenJDK JDK is pure garbage
map.forEach( (Player p, Integer key) -> {System.out.println(p.getName); System.out.println(key);});
thanks
or
// don't get getKeySet is the right getting tbh I forgo
for(Player p: map.getKeySet()){
int wow = map.get(p);
}```
did it and now it freezes here
okay, that is a bit strange
What is the java --version output? Also are you sure that the terminal is not locked?
Each server provides their own moderation. Asking for censorship never goes the way you think it will.
that's still a JRE from ~3 months ago
is there a newe version of zulu
or only java 11?
oh wait i see
still
frezzing here
Try using a fork of spigot then ig
Persistent Data Containers
ItemStack#getItemMeta#getPersistentDataContainer#setPersistentData
?pdc
this command exists? thanks lol
has anyone tested mongodb vs mysql on a minecraft server?
MySQL just wins in every situation
I still prefer postgres
I wouldn't say every situation
There are times where NoSQL is definitely better than SQL
When does it have the advantage?
When a table-like structure just doesn't make any sense. Whole object handling is a bit nicer rather than having to break it up into a table, or multiple tables if necessary
I'd still take SQL is a majority of cases though ;p
It's just not fair to say that "every situation" should be SQL
tag blocks which are placed with something maybe or save them somewhere, then check against that when a block is broken
theres an event for those I believe, do the same there
probably
You learn SQL in school (at least in Romania in the last year of highschool)
declaration: package: org.bukkit.event.block, class: BlockFormEvent
I've finished every Computer Science class my highschool offers
?paste
?paste
am having trouble with recipe1.setIngredient('S', RecipeChoice.ExactChoice(DarkSword);
https://paste.md-5.net/edehozujiz.javathe code
SQL is pretty easy to learn. Atleast what you need 90% of the time. Selects, subselects, insert, create table and join and primary/foreign keys
Obviously there's a lot more like views, procedures, indices etc
how can i fix
am having trouble with recipe1.setIngredient('S', RecipeChoice.ExactChoice(DarkSword);
https://paste.md-5.net/edehozujiz.javathe code
best thing to do
you should add - don't try to fix them, they are features at this point
I am having a shit ton of issues with gradle multiproject
it was a real story: 4000 lines of C code with that comment on top
Can anyone help me in that area?
area 51
@somber hull ask away
and learnt 0 sql?
My subprojects cannot see code from my shared project
yes
Is your shared project a su project in your gradle setup?
rootProject.name = "BetterSpawners"
include 'Freemium'
settings.gradle
For my shared
okay
we even have sql as a BAC subject
project structure
I'm not in a Computer Science Highschool lol its just a normal highschool
You should include the java plugin iirc for both modules
Can i do that through the main build.gradle file?
yes
tho idr how to do that with groovy dsl
Since I use kotlin dsl only
But let me see if I have a project that can showcase just that
Alr
@river oracle wdym normal highschool
where are you from
The United States lol
we don't like do specialization we have like a couple electives but a majority of our classes are required to graduate
Ok so i added the plugin for java
Nothing changed
However, the problem is that the subproject has no dependencies, and cant see code from the root module
Look at how its done here silent program
oh, ok
Yes
You need to apply the java plugin
And then add your sub projects to your other subproject
like:
compileOnly findProject('something')
iirc
College / University is when you do that stuff
Idr groovy syntax but sth along those lines
In the build.gradle file?
oh
i see
Well whatever subproject/module you want to
Or if you prefer implementation findProject(…)
Assuming you’re composing a single jar
How do i know my root projects name?
dependencies {
implementation findProject(":BetterSpawners")
}
this isnt working
fun i have no idea what this means
OK!
(:
It can see code from the root project. But not its own???
The GuiManager is in the same project
Did you apply the java plugin to the root project as well?
its hikaricp which is telling that message, i fked up their logging prefix
this is not root
Wdym?
The root project initializes everything
Thus you better be including the java plugin for subprojects in your root project
Put simply
subprojects apply plugin 'java'
Yes but is that declared in your root project’s gradle build script?
Like the roots plugin area in the build.gradle file??
plugins {
id "java"
id "com.github.johnrengelman.shadow" version "7.1.1"
}
group "me.silentprogram"
version "1.0-SNAPSHOT"
sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
maven {
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
subprojects {
apply plugin: 'java'
repositories {
mavenCentral()
maven {
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
dependencies {
implementation 'org.bstats:bstats-bukkit:3.0.0'
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
implementation 'com.github.stefvanschie.inventoryframework:IF:0.10.6'
}
}
dependencies {
implementation 'org.bstats:bstats-bukkit:3.0.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
implementation 'com.google.code.gson:gson:2.9.0'
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
implementation 'com.github.stefvanschie.inventoryframework:IF:0.10.6'
}
shadowJar {
relocate "com.github.stefvanschie.inventoryframework", "me.silentprogram.inventoryframework"
relocate "org.bstats", "me.silentprogram.bstats"
}
this is my root build.gradle
dependencies {
implementation rootProject
}
this is my subprojects build.gradle
Okay and where do you get the issue of accessibility?
From my subproject, to other classes in the subproject
this is the subproject
And the issue is that it cant see GuiManager in BetterSpawners
Within a single subproject?
watch that gui manager to be like package private or smth xD
Or between two different ones?
one
Yeah good point, silent program you might wanna check that out first
But else try to restart and invalidate
public class GuiManager extends GuiManagerAbstract {
wdym invalidate
Invalidate caches
thanks for the help
No worries, glad I could help ya
Last thing
How do i build it for the specific subprojects?
Oh
nvm
I now have a category for that on the right
Ye
what is check_decay in leaves block?
Oh no
How do i add shadow plugin to a subproject?
Ok ill have to come back later
But its not including my root project in the built jar file
Oh yeah
Switch to implementation
and you can include the shadow jar plugin the same way you did with the java one for submodules
Without version tho
?
Cuz that was already declared
If they should decay I’d presume
could it be possible that /kill @e doesnt throw a PlayerDeathEvent?
hmm it was for my vanish plugin, /kill seems to make the target stop flying
what are you doing inside a death event then?
Could anyone help me out? I'm trying to ignore my src folder and other folders through .gitignore but they still get pushed
BuildTools - TransportException
how to i make sspercific portals not teleport you to the end / nether?
you want to teleport to a custom location or just do nothing?
just do nothing
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerPortalEvent.html you can cancel this event
declaration: package: org.bukkit.event.player, class: PlayerPortalEvent
Is there a way to add a command to tab completion without it being in the plugin.yml?
yes
How?
well you know how you can extend CommandExecutor
im confused what am i supposed to do?
its.. supposed to stop the teleport from happening like you wanted?
you sent me a link to a million random words
random?
what am i looking for?
this is a development chat...
do u know how to do it (non developer side)?
i need the nether
well looks like you gonna need a plugin then
damn
do u think one will already exist?
this one perhaps?
I don't want to tab complete for a specific command. I mean as soon as the player types / I need a command not registered in plugin.yml to show up.
No, the only way a command shows in tab is when it is registered in the plugin.yml
thanks
is there one for end portals too?
Google your question before asking it:
https://www.google.com/
bro i cant find anything D:
so all you want is to completely disable both nether and end portals
yes but i would also like nether and end portals to be created in a certain world
so for e.g
in parkour i do NOT want players teleporting to the end in the end portal in a parkour map
but
in the survival world i DO want players to be able to make and teleport to the end / nether
ooh thanks you!!
so there is no need for this plugin?
well no
okay cool
has anyone a idea why my tablist is not working and why i see the vanilla tablist..
package de.maurice.mcp.menu;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import net.md_5.bungee.api.ChatColor;
public class TabList {
public void setComponents(Player player) {
player.setPlayerListHeader(ChatColor.GOLD + "TEST SERVER");
player.setPlayerListFooter("" + ChatColor.GOLD + Bukkit.getOnlinePlayers().size() + ChatColor.GOLD + "/"
+ ChatColor.GOLD + Bukkit.getMaxPlayers());
player.setPlayerListName(ChatColor.RED + player.getName());
}
}
wats ur server version
1.18.2
When are you setting the TabList?
I haven't tried this, but maybe if you listen to PlayerChatTabCompleteEvent and add the command to the getTabCompletions() Collection you can get it to work
You want to disable all commands?
You can remove visibility of any command by removing it in this event https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerCommandSendEvent.html
mvn package
command line? mvn installIn the directory with the pom
install installs it into your local mvn repo as well tho 
true, package is better
clean package deletes all previous build files before recompiling
did you run it -o ?
looks to be in offline mode
Did you run buildtools for the version
1.8
Sigh. I mean that works but it's so much more difficult than just using buildtools.
you are using an HTTP repository and should be using HTTPS
looks like
it can, IF all your dependencies are in your local .m2
check if all the repo's are https
Those are deps I'm talking repos
Why does tabComplete does not work?
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 1) {
return serverNames;
}
return null;
}
If i print out serverNames to the console it displays without a problem
[22:13:42 INFO]: Testowy przemek_testowy
they recently enforced https
yes
Hello, i try this, but i get error:
s.sendMessage("Roleplay Utilities Version " + this.getDescription().getVersion());
}````
thats unfortunate
gradle doesnt allow http either iirc
then you're shit out of luck
or it yells at u repeatedly for it
install it local
Step 1. Bitch at them.
Step 2. Either downgrade maven or download it locally and install
does https not work?
Heck even I got my maven repo to have https
it most likely already redirects to https anyway
probably cuz its an 8 year old repo :))
Unknown host repo.tigerhix.me
Doesn't have https or http, that url doesn't exist?
Maybe use dependencies that are still around 
1.8 moment
gonna have to install it locally anyway then lul
error is pretty clear no?
What are you doing here, ded?
had a question a few days ago lol
Ah
why are you
No idea why I prefer spigot over paper
more chaos = better
Cause paper = flammable
Am I doing something wrong? I can print out the list to console, but the tab completion does not show
does it ever get to that code?
dont forget to register it too
yes because things below it are working
or entire scope of that method
your only returning null under it?
so ofc it would work because its nothing
you know how to do remote debugging?
nope ;/
It does not 🙃
If something doesnt work in java best bet is to just start debug logging
Also dark eye remote debugging doesnt rly work for minecraft because it needs the server, but its brilliant for standalone apps
So theres something wrong with it
And did you register this tab completor?
I know thats a silly question, but when i create a class that extends thread, is only the code in the run() method in a new thread or everything in that class?
i would love to see a intellij plugin for mc development debugging tho
would save so much time
put it in run() yes
and start it with start()
or if you want
@formal bear https://www.spigotmc.org/wiki/intellij-debug-your-plugin/ this will change your life 🙂
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
But code that isn't in the run method wouldn't be in a new thread?
you can have a method referance to a thread without extending thread
the code in run is in a new thread yes
all other code is not
yeah but in the same thread
your constructor is in the calling classes thread
run() is the actual new thread
sec
only what gets ran in run()
actually i do my threads different but yeah thats what it is
i'm just using getcommand setexecutor as it working in other commands
I do new Thread(Runnable/ThreadHere).start()
this.getCommand("server").setExecutor(new ServerList());
shouldnt you use ExecutorService/ScheduledExecutorService in java
For program i have its not rly needed, you can initialize threads in many different ways
plus these thread are long running dont want them cleared by jvm
for scheduling i use chains of CompletableFuture that return theyre results in sync
Similar to NodeJS promises in a sense
I've had runnables run for 6 months. I don't think you need to worry about the JVM clearing them lol
lmao
That’s for long lived thread runners that might deal with a set of tasks
yeah its a bit different when working with Minecraft and Spigot/PaperMC
Using a raw thread is more when a single short lived task is to be executed
And sadly if you have a poop pc/bad jvm flags CompletableFuture will start a new thread per task
Apparently it works lol
[22:37:06 INFO]: botprzemek[/176.97.28.105:43207] logged in with entity id 19 at ([world]-5.5, 208.0, -13.5)
[22:37:09 INFO]: Works
[22:37:10 INFO]: Works
[22:37:10 INFO]: Works
[22:37:10 INFO]: Works
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 1) {
Bukkit.getLogger().info("Works");
return serverNames;
}
return null;
}
My logs have theyre threads logged into the console, only ever uses about 2-3
Conclure
locally its all on one thread
In which you might wanna think about the setup a bit differently
well not necessarily
On my remote machine i havent tested it yet
FJP’s workers might steal work
When building the subproject, it doesnt include the root project or any dependencies
Since is has a task queue per worker
Yeah but its what CompletableFuture uses sadly
I should just use threads ngl
for that part at least
Yeah, well generally it’s fine
As long as you’re not involving yourself with io tasks when using common pool
No local IO, but it does contact mongodb
Hmm
and google services
Could be problematic if the latency is bad
Latency wont be an issue
this is an authentication droplet so its gonna be running in the same data center as the other game servers
Since a lot of other stuff also uses common pool, if your io tasks occupies it, it will end up affecting performance on several other places internally and possibly externally also
Wel even io generally
nvm i figured it out myself
Since those tasks are always a bit resource intensive
Is there a way to get CompletableFutures to not use FJP?
Or just use runnables/threads is only way
CompletableFuture#runAsync(action,executor)
I just like CompletableFuture.runAsync)runnable_
Which takes any executor
Hmm ill have to look into making pools havent worked with thread pools because
Yeah Dw Dw java made it fairly simple to work with :3
Someone know the modern usage of PlayerPickupItemEvent ? Because this event is deprecated
does it not say what to use instead
oh it is its one line
nice was hoping it wasnt like websockets and needing to abstract and implement half the shit i write
declaration: package: org.bukkit.event.entity, class: EntityPickupItemEvent
@ancient basin
^
Seriously, it's just entity instead of player
Yeah tho methods from Executors are factory methods so bare in mind to cache the executor
IntelliJ didn't display this xD
In alot of cases yeah
Thanks
this is returning null
public MainClass getPlugin() {
return plugin;
}
However it is declared in the cconstructor
public StartupClass(MainClass plugin) {
this.plugin = plugin;
startup();
}
plugin cannot be null as it is what is extending JavaPlugin, and running the plugin.
Ok ok, I'll remember
public class BetterSpawners extends MainClass {
The supposedly null class
public abstract class MainClass extends JavaPlugin {
Myclass extends JavaPlugin
where do u create the instance
abstraction
Very hard to figure out given the references you given us so far
was like huh weird then i saw you say cache it
aka where do u do new StartupClass


Its the main class. So spigot creates the instance
show
But i pas sit through with this
where do you do new StartupClass
Nothing would be running if it wasnt the main class
public void onEnable() {
startupClass = new StartupClass(this);
this.guiManager = new GuiManager(startupClass);
}
I kinda wanna resend the debug wiki page now 🌝
LOL
what line is being called null
KEYS = new Keys(this);
Well
public final NamespacedKey ENTITY_TYPE_KEY = new NamespacedKey(plugin.getPlugin(), "bs.entityType");
This line, inside of KEYS
Would having one thread for all socket messages be better (No request will ever live past a few hundred ms unless mongodb hangs)
Or opening new threads for each request like so?
I basically just wrap each onMessage in a runAsync for rn
The server itself is also on its own thread outside the main
this is not null, its .getPlugin() that is null
What type of thread pool do u use
just the fixed thread pool i set it to 12 for now
why are you calling get plugin on plugin 🤔 shouldnt plugin already be an instance of javaplugin?
Have u configured time to to live and core pool size etc?
Or r u using default settings
I switched up my cstructure halfway through
Negative dont the futuress die once theyre completed?
Just default settings
Imma go back and fix everyhting later
try declaring it inside constructor
Yes well the futures get completed
It was easier to add getPlugin than to change every object to a different class
wdym, the getPlugin?
Burchard I’d use a fork join pool/ work stealing pool
It’s almost always superior to the fixed thread pool
Even without forkable tasks
si
And then just have it set to a max number of workers/threads yk
And then send it to the CF just
kk, and would the opening of a new future/thread like that for each socket request be fine conidering they wont be alive for long?
Idk how Threads actually get handled when put on a real cpu, wether there is a hard limit or it just depends on ram and cpu speed capabilities
Threads as of now are platform threads thus get mapped to os threads
Still null
private StartupClass pluginClass;
private MainClass plugin;
public Keys(StartupClass pluginClass) {
this.pluginClass = pluginClass;
this.plugin = pluginClass.getPlugin();
}
But with fork join pool you don’t care about threads
ni
i meant
In dumb mans terms that basically means that each Thread repesents a real thread on a cpu?
oh
Since it’s gonna be limited to the available processor amount anyway
this
perfect then
O
Yeah instead you have workers
declare this variable in a constructor
And a fjp can create more threads than its specified parallelism
If needed
It’s quite optimal
I just needed something like NodeJS's style of doing things async with Promises, would be 10x nicer if i could do it without threads cause thats how NodeJS does it but meh java
kk ill look into that
Yes well in the future we get what you call virtual threads
Then you can use Executors.newThreadPerTaskExecutor()
Since virtual are gonna be dead ass cheap
ohh
But as of now, fork join pool is usually what I prefer
Cached one is good also but it gets out of control when it comes to throughout sometimes this can allow ddos to happen
At least the one with Executors.newCachedThreadPool()
It’s great if you’ve full control over the tasks
Cuz then ddos is likely not gonna happen regardless
and how about the Thread class itself, are those virtual threads when executing with a fork join pool?
And yeah i have a socket rate limited that wont even open a new thread if it detects someones sending requests to fast
I wanted to run each ConnectedClient in its own Thread so i can have an event based system
No Thread as of now will always yield instances of platform threads
But FJP will in simple terms create a thread executor per thread, basically each thread has a queue of tasks
As opposed to fixed thread pool or cached one where there’s a single queue for tasks
I think FJP will be perfect for the requesting part definatly
gonna work on switching that over rn
Ye
It’s usually most optimal anyway
But people used the other two mainly when work stealing wasn’t a thing in java yet
Well unless you wanna configure one specifically
Dont think i rly have much needs for configuration too much
Altho the methods you have there are quite optimal if you don’t care that much
Ye
I do have an example in case you’re very curious but I doubt you’ll actually need it, my code is usually a mess anyway
so sad .07ms execution time thats gonna take like .2 when put on a remote server 
sure ill take a look

Lemme push then
code for mines weird
i made a api jar so i can handle shiz easier haha
i stole spigots event system in a sense
Any message from the socket server, will attempt to verify the message schema against the second argument of the annotated method
And will only fire the event if valid json and schema was sent
Had to upload to git
Kinda wanting to override the WebSocket class into my own so the methods themselves are just async instead of calling the Completable each time
👍🏾
oo
https://github.com/Conclure/Epicd
https://github.com/Conclure/ConclureLib
made those two public for now, but they probably will be made private again, anyway for the epicd one go with lol/user/StorageImpl (kinda how I use the future) and then for ConclureLib the data package basically
ill go take a shower so brb
Is it possible to get index of element in list when i check it with list.contains(element)?
I want to get index when players enters it
iirc nope
since an element can be contained multiple times
thus making the index ambiguous since the element can have more than one index
what are these options good 4? i can assume that Log Prefix is the prefix in the console, but all the other things are unknown for me.
load before, depend and soft depend are all about other plugins
and relative loading order
so they are irrelevant tbh..
I want to make something like, just use switch or how?
/command arg1
say bruh
/command arg2
say lmao
Well let’s say you depend on placeholder api
Then you probably want placeholder api to load before your plugin
Thus the order becomes highly relevant
Switch in the argument?
how do i set/send text in someones action bar (with commandblocks its /title @s actionbar) but i cant find it anywhere, its not player.sendTitle
player.spigot.sendMessage
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, message);
Hey, anyone know if there's a more efficient way of setting player permissions within an attachment
Currently I have a list of around 150 permissions, and running on the main thread to set them all is causing a large payload and causing the tick length to reach 100+ms
Any ideas?
switch (arg[0]) { etc }? is there a better way to do it
redesign and get rid of some permissions
Switch is fine if you don’t have a lot of responses
arg[0].toLowerCase(Locale.ROOT) tho
also set them all at once so there is only one update and not individually
5-element list, so its fine tho?
Do you have an example of this? The #setPermission only accepts a String as arg so how am I meant to execute all at once
Yea
use reflection on teh Map
but it does not scale if player adds another element, i read them from config section hmm
Will take a look, thanks!
it does nothing, so i checked the source code, and it sais its not supported yet?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Isnt it possible? Numbers are my config sections
"0":
arg: "Testowy" // if player writes /command arg then sendmessage text
text: "przemek_testowy"
"1":
arg: "Wiciaa__"
text: "wicia"
Idk pseudo
I'm making the typical mermaid kinda plugin where you can't breathe on land, and this works all fine, you air goes down on the surface and up in water. What i can't figure out if how to get the drowning damage to trigger. Do i have to manually damage the player or am i missing something?
seems like so
the manual damage or the me missing something
Have you checked the nms implementation to see where it damages the player
that's actually a really good idea
@ivory sleetBut did I assume that right?
.
Yes
found it
only procs if the eyes are underwater
so manual damage it is
Is there a way to have a preset template for the main class of future plugins being created by the minecraft development plugin (spigot plugins) in IntelliJ?
I know that @tender shard got something similar so i wanted to get that done as well so i don't have to copy the foundation again and again
you could create a maven archetype
now onto the next question, is there still no way to specify the damagecause when damaging the player?
mby setLastDamageCause?
How can I do that exactly? 😮
doesnt work; when you damage them it fires an event with damageCause.CUSTOM, and the setLastDamage cause just edits the last stored event after the listeners did their thing
indepth guide on how to create a maven archetype
and if i call the event before or after setting it, it simply fires two, the one with the correct damage cause being different from the actual damage event fired
welp, onto the things to add to the list of "need to use NMS for"
Anywhere I can get a comprehensive list of this lmao
I mean you could use setHealth and then fire the event urself. The player wouldn't get any damage effect in that case tho
for now i have
Custom PathFinding
NPC
Specific damage causes
Maybe this will be cleaner to understand, how it's made /kit kitname and then get list of items, i want to make something like that but with just one string
if arg[0] == kitname? then give him the items for the kit
also means other plugins can't affect it and that the death message would remain as "xxx died"
Man I wanna learn how to do pathfinding lmao
You need nms for that
which is what i wanted to set the damage cause for
?
can't access it without NMS afaik
ye in that case you won't be able to
only to use it inside your own plugin
but then there would be less hacky solutions anyway
eh, it's not that important anyways, just a bit awkward but not dire
guess i'll wait for the day it gets added
You could handle death messages urself. In that case you can deal with your own damage causes
but other plugins -> no chance
better than nothing i suppose
Technically you could take the default message unless it's custom damage and in that case set the correct one based on the damage type you set somewhere for that player
The mapping of all the messages might need some work tho. Probably easier to make your own
Hi, i'm working on a bungeecord plugin and i'm wondering how to execute a command as the bungeecord console
by googling it i found proxy#getPluginManager#dispatchCommand
but it doesnt work
What would the best way be to refresh a player's view of themselves? (Refreshing their skin)
I did some research and I heard the respawn packet, but that didn't give me any luck
i fixed it on my own
it for getting the actual version of the plugin
How do I change the types of trades a villager can spawn with? I'm not referring to modifying a specific villager's trades by targeting them and overwriting their trades one by one, rather I want to go to the very core of trading, and overwrite the vanilla list of trades that any given villager picks from when they spawn
gotta do:
//TODO: Fix this later
to put it more simply, I want to change the default currency for villagers from emeralds to gold nuggets 😄
when i am changing custom model data, i am doing that with setItem
but then the item will quickly be replaced, so you will see that animation of the arm going down and up again
is there an way to, well, not have that
lmao
Edit its attribute modifiers
Yea but like what would I set them to & what are they called, where can I find that info?
?jd-s
