#help-development
1 messages · Page 2139 of 1
if (damager.getItemInHand() == null) return;
so i'd do if (w.getItemMeta() == null) return ?
yes
or check if the item is air
if (damager.getItemInHand() == null) return;
what's the point of this line ?
If i gotta check air too
of check hasItemMeta()
basically but you dont need the parentheses around w.hasItemMeta()
yes, but lose one of the () if (!w.hasItemMeta()) is more readable
oh okay
sorry didn't know
also why did my config reset when I uploaded the plugin on the server ?
didnt you reset the values of the players on join?
depends, if you make changes
if you have other settings in your config I'd suggest creating a data.yml for your player data
I have player's kill and levels
Should I make a data.yml ?
idk saved it all in the config
a plugin config shoudl be for settings which rarely, if ever change. Data shoudl be kept in its own file
ah shit
Its just a learning process. You get better the longer you do it.
My guess is you are applying damage yourself
i've never modified the damage in my plugin
apparently i'm not the only one having this issue but no one found the fix on spigot forums
nevermind it does it with all items
just applying 4 hearts with bare hand and 6 with crits
?paste
I'm having this really weird bug, where my scoreboard keeps flickering and displaying only a small amount of the values I set, this is my code: https://paste.md-5.net/ewagajoziv.java
I would love some help because I really have no idea at this point😅
It is flickering because you continuously are setting a scoreboard everytime you call “updateScoreboard” which removes the old one and sets a new one
It wasn't flickering when I was setting the same amount of entrys every time, but for some reason every second it sets only 2 entrys for a short time and sets its back again
Try reusing the old scoreboard and see if it works
how can I make an event repeat every 15 min ?
bukkit runnable
do i put that in a listener ?
a piece of code
Use bukkit runnable
I need to tp players to a certain location every 15 min
Do you want to tp player the moment they join ?
no
You can do it in onEnable if you want to do it for everyone at a same time
yea
?scheduling
I am reusing the same scoreboard, I'm just resetting it every time
how to compile a plugin with source code? f youtube
did you use maven or gradle ?
Hello, is it possible to make that ? : When i click on a diamond block with a feather, save the loc of the block clicked and the name of the player who click in the meta of the item. It can be possible with what ? HashMap ? Set ? or PersistentDataContainer ?
all of the above
Is there a better way ?
They are all viable methods
Nice, thanks for your help 🙂
If i use PDC, what is the DataType for the block cliked ? And the Player ? For the player maybe a DT String ? But idk for the block
which PDC are you looking to use?
how can i use nms packages in eclpise?
Use maven and look at the spigot post on how to do so
yes, we can see the light mode
ok
I'm looking to use a PDC to get into my item the loc of the clicked bloc and the player
then store it in the item's PDC, where's the problem?
so an Items PDC. Ok you would create a custom DataType
look at teh javadoc to see the example of writing a custom data type
or use my lib that already includes blockdata/location and player as PDC types 😛 https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
Ok so i need to create a custom DT, i never used PDC before so i will learn, i didn't know that CDT where possible
Thanks @eternal oxide and @tender shard i will check both solutions, thanks for your help
what does player.getInventory() return if the player suddendly gets offline
there is no Player object for Offline players
but you still can have a reference to the player object
yes, but if they go offline it is invalid and can no longer be trusted
What are they?
awesome tools and you should use one of those
I Cant type on my phone i give up
Hmm are they simple to use eclipse is very hard
there is OfflinePlayer interface tho
Eclipse is the simplest to use
so the impl for offline player should exist
OfflinePlayer exists, which has no getInventory method
O.o i can't compile a single plugin in that its hard for newbies like me
but the player object gets flagged
Eclipse is known for it being simple and uncluttered
Actually i complied 2 project which are created by me but unable to compile other open source plugins 😅
Can anyone compile a plugin for me 👉👈
I think IntelliJ is way easier, for example because eclipse's maven integration is total shit
I think its easier because it's basic
I disagree
Well, thats true
Vscode is simple asf but people like there intellij so I'd go with that
the extensions are fine. theyr repo is shit
You'd get the most support using something like intellij since its so popular
However, Maven comes bundled in Eclipse, so no extensions needed
huh. Why does it throw warnings for some classes, and errors for others lol
[WARNING] Class 'org.yaml.snakeyaml.representer.Representer' cannot be found.
[WARNING] Class 'me.clip.placeholderapi.expansion.PlaceholderExpansion' cannot be found.
[WARNING] Some classes weren't found. It may result in weaker obfuscation. Add needed jars to the 'classpath' element of the configuration file.
[ERROR] CLASS NOT FOUND: com.sk89q.worldguard.protection.flags.StateFlag
[ERROR] ADD NEEDED JAR TO THE 'classpath' ELEMENT OF THE CONFIGURATION FILE.
[INFO] Obfuscation completed. Writing log file...
Can it compile plugins?
Idk I use maven man
I dont think it can
Asking someone to compile a plugin for me 😅
mvn install makw sure you have the shade plugin if you have dependencies that need it
Just use maven or gradle
^^ please do not rely on your IDE to compile your projects
Do you have any video tutorial?
Uhm mvn install in the directory should do the job lol
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I suggest you to simply buy the plugin if you can't even compile it yourself
do they have a pom.xml ?
Ohh is that simple
Idfk
I always wonder what this file is for 🤔
so you do have it in the plugin you want to compile
Na bedwars1056
I just wanted 1.18.2 support in that
Huh do you knownhow to code?
The developer is kinda rude even tho someone already added pull request
Yes
it is open source ? 🤔
Yes
Did you fix the plugin? To support 1.18
Someone already done that on github and provided code
Ok
Sure it the best open source free bedwars plugin
Yes
So....?
well NMS usage in plugins usually means you have to install the NMS dependency on your machine
Hyy if you free can you compile it i don't want to install all stuff in my pc as i don't an full time developer 😅👉👈
lol
Also all this make my pc lag alot
I remember when last time i tried development omg there were so many packages
What index is the off hand slot in a player's inventory?
that's not possible
Hehe i don't know
Google it
indexes can't be lower than 0
First image that comes up
offhand depends. you can switch hands now
Aa btw lynx can u 👉👈
if I switch hand the slot changes?
oh
you actually do not need to install things
they use the very legal
maven repo that provides the entire spigot server
Why do you want an index for the off hand? Just use teh correct API methods
and set
Wdym???
I love very legal maven repos
Okay short explanation
Not legal
Ohh
NMS is shorthand for net,minecraft.server and using it basically means that plugins use classes that mojang coded, not spigot. To be able to do so however, you need to have these mojang owned classes on the machine you are building the project on.
obviously distributing software from mojang that you do not know is not particularly legal
^^
literally just run mvn package after you cloned it ?
git clone repo
mvn package
I actually wanted to reply on this one
git clone git@github.com:Krakenied/BedWars1058.git bedwars
cd bedwars
mvn package
Hmm...
hm ?
Hm
I didn't got what you said 😅 can you do it for me 👉👈
No
wat
lol I already spoon fed you
He just wants you to do it for him
DMCA won't help here anyway
https://github.com/Krakenied/BedWars1058 this is the one i want to compile
yes
git clone git@github.com:Krakenied/BedWars1058.git bedwars
cd bedwars
mvn package
Where to do it? I mean on my cmd or...
Sir sorry but i really don't know java i am a basic programer with some py knowledge 😅
No... Thats what i am confused about
My java classes will start in 2nd semester
Well, install maven and git for windows
They don't teach you jack in school hate to break it to you lol
I went through 2 courses and didn't learn shit
Btw thanks alot for your time on me 😄
I've learned more off the net than from the school itself
School just gives a basic knowledge??
I did learn how to use sysout tho very useful 👌 👍
its less than basic knownledge
basic knowledge would suffice you how the language works
After you finish 2 years of college classes maybe you can make a basic calculator
and not "if you input this, you're gonna get this"
btw just to confirm is this correct? https://git-scm.com/downloads
omg is this how basic educations are at colleges?
That's a bit of an overexaguration but if you expect to go to college don't expect to learn proficiency or how the language works
They teach you input output of basic level functions that aren't actually applicable
yes that is the right git
I have studied tax law for 4 years and I still cannot do my tax declaration on my own. so yeah, that's how universities work
😦 i am gonna to start BCA (Bachler in Computer Application)
Wtf is that
degree
Universities are basically 4 year paper factories
or 6 years if you're lazy
an undergraducate course
[16:22] LynxPlay: yes that is the right git
Everything you've been told about how useful college is is a lie lol
I dropped out of university and took a colleges certificate because uni was a scam
Hi, why this removes items only if i have exact number of them?
ItemStack itemStack = new ItemStack(itemMaterial, Integer.parseInt(itemSplit[0]));
p.getInventory().remove(itemStack);
itemStack has amount 32, but when i have 64 it does nothing. How to make it to remove 32 from 64?
Took me one year
but its 16:24
wow
Use removeItem() instead, Notro
I'm still enrolled. officially this is my 18th semester lol
which one should i install?
Oh, didn't see that
binary zip archive
bin zip
i'll try, thanks
Will do what you’re expecting
remove() removes the exact item, removeItem() removes the amount
Link Checksums Signature
Okay, works, thanks !
link
oki
I'm tryna get out of college as fast as possible my parents are making me go lol
Get the quick bachelor's in cs and dip
lol
and here I am suffering through a master degree
I'll have most gen Eds done and all cs classes done by the time I actually have to start paying vs my highschool paying
i downloaded and extracted in a drive is it oki with maven?
you will have to add it to your path
► Java/Spring courses & guides
https://www.marcobehler.com
► Newsletter
https://bit.ly/2K0Ao4F
► YouTube sub
https://bit.ly/2lVExgm
W1D1 - Installing Maven 3.6+ on Windows
why didn't you just use an IDE to run maven?
Intellij -> File -> New Project from Version Control -> Enter Github link -> clone -> double click on "install" -> done
*Doesn't know java
I don't think that's required to follow the above mentioned steps though 😄
*uses eclipse
😦
do you need to know java to have an IDE?
Usually that would help as it's more likely you actually have one installed
I'll install netbeans now
NetBeans? Nah use the best glorified text editor on earth vscode
Because I use it therefore it's good by proxi
I am glad over everything that's NOT made by microsoft
but you use windows
because I have to
Lonux
I can't
Get gud
You can run anno 1800 on linux, just without mp as far as I know
noob
Make linux run windows executables
without multiplayer it's only 20% the fun
done with maven
that was fast
cd into the cloned repo directory, then do mvn package
Either way, if everything were to be on steam it would be much easier
Gross monopoly fail
I love steam I just don't like monopoly
But alas, Ubisoft is stupid
Listen I have no issues of other companies making their own shops just make it not ass please god damn
Noone forces you to exclusively release something on steam
yes, make it steam2, steam3, steam4, steam5
Epic is the closest thing to not awful
everything else on steam is shit
wow netbeans is the slowest IDE ever
the shop and lib is great
friend system is okay
profiles are okay
but everything else is shit
U know whats fast
👉 👈
an f16
a saturn V?
The greatest glorifies text editor
ok shut up, I'll try it
bet notepad is faster
I'm about to get flamed for it being ass
and already installed
probably
Sublime text is amazingly fast from my experience
U seem like the type of guy to not install the java language pack by redhat which contains all Java support
Y2K_ 👉 👈
sublime sucks, it always asks for donations lol
Best text editor I know. Handles large file sizes flawlessly and does not take years to start up
you don't have ssh setup
git clone https://github.com/Krakenied/BedWars1058.git bedwards
instead
the best text editor is vim or emacs
I only use nano
I only use tee
Cuz I'm too lazy to learn vim
Myes, but still does not fully offset the fast startup times
oh tea is great
ohhk
It can get annoying though if you are a Ctrl + S maniac like I am but eh
I am a ctrl s maniac lol
I do it on Google docs
Lol
Type a few sentences then ctrl s realize I didn't need to do that and get pissed off and repeat
I'd honestly buy sublime text if it wasn't so overly expensive
this worked now?? 🥺
did it ?
how can i get this numbers?
?jd-s
yes
Idk prob somewhere in meta or item stacks
why the heck is vscode using those weird colors on the left side
well cd bedwars into there
Since when is https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Registry.html a thing?
already, but unfortunately
Idk I use Arctic theme idk who it's by and I also use a custom background so my color scheme is dif
you mean git?
😦
bedwards
no, I mean the package names. commands, config, data is red, debug and enchantments is yellow, enums events is red again, exceptions is white, etc
Huh, pretty useless either way I assume
Also most of those are git control colors
and then just mvn package
but that's a fresh clone of the repo
i literally cloned it 3 minutes ago
maybe some auto format
declaration: package: org.bukkit.attribute, enum: Attribute
what does git status say
Did you initialize an empty repo
If so it's all added to the empty repo
I simply did "git clone https://..." and then opened that folder
also it doesn't support lombok?
Ir does
you just need an extension 🙂
Grab the Lombok plguin and restart
it working 😄
the lombok lifestyle
Same as eclipse and intellij
non compiling java code because records are too new
sweet 👍 then sit back and relax for a bit
might take its time
I've yet to use a record despite having data classes
hyy btw lynx do this works on all open source plugin??
Lol
non-compiling? well only if the IDE is shitty
and even then, everyone uses maven or gradle to compile, so it even compiles with a shitty ide
😮 how can i find if this process will work
my spacevim does not like it
generally if the project has a pom.xml this process should work
All your missing now is an anime girl background and a light theme
I mean, when I compiled the repo it took like 4-5 mins
noone can tell me that vscode is nice
it isn't
it doesn't even autocomplete the closing > when you type <
wait you complied it?
I type Class<? and then it wants me to manually type the closing > too? why?
yea I wanted to make sure that it does compile
Lombok on eclipse is pain. Delombok does a better job there
so you don't get stuck on it
its an editor that relies on plugins
then why you making me do all this 😩
learning experience
i used to like vscode before i tried the jetbrains ones
and a shitty one as well
I tried idea and I hated it
that make sense
It's so abrasive and it pissed me off

