#help-development
1 messages · Page 575 of 1
nah
2 new things at once? sounds like a recipe for failure
java makes me want to kms
java literally the best?

ide wanna kms too if i had to learn a IDE and a new language syntax at the same time
sounds painfull
you can use kotlin for spigot without problems
fun
you can also use VSC without problems
were having fun with kotlin guys i promise
is there a way to reload a plugin?
VSC has 0 kotlin support :P
you mean to reload the whole .jar file?
kotlin is pretty much exclusive to IDEA
huh didnt know
/reload
But that's no fun
Reload will reload all plugins
/reload confirm works on both spigot and paper
Be aware that it can break things
it worked! can i ask why it genereted paper-plugin.yml isntead of plugin.yml? should i worry on why i had to rename it?
you had the paper option under bukkit selected
Because you selected a paper plugin
its jank with the new gui
Yeah reloading worldedit too many times makes me have to sigkill my server lol
theirs a syntax highlights pluygin last time I checked, but its obvious why there isn't a VSC plugin, one of the biggest IDE companies in the game makes a language, ofcourse they aren't going to officially support anything outside of their platform.
Yeah worldedit doesn’t like reloading
because you selected paper instead of spigot
you can literally tell intellij to use vsc's keybinds
Causes a lot of memory leaks
i wanted paper
not as fun as corsair's memory leaks
why are you complainign here then
if you have rgb lights on your headphones or mouse or anything
their controller leaks
Then you need to run it on a paper server
like i said spigot plugins work on paper, paper plugins do not work on spigot
earlier you said you wanted to use spigot
i dont think i did ;v or im dumb
I've had rgb lights consume 12gb ram
do you want your plugins to run on spigot servers
or my bad, I misread
no, paper is fine
?whereami
more rgb = more ram - noted
?whereami
I use mismatched sticks
Damn
anyway, is that plugin supposed to be public plugin, or just for yourself?
for myself
both overclocked to 3600mhz (they're 3200mhz sticks)
then why are you running your paper plugin on spigot?
i swear i have a paper server?
well but then you're running an old version
i thought this was the sever for spigot and paper
isnt it just spigot < paper
craftbukkit>?
oh its a fork, i thought it was built as a replacement for spigot from ground up
no, this is the spigot discord
spigot is bukkit with the api, craftbukkit is that impl and spigot modifes both
paper is spigot with a few useful additions and a few bullshit additions / removals
and they ban people for random reasons
as I said, different culture and view on how minecraft should be ran
"how minecraft should be ran" 😂 It's literally a block game, not too deep
damn
What's your night job?
also minecraft
Murder
I am trying to male a command with a cooldown, and the cooldown can be set in a config file
(Config.get().getInt("Cooldown")) = is what you have set tre cooldown to in the config file
If i am sending (Config.get().getInt("Cooldown"))to the player it sends what is inside the fil but in the class when im trying to set the cooldown its not working
Here is the line:
cooldown.setCooldown(player, (Config.get().getInt("Cooldown")) * 60 * 1000, TimeUnit.MILLISECONDS);
Here is the most importens from the class
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (player.hasPermission((Config.get().getString("Permission")))) {
if (!cooldown.hasCooldown(player)) {
cooldown.setCooldown(player, (Config.get().getInt("Cooldown")) * 60 * 1000, TimeUnit.MILLISECONDS);
player.setFoodLevel(20);
player.sendMessage("§7Du blev mættet.");
player.sendMessage(Config.get().getString("Cooldown"));
} else {
if (cooldown.getCooldownRemaining(player, TimeUnit.MINUTES) >= 1){
player.sendMessage("§7Du skal vente §f" + cooldown.getCooldownRemaining(player, TimeUnit.MINUTES) + " §7minutter og §f" + (cooldown.getCooldownRemaining(player, TimeUnit.SECONDS) - (cooldown.getCooldownRemaining(player, TimeUnit.MINUTES) * 60)) + " §7sekunder.");
}
if (cooldown.getCooldownRemaining(player, TimeUnit.MINUTES) == 0) {
player.sendMessage("§7Du skal vente §f" + (cooldown.getCooldownRemaining(player, TimeUnit.SECONDS) - (cooldown.getCooldownRemaining(player, TimeUnit.MINUTES) * 60)) + " §7sekunder.");
}
sounds more like 2 hours than a whole night
in the day he writes cool stuff, in the night he saves servers from skript
You underestimate the spaghetti
mine is oiling the poles in strip clubs
Well if someone pays me for something I certainly won't work more than 2 hours for 50€ lol
quick question, if i wanna make a 1.8 plugin do i still use like 1.20 spigot/paper
no
Sounds fun, can I join some time?
no
Here's a fun one I've been doing
no, you use "spigot-api" version "1.8.8-R0.1-SNAPSHOT"
.
i only saw 1.12
can i just change
yes
Nice package structure 
<version>1.20-R0.1-SNAPSHOT</version> do i change this? and itll work like magic?
reload it and change api-verison but yeah
straight garbage
they use strings instead of data objects
or enums
not even used an autoformatter 
just a big ol if(tier.equals("highest")) coefficient = 1.2
else if
else if
no pdc no nothing, raw lore checks
and some other fucked stuff
yikes. I wouldn't touch that for 50€
pity price
I like reminding myself of my outstanding quality
by forcing myself to work for the equivalent of minimum wage in vietnam
You can always send the better paying ones to me then
nah I'm good
saving to travel to the states
After setting the base value of a players Attribute do you need to do anything else to save it?
also just bought a new phone and I gotta go to the dentist for some pricy stuff
So like
I need the cash money
customer feels bad for making me touch this
Lul
How to resend block updates?
I feel bad for the guy who writes code like this
calling it now'
this plugin was made as a first plugin with barely knowing java witht he mc dev plugi
till this day I never used that plugin
its meh
People have to learn
kinda useful for gradle, if you use maven just use an archetype
you don’t come in knowing it all
how would i enable a player to move items from their inventory to my gui but not the other way around lol
like i want to be able to move stuff around in my inventory
but not in the gui
i just dont know how i would detect if the inventory is a players inventory
So do we!
Well they could start with smaller projects that they are more in control of. This looks like someone who learned to ride a bike went to fly a jet
I mean does it work
u m
idk - probably - just like a jet will land at some point, no matter who's flying it and how skilled he/she is
yes
maven magic 🪄
bruh
you can check if the inventorytype equals inventorytype.player
the clicked inventory type
Can someone help me?
?cooldowns
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
This is a guess, but you can run an event for when a player clicks the item. If they move the item into another inventory type, remember that. If the event then runs again but the inventory type for the same item is back in the player inventory, put it back or cancel the event.
nah they should be able to move their items inside the gui aswell i just explained it bad there
but thanks
When i am using the command ingame there isn’t a cooldown i can just spam the command
@timid hedge i already replied to tou
Currently trying to make a method that opens the sign gui using ProtocolLib (so no sign is needed to be really placed). Does anybody know why the gui is closed immediatly in any other version that's not 1.20/1.20.1 or simply another way to achieve that?
public void openSignGui(BlockPlaceEvent event) throws InterruptedException {
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
Location playerLocation = event.getPlayer().getLocation();
PacketContainer createSignPacket = manager.createPacket(PacketType.Play.Server.BLOCK_CHANGE);
createSignPacket.getBlockData().write(0, WrappedBlockData.createData(Material.OAK_SIGN));
PacketContainer openSignPacket = manager.createPacket(PacketType.Play.Server.OPEN_SIGN_EDITOR);
openSignPacket.getBlockPositionModifier().write(0,
new BlockPosition(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ()));
manager.sendServerPacket(event.getPlayer(), createSignPacket);
manager.sendServerPacket(event.getPlayer(), openSignPacket);
}```
probably different packets in older versions or something
didn't papermc use to be developed by spigotmc tho
Yeah, Open Sign Editor takes a new argument in 1.20 that controls the side you write on, but i'm not providing it in the first place and i'm starting to believe my approach is just wrong
No
no
Paper is a fork
I have a question about the newer versions is there a way to send e.g. the ItemDisplay by packet or so that only special players see them. because I can only do it with the EntityItemDisplay classes but this does not exist.
maybe someone could dm me
show your config
the class is called Display.ItemDisplay
You don't have to do this with ProtocolLib at all. I don't understand
Player#sendBlockChange(), Player#openSign()
Sry i gtg, i can do it tomorrow
Yes I already tested also but without result? The ItemDisplay did not spawn
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(itemDisplay);
((CraftPlayer)player).getHandle().c.a(packetPlayOutSpawnEntity);```
Is only an example are the methods at all correct and how do I have to change here the item like the location?
no idea how it works in obfuscated mappings
is there a reason why you don't use mojang mapped names?
then you would have methods like "player.getConnection().send(Packet)" instead of player.c.a(...)
Just tried using those methods, they create a real sign. idk if i'm missing something
the commit message warcrime
Fake sign for one player
Yeah, they're "real signs", only on the client, not on the server
"Minor changes"
OH WAIT THAT ACTUALLY IS THE MESSAGE
lol I was making a suggestion
Small refactor
"made some stuff"
Well to be fair it was all one big refactor
and 1 or 2 small bugfixes
Swapped all my "Map<String, Object>" to ConfigurationSerializables
what the fuck
I must be missing something then, because they are pretty real right now. I can interact with them from a different mc instance.
public void openSignGuiNoLib(BlockPlaceEvent event) throws InterruptedException {
ProtocolManager manager = ProtocolLibrary.getProtocolManager();
Location playerLocation = event.getPlayer().getLocation();
Block imaginarySign = playerLocation.getBlock();
imaginarySign.setType(Material.OAK_SIGN);
event.getPlayer().sendBlockChange(playerLocation, imaginarySign.getBlockData());
event.getPlayer().openSign((Sign) imaginarySign);
}```
wrong reply btw
i stopped writing commit messages completely
Use Material.OAK_SIGN.createBlockData
nah I still do. I obviously did not name it "minor changes" I just love seeing that in repos
usually I just write "1.20 support" or the new version name, e.g. "12.3.1" and that's it lol
lol
And I still have a lot of (unfun) stuff to do before doing so. Documentation, language files, javadoc - and figuring out how to push it into some maven repo
i love writing javadocs
sus
deploying to a repo is basically just declaring the repository, and declaring username and password
Do I need a pipeline for that? Or do I just grab some files and upload them?
you only need this in your pom.xml
how does it know which version to push? Does it just take the one from the pom? I'll probably forget changing that every time lol
Taking a moment to apprenciate the beautiful Spigot API
Having lots of fun creating my own custom events 🙂
and then in ~/.m2/settings.xml you declare username and password, like this:
you just run mvn deploy and then it uploads whichever version you currently build
mvn deploy is like mvn install + upload it
oh so deploy is another stage, did not know
yep
Guess I can keep in mind to change the version when running deploy
i usually do mvn install and see if it works, if yes I do mvn deploy and that's it
it works now, ty :)
how do you deploy with javadoc though? Or is that automatic?
I've seen some plugin for it
you only need to add this execution to the javadoc plugin
then it automatically gets uploaded on deploy too
well first of all I need the javadoc plugin lol
the links you provided - what do those do? Since spigot isn't compiled into the jar
Just copy paste it https://github.com/JEFF-Media-GbR/MorePersistentDataTypes
So you can eg click on Block and it links to spigot javadocs
oh that's cool
The worst part before release will probably be to think through all the update processes. To not enforce breaking changes for new features
Therefore I'll probably not be done before end of 2023
How do I pass an object to bukkitRunnable?
I know I can still use the class that created the BukkitRunnable atributes, but I don't know how to reference the class that created the BukkitRunnable itself
You can create a variable beforehand and access that variable from inside the runnable
OO nice workaround thank you
just extend that class with your own one
{
class MyRunnable extends BukkitRunnable {
private Object myObject;
public MyRunnable(Object myObject) {
this.myObject = myObject;
}
@Override
public void run() {
// Do something
}
}
}
or I can create my own runnable
would it be more correct?
it's just a runnable for a timer
that's what I just suggested
Yeah I saw it
where one dot 8
chad intellij plugin
how
why specifically 1.8.8 before i tell you how to do it
change it in pom.xml
why cant 1.13 work?
my server is ran on 1.8
I feel like someone needs forcefully destroy the version 1.8
why do u guys hate it lmao
i promise you all your plugins you got are updated to at least 1.12-1.16 by now
i wish md wouldn't have fixed log4j on all the old versions
ikr
legacy software go brrrrrrrrrrrrrrr
my player base is 1.8
why bro
no one has a valid reason to hate 1.8 other then its old
is it to late to git revert

the reason to use it is stupid
and edit it to 1.8
compare the API between the two and you will easily see why
Yes, use 1.8.8-SNAPSHOT
are you really using 1.8? not even 1.8.8?
the reason to use the latest version is stupid
no its not
yah i ment 1.8.8
even using 1.13 is godsend
more features, and they are even starting to improve performance 😭
api is the problem
try to get a glass pane on 1.8
go ahead
how about ink sacks
need to edit anvils? no anvil events
its SO limited its insane
the problem is people who download a plugin that says "1.19+" and then writing a one star review because "why no works on 1.8.3"
i cant believe we even coded like that back then and thought it was alright
anyone actually wanna tell me how to make a plugin for 1.8.8 since its not in the list
learn how to edit maven and gradle files
im fine with 1.12.2
🤷♂️
if i have to
you change the version of the spigot-api dependency in your pom.xml
then they can use any version
can
they really cant
you can make your server support all versions lol
if most of my players are 1.8, isnt it better to make my server run on 1.8 then 1.12.2 with via version
yes
but wouldnt they have a better experience if the server was 1.8
instead of 1.12.2 with via
they will always have a better experience using whatever version the server is on yeah
also iirc you can add rewind with this to go backwards
and an even better experience if they can use new features like offhand, dolphins, nether bastions, pigstep music disc, world gen below 0, netherite, ...
what version did world gen below 0 come in
are they all using illegally downloaded 1.8 versions or why can't they just click on "update" lmao
1.16/1.17
i make all my plugins in 1.19 rn but i emphasize for 1.13+
wait lemme show u why
technically 1.16, but actual world gen below 0 was 1.17 IIRC
or maybe it was 1.17/1.18
not suer tbh
i remember that World#getMinHeight() was added in 1.16.5
i barely kept track of updates past 1.16 lol
wtf why does via backwards have an api
okay so
1.17 added the technical possibility for y<0
1.16.5 already added the method World#getMinHeight() (which was later moved to WorldInfo)
1.18 added actual world generation below 0
might as well just develop on 1.19 then
ok one sec guys
no
only on more than 1.18
develop on 1.20 guys
imma wait
yall do ur bug shit so i dont gotta deal with it
ill come when the fires over
there is not enough people on 1.20 yet I think 1.19.4 is a good start
tomorrow I'll play 1.20, never played it before
25% of bstats servers are 1.20+
naw wtf
46,6% are still on 1.19.X
why would anyone play the game in the browser instead of downloading it lol
minecraft in a web browser ive seen it come full circle now 
its for chromebooks
believe it or not
it runs very well on chromebooks
cracked?
its actually just a bungee plugin
do permissions have to be registered
so any java server can support it
i aint adding that to my server for damn sure
No, it's a legit thing. They announced it a while ago.
oh
anyone can host the client
minecraft is made with java, it runs on literally any OS
i own that domain
oh
it wont run on school chromebooks
this one will tho
no
you don't have to register any permissions
any ways
how doi make 1.8 plugins if i cant select 1.8
do i just edit the pom.xml and continue like normal
you type 1.8.8-SNAPSHOT in replace of the current version
where
https://www.minecraft.net/en-us/article/minecraft-launching-chromebook
https://www.minecraft.net/en-us/article/minecraft-available-chromebook
Not sure about the browser support, but the Chromebook is coming soon enough.
yes
aight bet
and java edition runs anyway
It's for the bedrock edition.
or ones with playstore and stuff blocked
interesting
ima shut down the site for now
were literally coming full circle holy shit
jesus christ
aight
java was originally designed for browsers 
yah lmao
40:
slot: 39
item: "PISTON_BASE"
name: "&f&lBuilder Kit"
permission: ""
enchanted: true
lore:
- "&7A kit that gives you a selection of"
- "&7blocks and decorations to build your base."
if (!(p.hasPermission(eachItem.getString("permission")))) {
coloredLore.add("");
coloredLore.add(ChatColor.translateAlternateColorCodes('&', "&cYou do not have access to use this kit!"));
} else {
coloredLore.add("");
coloredLore.add(ChatColor.translateAlternateColorCodes('&', "&aYou have access to use this kit!"));
}
it always adds the lore You do not have access to use this kit! even though there is no permission
its not a remake or whatever
its litterally the whole 1.8 client
lmao
it can join any server
shutting down the web server now
You have a permission set, an empty string
oh yeah right
Check if the string is null or empty before checking if they have that permission
man java seems complicated as hell
it sucks
should i learn java first and then try to make spigot plugins or do both at the same time
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Third link is good
It’s completely different
i know

i am javascript pro
the offsprings so good
I only really like You're gonna go far kid
if you do know javascript really well, transitioning to java shouldnt be realtively complicated, just needing to get a handle on OOP
And of course java is a compiled language so your gonna need to learn about that too
same LMAO
its the only song i know tbh i kinda just assumed the were one hit wonders maybe
sum41 is rly good tho
GOOD IDEA
im gonna add this as afeature to the plugin
ty for that idea
yes add epic aosid asioeaoeia
eaglercraft epic
no its a single player world
eaglercraft v 1.5;2 had single player
1.8 has no single player
this is v 1.8
i dont own the server
okay im adding it for that one line lmfao
i am staff on it tho
What's up danger
nothing much
blud didnt see the cover art
copyright incoming
does it actually play the song
yes
?
you're not the one distributing the song
does it convert it to note blocks or whatever
you're downloading it from a source
it converts youtube links to a resource pack that plays with a gui and a queue
woah im gonna steal that idea
its HARD
but first i need to figure out how to make 1.8 plugins
took me 1.4k+ lines of code just to get something functioning
on top of the 1.1k that was there for the music playing tiself
shits aids
did a bunch of refactoring tho, cut a bunch of code out
i would personally outsource development of it to unprivildged java programmers in southern asia
cheap work
ez plugin
they wouldnt make it async i bet
no payment until they are done
Tenofovir/emicitrabine prevents getting HIV = no aids
aint aids from monkeys
Aikar's Timings Viewer - View Timings v2 reports from Paper and Sponge
or gay ones
timings from my plugin
or is that a diff thing
lemme do one where it constructs the resource pack
damn that's pretty performant
wonder what happens if 100 players were to play music at once
idk but i can spam the fuck out of playNextSong without any drops
wtf is MMOItems doing lol
I have code in PlayerMoveEvent that is more performant
its downloading to youtube and converting it to OGG is the hard part
why did they specify object oriented/
converting to resource pack was straight forwardish
does java have a functional part to it
kinda
FunctionalInterfaces
so like javascript
FunctionalInterfaces and Functions
ok guys i am pro java dev now
but only if you are in a good java version
8
buildtools caused by: difflib.patchfailedexception: incorrect chunk: the chunk content does n't match the target. Help please
wtf is that domain
did you do what choco said
yuck timings
spark better
timings ddos attack
make 500 spigot servers make a timmings report at the same time
ez
yeah ik i should use spark tbh
İ dont remember what he said but i did everything without look their name
they rate limit
"Possibly a botched pull. If you delete the work, CraftBukkit, and Spigot directories and rerun BuildTools, it should apply fine"
Ipv6
yah that too
(If they even have an aaaa record)
İ have delete whole file and redownload it but still same
https://timings.aikar.co/dev/?id=28a74f6ec4394e25ab45cd8f0aab7b1a#timings
No way that 1500% is on the main thread wtf thats confusing
Aikar's Timings Viewer - View Timings v2 reports from Paper and Sponge
20 tps = 1500% of tick
make sense
its async so it doesnt actually hurt performance unless you dont have extra cores
and thats just for resource pack download, ffmpeg download, and resource pack creation
the actual hosting of the file and regular running is this report
make it send a request to a vps or something that handels all that
timing sis just whack
and make it send it back to the plugin
which sends it back to the player
ez
( i have no idea what im saying)
sure 2k please
no use 2 dollar vps
haha
dont udnerstand how that says 52% loss when the tps is 20 though whack af
wtf
yah downloading that now
i wouldnt doubt if that 1500% is on other threads but to say 52% tps loss when servers 20 tpsis whack lmao
okay but actually
wtf
bro its the best
💀
whats worse
this is sme guy that actually owns all this
those are his pictures lmfao
theyre discord is 10x better holy fuck
they post status updates 💀
how is this real
its a meme
who took the time to do allat 😭
but its so good of a meme it legitmatly looks like some 12 is trying to make a hosting company lmao
they even have a trustpilot
Ok Burchard thirty seven
https://spark.lucko.me/jRB4lgsWcO
Yeah this makes a lot more sense
aikar timings literally halucinating
i tried this without async one time
💀
poor server went down to like 15 tps when generating
(wtf is an mspt)
"Master of Science in Physical Therapy" thanks google
milliseconds per tick
ms/t would make more sense imho
Ok Burchard thirty seven
?
?
womp
womp
mfnalex you are so zesty
wtf operagx has built in chatgpt
ikr
Real (im at my lowest rn)
@noble lantern https://mzunguhosting.ml/
This is real btw
OH NAW
Debian 5 lol
they;re out of stock :(
back in 2008 or so, I had my first ever VPS there
wild question: is using spring a bad idea? really I just want to use something like spring data jpa to save stuff..
Actually, what is good practice to save player data?
You could use spring though that seems overkill
Plus it would bloat the jar file like crazy
I thought so too...
I really don't want to make sql queries myself :,v is there a good way to do this?
depends on the data
Player uuids/names + numbers, potentially relational data, too
the amount of data and if it needs to be accessible offline would decide
~ 150 rows on one (player data) and could be 10ks on another table (if I were to save logs on a database instead of a *.log). It would only need to be accessible on the local computer the server is running at
10k total for all players?
For now, the basics, just 150 rows on a table
I'd probably consider using the player PDC and the world PDC
so long as you can keep the amount of data down
player PDC is only available when the player is logged in
world PDC is always available
Ooo I might need offline player data
saves to the world files so is deleted when a world is deleted
yeah player pdc not available when offline
is great for player specific persistent data though
I'll go that way first then, and perhaps cry about it if/when I have to change it
Thanks!
.. I could make an interface and make it easy to change... yeah I'll do that
And items
PDC could be available for offline players if I could figure out how to design this api

I'd suggest identical to online Player
I just use a Future for offline PDCs
The problem is that player extends offline player
public class OfflinePlayer {
public CompletableFuture<PersistentDataContainer> getPersistentDataContainerFromDatFile();
or sth like that
Yes but then that has to exist in player
And sure you could just make it instantly return their in memory pdc
But it’s kind of ugly
player could override that and return the online PDC with an instantly completed future
Where’s the best place to go to hire someone to develop a plugin for me?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Gotcha thank you
Someone suggested a new interface that only applies to offline players
And that’s all well and good but you’d need to check and cast to get an instance of it
Which is meh
the getpdc in player woudl return the current pdc as normal, The offline player getpdc would return a future. I see no issue there.
Don’t think those return types are compatible
in getpdc in offline player it shoudl check if there is a player object, if there is return its pdc
Either way this isn’t just about pdc
It’s all the offline players data
Currently it only adds 3 new methods, loadData, saveData, and isDataLoaded
But of course those methods don’t really belong in Player
But they have to be
LoadedPlayer - an offline player whose .dat file is loaded lol
so it's like an online player (pdc, can check health, potions etc) but you can't send packets or anything
// in Bukkit.class
public static CompletableFutuer<LoadedPlayer> loadOfflinePlayer(UUID);
Bukkit.loadOfflinePlayer
would be quite easy to do, just get the .dat file, throw it into NBTIO or however it's called, then throw that into a compound tag
That’s what it does currently
But it caches the values to variables
I guess technically I could just leave it as the compound, it shouldn’t be that much of an overhead
That’s the draft PR for reference
Is there a way to use custom colors in minecraft or just the default ones?
Use hex colours if 1.16+
On wool?
Yes
Damn, I didn’t know
The only problem I can see with this is the fact that you’d probably end up needing to use excessive amounts of locks since you don’t want it to read whilst the file is getting written to
which may end up affecting more behavior than what you initially think about
I mean ofc u can use NIO api
It should only be written when someone calls save on said data
yes but that is enough to require concurrent locking mechanisms
But yeah you’d have to stop multiple save calls from running at once
Which is annoying
Best way is probably a stamped lock
But else reentrant read write
Altho that does lose the optimistic read and upgradable lock part
I’m not even sure what would be best
Should calls to save while it’s already saving block or just be discarded
Well since u have to avoid concurrent writes
They’d need to be synced
Altho necessarily not on the server thread
But more like each coming write awaits the current write
Hmm
I mean you could if you wanna be simple:
ReadWriteLock lock = new StampedLock().readWriteLock();
//read (this is in a CF)
lock.readLock().lock();
try{
//file read
} catch (…){
} finally{
lock.readLock().unlock();
}
and the same for writing
Think this is what LuckPerms is doing iirc
Seems easy enough
Yeaaa, :)
OfflinePlayerData
Yeah don’t they just lay their backs on netty? 😅
Hey how do I use the MOUNT packet for protocollib? I tried setting it like this:
passengerPacket.integers.write(1, 1)
passengerPacket.modifier.write(0, IntArrayList(botId))
But it crashes with an index out of bounds exception
I believe so
Ah crap I also have to worry about minecraft trying to access the file, not just plugins
Plus I need to decide what to do if the player joins while their data is loaded
if the join you just like force run any tasks that are queued or whatever then load their data
Or wait let me ask
Does the OfflineData thing represent the .dat file?
or does it represent the player data
It represents the contents of the file
Ah, then you don’t have to care right?
Just read the file, and map it to the object regardless
Cuz then you only worry about writes
Yeah
My first idea was to block them joining and force a write first
So nothing is lost
force a write?
Force anything that’s been modified in OfflinePlayerData to be saved so it isn’t lost
And then let minecraft read it
Oh yeah, well that’s just a write right
Myea
I think that works, when does mc decide read it btw?
in terms of spigot events
Good question
Lemme check
I believe it’s after the prelogin event and before the login event
Also minecraft doesn’t write to the data file directly
File file = File.createTempFile(id + "-", ".dat", this.playerDir); NBTCompressedStreamTools.writeCompressed(compound, file);
File file1 = new File(this.playerDir, id + ".dat");
File file2 = new File(this.playerDir, id + ".dat_old");
SystemUtils.safeReplaceFile(file1, file, file2);```
Ahh
Just what does safeReplaceFile do? I assume thats a mc util class
And is this async? (If u can find it out, what thread 😅)
if (this.scheduledTask == null || this.scheduledTask.isCancelled()) {
return;
}
``` this won't error right once I reember combining a nullcheck in an or statement and it erroring until I sepparated them
Yeah if the first condition is true it won't evaluate the second
So it appears safeReplaceFile does the following:
- Remove the old backup
- Create a new backup
- Remove the old data file
- Rename the temp data file
- Restore from the backup if above fails
Each one is attempted 10 times
Which I suppose is one way to make sure it gets saved
I'm trying to simulate blocks particles that spawns when a player run on a block but
MaterialData is deprecated.. anyone know how can I do that ?
BlockData is the replacement for MaterialData as of 1.13
Oh okay, thanks !!!
Gonna have to narrow that down a bit, chief
There are a few getColors()
Though as far as we're aware, yes, they should all work
setColor() I meant
What are you trying to call it on?
Oh, you need to cast the meta to LeatherArmorMeta
Smh generics when
LeatherArmorMeta meta = (LeatherArmorMeta) chestplate.getItemMeta();
is this were id ask for help with running certain cmds with plugins
Probably better suited in #help-server
ok ty
Is this method: https://docs.oracle.com/javase/8/docs/api/java/net/InetAddress.html#getHostAddress--
For getting the IP of the currently running machine consistent across windows, Mac and Linux? Would it ever return something other than the external IP address if i do something like:
Basically just not sure if it would return something funky in an environment like pterodactyl/docker where networking might be done differently
try {
final InetAddress address = InetAddress.getLocalHost();
return "http://%s:%s/%s.zip".formatted(address.getHostAddress(), this.resourcePackServerPort, fileUUID);
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
can spigot run paper plugins?
if they have a normal plugin.yml and dont use any paper api yeah
if they use any paper methods they wont run anymore
So, essentially, no. Thanks~
It returns the current ip address associated to the localhost.
It could be the external ip, it could be the external ip but intern, it could be 127.0.0.1, basically you can‘t be sure and should get the ip by a configuration file
would there be a way to always ensure you can receive the external IP address? Thats how i was doing it before with a config file but im trying to go for a near-seamless install where the user only needs to open a port for setup
guess i could always add an option that if the ip address received is 127.0.0.1 i could retrieve the config value as a fallback
yee imm a do that ty
Use public apis like https://api.ipify.org or https://ifconfig.me/ip
good idea thanks :))
some people were telling me to add hidden item data how do i do that?
?pdc
ty
Sooooo I am having the weirdest issue ever.
my @EventHandler isn't wanting to work.
I have registered the listeners in the onEnable(), I have made sure that the class is implimenting Listener. I have added a PlayerMoveEvent listener as a test to be sure this event just wan't firing. I can't think of why this isn't working
relivant code https://sourceb.in/OEeZs5D1W3
Tried putting in the same class because idk maybe broken but nope
no errors but no debug messages
if I put a debug in the checkFishingTimes() method it prints
all of the above
you have 2 instances of the class
add (ignoreCancelled = false) to the event handler
I think they would notice if the event was cancelled lol
If it was canceled I wouldn't be able to move
Can you send your full main and listener class in a paste?
Uhhh its a really old project so don't judge the poor code XD
one sec brb
Main class
https://sourceb.in/HTiL4TwlO2
Monstrosity of a class
https://sourceb.in/I6FDA8Fqn1
no errors so log kinda pointless
Are you in creative?
paper fork
ye?
Thats the issue try in survival
For PlayerMoveEvent?
No events are being triggered
Try control + f your plugin name in the logs
Well test the events in survival not in creative
Including startup logs
Why?
Because some events dont fire in creative or have their own specifically for creative
Do you have any other plugins?
Yes only a select few though
Maybe try adding @Override to your #onEnable() and #onDisable() methods.
That won’t change anything
That annotation doesnt do anything for runtime
Do this
method is being triggered its just the event handlers
Anyways i told you what to try
And make sure your paper fork isn’t removing System.out for some reason
Try using Bukkit.broadcast
nope tested in the method that is called from onEnable
works fine
Alright you both can keep trying to figure out other causes i guess. Not sure why its an issue to test it in survival lol
Oh I see the issues now
Plugin GlitchMCLootLake v2.0.0 has failed to register events for class dev.selena.glitchmc.lootlake.FishingEventListener because com/mewin/WGRegionEvents/events/RegionLeaveEvent does not exist. forgot to add the WGRegionEvents plugin lmao
That would do it, but for future reference though, test in survival
That’s not necessary for the events being tested
^
Because as i said not all events fire in creative
Almost all of them do
No
There are select few that don't trigger in creative
Besides damage events what else doesn’t trigger?
Inventory events, some move events wont. Other stuff
Most inventory events. There are some events for creative mode, but they are lacking.
Inventory events trigger, just not well
is there a way to get the default damage of an item without nms
The client just doesn’t send info when in creative
Attributes?
but what part of it
if i do ```java
AttributeModifier damageModifier = new AttributeModifier(attributeModifierUUID, "damage adding", newValue * 0.5, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND);
meta.removeAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(attributeModifierUUID, "", 0, AttributeModifier.Operation.ADD_NUMBER));
meta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, damageModifier);
So i looked and it doesnt appear there is api for getting item attributes like damage
Attack damage is the damage from entity not sure if that also includes if it uses an item
a normal item without any changes is like this so
can someone help me. I had a eco plugin downloaded but deleted it since it had a loud and annoying notification so i downloaded another one and it keeps telling me i dont have perms to do /money or anything ive already /eco reload but nothing is working
dont even know if this is the right chat
You need a permissions plugin and then give yourself the relevant permissions
any suggestions ?
Get a permissions plugin. Luck perms seems the be the go to. i personally use group manager but others will yell about it being outdated or something even though it is still maintained lol
dang, well thank you i dont even know if this kind of issue is supposed to even be posted here or under server
It more of a server problem then it is development
But its fine, you didnt need extensive help and no one is here chatting lol
@wet breach im sorry but i downloaded it and its already hurting my head
im new to plugins and stuff so i hope you can forgive the ping
Np. But i dont know luck perms. They should have a wiki on how to set it up and use it though
There might be someone here who knows it better then me
i downloaded group manager im on a spigot server
LP is easy dawg
Oh Gm
Gm is super easy. Just open up the permissions yaml file. And either create a group or use the existing ones and add the perms you want
The plugin in question you are having issues with earlier it should have on its resource page the relevent permission nodes
Then once you finish adding perms to the group you can then use a command to add yourself to said group in gm
im running my server on sharkbite
sharkbyte**
First op yourself, and then using gms resource page you can from within the server add perms to the group you want and add yourself to said group
.. how do i find it in the server
@wet breach yooo frost
how u doin :))))))
sooo uuuuuhhhhh.. I am using World Edit's api in my minigame.
Idk. Not familiar with your hosting provider
Is there a way to check if a block was placed by a player or generated naturally?
shockbyte?
no. the only way is to store all blocks placed and broken somewhere
and compare aftrer
ya ...
built in sadly not, i just used alex's customblckpdc and saved a byte to it
You know, LuckPerms only requires console use once and then can be configured completely in game afterwards.
Sounds fine to me
when i was downloading it it didnt have a spigot option
bukkit is spigot
but with a faucet
I wonder if I can use block PDC to make stuff like modded
im lost ...
🧠
no spigot? use Bukkit. It's the same
It’s hard to explain, but if you see plugins labeled as Bukkit, they will run just fine on spigot.
im currenly running a spingot server so i can use gyseer plugin
great! so no issue?
and that doesnt support buket servers i believe
if there isnt a spigot option, use the bukkit one, it'll work
Spigot servers can run bukkit plugins as they are compatible.
or get a better provider. kek
better yet, host yourself
I bet if you changed one lil line in the pom.xml of most spigot plugins it'd run on bukkit and I bet it work the opposite way too
the gyseer plugins to run crossplatform and thats a main one for my server even tho its really just for my group of friends that have bedrock
on the luckperms download you can use the bukkit version, you dont need to change the server version
^
They went with GM
Gm doesnt have a specific version and is typically labeled bukkit but it will work on spigot or paper and most other forks that implement bukkit api
It even gives examples on the website. smh
ifconfig works like a charm thanks a bunch for that suggestion 🙂
Is it possible to use Player#openSign on a "fake" sign created using Player#sendBlockChange?
Guys an open-ended question about design choise of my plugin:
Im running a minigame where people would be teleported to a 9 chunked-randomly vanilla generated terrain (so the map is never the same).
Lava slowly creeps upwards and whoever dies last, wins.
After a game, This area needs to be get rid off. and players teleported back.
I thought about using multiple worlds for multiple game lobbies, but that turned to be very resource intensive and I would like my plugin to work on an 8 gig server.
Any Ideas on how to efficiently and smoothly make lobbies of randomly generated 9 chunk terrain and use it then get rid of it?
No. Once the sign is placed there is no option to edit later thus the only time open sign can be used is when a sign is first placed
and frostalf. I know, I dont wanna have a convo about upgrading yet again.
There should be in 1.20.1. You can now just right click the sign to edit in vanilla.
yes i'm on 1.20.1
Use a void world, each minigame is a schematic to include its floor. Use regions to help identify borders and to just remove the arenas and repaste in. This will remove lava as it will just get removed and anything left over falls to the void
can't find a way to open said sign's gui without placing it "for real"
I'm leaning towards no as I believe that it looks for placed signs on the server, not the client.
Oh that must be new then
how do I generate random terrain where the players will play?
what if you placed a sign in another world and then opened that sign to the player 💀
That being the case the api is probably not updated yet to handle that
So odds are it still wont work from the api like that
Or placed it at the height limit and opened it
too much can go wrong with that one
Got to give some time for api to fully update to 1.20 features
Might take a couple of months but it will get there 
Just save the block it replaces and place it back once done
Or you could make an algorithm that searches for the nearest air
I dont see a problem with this if 1.20 allows editing signs after they are placed
i'm afraid that's not a possibility :(
just go - 30 million -30 million and place em there then
29mil*
I thought about using a void world and a normal world. Players get teleported to different "plots" for game lobbies in the void world, A random 9 chunk area will be coppied from the normal world and pasted where the plot is, make lava rise, end game, delete the plot and flag it as free for the next game.
How does that sound?
if you got players at 29m blocks somethin wrong 
sending block updates to unloaded chunks is very risky afaik
Imagine the players going to the worldborder and suddenly seeing a signyard
Doing anything within unloaded chunks is a bad idea
The reason i said void world was because when you remove the arena you want anything that gets left behind to just fall into the void. Removing flowing lava and water is a pain because stationary and flowing are two different things and it will take too much resources to find all the stationary and flowing lava bits
yeah having 4 chunks or so loaded out there wont do much for your server perfoamcne
and 4 is excessive
youll likely be breaking the signs when your done, so 1 chunks prolly plenty
I see.. But what about the idea I said in that message?
Its basically about what i said
Using regions from worldguard just helps with borders automatically since it saves that info etc
And you will need something like that anyways to prevent players accidentally leaving said arena
I was using player.setworldborder
i'll narrow the question down, i haven't explained myself well enough. My code right now looks like this:
BlockData imaginarySign = Material.OAK_SIGN.createBlockData();
event.getPlayer().sendBlockChange(playerLocation,imaginarySign);
Now i'd need to Player#openSign(Sign), but I have no idea how to go from a BlockData object to a Sign one.
Sign extends BlockData iirc
Worldguard will be better and has more features for your use
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/Sign.html
ah yes forgot theyre tile entitys
declaration: package: org.bukkit.block, interface: Sign
You need to cast blockstate to sign
so tbh theyre not even blocks (you can still get block data and cast it back and forth though)