#help-development
1 messages Β· Page 1013 of 1
is there a way to get the client brand like fabric, forge, lunar client, badlion?
basically the brand shouldn't be trusted, it's just what the client claims to be.
yeah i know this
telling imyuvi
i need just a way to get the client name, i checked some plugins with api but found nothing
i know vulcan anticheat have a client detector in it but can't find the api
unfortunate, but vulcan offers the API as an external jar
that you can download
it's not properly hosted
i don't know how to add external api, im not an expert, just started coding
the impl must be inside the anti cheat
but as far as i know its obfuscated
maven?
you can add jars as dependencies in maven
if you just started coding, we would have to hold your hand to make this whole project
are you a customer of vulcan?
i have the jar but i don't know how to add it in the pom cause i don't know the artifacts id
yes
ill try, thanks
Hey, i'm facing a issue,
every X time (presave + task) i'm calling setRanCm(bukkitPlayer.getStatistic(Statistic.SPRINT_ONE_CM)); to save the sprinted distance of a player (we calculate stuff with this), upon joining I set the statistic to that value (i have multiple worlds etc.)
But sometimes the statistic is randomly 0, is there in minecraft any way that statistic can get 0 by itself?
Its also only the SPRINT_ONE_CM statistic that can get 0, even though i save more stats (swimming, flying etc.) and those dont get reset
Stats are per world
Yeah i know, so that why i'm saving them and setting the stat upon the player joining the world, but sometimes i make a getStatistic call and then it is randomly zero
perhaps you get it mid teleport or something?
There is no reason for teh sprint stat to reset unless you, or someone else resets it
or a plugin is doing something
also that reminds me, arn't the number stats ints @eternal oxide ?
Yes
so technically it can flip
True, if it gets big enough
I'll ask my players if they have any guess how many they approx ran before it resetted
just log the stat values for a bit
Should keep some sort of buffer and if the difference is over some threshold, ignore it
also idk how mojang does the code, but since the stat can't be negative, that means it can only store half the numbers
since Java doesn't have an unsigned int
if you have backups you can check. stats are all in json files
[12:18:22 WARN]: java.util.ConcurrentModificationException
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1415)
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.indexOf(ArrayList.java:1265)
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.contains(ArrayList.java:1276)
hey, i am creating my bw plugin but if you remove from the team the player and then you do at the players the .isEmpty or contain, it get error. The code is in sync so i dont know why i get the error
will do π thanks for the help for now
you can not modify a Collection you are looping
I did not understand what you said
He explained pretty clearly
It looks like you are looping over a Collection and modifying it at teh same time
While you are looping over a collection, you cant modify it
is all in sync
is not async
Show your code
that dont matter
makes no difference
sync or async. u cannot modify a collection you are looping over
?paste
use an iterator, or change how you are doing it
for(Element e: collection) {
collection.remove(e); //<- throws CME
}```
i know it, but i dont do that
this is the code
can u also show the entire error then
so we can see which class it comes from
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1415)
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.indexOf(ArrayList.java:1265)
[12:18:22 WARN]: at java.base/java.util.ArrayList$SubList.contains(ArrayList.java:1276)
[12:18:22 WARN]: at dev.bsbedwars.it.team.Team.contain(Team.java:66)
[12:18:22 WARN]: at dev.bsbedwars.it.arena.component.ArenaScoreboard.game(ArenaScoreboard.java:60)
[12:18:22 WARN]: at dev.bsbedwars.it.arena.component.ArenaScoreboard.update(ArenaScoreboard.java:31)
[12:18:22 WARN]: at dev.bsbedwars.it.arena.component.ArenaScoreboard.run(ArenaScoreboard.java:128)
[12:18:22 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
[12:18:22 WARN]: at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352)
[12:18:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:890)
[12:18:22 WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:412)
[12:18:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:815)
[12:18:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:648)
[12:18:22 WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.lambda$spin$0(MinecraftServer.java:133)
[12:18:22 WARN]: at java.base/java.lang.Thread.run(Thread.java:842)```
β¨ async/fast/supersonic β¨
Didn;t provide that code so we can't see
new ArenaScoreboard().runTaskTimer(BedWars.getInstance(), 0L, 20L);
is in sync
what do you have that is NOT sync?
for that error i have toggle all void async in sync.
only async is the generator
Are you sure you are not firing your kill event async?
is sync because i have do in all death event e.isAsync...
@eternal oxide you can come in genral-1?
Be certain, super(false)
super("ok");
removeIf
that works too
this cause the error
ArenaScoreboard.game is reading while something else is writing to the team's player collection
thats like moving the issue
Your Scoreboard code or some event is running async
you are reading and modifying yoru players List at the same time
either your death event is running async or your update of your scoreboard is
fastboard is async?
no idea, is it?
possibly
You've not shown us any scoreboard code (even though I told you that was throwing the error), so I've had no reason to look at fastboard
if i toggle the scoreboard and the tab, if i try to get if players is empty or contain, it get always the error
@eternal oxide the error is cause by this
but this is sync
i am tryng to do syncronized...
yoru error is caused by TWO things, not just one
one of them is async
I looked though fastboard, it runs sync to whatever is calling it
?paste you ArenaScoreboard.java
There is nothing in any of your code so far that would even need async
yeah you are calling the update method async
looks quite sync to me
call your runnable sync not async
and change thsi code to use removeIf over creatign a whole new List and setting it
???
his error says otherwise
where i call it async?
the error is about trying to loop through array and modify it at thw same time
when you start your ArenaScoreboard task you are doing it async
no its not
its thrown on a .contains
he's modifying the array in one thread and accessing in another
i am removing the scoreborad and the tab, but i get the error always
just stop trying to do anything async
you do not need it
make your kill event sync
it is
i have do e.isAstnc
and the result is false
the error you posted was passed though your Scoreboard class
which is line 128, calling update() in yrou runnable
so? it is sync
i have find this
@echo basalt the removeIf cause the ConcurrentModificationException
THat just means you have 2 threads accessing it
Show us where you start your ArenaScoreboard task
Either your kill event is async or your ArenaScoreboard task is
I've removed it for now
Just stop using ANY async. It will fix your error
π
Hey, I wanted to know how I can open an Anvil Inventory that can be used by a player.
I used player.openInventory(Bukkit.createInventory(null, InventoryType.ANVIL)); but with that the players can't use the anvil
what version are you on
1.20.4
Hello guys, is there a method to clear Block Damage (Block Breaking Animation) to a player?
?
anvil gui class was never finished
and how can I open an Anvil GUI then?
That's not true
It is finished and works as intended
really then why are there wrappers for it
what is this?
Nms
Long story short bukkits inventory system is ancient
It can't handle it
btw I just need the vanilla anvil functionality. No User Input or anything
It's not unfinished it's just a bad system
If you're comfortable dipping into nms you can do it in like 5 lines
my problem is that i don't have access to NMS because BuildTools won't work on my computer because of my wifi connection
Trash wifi?
actually not but it isn't able to download everything from git
we don't know. Me and 3 other guys here on the discord tried to fix the issue for like 3 hours and nothing worked
would be very nice, thank you :)
Can you possibly link me the convo too pls
it was like last year
Sorry not at pc rn so can't search
Ohh we've updated bt a lot try again quick
?bt
I can try
This time there is a maintainer actually knowledgeable about it outside of md
Use the gui
If your on windows
same error as last time
Send me a paste I'll post it in a thread quick
wait but it says failed to download but it still does something
Well if it fails send me a paste
?paste
Hey do me a favor does hub.spigotmc.org load on your web browser
yeah
Ok thanks
You on Linux or windows
windows
I'll be back in a bit to help more
@fickle mantle do you have git installed on your local machine?
yeah
First make sure this link opens in your web browser https://hub.spigotmc.org/stash/scm/spigot/builddata.git
run this separetly git clone https://hub.spigotmc.org/stash/scm/spigot/builddata.git
yeah it does
does it work or do you get the timeout error?
you mean when I try cloning it manually?
yeah
what's your download speed?
25mbits
alr I'm testing something gimme a sec
are you trying to build latest? otherwise this might not work
yep
ok
do me a favor in your terminal run git config --get http.postBuffer if there is an output send it here
nothing
alr
Maybe try git clone --depth 1 https://hub.spigotmc.org/stash/scm/spigot/builddata.git
Just to see if it can even pull anything down.
January or something
mm yeah that should be fine
you could try increasing your buffer size, but given the error idk if that's for sure to help
how do I install buildtools manually? I downloaded builddata bukkit and spigot
you can't unfortunately
you need the .git folder for BuildTools to recognize it
I can help you with that, but I believe fixing this has benefits :P running BuildTOols in the future would be nice
I'll try one last thing here
git config --global http.postBuffer 524288000 try running this than rerunning buildtools
What's the output of git --version?
git config --global --unset http.postBuffer run this if that doesn't work
2.43.0
latest is 2.45.1 that should be a non issue its 2 minor versions out of date
lmk theresult after increasing your buffer
π
Task exited with error code 1
what the fuck OpenSSL does not like you
if you don't mind what country are you from
germany
okay that should be a non issue
are you behind some proxy?
I smell shitty ISP configuration

