#dev-general
1 messages · Page 558 of 1
Elara Docs 😌😌
ah yes, i sure do love non-existent docs
spigot docs are the same headache as java
Java good
github readme doesnt count
lmao
why not
IntRange
Range operator
so basically its a collection of ints, starting from 1 to y+1
1..10 = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
damn thats too sensible
ooh so it adds up
not verbose enough 💢
well what is y
9
then no
I know another language with .. syntax
oh really? thats cool
your welcome :)
smh. I love potatoes
huh? potatoes are good
and yw
oh boy. I finally am done with DeluxeTags (for now) and PRed my DeluxeMenus work. Took me a while xD
I really am the best at procrastinating
Almost done fixing Kotlin 🥺
This lib uses regex so I've had to add a few weird exceptions 😩
https://highlightjs.org/ are you using this?
Using PrismJs
#871306913390948362 must be Minecraft?
no
No
Ok, thx
Have you used that one before?
no
From examples I found it doesn't highlight Kotlin well either
just curious cuz i think that's what discord uses
Hmm
Hmm let me test
listening {
on<GithubPush> {
log { "Detected Github push." }
checkRepository()
}
}
Yeah it doesn't highlight anything
yes but it does on mobile
Functions
every function?
Yeah
fun test(string: String): List<Int> {
var test: String = "Hei"
return mutableListOf()
}```
On the phone it doesn't highlight functions either Gaby
I guess it doesn't work because it is looking for fun
Well i'm talking about function calls
Ayy I got it
Yeah I know most places won't highlight it, but that's my goal, is to make it look as close to the IDE as possible
ok bud
is that supposed to be kotlin?
Yea I'm reading this document on github
it could be depending on the context
you need a type for msg
its no different than java, just a few changes in the syntax
I mean why are you even learning kotlin? We've mentioned multiple times java is probably better at first
if you know java the switch to kotlin should take maybe a day or two
and after you're confident with java feel free to move to kotlin
class YourPlugin : JavaPlugin() {
override fun onEnable() {
logger.log("hello world")
}
}```
tutorial done
Blitz double standards 🤨
and by know, we don't mean that you remember that a class needs to be this type etc. I mean you actually understanding it
no. I learnt kotlin first bcz I was forced by mitten. well not forced but recommended. but I learnt my lesson.
fun main() = object : JavaPlugin() {
override fun onEnable() {
}
}```
if you know kotlin you don't need spigot tutorials
odds that works?
no chance
BEIWbwgduenqopsdkdb
Java isn't better to start imo, but I feel like they are moving too fast, already getting into operator functions etc and only started like 1 hour ago
wew thanks I already have that
Just learn one of them and stick with it until you’re confident enough in that one imo
^
yeah. I guess if you actually want to learn kotlin, and actually learn it, you can start with that too
better to be good with 1 than mediocre with both
Brb need to grab discord nitro so I can use emotes
Yeah why are you even swapping from Java to Kotlin, you were just learning Java
that hurts mitten 
it's true
just be good in both
agreed.. this is the way
https://i.imgur.com/wSrr8lw.png apparently, according to Mojang, an ocelot somehow counts as a monster 
deep down it wishes it was a monster, but on the outside it's just a squishy katto
lol
I may or may not have gone overboard with my syntax highlight
😌
It also uses Fira code cuz best font 😌
😍
oops ping
Ayy fixed groovy for gradle as well 😌
why ...
Well when i post gradle stuff I tend to do both kts and groovy so, useful ish xD
Java also looking really nice
That was actually quite fun
nice boy
is there an alternative in java for kt's reified, other than a Class<T> argument?
you need a reified type?
I need to access its class to be more precise
yeah nty
typetokens 🥲
^for instance thats how TypeToken does it pretty sure
YET
will come back to TT later, brb
baked type coming soon
😌
😌
the reason why type tokens work is because generic type information is stored in the class file
I think
Generic type of the parent class is stored
anonymous derived type stores the type
or
well
if you do new TypeToken<Map<Blah,Lol,Elara>>() {}
actually, I read about this before
When we added generics to Java in JDK5, I changed the class java.lang.Class to become a generic type. For example, the type of String.cla...
😌
I don't exactly know how it works but doesn't reified in kt pass the instance of the Class<T> under the hood?
Idk tbh, maybe
I mean, im not totally against Class<T> was just wondering if there would be a better way.
I will see how I can include TypeTokens in there
do u have the ability to use mixins there?
well unsure if you could mixin on java standard classes
would be neat
Mixin?
yes
well, no
not entirely
because it requires the function to be inline
https://i.imgur.com/rfenbbJ.png anyone know why this happens when I run a test server?
There's always blank lines in between :/
Sometimes there isn't though (this is the same server session btw): https://i.imgur.com/qMS6gCg.png
and so it gets a bit annoying, for example here this tab message takes up a lot of space in my console: https://i.imgur.com/iJwd7Af.png
rip embeds
;-;
unorthodox terminal + old version = bugs
Grrovy and kotlin
how do I define a groovy extension method from the kotlin dsl
intellij terminal
oh
This is horrible
I hate gradle
is that possible?
I hope so 😳
Doesnt the kotlin plugin do that?
like for
implementation kotlin("46546465")
is that an extension method?
idk
💀
yea it is
inline extension Kaliber
also happens in command prompt.. and latest.log
🤔
and it doesn't happen in 1.17hyqbakjns,d
but still
Sounds like 1.8 to me
Not news
dkim do u use 1.8 fr?
dkm19375lib?
even yesterday it didn't do this 😭
wjat is it den
thanks
the issue still persists without plugins 🤔
hmmmmmm
also happens with a brand new server
D:
why
Does anyone know of a way to set my minecraft FPS to 0 or 1, or render distance to 0, or essentially anything to have the game keep playing but take up an extremely small amount of resources? I'm AFKing on a server overnight and would have to leave my PC on, but don't wanna run my pc too hard
iirc there are some mc console clients, where the mc window doesn't show up and it's just a console, maybe that might help
Could I somehow navigate those to a specific spot? I would need to find the AFK pool
yea you can just exit minecraft once you go to that spot and rejoin using the console client
here's the first one i found: https://ci.appveyor.com/api/buildjobs/6gdqim18x6qlo5c0/artifacts/MinecraftClient%2Fbin%2FRelease%2FMinecraftClient.exe
I always get re-spawned at the spawn on join D:
yeah i was gonna say, I'm sure there's a headless minecraft pc thing
they have ones for your phone where you can login and send text chat and stuff
headless? 💀
uh yeah headless
why's it called headless 🤔
https://en.wikipedia.org/wiki/Headless_software#:~:text=Headless software (e.g.%20%22headless%20Java,on%20servers%20and%20embedded%20devices.
Headless software (e.g. "headless Java" or "headless Linux",) is software capable of working on a device without a graphical user interface. Such software receives inputs and provides output through other interfaces like network or serial port and is common on servers and embedded devices.
The term "headless" is most often used when the ordinary...
ic
I aint got no head
Nvm, apparently console clients aren't allowed on the server
lol
oof lmao
i mean isn't that the same as a console client
Max it to 1
¯_(ツ)_/¯
I can only do 5
you might be able to change it in options.txt
That's true
[Char] 😌
holly shit. are those actually types of string in rust?
It's actually pretty hacky
quality code in vc rn
It kinda stores the class in a map and gets it back when needed
making threads in kotlin 🤢
also you can just do ```kt
thread {}
instead of Thread {}.start()
Not using coroutines smh
well the whole point is to crash his pc
oh what
kinda
sorta
not really
You can see all of those as a string, but they don't really all represent a string
for example they're throwing in a byte pointer as a string type
lol
and use &str twice
Wait what?
I thought it only worked with inlined functions where the class in actually known at compile time
I'm pretty sure that's the case too
Huh just tested it and seems to be the case
I remember it doing what I said before though 

