#help-development
1 messages · Page 1467 of 1
okay ill read that later and what about the error
this right?
I didn't have nitro and I could customize it
It's only for some random people
I currently have nitro... but it does not let me edit it
yeah me too the unlock with nitro doesnt work the about me writing works like writing and then saving but nothing changes
ANYWAY
is there a point on doing a custom fork?
like any advantages if you're creating your own server..
You can always improve performance
aight
any other advantage lmfao
You can do whatever you want
Just put your gamemode into the spigot itself :troll:
ItemStack[] items = (ItemStack[]) map.keySet().toArray();
ItemStack foundItem = items[IntStream.range(0, items.length)
.filter(i -> items[i].isSimilar(item))
.findFirst()
.orElse(-1) + 1];
ugh bad formatting but there you go @quaint mantle
that'll grab the next item
Yes
I mean it's untested
It will probably throw an error if you're on the last item
It has no point...
you literally can do anything tbh
send custom packets
do anything what you want
but custom packets require client
that is able to accept it
I mean you can do that with plugins too 🧠
You're probably creating a too large inventory
nah like just defining a completely new class
a completely new packet structure
Then show us the code
Saving inventory:
VariablesHandler.getPlayerInventories().put(player.getName(), player.getInventory());
Putting into inventory:
if (VariablesHandler.getPlayerInventories().containsKey(player.getName())) {
player.getInventory().clear();
player.getInventory().setContents(VariablesHandler.getPlayerInventories().get(player.getName()).getContents());
VariablesHandler.getPlayerInventories().remove(player.getName());
}
I mean you can write your own packet system with plugins
ig but id rather that be part of the server
pls use uuid over name btw
why?
Not while the player is connected though
ohhh okay
Still, UUID is better
player is saved in the map
they leave and come back with their name changed
and now boom contents gone
However, I guess you could use a Weak data structure and Player
but id rather use UUID
ok and the error?
I mean advantages that can improve efficiency....
or performence
or make things easier.....
or things I should probably do if I make a fork
could you try printing out the size of the contents stored ?
You know what else could make it better? deez nuts.
the dish respect.
i dont see getContents.size
oh yea sry
weird doesnt do anything rn
nvm im just stupdi
41
maybe it gets even an armor?
It copies the armor and offhand slot
xd
But doesn't like setting it back I guess
yeah so how do i fix that
anyone know what happened to the spigotmc maven repo, there doesn't seem to be any builds on there for pure spigot/craftbukkit just the api? I'd rather not use build tools and I need to do NMS development. I've got the mavenLocal repo, is this working for anyone else?
You need to use buildtools to add NMS to your local maven repo
You need BuildTools for NMS
😦 bruh moment
i mean you could just build them all
@young knoll do you know how to get the armor contents and other stuff separately?
getArmorContents and getItemInOffHand
and the item contents bcz that returns the armor and offhand
Heyy Guys, im really dumb with coding xD. And i want to get a link from a API and transfer it to a QR Code
Any ideas?
what
Yeah, im trying to get a link from an API called ThemePark. And get the link from it so i could generate an QR Code in minecraft with it
aynone know how essentialsx works
i hate this yagpdb bot
public static void create(String qrData) {
try {
String charset = "UTF-8";
Map<EncodeHintType, ErrorCorrectionLevel> hintMap = new HashMap<EncodeHintType, ErrorCorrectionLevel>();
hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
BitMatrix matrix = new MultiFormatWriter().encode(new String(qrData.getBytes(charset), charset), BarcodeFormat.QR_CODE, 200, 200, hintMap);
MatrixToImageWriter.writeToFile(matrix, path), path);
} catch (Exception e) {
e.printStackTrace();
}
}
Wow, that's really helpful, thank you!
yw
oh sorry imports
import java.util.HashMap;
import java.util.Map;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
Alrighty, thank you!
I ended up making my own shenanigans again
https://gyazo.com/d1b8270411f14a66a89ae1c7fe3a9ba7
I don't know why, but when I try to build spigot and use the jar, when starting I have that : https://paste.md-5.net/abuqufigar.sql
Can someone help me ?
{
potions.add(new IItem(0, new ItemStack(Material.DIRT), 25));
potions.add(new IItem(1, new ItemStack(Material.COAL, 3), 30));
potions.add(new IItem(2, new ItemStack(Material.DIAMOND_AXE), 266));
potions.add(new IItem(3, new ItemStack(Material.EMERALD, 6), 2));
}
public IItem next (ArrayList < IItem > items, ItemStack itemStack){
int index = 0;
for (IItem potion : items) {
if (itemStack.isSimilar(potion.item)) {
return (index == (items.size() - 1) ? items.get(0) : items.get(index + 1));
}
index++;
}
return null;
}
public IItem previous (ArrayList < IItem > items, ItemStack itemStack){
int index = 0;
for (IItem potion : items) {
if (itemStack.isSimilar(potion.item)) {
return (index == 0 ? items.get(items.size() - 1) : items.get(index - 1));
}
index++;
}
return null;
}```
ig try removing content where the buildtools.jar is
files folders in it
But I need them to build the jar
show what you have in there
Well if it works it works 
Yeah it's good
root where I used BuildTools :
@chrome beacon could you help me btw with the getStorageContents or smth ?
yea well remove everything except BuildTools.jar
Sure
wait ok
And I try to build the jar
maybe try --disable-certificate-check
Unrecognized option: --disable-certificate-check
how can i remove armor and offhand in PlayerInventory#getContents in 1.9?
How can I check for armor changes with Spigot. In paper there is an event but is there anything similar in the Spigot API
You can't
PlayerInventory#getContents in 1.9 version like returns armor contents, offhand item, and this
at least before 1.12.2
im on latest
maybe ArmorStandManipulateEvent
I dont need Armor stand
So you just want the inventory not armor and offhand?
yes
maybe try inventoryclickevent and then check for the inventorytype if its inventorytype player
Try using getStorageContents
I won't work with clicking with the item in hand
If I remember someone made a plugin to add this event
Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.PlayerInventory.getStorageContents()[Lorg/bukkit/inventory/ItemStack;
at pavlyi.authtools.spigot.listeners.MainListener.cancelSetup(MainListener.java:125) ~[?:?]
I am aware of this plugin but its just something else someone has to download to use my plugin
I think im gonna have to, since there is no easy other alternative
Just put credits in here
Do what you want, but be sure that there is no native method to do so
What spigot version?
1.9
Why are you on 1.9
for plugin development
But why 
the client im doing it for choose it
Not if you check what is inside
I meant for the 1.9 comment xd
but i know what u mean
x)
For me I only used 3 versions of spigot 1.8, 1.12.2 and 1.16.5
wait how would i filter it?
Get what's in the armor slot and remove it from the array
tbh idk why spigot havnt alrdy added armor events
just a question how would i get the list or idk? sry i never used filter function
Arrays.stream(VariablesHandler.getPlayerInventories().get(player.getUniqueId()).getContents())
.filter(item -> item != null)
.filter( item -> VariablesHandler.getPlayerInventories().get(player.getUniqueId()).getArmorContents())
.collect( Collectors.toSet() );
That would work
so like item.contains?
what would be the most efficient way of pulling blocks out of the ground and have them flying in the sky with as little lag as possible
And is there a way to get a list of blocks on the surface around a particle.
Yeah this is never going to be very performant so don't worry about it too much....
never?
.
TNT cause a lot of lagg especially if there's a lot of it
can you guys give advice? I am making a spider armor that gives damage reduction for spiders. How can I make that?
listen to the damage event, check if attacker is instance of spider, reduce accordingly
no no i meant like get blocks floating like their stuck in a tornado etc
e.getInventory().setItem(coinSlot, new ItemStack(Material.DOUBLE_PLANT, 100)); This will set it to 64 items, any way to bypass this/
?
so that it's 100 items instead of 64
oh I assumed you were doing tnt
dont believe so
i just dont know where id start to get blocks floating
Then just set the block to air and spawn a falling block?
Not sure what you need help with here
Oh it’s that simple…
Hey there I need some help with iterating though my config file. I really want to progress make progress with my plugin but I am stuck with it.
I already posted the problem here https://www.spigotmc.org/threads/can-not-iterate-through-config.508069/#post-4174081 and if maybe someone would be interested in directly helping me with that problem I would be pleased.
TL;DR:
I try to iterate though my config file but don't get any value. I followed some examples already but end up with nothing working yet. Would be happy if someone who already made it work is interested in helping me.
posted something there for u
@sonic bronze same
is there a non-deprecated way to spawn a falling Block with Data? Because World#spawnFallingBlock() is deprecated
any idea why this custom effect kills even a creative player?
- ==: PotionEffect
effect: 6
duration: 2000
amplifier: 125
ambient: false
has-particles: true
has-icon: true```
6 is instant health
@quaint mantle did it again
how would i figure out whats causing the null pointer?
check if the getString realy find
thanks
if i create tow team on different scoreboard did the player can see other team color name (above player head) ?
or they need to be in the same scoreboard ?
ok thx
Bruh 1.7
@quaint mantle answered again
guys he found the problem useless to ping him
and the error screen contain all infos
I was able to fix it thanks
just a sill config mistake
how would i remove potions effects using uuid's?
use the UUID to get the player object
and then from the player object you can remove potion effects
oh
thanks, would this work?
yes that works
thank you
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
I'm creating a client, after I ran it for the first time this error came up:
https://hastebin.com/macewagivi.sql
I tried changing my client compiler to java 1.8 and overall eclipse compiler to 1.8 but after doing that and running my client again the same error still keeps popping up.
Im using mdk.
the issue is the reflective code
actually what does your pom look like?
could just be a simple issue of not specifing the correct JDK
oh not using maven to build
it's "pom.xml"
Yeah theres no such file
so I take it you are using ant then
I followed a tutorial
Ive never used gradle or maven myself
but this one
is associated with gradle
ah gradle
just tell me when you guys are done helping each other So I can post my problem, ok thanks.
I am not familiar enough with gradle to help solve any issues related to it. Anyways, it is either going to be an issue of not specifying the JDK properly and thus, the compiler just uses what it can pull from the command line, which whatever JDK version pops up when you do java --version on the command line. Or it is a legit issue with the reflective code that is causing the class cast exception.
then why chose it in the first place?
@vital ridge doesn't necessarily mean it is a good one or accurate
Well I got to learn from somewhere right
Just trynna watch every single tutorial i can
to get at least some knowledge
indeed, but projects like forge and tools such as java and maven change over time
thus making the tutorial you following, outdated
ye maybe, its from oct 2020
Idk like, what should I do lol, I still want to continue with it
in the comments, a few people had the same problem, but they were told that its cuz java 1.8+ is not supported
Java made changes in later versions to how reflection works, so it is quite possible that forge updated their code to keep it compliant with that. If that is true, then you can't use the updated project with older versions of java
I wouldn't try java 9
try with Java 11
9 broken too many things, 10 fixes some of those things, and 11 everything is fixed that was broken lol
I still love Java 8
Yea theres still the same error
@vestal dome why? missing out on many great features in later versions
and best part is, all the way up to java 16 you can still run java 8 code
Unix sockets are in Java 16
natively
Unix?
yes, unix sockets are like TCP sockets
but better especially for things say MySQL DB servers
that are running on the same host
less overhead and more bandwidth 😄
I would say being outdated is the best way to maintain Cross-version
even most of my plugins are base 1.8.8
Also, in the later versions the GC(Garbage collector) is significantly improved over what is in Java 8
Java 16 can run anything coded for Java 8
What if you compiled using java 16 and someone uses java 8?
you can even use JDK 16 to compile for 1.8 as well
@vestal dome obviously if you compile for jdk 16, you can't use lower versions to run it. But you don't need to compile for jdk 16 unless you make use of specific features of it. But that isn't the same as running the server/plugins with JDK 16
But you don't need Java 8 to compile for java 8 either
exactly.
so there is no harm in just simply upgrading
I don't disagree with people who update their java server version to 16.
I'm just saying I'm not updating my plugin's base Java because it may interefere with cross-version support.
sure, if you want to support java 8
personally I compile for java 11
if you refuse to update to java 11 at minimum, then that isn't my problem 😉
Alright
Now uhh
I have this timings.
but I specifically check if the chunk is loaded or not.
because you may not want to load the chunk to make the machine produce,
and lag out the server, but it still does.... I don't get it
not sure what you mean by not want to load the chunk and make the machine produce
I don't want to produce on a machine on an unloaded chunk
because I don't want to lag out the server.
you mean, have things like crops growing?
no
it's a block that you place
and it produces some items every few seconds
the idea is that if a machine is in an unloaded chunk, it will not spawn any items neither work.
if it is on a loaded chunk, it will drop it's item and do it's thing
but for some reason the plugin still loads the chunks when producing.
probably has to do with some code you are using then
and I even have a check before spawning it
here look
I have a check at line 25
it checks if the config is enabled and if the chunk is not loaded, it will just RETURN... and it's done
the chunk is not loaded and performance is not affected..
any particular reason why you bitshift the location?
That would load the chunk
close location.getChunk().isLoaded()
Yeah, getChunk().isLoaded() is always true lol
let me guess why lmfao
if you don;t want to risk a chunk load https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getLoadedChunks() contains
A better solution would just be to check if there is players nearby
or isChunkLoaded(x,z) on World
instead of loaded chunks
this way, even if the chunk is loaded, your machine won't be producing stuff while the chunk is waiting to be unloaded since that isn't instant
Pissed
sense is kinda apsent tho
what am I even supposed to use?
it doesn't even make a little sense.
Absolute NONE
Unless I done something wrong, but still.
wtf
well, the best solution would be to change what you check for or add an additional check so that there isn't problems with a chunk being loaded unnecessarily for whatever reason
the additional check would be to simply check if there is players nearby
if there isn't any players nearby, simply don't have your machine do anything. As I said earlier. Even if a player did cause the chunk to load, chunks don't unload instantly either.
umm did i do anything wrong here
well.... do I even have to say a word?
we don't even have the pom so.. if u could send it, would be easier....
either you have some missing tags, or indentation is incorrect for the tags @digital plinth
p
getChunkAt loads the chunk synchronously
basically a no-no
especially on paper
you basically never want to call getChunkAt
because paper's chunk loading is asynchronous, unlike spigot's
it's stable as long as nobody wants chunks to load synchronously
How can I get an argument like "/chatlogs <name>" which responds to the sender on the target
the new Sublime Text 4 is awesome
the goal, basically, is to reduce sync chunk loads to exactly zero
few things in the base game cause them on paper, most notably perhaps nether portals
plugins that fire sync loads are generally frowned upon
frowned ?
its blaze fast, supports GPU acceleration, looks as great as VSCode UI, apart the con of the bulky sublime merge
do you think there is a way to make the chunk load blazing fast just by loading all chunks to memory?
it would still be quite slow, but not as slow
as stuff like light and neighbors need to be computed regardless
and just parsing the serialized data and spawning all of the entity and tile entity objects and everything will take its time
what are you doing, anyway
What's the best server implementation in your opinion?
vanilla is kinda og
I still consider base spigot or paper very good for it's value
I like spigot 🙂
there is little value to it by this point other than the forums being a large repository of noob questions
I never used any other server implementation except Spigot, Bukkit & Paper...
Oh and NMS itself.
bukkit is the most popular api yeah
spigot is built on top of bukkit, and paper is built on top of spigot and thus includes bukkit. So, doesn't matter which you pick, get the bukkit api regardless 😉
I find bukkit quite questionable ngl....
bukkit is kind of trash around parts
Bukkit developers didn't always make the wisest decisions especially after a couple key developers were hired by Mojang
"respository" is not a word
there are quite a few design decisions in bukkit that i disagree with and some things could definitely take some inspiration from the other projects around
most of the decisions were based around how lazy they wanted to be
I still like to use NMS..
one of the things i really don't like is the tooth-and-nail "we must not break backwards compat" mindset
Learning how to manipulate NMS can actually be pretty useful, I would say..
hmm yes forced paper adventure components when
your contribution to bukkit at the time could simply be denied all because they don't want to maintain the code you contributed even if its super valuable 😛
Why don’t you like if
It*
tbh that's the case still mostly everywhere
limiting
it's not really worth pulling in if nobody can maintain it
If u don't feel good with Bukkit...
Use NMS
simple.
just agree that you will have to use a LOT of reflection.
NMS doesn't always require reflection
wdym?
but problem with using NMS is the unpredictable changes to it
Sigh
to be honest I'd almost take unpredictable changes over half a decade of stagnation
that is why there is an API 🙂
MD FOUR
all praise to the supreme leader