Maybe try the --disable-cert-check?
could also disable HTTPS to
that might help going unencrypted seems to be the way here
same error
nope
idk if you have one, but like I smell so much shitty ISP off of this
dont have one
Windscribe is free. 10GB/mo
well whatever for now your ISP needs to get their act together...
Another attempt on another machine or connection would give much more information.
@fickle mantle I'm going to throw together a library for you :D
I reran it 2 times now it downloaded that mojang thing
That seems to be a common issue with really bad connections.
gg
How fast is your download speed? In seconds, FAST.com's simple Internet speed test will estimate your ISP speed.
What's your speed?
26
Is there a way to get a potion effect by it's actual ID? like "minecraft:nausea" instead of PotionType.CONFUSION
But do you frequently run into stutters or large hitches in your connection?
You using wifi or ethernet?
wifi
And your ISP has a direct line to your house right? Or are you using one of those wireless modems?
yeah i t has a direct line
Can you try plugging in ethernet and seeing if there is a difference?
don't have a cable for that
Most of consumer ISPs limit traffic outside of its country so good luck with that.
Well then a VPN is the only other option at this point in time.
But actually I don't need BuildTools rn. Could you please help me opening an Anvil Inventory that works? :D
I'm making you a library
thank yoouuuu
Does anyone here use startAllBack
Why both ItemMeta#getDisplayName() and ItemMeta#getLocalizedName() returns null? (or empty string)
ItemMeta itemMeta = item.getItemMeta();
if (itemMeta != null) {
this.name = itemMeta.hasDisplayName() ? itemMeta.getDisplayName() : itemMeta.getLocalizedName();
}
api-version: 1.13
has anyone ever sent raw data packets?
Because they aren't required and by default don't have either one of those.
wsup
I dont need to get item name if display name not exists?
Names aren't set by default
If the display name isn't set the client defaults to the material's translatable component
Thanks
when i create 16 threads, create a method #runTask(Runnable runnable) and the method chooses which thread has the least amount of stress, will this then be peak async programming, or is this idea stupid?
"thread has the least amount of stress" is not a thing
a thread either is working or not
what you are describing is just a thread pool tho 
yeah but the thread with the least amount of tasks in the queue
so good idea?
this is mutli-threading and not really asyncronsous programming. The API does make it confusing on this, due to its usage of asynchronous and what it appears to mean. But Async does exist with just a single thread.
When you run something asynchronously it means it is non-blocking, you execute it without waiting for it to complete and carry on with other things. Parallelism means to run multiple things at the same time, in parallel. Parallelism works well when you can separate tasks into independent pieces of work.
this is what stackoverflow said
That is pretty accurate there
i keep getting this error when trying to use nms to spawn a npc
https://paste.md-5.net/raw/figahakayu
isnt a thread pool kinda bad, if i have a system and the pool shares the tasks between threads, it willl end in a mess?
you don't share tasks between threads at least not ideally
what does a thread pool do, then :(?
Each thread has a queue, this is its work queue
i thought i was sharing tasks amongst threas
you would have a master controller that assigns work to a thread. AKA thread pool manager. The manager also has the responsibility to remove threads or add threads as needed
your tasks would get assigned to a thread, and that thread will do its best to clear its queue
the goal is to never have a thread not doing work, if it doesn't have work ideally you want to remove the thread
exception here is to keep a minimum amount of threads open, maybe like 2 or 4 if there really is no work to be done that are idling and waiting
okay
while you can add threads it should be noted that you should have a max amount of threads there can be, otherwise it starts to cause a negative impact as you continue to make threads
Hey, can anybody help me with shading a maven dependency in intellij
Don't use system path dependencies
if that's your plugin/api use mvn install on the project to add it to your local maven repo
also remove createDependencyReducedPom setting and update the shade plugin
latest is version 3.5.3
you should probably be setting your java to version 17 too
source and target should also be set to 17 once you do so
so thats all I have to do?
how do I do t hat
in my plugin.yml, how do I set the version to my plugin version set in my build conf?
maven or gradle?
gradle
π€·ββοΈ
lol
eh i'll just try this: https://github.com/Minecrell/plugin-yml
i dont understand what I have to do
that doesn't look like it supports permissions tho
nvm it does
your mistake is using the plugin.yml for commands
what do you mean about permission support then
i just have the permissions declared there
why just do it in code
is that even possible
yes
declaration: package: org.bukkit.plugin, interface: PluginManager
if you use reflection for commands you can also just use PluginCommand
instead of BukkitCommand and it handles registration for you for commands
i use cloud
I use clown
this just in emily uses chown as a minecraft command library
absolutely revoultionary
Good luck, I wanted to ask for help, I want to create a server but I'm looking for spigot 1.8 up to the maximum version 1.20, would anyone have the link to download it or where can I get it.
This channel is for developing plugins
thanks
oh
I thought it was the "I refuse to learn basic java" channel
that too π

tf is oop? I just want to get the stuff done π€‘
?paste
https://paste.md-5.net/kojekamesa.java Any specific thoughts why this code returns error 400?
https://paste.md-5.net/oreqazocus.cpp I have defined the method here
Tbh idk why the error but its the first time im seeing someone putting such a User-Agent, interesting tbh
Could it be something related with character limit?
user-agent doesn't really matter and you can just put anything you want, however some webservers do things slightly different based on user-agent. This is handy if say you are making use of api from a certain browser. Like using chromium or mozilla stuff.
I know, just said idk the error but its interesting User-Agent xd
@quaint mantle might I also suggest to condense your ifs π
are you sure it needs to be a post request and not a get?
error 400 means bad request. That means you are either using the wrong request method, or something is not right with your request
Can you explain what you are trying to do?
Doesn't post request allow you to send messages without hitting the limit?
A webhook notification when a player does something
Does something where?
Notification on discord?
Right, like a webhook notification
A discord url looks like: https://discord.com/api/webhooks/XYZ/XYZ
But yours is spigotmc?
How to get files from plugin resources folder?
MAIN.getResource("languages/en.yml");
declaration: package: org.bukkit.plugin.java, class: JavaPlugin
i replaced \ into / and it works! Thanks!
To most funny part is, i decompiled a proxy plugin from a friend who cant code and he used the same API as you π And its working
Now im fucking confused
?paste
The sourcecode for the webhook is on github, by the way
https://gist.github.com/k3kdude/fba6f6b37594eae3d6f9475330733bdb#gistcomment-2178978
ik
i have this code to increase the experience of a pickaxe and i have an explosion enchantment which breaks a 3x3x3 area and calls the BlockBreakEvent for each block. The problem is when the pickaxe is not cached yet. When the pickaxe is not cached, i cancel the event and load it from the dao asynchronously. Due to its async nature, i get an race condition, where instead of getting the 27 xp, i can get like 1, because it had 27 completablefutures but only 1 of them was able to store it in the cache
how can i fix this race condition?
the explosion enchantment
why are you getting it async from teh dao? It's in game and active you should have the data already loaded
Is it me or the does picture not load?
Elgral, are you having a stroke
if the enchantment's priority is lower than the xp one, i get the race condition, but if its the contrary, i get 1 extra xp
Its for you, its loading and our webhook is working, i tested, so its not discord π
the pickaxe may be anywhere. it may be dropped, in an inventory, in a chest or stored in another plugin
I haven't done anything wrong, have I? π
so there is no way i can all pickaxes at once
if it's being used by a player it's clearly in their hand. Data shoudl have already been loaded
the client may have an auto miner block that uses the item
in all cases, i need to load the pickaxe
its still in game, in an inventory. Data shoudl already be loaded
but not in my plugin
you shoudl never be requesting data for an item which is in game
but i am
Yeah
and how can i fix the race condition?
tbf, thats some bloat code lol
instead of using a simple listener method
i never faced a race condition, so i really need to know how to fix one
Yours is not really a race condition. Well kinda, you cant predict which will finish first
So Don't!
actually, delay your explosion event until the next tick
Gambling addiction on a weird level. Which on finished first. Thread 1 or 2π
i tried to cache the completablefutures for each key like this:
private final Map<K, CompletableFuture<V>> futures = new ConcurrentHashMap<>();
public CompletableFuture<V> readAsync(K key) {
return futures.computeIfAbsent(key, super.readAsync(key)).whenCompleted((data, throwable) -> futures.remove(key));
}```
It made the amount of xp be close to 27, but not exactly 27
But as Silver said, it's a gamble, you could chain your Futures
Not sure if i correctly understand the problem, but my approach of caching custom items is to load them when the player joins by scanning their inv
use thenRun btw
what if the database connection have a bit of delay? I would end with the same problem but milliseconds later
Put your explosion in an "action queue"
Which is why you don't rely upon a db connection for live data
Or get your data before letting players break blocks
Best solution
which is what i am doing
but the explosion enchantment spams the blockbreakevent
and here i dont let the player break the block while the pickaxe is not loaded
your pickaxe cache should be responsible for getting stuff from the DAO let's begin with that
fetching data from the DB has no business being in a listener
if you don't allow breaking until the data is available there is no explosion
no explosion, no multiple block break events
If your explosion happens it means you must have got the pickaxe data
or you are not actually caching it properly and getting it fresh every time
I saw 4 images and 3 different implementations of a BlockBreakEvent, a new record. Thats fun
I mean packets that can be sent via Channel#unsafe#write
Because they don't require compression as they're already compressed
And version data is correct because it was transformed with ViaVersion's api
Cuz I get "DataFormatException: invalid header check"
And the client disconnects
erm
can i copy paste apache commons code in my project?
at the end of the day, who cares
That's a bad way to do it but yeah ig
its that just like a sound effect like "wtf you saying?" or database related xd
former
Ehm what the sigma
on PlayerMove I am doing player.stopSound(Sound.BLOCK_WOOD_STEP) but I still hear it
how do I make it so that it doesn't play the sound when the player walks on a wood block
Moving sounds are client side
does that mean it needs a resource pack to get them not to play
i don't even know how to do that
this.target = this.targetType != Player.class && this.targetType != ServerPlayer.class ? this.mob.level().getNearestEntity(this.mob.level().getEntitiesOfClass(this.targetType, this.getTargetSearchArea(this.getFollowDistance()), (entityliving) -> true).stream().filter(entity -> entity.getBukkitEntity().getPersistentDataContainer().getOrDefault(Overcharged.WARDEN, PersistentDataType.STRING, null) == null ? true : !(entity.getBukkitEntity().getPersistentDataContainer().getOrDefault(Overcharged.WARDEN, PersistentDataType.STRING, "").equals(this.mob.getBukkitEntity().getPersistentDataContainer().get(Overcharged.WARDEN, PersistentDataType.STRING)) || Shard.getSummoningMobs(Overcharged.getPlayerShard(Bukkit.getPlayer(UUID.fromString(this.mob.getBukkitEntity().getPersistentDataContainer().get(Overcharged.WARDEN, PersistentDataType.STRING)))).getItemMeta()).contains(entity.getBukkitEntity()))).toList(), this.targetConditions, this.mob, this.mob.getX(), this.mob.getEyeY(), this.mob.getZ()) : this.mob.level().getNearestPlayer(this.targetConditions, this.mob, this.mob.getX(), this.mob.getEyeY(), this.mob.getZ());
``` new n improved btw
where is the formatting
Oh what in the fu
The syntax highlighting just gave up
Try stopping all sounds and see if that helps
that is formatted
yeah idk why
needed to see for myself
Someone trying to avoid local variables?
or just make it as unreadable as possible
torvalds wouldnt be happy with the nesting of that code
suppose were talking about this :|
richard is a legend, linus is a legend of some kind
i appreciate that u think richard is a legend
i mean just read his email conversations
Do you want to search in verified, verified, verified, or verified
verified staff isnt a thing
bc ive seen colls screen
then we dont know
i mean his emails are fun to read
ye
Maybe discord should just not send channels you donβt have access to
TLDR
They donβt send the content thankfully
ah he just yells at people
But idk why they send the channel at all
he once told a user they were too dumb that they probably were unable to reach their mother's tit to suck on
ahahaha classic torvalds
well clearly not
if he has time to respond to his users like that
i mean, i don't have the context
i mean..
but if he does it unnecessarily
then its just lame
like out the blue
but yeah id love to lash out on my users time to time
elon also got better things to do and does the same thing
he doesnt yell at them, just replies to random people
if i lash out on someone i'd need a good reason for that
so does linus
read all the emails
love it how he yells at kernel contributors
can anyone help me with znpcs plugin?
help in what way?
i want to do /znpcs action 1 add CONSOLE mvtp %player_name% Survival
but appears "Hey!, The inserted number/id does not look like a number"
sounds like a #help-server problem
tf is this
codwe
now this is efficient line usage
Hey guys, hope you're doing well.
Trying to make a plugin now but seems like it's taking as a paper-plugin and it loads way too early, where is the place so I can change this and make it a normal bukkit plugin
Donβt use paper-plugin.yml
am not, just plugin.yml
holy shit hes back
Hey Ebic! How you been
good good, hbu
Very good indeed
irl jobs is sick
Wanted to have a bit of my own time and do some mc
?paste ur plugin.yml
I checked the jar and it has a plugin.yml file in it's root, where it should be, this message is showing literally almost at the start of the entire server startup, like it's trying to load all the way before
Empty plugin ebic
On it
Does it occur on spigot
?whereami
i couldn't wait
lmao Im well aware where we are
But i feel this is a me error, not a server jar error
remove load postworld and check again
I am still using the spigot api to develop
maybe you're exporting your jar wrong
what are you using as an IDE
are u using maven
yes
i use mvn package
What's weird is that if i decompile the plugin it shows perfectly
on my maven projects
Will try
but i dont think it'll make
Oh god here we go again... Invalid signature file digest for Manifest main attributes
upload ur jar here
XD
Is using install good?
Nooo guys we will steal his holy code!
install and package do the same thing
use the jar with no prefixs or suffixs
ye
install fills up your maven local with multiple copies
bro could use this as an opportunity to spread a virus
I should clear my maven cache
package is correct, unless you want to access it as a local dependency
framed
rip
What's strange is that the thing complains about no plugin.yml and i can very clearly see a plugin.yml where it should go
This error also usually indicates that you're bundling a signed jar inside your plugin jar file
What am I even doing here lmao
Like why is this a thing
why all classes are "package-info.java"
somethings fucked in ur build
oh fr
I can see that LMAO
XD
It's a fking default project
ur main class is in files
How did I already fuck up maven already
?paste ur pom
but it's more beneficial to understand the issue
so you can learn
and not run away from your problems
Indeed, I already use gradle on day to day
Learning is fun
I guess i deserve the error for using @tender shard archetype plugin
check the jar thats in /target/
But I love running from my problems
based on your physique
Got those
use the one with no prefix
it doesn't look like it
tf fook
remove minimize rq
adventure based
Tf you know about my physique
maven decided to remove everything
convert to gradle, all issues solved
Yes but where is the learning bro
Also btw
dont need to learn
?java17
Install Java 17 at https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot
xd
wait no
m3 is arm
not x64 or aarch
oh wait
I forgot arm is the same as aarch64
Ok
i think ur first issue was mac
couldve got a framework
I have both now, beast windows, beast mac
damn
No thanks
now its time to linux
arch linux
Is perfect
No thanks
I use linux on cloud environments, no need for pc just for that
Wanna see my mac setup?
sure
the fact theres a bezel in the center hurts my eyes
Windows setup is 3 of the same monitors but standing desk
Sad little laptop connected to 2 giant monitors
LMAO the birghtness of the laptop
also that laptop is so bright
It makes your retinas into liquid
100%
behind your eyes could be full of eyelashes
bet thats fun
When i do mobile, i can get like 8 emulators at the same time with 20% usage
my pc has decided a vm is going to use 90% of my cpu randomly
That's the beauty of vm
Imagine if itβs just lying
lol
βYeah man your cpu is at 12% usage trust meβ
maybe its time to reinstall windows
I mean
It's actually cold
Fans are barely on
idk how they do it
but M chipset is actually insane
@remote swallow
Help me convert this pom to gradle
Empty gradle practically
actually nah
I will make maven work
how can I make my plugin create file in the same folder as it is in? as in, in ./plugins? im trying to create json file but I cant find it anywhere
im using jackson for that
Plugin#getDataFolder
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
id("net.minecrell.plugin-yml.bukkit") version "0.5.3"
}
group = "com.tomisanhues2"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT")
implementation("org.spongepowered:configurate-yaml:4.0.0")
}
tasks.shadowJar {
this.archiveClassifier = ""
this.archiveVersion = ""
archiveFileName = "${project.name}-${project.version}.jar"
}
bukkit {
name = "MytherialHealthData"
version = project.version.toString()
main = "com.tomisanhues2.mc.HealthData"
apiVersion = "1.20" // LATEST
}
Ah shit lmao
Ok fine, lets hot swap a minecraft plugin project
deleting the maven stuff and adding the gradle stuff
What could possibily go wrong
after its done delete .idea and reopen it otherwise it thinks maven files still exist
average intellij moment
Configurate?
id say its probably easiest to run gradle init then modify the build file
also thats gradle kotlin
Is spigots config api not good enough for you? Smh
Ok
nope, it just uses the pom.xml
altho i don't remember seeing anything maven related while i looked in the idea folder
thanks
it works...
...kinda
I forgot the / lmao
use Plugin#getDataFolder
You should use the constructor that takes a file and a string
thats what I did
new File(Plugin#getDataFolder, βfart.txtβ)
Looking good now @remote swallow ?
ye
neat
Will try now, empty file
how can I remove legacy .yml files that appear in my plugin's jar file?
not the plugin.yml ofc
ebic wanna help me with part 2?
run a clean package
depends
Add a step to build.gradle which executes a file called deploy.sh which i already have
exec task
yeah
If it just copies the jar somewhere
copy task
You donβt need an external sh file
Ah
Then it enables remote debugging
Which is sick
It stalls the server but works fantastic
hotswapping π
kotlin hotswapping is fun
Can grade just do Runtime#exec
prob
Or whatever the Kotlin syntax is
is there a way to get rid of this popup?
no
Really?
that should be controlled by version control
/gradle no .gradle yes
You should include the /gradle folder with the wrapper
/gradle has wrapper jar in it so everyone who tries to build use the same wrpaper jar
means you dont have "works on my machine"
Ah yeah supposed something like that
necessary because gradle breaks every version :>
craftbukkit still exists smh
Clearly craftbukkit should implement an entire custom server
clearly craftbukkit shouldnt exist
Then what will implement the Bukkit api
spigot
craftspigot surely
Ah yes
I mean realistically for that you always have
.*
!.gitignore
in your gitignore
just use cabernetmc bro
fr
I can't think of any dot-file besides .gitignore and .gitattributes you'd not want to ignore
Anyways, I'm eepy; time to go to bed now
.dotenv
How to split text with \n into several string?
For example:
Input is: "Test\nAboba"
Output: ["Test", "Aboba"]
text.split("\n") and text.split("\\n") not working
no, its not working for me
wha?
\r
some CI bs I presume
Nah itβs a standard file for environmental variables
Thanks!
you should never vcs it lol
Yeah im saying it should be in the gitignore
Itβll be covered by .*
and geol said he doesn't know any files besides .gitignore and .gitattributes you shouldn't ignore π
Wait I misreas what geol said
How to get default potion color and potion type?
Default potion is potion that from vanilla minecraft
PotionMeta
PotionMeta not working
if (itemMeta instanceof PotionMeta) {
PotionMeta potionMeta = (PotionMeta) itemMeta;
this.RGB = potionMeta.getColor();
this.potionEffects = potionMeta.getCustomEffects();
}
Here is result
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
[02:32:19 INFO]: [FastPluginConfigurer] PotionEffects: []
I dont understand it, i am not using linked hash map anywhere
are you trying to get something from a config
is it gson
i have no idea
Caused by: java.lang.NoSuchMethodError: 'java.util.List org.bukkit.potion.PotionType.getPotionEffects()'
I am deserializing on server enable
and then trying to print a value from json file
its weird because it works for another json file
but its exact same implementation
@remote swallow
Is there a event for pre-quit?
Like, when I show players health on PlayerMoveEvent it can go over 20 no problem, but if i hook into quit event and get players health it resets to 20 so only can see 20
Use the older deprecated one for old versions
I cant find potion amplifier and duration
idk wum
what the fuck
when im trying to print class of this object I get error
whenever im trying to get entry by #get() it gives me an error
its just a hashmap
first time im seeing this kind of problem
How i can get effect duration and modifier
if (itemMeta instanceof PotionMeta) {
PotionMeta potionMeta = (PotionMeta) itemMeta;
PotionData potionData = potionMeta.getBasePotionData();
PotionEffectType effectType = potionData.getType().getEffectType();
this.potionEffects = new ArrayList<>();
if (effectType == null) {
this.RGB = potionMeta.getColor();
this.potionEffects.addAll(potionMeta.getCustomEffects());
} else {
this.RGB = effectType.getColor();
this.potionEffects.add(new PotionEffect(effectType, (int) effectType.getDurationModifier(), potionData.isUpgraded() ? 1 : 0));
}
}
there is on bungee idk about spigot
Yeah I figured it out
It was a different plugin
Eco plugin
So I just ran my task delayed by 1 second
And that guarantees the player data is changed by that plugin
Works as a charm
This code returns empty list, how to get main potion effect?
PotionMeta potionMeta = (PotionMeta) itemMeta;
FastPluginConfigurer.getInstance().getLogger().info("Potion effects: " + potionMeta.getCustomEffects());
Main? Technically Potions can have many potion effects, so can you define "main"?
default potion without any change, vanilla potions
I need to found a way getting potion effect
Or how this potions was creating?
You could tag them with pdc upon being taken out of a brewing stand
What does this have to do with the brewing stand
I dont need to tag anything, i need just get potion effect then store it in the config
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/PotionMeta.html#getBasePotionType() for new versions (1.20.5/6 iirc)
. You said you wanted to know how it was created
There is nothing in PotionData
i cant get PotionEffect from PotionData
Correct
The duration and level is determined by the base potion type
The modern PotionType does have data on the duration and level of each effect though
But thatβs 1.20.5 api
duration in ticks?
Yes
Hey, I wanted to work on a plugin on 1.20.6 and I am using nms. In a older plugin (1.17 I think it was). I used the ServerPlayer class, now I am trying the same but the import doesn't work anymore. Did ServerPlayer got removed / moved or replaced by a different class in 1.20? I couldn't find docs related to that
nope
Gonna make a plugin tmrw, is this the right file lay out?
Companies/
β
βββ src/
β βββ com/
β βββ yourname/
β βββ companies/
β βββ CompaniesPlugin.java
β βββ CompanyCommandExecutor.java
β βββ CompanyManager.java
β
βββ plugin.yml
βββ OtherPluginFiles...
You can lay it out however you'd like, really. Though depending on what build system you're using, your plugin.yml and other plugin files may want to be in either the source directory, or maybe a dedicated resources directory,
If you're using Maven or Gradle, they're put in src/main/resources by default. Either way, you need to make sure that when you export or build your plugin, the plugin.yml is in the root directory of your plugin binary
do u recommned gradle or maven?
maven is simpler
Hey guys, any suggestions for 3x32inch curved monitors layout?
Currently use a horizontal layout but it's so wide
And i don't think there are any good triple horizontal 32'' monitor stands available
Is there a way to extend a Mob to PathfinderMob in a class that extends Mob?
What
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));```
requires PathfinderMob.
but I'd like to have the class extend Mob, and somehow get PathfinderMob from that rather than having to extend PathfinderMob
Nope