Anti Kotlin Karen
Well. He's anti anything that he's currently not using
I don't mind exposed too much but this is pretty damn ugly
Smh
how do you fix this?
Use https://paste.helpch.at/ for errors, logs and configs. So we don't spam the discord.
something is null on PluginMain around L331
help me
[20:14] kashike: public final class BlockContentTypeLoader extends MultiTypeContentLoader<BlockGenre, ContentBlock, ContentBlock.Builder<ContentBlock, BlockStateDefinition, BlockStateDefinition.Builder<BlockStateDefinition>>, BlockContentProcessor<ContentBlock, ContentBlock.Builder<ContentBlock, BlockStateDefinition, BlockStateDefinition.Builder<BlockStateDefinition>>, BlockStateDefinition, BlockStateDefinition.Builder<BlockStateDefinition>>> implements Witness, MultiTypeContentLoader.Translated<BlockGenre> {
[20:14] kashike: public abstract class MultiTypeContentLoader<T extends Enum<T> & ContentType.MultiType<C, B>, C extends CatalogedContent, B extends ContentBuilder<C>, P extends ConfigProcessor<B>> extends ContentLoaderImpl<C, B, MultiTypeContentLoader.Entry<T, C, B>> implements MultiTypeExternalContentProcessor<T, C, B> {

is that an actual class 😳
😌
Did something change with Paper and bukkit or something? For some reason if I use com.destroystokyo.paper:paper-api:1.17-R0.1-SNAPSHOT my org.bukkit classes aren't showing up and not loaded, but if I use org.spigotmc:spigot-api:1.17-R0.1-SNAPSHOT they do show up
which is odd
I'm so glad I'm not alone on this path xD
lol
hiwuads why is intellij giving me a
Unused equals expression
when nullchecking 😒
trying to do if (duration == null) 5 else 6
but it won't let me without a warning 😭
anyone know what intellij wants me to do (kotlin)?
what's duration?
and context
uhh oops i didn't check this channel ;-;
but i just ended up making another variable, so now it's this: ```kt
val duration = args[5].toLongOrNull()
val restArgs = args.drop(if (duration == null) 5 else 6).joinToString(" ")

huh, i pasted that code somewhere else and it warns

ok i found a solution: duration?.let { 5 } ?: 6 xD
dkim you used the thonk emote 1000 times
congratulations
i just counted with discord
lol
isn't that the opposite of what you had?
uhhhhhhhhhhhhhhhhhhhhh
OOPS
🤣
go to the search bar
oh
then type dkim then click user
and then after that
type : thonk (without space)
it says 1044
oh wow 👀
yep
lol u only used it 10
https://paste.helpch.at/odobehamiw.bash
uhhhhhhhhh
the file location exists.... aaaaaaaaaaaaaaa
this new InteliJ logo is cool, but it keeps throwing me off, anyone else notice that?
i love it
i don't know what "keeps throwing me off" means
or what I'm supposed to notice
https://i.imgur.com/H7ZHJXW.png lol i looked at my timings and was so surprised that it wasn't lagging (this is a plugin I started working on about a week ago)-
all my other plugins always have red or yellow numbers 🥲
how do other plugins have nothing though 🤔
how do people optimize so much 😩
Timings only shows the main thread... so anything off of it isn't seen by timings.... Basically... If its async it can't cause lag. (Thats a joke)
well i mean it is true
until you reach the limit of the cpu
but i doubt you'd be doing anything that performance-heavy 🥲
the thing is that most of the things im trying to do has to be ran on the main thread
Such as?
probably stuff related to modifying the world
It distracts me ig
Is anyone good with Skript? I have a skript I'm trying to run that blocks /bal on certain players. (I.e. players can't check Staff Members /bal) and it literally turns my server off every time I use it in game
I think the problem is trying to use Skript in the first place
I'm a volunteer, and you're asking in the wrong channel 🙂
Plus Skript is literally a piece of shit, so I can't really help you with it
But I wanted to!
@here'
Oh
Answer sheet
Was uploading it
Needed to get it onto pc fast
Had like 2 mins left to submit
😂
dang racing the clock
i remember scanning my calc homework as fast as humanly possible 3 minutes before it was due and uploading the pdf
Yea thats gonna like cost me 10% in the overall grading I think
Actually, might be 5, not completely sure
Python bad
How else would hackers use a single python function to steal it? Duh
Insert meme about python users raging when they don't have the one function that solves the Pythagorean theorem in 6 dimensions morphing over time based on 8 random numbers generated from atmospheric noise

credit_card = overly_verbose_and_specific_function_that_steals_credit_cards()
Can I use Java and kotlin in one plugin ?
Yes
aah nice
cuz my color thingy I don't know how to rewrite it in kotlin since I got help from here
why dont you just stick to one language until you learn it well enough?
^
bcz why would anyone do what we already said 5 times? 
Stick with haskell
^
:simon_peek:
new haskell mascot??

haskell_anime_girl.png
btw bm, I figured out the groovy issue
Ah nice
seems you just need a doCall function
groovy looks up the doCall def that matches the call
It calls a function in order to call a function?
yup
😌
No problem, anytime
Skript hater 😠
welp. its you against the world. so good luck
Nothing against skript, all against the people who use it in the wrong way
@hot hull Since it has been a while since last time I showed you some progress
oo nice
new ben awad video.
We had this conversation in spigot discord already lol
y e s
My hero 😍
#871306912342343701 message
wait a minute
3-4 hours a day
$75/month
75 * 12 = 900/year / 365 = 2.47/day / 3 -> 4 = $0.62 - $0.82 / hour 🥲
a worthy salary
Lmao
well.. last time it was like 45$/month
🙂
you should be grateful.
@shrewd jolt Please delete that, I beg
McDonalds work it is, pays better
oh 🤣 🥲
but this one has a time requirement
per day
@old wyvern
Im trying, gradle api sucks tho
😦
Do you know if theres any way to get extra function that works fine on both groovy and kotlin?
I got it to work on groovy and kotlin separately
Let me phone my Gradle experts.
Alrighty
No confident answers.
Well, people are msging me to apply so I’ll raise it if I get no decent applicants lol
I really hope you understand those are most likely not developers.
just "wannabe" developers.
if they have no clue what development payment should be.
Yeah that’s true, well, we’re in no huge rush
I’ve found reliable people who don’t charge much in the past, partly due to them wanting to work with “famous YouTubers”
That’s less then a 50 cents a day
Also $75 was the minimum, I’m willing to go double or triple that lol
Why does he want a Matt?
yeah. I guess budget is usually the highest you go and you negotiate down from there. or at least that's how most #871306912342343701 work.
but yeah I didn't see the minimum
1k a month and I got you
damn. I finally finished Triumph Chat!
Smh
Lmao
from today I will not be working on any triumph library, framework or plugin anymore. bye
ok
Since Bardy abandoned Octo, are there any decent JDA frameworks out there or is it back to plain JDA now?
what's wrong with JDA?
Nothing, I just liked how simple Octo was
if u want commands, u can use jda chewtilities or whatever it is called
right, thanks
Cloud JDA 👀
Matt has one as well
does he?
only for commands i think
Old af though
double = ~$1.2/hour
triple = ~$1.8/hour
🥲
Hey that's more than the minimum wage in my country lmao
o
sign up then!
yeah. I Was going to say. That might actually attract good-ish develoeprs. bcz in a lot of countires thats a lot more than what they would normally make but still. they're starting to understand that they can get paid US salaries
Doing like plugin work in a poor country must be so good
since they do the same work
🥲
u would think.
depends if its relative
well yeah. problem is you can't really get someone to pay 20$ xD
Well it wouldn't be cuz it's international
relative in terms of prices in shops and stuff
yes
$15 is worth $15 everywhere
But $15 will get you a house in some places and a loaf of bread in others
SO
🥲
If you live in somewhere where you could buy a house
yea 15 is definitely not the same everywhere
It's great
i actually looked at house prices in some poor countries before
Because you get paid significantly above the average wage for your country
Even though the work isn't much harder
Planning on moving, huh?
maybe 🌞
Lmao
My mum owns a house in bulgaria
fancy
Not really
It cost about 8k
Pretty much just a stone box with beds doors and a big garden
Literally Bulgaria
u sure about that?
Where do you live?
because I Don't believe you could Kaliber
but yeah. I understand. the thing is... developers from poor countries just undercharge.
and that's why you see all those people saying "someone else would've done it for 1/4 the price you did it for"
yeah. home prices sky rocketed here as well.
well they've been increasing a lot in the past few years
we're still top 1 at home owning tho
in the world
Argentina
I Mean. if you think about it, the whole culture in "modern" countries is to pay rent. and yeah I Know a lot of people would love to own a house over paying rent but it is what it is.
Everyone would prefer to own than rent
I actually know people who don't
they're young and only care about partying and stuff.
so yeah. I guess you could say "any smart person wants"
the thing is, the culture here is, work your fucking ass off, and don't take loans from banks.
or at least in my area. people hate banks. tho they're being forced to use them bcz now most companies only give you the salary thru banks. but even my parents, they receive the money and next day its out of the bank
whats wrong with banks
i can understand a loan, but storing the money in cash instead?
I could go on and on about stuff wrong with banks. but main reason is people don't trust it. there's a lot of stories of banks taking people's homes. and sometime for stupid reasons
and the sue for everything culture doesn't exist here xD
Y'all pussies, that's what's wrong
yeah
maybe. bust still. fuck banks
anyone has a snapshot of this page? https://mcflags.emc.gs
its the startup flags
or what flags are recommended these days?
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=5005,suspend=n -Xms2G -Xmx2G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar Server.jar nogui i think this is it
it also has a few different jvm flags for like intellij and hot reloading i think
thank you. is this what the cool kids use these days tho?
perhaps
alright. thank you
does it not work for you?
didn’t for me a second ago
nope
its just a blank page and the title loading forever
actually
weird
doesn't even load a page
at all
oh wait wtf
somehow got on this page now https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
in a private tab
so might need to clear cache
or wait a second
lmao
same 🤔
Anyone knows if fjp eagerly or lazily create new threads, I assume it’s eagerly since it’s a fixed size but unsure.
yeah. it took me a little over 40 seconds to load
the other times I Was just not waiting
wait wait wait
this is probably really obvious
but is banning just a playerjoinevent cancel
might be better to change the result of PlayerLoginEvent
Player join event isn't cancellable
join is after they've logged in and spawned in the world
ah
besides you can just add a ban entry instead of preventing login manually lmao
Yeah i wasnt sure if like
You can provide a deny response in prelogin event
Just from a base level, banning was just canceling a login event
essentially
just popped into my head so I'd thought I should ask
@half harness what u doing?
watching a 2 fps discord mc stream from _riced_
1 sec for answer? or 1 sec and then we play?
1 sec for answer
1
since i can't just leave the ss ;-;
why?
there's a button for literally that
leave stream
or whatever its called
is your discord bugged out?
yea but i dont want to just randomly leave ._.
ah
Oh my god, I just lost all the progress I did yesterday on the highlight, i forgot the files were on the node_module part which isn't put on github and i ran yarn install so it was replaced by the original, someone shoot me 🥲

IntelliJ Local History 😌
which isn't put on github
it doesn't rely on github
It's gitignored, ij doesn't track it
-_-
discord
this is not an embed
oh
it works now
nice
but it still records changes
as long as its a file that contains text
soooo if you're using a jetbrains ide you can just use local history
:))
Dkim, go to project explore and unclick show ignored files (i think that's the name) and try again
project explorer?
oh
wheres project explorer?
i just right clicked the project window and clicked "Show ignored files" and now it says "1 hidden"
and that "1 hidden" folder is the .idea folder
o wait
what now i can't use show history?? 
why does intellij do this
wait im so confused
lol
what
oh they updated this?
that is so fucking disgusting
why?
I actually like it
these are mine
I feel like they're more clean
I Love them
hmm
yeah. I guess. the other roles is broken again xD
yeah
was just telling that to cube
but yeah emilly I guess you're kinda right. I do like the old ones more
but these ones are not that bad. and I can see what they're trying to o
do*
I can't see how they looked before
can you do a screenshot for matt's profile
in full?
welp. going to watch a Star Trek movie
bye
those kinda look like clickable buttons lmao
they indeed do
guess what imma do
Guides that have pictures of code instead of code blocks are the worse
😩
copy pasta prevention

what did I just find
truee
java is part of .NET framework 🙂
@ocean quartz GG noob
So Yugi what Gradle problems are you having? Can they not be split from Groovy and Kotlin?
I managed to fix it actually
Seemed to have been an issue with shadow doing some implicit relocation
So it wasnt able to cast to a function type where needed because of the package difference
Who has font ligatures in their docs 😌
Anyone here good at using hoverevent, showtext and click events?
You'd have better luck if you asked what you need help with specifically
Well I am using a help plugin to create a custom help layout
I made 5 headings, I want to make it so when you hover over each bit of text it gives a description. then when you click the text it open another page of text
But i have no idea what way to do the layout to make it do all that as im new to this
Any idea?
like the == sign?
and != becomes the = with the slash
boy i wish github would do that
for display
Well
- Wrong channel #development is probably more suited
- im sorry i don't really use Spigot's chatcomponent api
a lot of us use Adventure
Ah right fair enough np
Yes sir 😌
😌
On your docs? ;o
I think I'll make it easy for others to use, but not exactly made for it
At least not until i can make this better
Ahh
Cuz still no idea what I am doing on the front end side 🥲
🥲
This is how it looks so far though
damn I am liking that
light mode?
I was talking about IDE
i didnt know you can use them on docs
You can on mine 😌
die
WHERE is >>=
I wonder how hard it'd be to make this public
I guess an editing mode shouldn't be too hard
Somewhere
hmmm
I expect a screenshot within the next 10 minutes or there will be trouble
Add <$> while you're at it too
Pc is already off, so maybe tomorrow if I don't forget
🤬 🤬 🤬
has anyone put VERSION_1_6 instead of VERSION_16 in gradle accidently for java version
lol
Java 16 is 10 times better than Java 1.6
Yeah lol
No of course not, it's the bitwise right shift assign operator
Oh and also it's in Haskell, I forgot about that
what languages does that exist in lol
Java, C, etc
that exists in Java and C???
Yeah
int x = 4;
x >>= 2;
x = x >> 2
^
damb, news to me
But yes it's also the monadic bind operator 😌 
i knew it
but obviously I wasn't talking about that
hey uh
Anyone know how to make a LEGIT website?
in CSS or HTML?!
You mean ScriptJava?
Should I use ImmutableMap in java 16 in place of Map if I exceed 10 entries?
(10 entries is the max for Map.of)
not really a builder
Well in the case of Map.of/ofEntries/entry it is :P
I am pointing this out because you linked the factory method pattern
which is not what the methods in question apply
I'll admit I did not know the factory method pattern before my recent exam though
I had never seen it
and tbh I still don't really understand how it's supposed to be special or useful
to me it just seems like a specialised strategy pattern
I wonder for how long I will remember all those patterns lmao
I literally burned them all into my brain in 2 weeks
@forest whale have you heard of emacs org-mode?
nope whyyyy
it's very good at taking notes! 🙂
Lmao
@rough socket I sure do hope your request is a joke
I doubt it
im crazy
working on a plugin library & offline players editor that reads offline player data from player data file and edit it
still have 10+ versions to support
im so tired of nms reflections
nobody asked but yeah
I thought nms is fun 🤔
but it becomes repetitive action now
since i am just finding the similar methods in every single version of spigot ever
and have to reflect one by one
nms is fun because you can explore methods
but now i have become nms machine lol
public interface Offliner {
public String getUUID();
public String getName();
public Object getBase();
public void loadData(DataManager manager) throws PlayerDataNotFoundException, PlayerOnlineModificationException;
public void saveData(DataManager manager) throws FileNotFoundException;
public void setHealth(float f);
public float getHealth();
public void addEffect(int effectId, int duration, int amplification, boolean ambient, boolean particles);
public void removeEffect(int effectId);
public void removeAllEffects();
public List<Object> getEffects();
public boolean hasEffect(int id);
public void setItemInHandIndex(int index);
public void setItems(ItemStack[] items) throws InventoryArgumentsException;
public void setArmour(ItemStack[] items) throws InventoryArgumentsException;
public ItemStack[] getItems();
public ItemStack[] getArmours();
public int getItemInHand();
void setItemAtIndex(int index, ItemStack item);
}
anymore methods to add?
i feel like i have exhausted all the possibilities here
as for 1.8
I don't know the gamemode or context you're operating in, but hunger, coords (+yaw and pitch), and world?
oh yes that helps a lot omg
thx a lot mate 🙏
if you have any suggestions pls ping me again
Obfuscated code = shitty code and/or insecure dev
Change my mind
minecraft client devs = obfuscated code = insecure dev and/or shitty code
100% correct
I never obfuscate anything but if you ask the Spigot staff I have the worst code there is because they roasted me every premium plugin I submitted 😂
i dont even have the permission to submit premium plugin lmao
as my spigot profile is so not maintained
Every time in the past that I've submitted they gave me a lecture on how I use static inappropriately. I've gotten the same lecture by people in the discussion sections of my plugins. Literally every resource I've ever looked up has never given me any reason not to use static as a means to access a constant public variable though so until someone explains instead of roasts I guess I'll never know lol.
yeah people just wont stop bragging about "oop style" or some crap lol every time they see any static keyword that appears
and they just kinda force you to use "dependency injection" when you dont have to lol
when using static variables is 100x faster and more efficient
"dependency injection"
i love the quotes lmao
the goal of OOP is to protect you from yourself essentially
encapsulation is the big keyword
static getters and other static abuse essentially destroys that rule, so that's why they're so discouraged
when you do dependency injection, you have to make things in a certain order and you know exactly which instance you're getting
static getters can work for a singleton, but rarely do people make actual singletons
but i mean the classes with like all public static functions
you dont need encapsulation for util classes
but people just wont stop talking about oop even with library classes
It's almost like java is an OOP language
pepe hands
but I mean yeah, pure functions can totally be static
but I don't think people would lecture you about dependency injection for pure static functions
Static methods doesn't mean you can't pass the plugin instance as a parameter
The whole "di when you don't have to" doesn't apply here
Spigot has turned down numerous premium plugin requests because of exactly this for me at least 😂
Edit: I should add they absolutely ROASTED me in the process of the denial as well basically said learn how to code kid
Dang, can I see these premium plugins' source code?
java is a poop language ha gotem
I severely doubt they'd turn you down for static pure functions
Lots of static methods != util methods
If they turned you down it's because you were using it wrong
Yeah I'm sure there was something spoopy going on
They may be dumb, but I don't think they're that dumb
More than half the people posting spigot plugins don't even know what the static keyword does
it lets you do anything wdym
It just makes every instantiated object of that variable refer to the same memory value is my understanding
It means different things in different contexts
i mean all purely public static methods
ofc you can still have a class that has some instance methods and static methods
but i am talking about all static methods which is util methods
and ofc you can use dependency injection on util classes lol
but thats just a waste of resource
For variables, yeah it does something like that, basically making it a constant
"static indicates that the particular member belongs to the type itself, rather than to an instance of the type"
For methods, it means you don't need an instance of the surrounding class to call it
It's basically like every instance of the type referring back to the prototype
So why would it be bad practice to have a util class full of em
He's talking about static methods
Not static variables
Methods that are pure and don't have any side effects can be static, usually utility methods is what they're called
For things like parsing color codes, or printing a message or something
"When a variable is declared as static, then a single copy of variable is created and shared among all objects at class level. Static variables are, essentially, global variables."
"That's a waste of resource"
My understanding is perfectly in line with all documentation I'm finding, but I still don't understand why it would ever be bad practice to have util classes with static methods and vars
It wouldn't
My guess is that some other stupid shit is going on and that's why they are getting denied
a pointer to a class is also a kind of resource
basically when you dependency inject you are initailizing a pointer i guess
You're not initializing things again, that's literally the point of dependency injection, to share already existing instances
Oh I wouldn't doubt there is SOME stupid shit somewhere going on as I don't follow the semantic standards/conventions perfectlyyyyyyyy. But the point is that's not the reason they gave me. They specifically told me they denied me because I don't understand the proper use of static.
Is your code open source?
I'd like to take a look possibly and maybe see if they are justified lol
sharing existing instances means initializing pointer that points to the original instance
which takes 4 bytes of stack space as i remember
Wow, so much!
Oh no, not 4 bytes
wow 4 full bytes
lol
The point of dependency injection is to protect you from yourself and is a good OOP practice
i mean 4 bytes is still 4 bytes hahaa
Hardly
^
It's not worth saving some bytes over making your program a lot less maintainable and error-prone
That'll totally mess my 32kb of ram computer that i bought in 1985
I think you are the only person occupied of how much memory one DI takes
What lol
This ladies and gentlemen is what too much NMS does to you ^
Let me tell you there is virtually no argument to be made against dependency injection with space concerns as the primary issue
Well the thing is if you look at my typical free release source it'll look hella jank because basically every plugin I release is a tech demo of some new functionality I thought of and haven't seen others do yet. So my typical plugins have code from other projects that isn't utilized, comes packaged with the spigot jar inside of the plugin .jar for easier build dependencies on my end 😂 Some real bad bad practice. But my premium plugins I made sure were very cleaned up lol
Wait wait wait, what
If you want to write error prone code that breaks oop principles go for it
No look past it
You shade the spigot jar?
Shhhhhh
WhY nOt