Stop using nms and stop bitching about an API you have made no effort to improve
it's a violation of the TOS to remember it
I'm no chad coder, but I like this man!
lmao
API's are not meant to change wildly all the time anyways
i can't hear you over the material enum
what does this have to do with it?
what?
recently
I don't see how licensing is the issue here @mortal hare or even related to the topic o.O
mappings? what?
maybe he's talking about nms for some reason
If you're concerned about licensing then using NMS is definitely not the answer lol
Yea #576 when
true
I think the low/no contributions is simply due to the complexity of making a PR.
Well obviously complaining is easier than doing anything at all
More rewarding for sure
also, tbh spigot PRs are rather simple compared to other projects in the eco system xD
Ive always been intrested in APIs is the spigot backend of the API open source?
like, bukkit and craft bukkit changes are just commits
@eternal night it can be hard if you don't understand how to make patches
awwwwwwww yes, please change my mind
I say change my mind ironically.. because it's true.
Yes, check the readmes, also contributing page on the wiki
there is a bash script that does all of you
hot
ooof
PR's are rare because people are afraid to fuck up 😄
well it is easy to mess up the patching process depending where you are trying to make the PR lol
Cannot get it, Cannot get it, Cannot make it, omg.
meanwhile the paper people are sitting on a huge backlog of prs that they have an entire team verifying and merging
To be honest, the only part I found lacking in the API (that I can remember) is the Half finished Vehicle API.
people have asked for API about loot tables in the past day like 3 times
There are a lot of small things
I looked for a creeper ignite event, sadly there is not one
add it yourself
what is wrong with the API for loot tables that is currently in place @wraith rapids ?
yeah, the few, pre-existing vanilla loot tables are there sure, but you can't create new ones or modify the existing ones
I thought creepers fire teh prime event, just as they are about to explode
you can create new ones o.O
They do
not afaik
But I want just as they start the fuse
i guess I could be wrong but I've never heard of that being possible
over the several dozens of times people have asked for it
well most of the problem revolves around most not understanding how the server uses loot tables and when they are created
and once created what you can or can't do with them
Creating a purely code driven loot table is problematic because what do you do when the plugin is not loaded?
the same as you would do when the datapack isn't loaded
cry ?
which, I don't know what that is, it probably is either silently omitted or stripped out
either way the problem shouldn't be different from that of datapacks
A Datapacks doesn't leak an entire plugin, it's just a string
are you talking about reloads?
Big difference between attaching an arbitrary java object to an entity and attaching a string
i don't know what you're talking about
someone just remove /reload please
would save us such a huge headache
would even make those pesky custom inventory holder impl relatively safe
i see no difference; both are things provided by a resource that can be absent at any time in the future
not like any serious production environment actually uses a reload
The existence of reload is a great reminder that it's an API not a modding framework
- plugin API
why is it not? what else is it? Isn't that how to use maven/
Repository, spelling
reload would work properly if most plugins were coded to handle it. Unfortunately many developers just simply don't bother with it lol
kek
all of my plugins are intended to handle reloads
Well, yes but then you would move that responsibility into plugins hands
I mean if you use the API, reload just works
which like, do you trust the devs
if it doesn't handle reloads, it's probably 🚮
maybe we just need a bukkit based modding framework 🤔
Aka forge
sukkit
it has always been the responsibility of the developer to handle reloads
i had a play around with mohist and i couldnt understand why mods dont like working with plugins
yes but as of right now spigot ensures that, even if you mess it up, you should (looking at you inventory holder) not leak any classes into the server runtime
forge is bukkit based o.O
that is a new one
based?
implements bukkit api
---joke-->
your head
forge is also redpilled
you better be
ye plz forgive me for my inherited lack of humor, I can't help it
@eternal night not sure what you mean by leak classes into the server runtime. Classes of plugins are loaded onto the classpath. That is why sometimes when you replace a jar or remove it while the server is running, it doesn't mean it was removed from the server until it restarts or changes appear.
They’re in their own isolated classloader which is removed when you, eg, reload
he probably means that instances from plugin classes aren't strongly referenced, which would keep the classes and through the classes the pluginclassloader strongly referenced, which would also retain all static shit strongly referenced
^^ so if your plugin threw its class into an inventory (e.g custom inventory holder) and is reloaded and dies, that class would still fly around
Becomes problematic if you leave your own classes lying around nms
because now the server is holding onto it
and now that class is holding onto the classloader
which holds onto all of the other classes
@eternal night ah ok, yeah understand what you mean now
yus, sorry if I was not clear enough on that
well, I mean, that is the difference between decent devs and not so decent ones lol
however, most plugins are free
and you get what you paid for
^^
don't need to tell me about that
maybe we just need some form of abstraction of the PDC on an inventory, so people that need to easily identify inventories and store data on them can use that
was a developer for them for a shot period of time so I have first hand knowledge 😛
🤔
yeaa
but like, you also don't wanna add metadata api to it
because tbh that was pain
yeah metadata was cancer
So like. move PDC values into an ArbitraryDataContainer or something that does not promise persistency
have PDC extend that interface
and give it to each inventory
TransientDataContainer :fingerguns:
being transient you wouldn't need the persistentdatatype bullshittery of the pdc
You do tho
since your data would go poof on plugin unload or server restart or whatever
so you could just hold the actual data you have
but then there isn't a difference between the current setup
like if the server would have to go through each container at the end
and poof your things
i call many things bullshit
not like inventories die through a reload
don't take it personally
😱
i dont seem to be able to find the spigot github, maybe im just being blind?
Don’t care, fix your attitude or get out
?stash
ah thanks
well there is a spigot github xD just not with the repos you need
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
1.17 in the works?
we shall feed you to the goblins for asking
👺
xD
don't think that really needs to be asked. What version hasn't been worked on?
1.19
How to delete discord
🤯
maybe there is a hidden 1.19 version of spigot, with #576 already merged an materials happy
well, deleting discord is super easy, just don't think very many people would be happy about it XD
we should just all go back to irc
I like irc 🙂
pisscord is trash
actually, does this discord have an irc hook ?
well discord wouldn't be so bad if they allowed people to run their own discord servers
😭
but then the NWO wouldn't be able to censor and arbitrarily delete guilds for wrongthink
NWO?
nevermind
you k bro?
lmao
more tinfoil @eternal night ? o.O
frosty frostfrost is out like a snowman
😂 man just google NWO xD
you mean, I should par-take in the nonsensical conspiracy stuff
yes
covid19 is caused by 5g cell towers
that made me laugh the first time someone told me that @wraith rapids
it's remarkable how dumb people are
reaching the pinnacle of help-development has never been so easy xD
I've heard worse conspiracies 🙂
well you were on point with the conspiracy until you introduce the animatronic thing into it @quaint mantle
haven't heard about the animatronic thing either
of course
US taxpayer dollars will keep them safe from now to armageddon
You forgot to include the NWO using infant blood to stay young
just eat your bugs goy
I'm safe, I wear 10 masks! I get faint at times, but I'm sure I'll be ok.
many people do
🔨 Banned madafaqcking_guy#0781 indefinitely
md5 savage
well, it had to end somehow
yeah god forbid anyone talk shit bout israel
don't think that was the issue
Quick question how do I check if it’s a players first time online. Player#hasPlayedBefore doesn’t seem to work
define doesn't seem to work
Anyone know mySQL here? I'm trying to make my chatlog plugin get all entries from one user, without doing it all through coding. For example, ```
Monotoo 5
placeholder_1 5
Placeholder_2 5
@random epoch if the player has never joined your server before, it works.
iirc it's set on the first time they quit
Makes sense thanks
it gets set on the first world save @wraith rapids
anyone know any good permission plugin
as well
last played should get set on quit
luckperms
should use group manager so everyone can tell you how terrible it is 😉
lol
what do you mean the old days?
pex > everything else
group manager still works
GM is ass
so is everyone else
I love it, but a lot of new people are like what the fk am I meant to do
same as pex
or do you mean the rate they are is significantly increased?
LP just has a cool web ui
i mean as in immediately
lmao
I generally use a modified version for GM 😉
it works and have no reason to use anything else
i remember aikar raving about his permission setup
he has his own plugin?
apparently his permission setup leverages almost entirely on the built in bukkit permissions.yml
or does he use a modified version of an existing one?
Well nothing wrong with that I suppose
he just has a very small and lightweight plugin to add root nodes to specific players, which are then configured in perms.yml to have all of the other nodes as children
since the built-in perms system can't actually differentiate between players
aside from ops and not ops
I can see how that kind of setup is more ideal for a database setup
aikar raves about a lot of things
he has his own dedicated channel on the paper guild for raving about dieting and nutrition info
lol personally he should just stick with coding advice and not nutrition stuff
I hate to ask a general java question here but the java discord couldn't answer my question (lmao). Why does it seem like every Location in the list becomes identical to the most recently added Location? I added the console commands to try to understand what is happening, I'll post the console's messages in a second
remember that locations are mutable
Locations are mutable
hello there so after a game ends im trying to unload the world to then delete it. but for some reason the world that the player left does not get deleted. this is my stack trace. https://pastebin.com/Sdd5yCVX
the part of my code where im getting the error:
public void GameEnd() throws IOException {
for (Player player : Bukkit.getOnlinePlayers()) {
plugin.runners.clear();
plugin.hunters.clear();
plugin.playermanager.clear();
plugin.playersInGame.clear();
plugin.playersLeftGame.clear();
player.getInventory().clear();
plugin.sendToServer(player, plugin.getConfig().getString("Settings.Hub"));
}
Bukkit.getServer().unloadWorld("ManHunt", true);
Bukkit.getServer().unloadWorld("ManHunt_nether", true);
Bukkit.getServer().unloadWorld("ManHunt_the_end", true);
FileUtils.deleteDirectory(new File("ManHunt"));
FileUtils.deleteDirectory(new File("ManHunt_nether"));
FileUtils.deleteDirectory(new File("ManHunt_the_end"));
Bukkit.createWorld(WorldCreator.name("ManHunt"));
Bukkit.createWorld(WorldCreator.name("ManHunt" + "_nether").environment(Environment.NETHER));
Bukkit.createWorld(WorldCreator.name("ManHunt" + "_the_end").environment(Environment.THE_END));
} //and i have already tried sleeping in between the unloadWorld and delete directory!
the documentation about which methods return a modified clone and which methods simply mutate the location itself is kind of easy to miss
but it is there
most of the time, anyway
Oh 👀
b r u h
so you're probably modifying the same location repeatedly and then adding the same location to a list several times
tried that already
true is save, if you're deleting you dont want to save
So I should make different variables for each of the locations, then add them to the list?
also your spigot is ~100 versions outdated
making different variables does nothing
multiple variables can point to the same object
but it is just the world that the player died on that doesn't get deleted and renewed
Clone it each time you want to modify it
what you need is a new object, not a new variable
Got it
no players?
it will only return true if the world was unloaded, and it will only be unloaded if there are no players
dead players are in a strange state
how would I stop a banner from being destroyed by a block update (i.e. breaking the block which supports it)? Is cancelling the BlockPhysicsEvent fine in this case?
(this is all in the javadocs)
they still exist in the world
alright
and i'm pretty sure they still load chunks and count for mob spawning, not sure about the latter
@dense goblet should be
God that one tripped me up hard yesterday, they aren't counted on getOnlinePlayers()
Is Manhunt the overworld in that server?
would it work if e.g. the banner is on a sand block which gets updated by a chain of physics events?
yeeeah dead players are kind of weird
deleting overworld is a big no no
I need the banner to be indestructible pretty much
you'll have a relatively hard time doing that
there are quite a few things that can destroy a block
Overworld is blocked from being unloaded so can;t be deleted
the main worlds all are
I have a bunch of them down already but physics is one that docs say you should be careful with
well uh
only overworld is prevented from being unloaded
@dense goblet I mean it would be far better to just stop the support block from breaking
yea
preeetty sure the primary world's nether is as well
leaving things floating in the world that dont want to be there is bad
Then you can;t unload it nor delete it
they will get removed one day
at least I vaguely remember not being able to unload it with multiverse
but even if the player dies in for example the nether then the nether dosn't get deleted and renewed
though i do have a "main" world
which is like a waiting area
yeah you want to move the dead player out of the world first
https://hatebin.com/kajuhttzfj my events
aight
For teh end and nether you will have to ask teh server to unload the world and then wait for it to be done.
yeah that is prob a good idea.
but now that I think about it, it leads back to the same problem
i.e. gotta cancel a physics event which is said to be unreliable
such as when the banner sits on a sand block
just put the banner not on sand lol
when i use hikari like this
hikari.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");
hikari.addDataSourceProperty("prepStmtCacheSize", 500);
hikari.addDataSourceProperty("prepStmtCacheSqlLimit", 2048);
hikari.addDataSourceProperty("cachePrepStmts", true);
hikari.addDataSourceProperty("useServerPrepStmts", true);
hikari.addDataSourceProperty("serverName", DatabaseConfig.getAddress());
hikari.addDataSourceProperty("port", "3306");
hikari.addDataSourceProperty("databaseName", DatabaseConfig.getName());
hikari.addDataSourceProperty("user", DatabaseConfig.getUsername());
hikari.addDataSourceProperty("password", DatabaseConfig.getPassword());
hikari.addDataSourceProperty("useSSL", false);
hikari.addDataSourceProperty("characterEncoding","UTF-8");
hikari.addDataSourceProperty("useUnicode","true");
hikari.setMaximumPoolSize(10000);
hikari.setLeakDetectionThreshold(10000);
server is freezing, why is it?
and disallowing putting it on certain blocks would feel clunky
you are probably performing queries on the main thread @naive spindle
👀
run the queries using an async task @naive spindle and it shouldn't cause your server to freeze
baby's first steps into the world of concurrency
we already run the queries using async
the problem is that config, sth is wrong here
nope
make a thread dump and look at what the server is freezing on
a separate thread should not be causing the main thread to freeze, if it is there is something wrong with you code that is causing that thread to sync with the server in a bad way
to figure out why the server is freezing, look at what it's blocking on; take a thread dump and assess the issue
or post some actual code we can advise on.
problem is
hikari.setMaximumPoolSize(10000);
hikari.setLeakDetectionThreshold(10000);
i deleted these lines and its working now
👀
not sure what the leakdetection does
probably the issue
as for poolsize, that shouldn't cause issues except network related ones lol
leak detection sounds dubious
never heard of leak detection for connection pooling
it prints when you don't close the Connection afaik
sounds pointless
not sure why it would do that, if you don't close the connection yourself, the OS will eventually do so
sounds helpful
but usually it comes at the cost of performance so you do it only in dev
sounds like something that should be a flag at compile time
but it wasn't the problem
i only deleted that line but it still didn't work
maximumPoolSize is the problem i think
yeah 10000 is a lot
have you taken a thread dump yet
the main problem was our plugin is not saving every player if we kick all the players from server
when wem kick 1-2 players it is saving them to sql
but when we kick multiple players like 10-15
it is not saving
the main problem is this
PlayerQuitEvent?
yes
well that isn't an issue with the pool size
how can we fix it?
uhhhhh........ like are you doing it in a seperate thread?
probably should configure your mysql server to handle a larger connection size though. But what you should be doing, is utilizing the pool and let your task do its job and notify that its done doing its job in saving all the player information
don't you have errors even?
you are probably expecting it to be instant
i cant find
when it simply isn't going to be instant if you have 10k players
can you send some code
for utilizing pool
I am not going to do your job for you. You are already using HikariCP
its just a matter of using its API to fetch an existing connection
and then creating an appropriate task to do the job
and have some way to notify it is done
this way you can do your restart or shut down the server or whatever else you need to do
also stop increasing max connections lol
leave it at the default or like 20
its literally causing your problems
20k connections is insane
yeah, connection pool size isn't the same as max connections
on mysql or code?
both
sure
also i found a error ```
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30000ms.
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:695)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.getConnection(HikariPool.java:197)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.pool.HikariPool.getConnection(HikariPool.java:162)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.hikari.HikariDataSource.getConnection(HikariDataSource.java:128)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.core.database.Database.getConnection(Database.java:133)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at net.cladium.core.player.CladiumPlayer.lambda$saveOptions$3(CladiumPlayer.java:217)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[20:13:59] [Craft Scheduler Thread - 4729 - Cladium/WARN]: at java.base/java.lang.Thread.run(Thread.java:829)```
why create 1 connection for 1 thing...
connection pool size is similar to creating a task handler
each pool created can handle many connections
i can send more errors
so a size 20 for connection pool could mean, 20k connections if each pool is configured to handle 1k connections
well.
reading errors is fun.... unless they are completely copy and paste of each other.
just wanted to paste all of them
basically, you didn't bother catching the exception if a connection isn't available
or bother handling it
SET GLOBAL max_connections = 30;
is this ok for mysql?
mysql, you want 50k-100k
shouldn't need more then that, but mysql is capable of handling millions of connections though
md_5 said lower it, it was 10k before
more or less referring to your connection pool size
I created a new /stop command, it loops all players and kick them all. and after 30 seconds, it shutdowns the server.
since you didn't understand that pool size isn't the same as how many connections it will make
and this is the saveOptions method (for saving datas to sql)
how can i make this better
@sullen marlin unfortunately cancelling the physics event doesn't stop the block from breaking, it seems to have no effect (even though it prints that the event is cancelled)
i dont want you to do my job, i only need some examples
also, using that command doesn't make that setting persist between restarts of mysql server. If you want the setting to persist need to modify its config file.
So, first things first, set your mysql server to handle 100k connections, next use a connection pool size of 10-20, and then configure each pool to have 100 connections. This gives you 1000k-2000k connections total that hikaricp will use or try to use.
that is a bit extreme and would recommend using lower limits if possible for your connection pool, but that should resolve your issues or some of them.
how do i not save a world
on disable
do i like
unload the world onDisable
with save = false
we dont know how many connections does our plugin need, thats why we set them to 10k-20k-50k... bla bla
that is fine, I am telling you what you failed to understand and went wrong as far as configuring the connection pool stuff goes
connection pool size does not mean the amount of connections it will make
so i'll add my.cnf
[mysql]
max_connections: 100000
and we need to set pool size to 10 or 20 in code?
how can we configure each pool
hikaricp should have api methods to set the connection limit for the pools
so these are right yeah?
yes
restart mysql server so that it uses the new config setting, or use the command to change it
we'll try that thanks!
i cant find it, can you give me a link?
it seems the configuration option you were using was correct, however I don't use hikaricp so I can't say for certain why setting it to 10k for example would cause issues other then guessing that it creates 10k connection objects in their own threads which can be bad lol.
I'm pretty sure you set it from the HikariConfig
I personally use BoneCP even though it is deprecated
how
how?
HikariCP doesn't have a setting to create partitions
Just look where it is and change the values
wdym?
partition is like a handler
just realised dividing coords by 16 doesnt give the proper chunk coordinates on negative quadrants .-.
In one of the constructors, sorry, use the one who needs a hikari config
rightshift by 4
^^
that multiplies by 2^4 no?
Still don't get what you mean
A listener of queries?
I am using integers
@dense goblet there is a few ways to resolve your problem. Easiest one is bitshifting
ooo that is cool
or you can just use absolutes and keep track of the negatives
thank you for the tip
-1 / 16 = -0.0625 which rounds towards zero, to 0
or you can just simply divide by a negative when its negative numbers
and what about modulo, if I want chunk-relative coords
and yes, for values that don't divide evenly need to round the values
you want to use & with a bitmask
so x & 0b1111
cool ty
the reason why these semantics work is because the chunk coordinate and the in-chunk block coordinate are effectively complementing bitmasks
ever worked with queue managers?
that is, the 4 least significant bits represent the location within the chunk
and the 28 most significant bits represent the location of the chunk
put them together and you have a global location within the world
right shifting by 4 yields you the 28 bits of the chunk coordinate
bitmasking by 4 rightmost high bits yields you the block component
thats a good way of looking at it
going a step further you can split the 28 remaining bits to 23 bits of region location and 5 bits of in-region chunk location
but that's less useful as regions aren't really exposed by the api
Executors count? ;p
@vale cradle yes that counts
I actually split my custom chunk data by regions too so I should change that logic as well
well partitions with connections is like workers
and you would set the amount of connections each partition is allowed to make
IE, the amount of work they could do
So, you want a pool for each executor?
exactly
There is no need to create so many pools
this is optimal because if a pool is too busy, it should use a different pool
all the pools
Personally I create an API to do the DB work, and I connect them with the rest of the code using Futures
pool.close(Reason.AIDS)
The DB stuff is made in a different thread but from the same executor
I create an Executor for each one tho
hikariCP is supposed to be the successor to bonecp, however hikaricp is missing features
one for MySQL, another for MongoDB, etc.
one might say you're boned
Never used BoneCP, but using what I told is pretty much the same as I've read
Well there are different ways to implement connection pooling
all you are doing is just using your own implementation
instead of using a lib for it
It's not so hard tho
Btw, I have my own library
And all of those stuff is on there
@vale cradle it may not be hard to create your own connection pool implementation. There are various requirements that are related to connection pools
some people need speed and then others don't necessarily need speed but want a smaller memory footprint
to implement either of those requirements requires vastly different approaches