what was it, give a man a fish and they won't be hungry tonight, teach them how to fish and they will never be hungry again
something like that
but it stuck on 12 😦
vscode is like intellij on crack with funny colors
yaa you are so nice
I use eclipse hockey's
many colours are great
Hotkeys
but without any structure its weird
I literally already explained to you in one sentence how you can compile every maven-based plugin but you ignored it
its first time when a developer is so nice to me and teaching me something
😅 sorry
hear what? 😄
your attempt didn't count as a first time :>
you can be glad that anyone here is helping you
normally all plugins developers reply so rudly 😦
normally with something like that you get jumped on
but most of them dont even know it theirself
I cannot blame them. It gets frustrating at some point
yaa ik i am also really gratefull first i was worry of being ignored
but lynx is so nice he should be staff

nicer than imajin
is your internet ok o.O ?
and conclure
guys someone reply my question for java ?
conclure is bae
naw conclure nice
State your question first
idk it stuck on 17
what is it
Then we can answer it
I mean, you can stop it and try again
if it is stuck there for an unnatural amount of time
do i need to clone again?
no. you haven't asked any question in the last 2 days so obviously noone can reply to any
Sir, did you try to restart your device?
no
ohh i closed cmd
waitt
my english not my main language
i think how can i tell u 😄
wait Ctrl + c closes the entire CMD on windows ?
no lol
Yea didn't think so 😅
na i just closed manually
oh
that would be terrible hahaha
lol
😅
lol doesnt good translating
I mean it is windows :>
No matter the language you use, you never ask to ask something on the internet
it does
terrible is kind of its main selling point
they improved it
It depends on the language you translate it from/to
I'll watch BTTF3 now
oh oke w8
yeah true
wooo chat become fast
German <-> English for example is good. Chinese <-> English not so much
at least en -> ger, ger -> en improved a lot
for german<>english it works very nice, for latin<>english, it doesn't work at all lol
aa btw lynx now what should i do? do i have to close again?
german <> english is even better than deepL now
oki
i'm learning java but i can't understand some things
example i was need a take some strings 4th letter with charAt
What will this do for me?
you know on windows you can type "cmd" into the address bar you are trying to open and then cmd wil automatically open in that folder
the more you know
btw on my discord I have a dude who always opens tickets and then simply writes "hi". After 2-3 days I think it's weird and I reply to him "hi, can I help you" and then he immediately asks his question. but first he always waits until I've written "hi" too, that's so useless lol
but cd feels so cool
how the dir changes
oki it was something bug i gusses
I mean, who uses the windows explorer tho 🤔
in debian testing, they renamed cd to dvd
now it processing further
thats the standart for most of the people
int codepoint = string.codePointAt(3)?
people who use windows - you cannot tell me that you would rather do like cd ls everywhere
or they just say hi and wait for your response
no for get a string 4th letter or 3, 2 1
masochist
well saying "hi" or similar is of corse better than only asking the question, but it's useless to wait with asking the question until someone has replied to your greeting lol
bruh now it stuck in next process 😑
What will this do for my programming?
hmm what ctrl+c do btw?
you want to get the 4th lettter of a string? then do ```java
char myChar = myString.getCharAt(3);
attempts to kill the current command/process
1st letter -> .codePointAt(0)
2nd letter -> .codePointAt(1)
3rd letter -> .codePointAt(2)
4th letter -> .codePointAt(3)
yesss
yeah i mean if you order something you dont just say "hi......................", you say "hi, ich hätte gerne einen döner mit alles bitte"
Reeeeeeeeeee legacy code
i pressed and it started processing further XD
lol
i know but
Where will I use it in program development?
but would you wait with ordering until the döner dude has answered with "hi" as well? 😄
:DDDd
never
exactly lol
thats what i meant
hi, <question or whatever>
aaa is it succesfull?
ok nvm maybe if i learn java can understand
<question or whatever>.
Respond or I'll kill your family \s
lynx
discord wants my family to be killed
Might be some packet spoofing
Probably the fact your pressed Ctrl + CxD
Either way, somethign is strange with the webserver
try again
did XD
ugh I just realized I had an open ticket I never answered since... SEPTEMBER
oki
Better than the PR that converted all extranous tabs to spaces that was left unresolved since last mid-last year
who the fuck creates PR for that lol
https://github.com/SaberLLC/Saber-Factions/pull/163/files oh, actually it was the reverse. Eh I should close this PR
Because someone is going to Copy and paste this code
e.g. "thanks for this PR, did you test whether everything works" etc, then ask him to create unit tests etc
hmm
after half a year, you can actually merge it and mention him in big letters as CONTRIBUTOR on the readme page
also thank him, his parents, and his children personally
I am the person that created it
then it's even better
I should get off of discord, the heat is starting to fry my internals
what ctrl+r do on cmd?
you can thank yourself in the pull request comments
i am so fked up with my life i have paper tommorow and i am compiling a plugin
I also made a PR to slimefun a while back so I can finally add some support for it in my CE plugin, but that one didn't get merged yet but heh, it means less work for me
that could be me 🤔
bruh we're spigot's discord, we don't talk about paper here
Bruh alex
🤣 spigot don't talk about paper
But hey, it's gone now
did you just assume my gnender?
Alex is pretty gender neutral to me
purpur
fart
but "bruh" assumes ownership of a certain body part
does it 🤔
🤣
well it is derived from it
where this conversation is going
but does that imply it kept its meaning
🤣
I've never seen someone say "bruh" to their girlfriend lol
deep philosophical questions with lynx and alex
Either way, the intention wasn't that
on a daily xD
that sounds like a youtube series
🤣 i said it to my bestie alot
it could be 
😗
🍆
But it isn't 2021 anymore, so I am free to assume gender either way
hehe...
oh man bttf3 definitely is the best part of the series
did it compile btw ?
and then rename general to help-development, or what? 😄
https://mail.openjdk.java.net/pipermail/discuss/2022-May/006077.html damn, Date is scheduled for deprecation
Not sure if I use it however
wait btw is it using net?
why my code no workings??????
https://paste.md-5.net/todomivemo.coffeescript
guys can someone help me i get everytime strange symbols and -Dfile.encoding=UTF-8 before -jar dont working
is there a way to fix it?
oh no
why
do they really do that or is that just someone who suggested it?
Alternatives exist
just put 69 in ''
It is a suggestion, but it makes sense to some degree
didn't you already ask this yesterday and kept annoying everyone with this?
ik it was a joke 😄
ohh lol
If it is discussed at that level it might get deprecated in a few releases
Though u blocked me + no one helped me + just watch your previous offtopic messages here
Either way, just a thing to keep in the mind
cmn dont be to salty buddy
I'm looking for a way to save & load player teams and player tags given using /tag
further context IS needed
btw did anyone here made a real public plugin which can be usefull for a smp?
Hm
No skilled java programmer uses the legacy classes in new applications
except when integrating with legacy APIs.
Well I use the Calender often to simply get the current year or similar and I don't see any reason why using it would make anyone less or more skilled than others. I think the whole post is pretty bullshit
pretty sure this goes to #help-server
I did, unfortunately discord still shows messages of blocked people
LocalDateTime be like:
you came here few moment ago right?
or u maybe opening them
I think so
most of us did, I assume
hey anyone know if there is a cap when using persistent data storage
just wondering cause there are caps on things like attribute max health etx
then shut up 🤣
can i get some link i would love to try some
no need to be rude
oki sorry
Oh yeah I did make one
I have once stored a few hundred megabytes in a chunk's PDC and it worked fine. although you probably shouldn't do that normally lol
lmfao ok
can i get link?
also anyone here using intellij
about 80% of us use intelliJ
so like
im not sure if its a bug
but i use the minecraft development plugin in intellij
then it's a bug
noob
that plugin is bugged as hell
Anyways I'm looking for a way to save & load player teams and player tags given using /tag.
@echo off
java -Xms1G -Xmx1G -XX:+UseG1GC -Dfile.encoding=UTF8 -jar minecraft_server.jar nogui
pause
this is code and it dosnt working
and when i transfer a plugin file from one comp to the other it just stops working
isn't this a server start code?
That alone is working as intended
you mean when you transfer the "source code" of that plugin?
it is
it dosnt work
like the whole plugin folder ig
(Either way, specifing the default file encoding is dangerous)
mfn you got some really intresting plugins
you probably have added the dependencies manually and so you're fucked. you should use maven or gradle or a similar dependency manager. maven, gradle, ant, ...
thx, I got about 30 more but they are not on spigot lol
i judt move it onto a mac cause i went away for a bit
and even after installing the plugin and restarting everything the plugin doesnt work
but when i create a new file then it works
can someone help me
essentially when i transfer a file to another device it stops working
like cloud backup?
ohh
so like vault?
I sent in DMs
The file or the device?
the minecraft development plugin in intellij
so guys
lol imagine coding a plugin sooo bad that the computer breaks
how do i get the player
can someone tell me what methods do I use for saving & loading player tags & teams?
erm you should use a HashMap<String,Object>
ya that one is good but not perfect it don't support multiple backup but its also nice
WHAT
it is an extra storage one
yes, yes
are you telling me players are objects?
no dought
If you say so it has to be true. How stupid am I to not see the truth
#youtoo
it's no problem, maybe you were blinded by one of my previous flashbang screenshots
we live in a simulation
meanwhile I am still trying to get info on how to save and load player tags and teams
i can't belive how much helpful is this community today 🤣
uhh its done automatically?
oh they crossposted
I need it per-world
autocorrection changes uhh in and lol
sadge
alex answered my question so what
0.0
unless a plugin for saving tags & teams per-world exists I need to code it manually and to code it manually I need the methods
the methods for what o.O
saving and loading teams & tags
I mean I linked you the method to get a players tags in paper
what tags?
scoreboard tags
oh didn't see that one
thanks
i forgot
teams, you will have to query the main scoreboard for
is there a way to get the scoreboard of a world?
just for curiosity is it possible to code a mc plugin with python?
nope
scoreboards are server wide
?paste
Skript exists tho
not world wide
whats that?
a plugin
a plugin which allows you to create "Skripts" (functions) that you can use
😮
help pls i am creating a reload command but when i set the permissions the game not detects it works without the permission any help? https://paste.md-5.net/vaxobuceso.java
yes sure, but it would be way more complicated than simply learning java
btw i know py how hard it would be to learn java
JPython 😎
spython
help pls i am creating a reload command but when i set the permissions the game not detects it works without the permission any help? https://paste.md-5.net/vaxobuceso.java
py is dynamic but java is not
that doesn't exist does it?
imho java is WAY easier than python
help pls i am creating a reload command but when i set the permissions the game not detects it works without the permission any help? https://paste.md-5.net/vaxobuceso.java
afaik it doesnt
I learned it in like 10 minutes when following a basic tutorial on a minecraft plugin
python is wonky
@eternal night its donw now?
the basics at least
The da-vinci machine update exists
really 0.0
I think java is easier than python too
from where you learned?
that's why I don't know python
youtube
Neither language is particularly easy
ohh can you also share with me :3
please help 😭
If you start out with the wrong tools any language can be quite hard
The python ecosystem is built in a way that if you pick the wrong tools you will not get hurt too much, but java has the biggest potential if you pick the right tools
yes @chilly fox
its done where i can find the jar?
in bedwars-plugin/target
hmm...
the jar without the original prefix
means where?
isn't building artifacts easier and faster than building the project?
in which drive?
oki got
The IDE artifacts?
If you mean that, then perhaps, but once you get non-trivial build logic it gets complicated
IDE artefacts are pain
Especially if you want to use shading you are better off not using it
thanks alot lynx
np
imho jave is easier than python is because proper IDEs exist and because of strong typing
Myes, but that requires picking the right stack from the get-go
I started java with sublime text and a bash script, which is a lot worse than my current eclipse + maven stack I have these days
wtf
why didn't you use an IDE in the beginning lol
even my school taught me to use eclipse like 12 years ago
but yeah then I switched to intelliJ because eclipse had problems with maven
We use Netbeans
I've also tried it today and it seems very ancient to me compared to intelliJ
Agreed though it's JFrame and JPanel designer is better
My school teaches me to use the so called "JavaEditor", that being said I am straight up refusing to install it at home
And apparently it is quite a known IDE on the german market
I have never heard of it
I started of in school with "HamsterSimulator" lmao
that basically is a "java learning IDE"
It is aimed at java beginners so that is probably why
And "HamsterSimulator" is quite a name
Ach du scheiße
What the hell is that
lol
Hey, quick question that I hope someone here could help me with
How do I co about copying a folder (and everything within it) to my plugins data folder?
I have this plugin structure ```
src.main.resources
config.yml
parts
file1.yml
file2.yml
file3.yml
I tried looking into apache commons IOUtils and FileUtils but had no success
That is a tough one
I think it's not that easy since it's in a .jar file. you could load your plugin .jar as ZipInputStream and loop over the entries
or you simply hardcode all the filenames, which obviously is the easiest
A hacky way would be to
URL x = getClass().getProtectionDomain().getCodeSource().getLocation();
try (JarInputStream jarIn = new JarInputStream(x.openStream())) {
JarEntry e = jarIn.getNextJarEntry();
while (e != null) {
if (e.getName().endsWith(".yml")) {
// Copy entry
}
e = jarIn.getNextJarEntry();
}
}
That being said that will not absolutely always work
yeah, basically what I was talking about, only did I accidently say ZipInputStream instead of JarInputStream >.<
The difference is nonexistent either way
@EventHandler
public void chatFormat(AsyncPlayerChatEvent e){
Player player = e.getPlayer();
e.setFormat(ChatColor.GOLD.toString() + ChatColor.BOLD + "Havana" + ChatColor.DARK_GRAY + " >> " + ChatColor.GRAY + "%s" + ChatColor.DARK_GRAY + ": " + ChatColor.GRAY + "%s");
}
Hello, so I have this. Everything works fine, but when I type in the chat, my name color is Red instead of Gray
How can I fix this?
That being said, there might be an easier solution, lemme check
that's because %s is replaced with your name + red for OP
I also tried p.getDisplayName()
still red
can I fix this even if the player has OP that the name will be gray?
Nope, apparently not
I also don't think so. loopingover the zip contents is the only way
or, as said, hardcode the files to save
you can manually insert the message and name in setFormat buuut
then you also have to escape the % chars
I was thinking that you might be able to obtain the children of an URL, but you likely need a JarFileSystem for that
otherwise it throws an exception when people type sth like "%s"
hm wdym
a URL*
well sth like
setFormat(player.getName() + " > " + event.getMessage());
how so?
Is U a consonant in this case?
but as I said, you'll have to escape the percentage sign
A(AN) is determined based on the sound, not just because it's a vowel or not
yea i dont mind
you can simply replace % with %% in the event.getMessage() and it'll work
The U in URL sounds like a Y in YOU so it's A and not AN
Yeah im new to Java so thats why
Well the U in URL is very much an U for me
Thanks man, it worked 🙂
Also, Y needn't always be a consonant
it's pronounced "you are ell" so it's "an url" but tbh who the fuck cares lol
Yeah
i'm glad that in german, we don't need to differentiate between "a" and "an". All we have to remember is
der, die, das, den, dem, ein, eine
lol
Yes, but then you have a huge table to remember and to know whether a noun is an object, subject, dativ (or however it is written in english) or gentiv (whatever that is in english) as well as whether it is masc, neutral or fem.
This is far too complicated for one to remember
Also, then there are also the possessive pronouns, demonstrative (?) pronouns and whatever
And there is also einer, eines, etc. (e.g. Die Tochter einer Frau)
oh yeah I forgot "des"
So, it probably would have been prudent to mention that I am using kotlin, but it was simple enough to translate it (totally didnt just let intellij do it for me)
But it works, with a small modification to have it only load things from the parts folder ```kotlin
val x: URL = javaClass.protectionDomain.codeSource.location
JarInputStream(x.openStream()).use { jarIn ->
var e: JarEntry? = jarIn.nextJarEntry
while (e != null) {
if (e.name.startsWith("parts/") && e.name.endsWith(".yml")) {
saveResource(e.name, false)
}
e = jarIn.nextJarEntry
}
}
tbh, spigot probably offers a better way to do it
nope, afaik "saveResource" is everything that it offers
I mean to obtain the plugin jar
Relying on the code source is dangerous as it may not be present depending on the classloader
As far as I remember we had a teacher that said that genetive does not exist, so cannot blame anyone there
Why for example attack speed in attribute of wooden sword is -2.4000000953674316 but in game shows. -2.4 in what time? ticks or what
GENERIC_ATTACK_SPEED ADD_NUMBER -2.4000000953674316
Der Dativ ist dem Genitiv sein Tod
btw I'll have to reread that book, it was actually quite funny
there is not just the ADD_NUMBER modifier
Do you have other modifiers?
But uh, that does not apply to itemstacks for some reason
how could i get block that player look at?
Player#getTargetBlock()
that's all?
yea
Yeah you can pass that in
You probably don't want to go over 5
is there a way to shut the plugin down?
getPluginManager#disablePlugin() ?
ty
declaration: package: org.bukkit.plugin, interface: PluginLoader
Does someone know a library for java to parse arguments?
shit this doesnt work wait why am i in #help-development 🤔
E.g. sth like
survey --title "What's the best Back To The Future movie?" --option "First one" --option "Second one" --option "Third one"
well it's a development question
@worldly ingot am I stupid or is the description of this channel very weird? It says this channel is for "Spigot / Bungee coding" but it also tells people to ask "other" questions here lol
i was thinking bout that too
it was written two years ago ¯_(ツ)_/¯
maybe "here" was supposed to be a link to the general or help-server channel?
because links don't work in channel descriptions
what isn't working though?
except for the obvious thing that you put it into discord which will obviously not render custom HTML lol
i thought posting a spotify embed here would work
anyone know how to join with some sort of debug instance?
im getting a stupid client error
but idfk what is going on because it doesnt log it
it should as it disconnects me
but it doesnt
you can just post the link and it will "embed" it automatically IIRC
hello i ask you line 6
i guess
hover over the error?
1 line -> 6
uhm what?
also your class name should start with an uppercase character
skywars -> Skywars
ugh
yeah
got ninja'd again
change test by skywars?
what
why
if you want to change your class name to Skywars, right click on the test in the explorer on the left and click "Refactor"
because that's the convention
Classes have UpperCamelCaseNames by default
andMethodsAndFieldsUseLowerCamelCase
you need to build your plugin and put it in a server to test ot
it
thx
thats because in java, public classes in files need to be the same name as the file itself
?
you cant have
public class Test {
}
``` in `NotTest.java`
it has to be called Test.java
the name of the file the class is stored in ^^
"Test", not "test"
yes RedrSkyWars
your class must extend JavaPlugin
that means that instead of doing
skywars_plugin
skywarsplugin
skywarsPlugin
// any of these
``` you use `SkywarsPlugin`
do you even know how java works?
?java
it's learnjava
?learnjava
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.
epic command fail
I don't get why everyone is mocking them for the file name
in every screenshot they sent, the class name matches up with the file name
oh okay. the only problem I saw is that they try to "override" methods from JavaPlugin (or Plugin) without actually extending JavaPlugin
