#help-development
1 messages · Page 904 of 1
Aye but what would it be checking against? or is there just a massive switch statement lol
Each enchantment has their own class
Well, any that need to override anything presumably
Yeah all those basically work the same
You really should use Mojang mappings
aye but prot will conflict with fire prot and the others
Yes
so I'm looking for that logic
Im pretty sure it just checks if otherEnchantment instanceof ProtectionEnchantment
I would just grab the key of the enchantment and then test against that
I could do it manually but the idea was I was hoping to find some logic method that I could override to have minecraft to the conflict checking for me
idk what method that is
Also, yes it seems you're correct. An enchantment determins conflict by if they have the same class...
Given that, I think I found it
Thank you very much!
No idea how to use them lel
?nms
I just rummage through obfuscated code, this is life for me :p
if I remember correctly, you can't use mappings in your actual plugin? They're only used to find the correct methods ye?
u like unmap them when it compiles
How do you incorperate an unmapped then? I use a custom build script
You can use them during development
I just posted it silly
.
Ye thanks for that 👍
oh
what if ye don't use maven or gradle?
Then you should reconsider
I don't do enough NMS stuff to consider converting to maven, my build pipeline is already quite streamlined. I just press 1 physical button atm
Don't think I've heard of that no
how are yo compiling
so just running javac
Why would you reinvent a worse version of maven/gradle
maven does all of that for you
with version control
and automatic repository downloading
you don't have to manually download all your imports
It caches everything
so it does download everything...
I've been too lazy to learn gradle or maven, it also looks hella complicated
it's not
maven takes 10 mins to learn
I guarantee you 99% of java developers and 100% of any company using java uses either maven or gradle
and for good reason
It is a pain updating the Maven plugins.
how?
you just change version in pom
Yes, it's a pain to go look up the versions and change them. Why can't it just use the released version itself?
Last time I tried latest, it didn't work, but that was probably with jitpack
but that is generally not really good practice
I just see maven as another tool that can break easily if not configured properly
call me a dinosaur
I see so many new devs refusing to use maven, but once they do they never go back
I've met many people like you, with the same thoughts.
Trust me, maven is just better in all aspects
adding custom libs that are not in the central repo?
We're more than happy to teach you how to use it
conflicting libs?
they use gradle
💀
Source?
idk for the minecraft src
but thats what they use on their github
in the time you've spent here complaining about this crap you could've set up nms with maven like 10 times over lmao
Fair
yeah assuming you already have all the know-how
the guide is pretty straight-forward
I'm 99% sure Mojang uses Git.
yeah well it should be known they use git
this is news to no one
Inb4 it’s gitlab
gitlab is nice
sourceforge.net :^)
Adding a lib to eclipse or itelliji directly is far easier than using an over complicated build tool
Linus Torvalds wrote git in a weekend.
you're right, 99% of other devs are wrong
give this guy a medal
use maven
yes i know context
just use maven
instead of trying to argue why you shouldn't try
I love arguing too
This was one of Linus' goals:
Take the Concurrent Versions System (CVS) as an example of what not to do; if in doubt, make the exact opposite decision.
damn
what's that captain disillusion talk about arguing with strangers on the internet again
Just let them enjoy their javac bash script and wait until they actually wanna do sth a bit more complicated like shading sth lol
How you gonna argue that a() b() c() are better than actual method names
they are
Its shorter! Less to type
how about no 🤡
when using non mapped nms i roll a set of dice and hope its the right function
have you ever wanted a random dependancy to magically update one day causing your build to break and you don't know why? Try Maven today!
maven doesnt do that
lol
a() b() c() easy as 123 simple as do ray me
dependencies don't update if you don't update dependencies
you update dependencies when you want to update dependencies
Yeah man gradle keeps updating my project to the latest spigot and breaking everything
Smh
I guess technically that’s true since spigot always uses v0.1-snapshot
also not to mention if you ever collaborate with anyone, if they hear you're using artifacts intead of maven or gradle, they will most likely leave lmao
why is my alter-ego typing
L'emily
You are still using a build tool. Its called ant when you add dependencies or libs this way
inverse Emily
French Emily
Dependabot is for breaking your code by updating dependencies.
🥖
xd
this is why i don't use dependabot lmao
I saw PlotSquared(?) had to revert a dependabot change.
a build tool that I built myself that generates itself with code. All I need it to do is slap the classes in a jar and copy it somewhere
I don't need maven to contact skynet to pull libs and complain about a syntax error in pom.xml
french (derogatory)
and how exactly will others build it
also learn to write xml
its not hard
They’ll run the bash script obviously
you are describing artifacts
my guess is that they don't plan on collaborating with anyone ever basically
When you add a lib directly using the ide it is using ant to do it. To do it any other way you would need a custom plugin in the IDE so it recognizes the dependency is there. You can have a custom build tool i guess and reinvent the wheel. But virtually all java ides support ant, maven and gradle.
they are preemptively preventing themselves from every having a contributor
Tbf you’ll probably live longer that way
less chances of getting stabbed ....
would you rather cure cancer and live to be 20 or live to be 100 and do nothing
cure cancer
use maven
I already have to contribute with other people at work
But I’m already past 20
your coworkers must hate you
the amount of time we spend on fixing git merges and build tools
then your team needs to learn git
a lot of time wasted lol
and learn BT
are your teammates 14?
this is a deficiency on your part
they already do
Sounds like you dont know to use the tools or who ever you work with.
Back in my day we had to trudge through 7 miles of swamp to merge changes
Uphill both ways
Nah the real problem is people
get rid of people
Well not a bad description of cvs
Imagine making this comparison 💀
you must be such a welcoming and warm person to work alongside
At first I thought you meant cvs pharmacy
You know me all too well ❤️
yes because its hyberbole
that's the entire point
yeah had to clarify no no
Might as well be the same thing. They are a pain too
We don’t have cvs here so I wouldn’t know
All I know is they are known for long recipes
Well, have a good one o/
this was fun kek
no u
❤️
how romantic
vlogcreations is great
anyone know why this is erroring?
the methods dont exist
What version
1.20.2
Compare different mappings with this website: https://mappings.cephx.dev
Although if you are on 1.20.2 just use pdc
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```thats my import
whats pdc
?pdc
It’s an api for attaching arbitrary data to items
(And entities, chunks, worlds, block entities, etc)
my brain hurts so bad rn
im struggling with adding the worldedit api in my pom
ah good ol' wedit
added the repo?
https://www.spigotmc.org/wiki/setting-up-the-worldedit-api/
i followed this
well nevermind
it fixed itself
🦆
🦆 💨
is this is a bug?
i use Integer to prevent autoboxing
since i use Integer for multiple generic functions anyways
so what's the deal?
no intellij just doesn't want you to be an idiot
its really begging you to use int
yeah but intellij doesn't have that context (though tbh doing this to prevent autoboxing probably saves at most a few nanoseconds)
Muh cpu cycles
autoboxing is a non issue
and that is an over optimisation that will effectively do nothing
ofc its non issue
its just that i'm using Integer for a reason and it shouldnt throw this error
youll have to just disable it in ide settings
but i guess it doesnt analyze called function, where multiple functions with Integer args are being called
not much else you can do
its not an error
just a warning
this code will compile and run
I wouldn't be surprised if your compiler just optmizes Integer into an int though
Ooh is it bytecode time
but wait
maybe it's right
it would autobox the integer
for the called argument
since i specify Integer inside called function args
so it doesnt really matter
it just that it would increment the primitive and then autobox it
but due to how Integer is immutable it really doesnt make any difference
?paste
thanks
Sounds like you’re over complicating it
the easy solution here is to cope with the fact you just lost like 5 cpu cycles to autoboxing
if you can't cope with that code in assembly and leave java behind
no that's not why im optimizing it
i need to complicate things rn
since im participating in a java course enrollment
???
and i need to fancify my code
minecadamy
looks like you want to get rejcected lol
for complicated, unreadable, stupid code
that's literally what they asked lol
they asked for me to implement fizzbuzz algorithm that could be maintainable without "if statement hell" in the future
okay
if you put this code into a merge request and asked me to review it
I would reject it immediately
and look at all of your other merge requests and likely reject those by adjacency
Consider that in the near future more conditions will be added, so code should be extendable without much effort.
okay
ofc i would've done if statements
I have no idea how to do that here
You are not understanding
You are overcomplicating it
You could also make a record
to the point where it is impossible to maintain
you are making enterprise java
stop it
KISS
keep it simple, stupid
@mortal hare are you trying to make enterprise fizzbuzz
Record that holds an integer and then the string that should be added if the number is divisible by said integer
we are one in the same <3 My favorite coding principle is KISS
and that's not that bad?
no it's a pejorative
that's horrible enterprise code is fucking shit
why was i told about KISS 2 days ago and ive now seen it like 3 times here after
I swear I’ve said it to you before
its the KISS infection
this is my universe you're juist living in it
again, i cant do smth like this
uhh
why not?
literally
what/
then the course is a waste of time
Actually you don’t even need a record
its not worth your time
You could just do Map int -> string
genuinely if they make you do enterprise java for a simple problem its not worth your time
i've participated before
actually
you are overdecomposing the problem
and i got 8 page test
you are actively corpsing it
ik its stupid
i would never write this, but they want me to write smth like this just to prove that i know something about java
this shows me you know nothing about java
then show them you know best by KISS
and you just know how to stuff as much shit as you can into a program
I think the people who run the event are idiotic as hell
if I cannot read your code or understand how to use it, it's bad.
im here at least 3 years, i do have some of my minecraft plugins, ik what im doing its just that what's that they're asking, modular code for a simple code
why are you even trying to do pure functional
in an OOP language none the less
because if statements would be cancer according to them
what oh
i already stated
this is not gonna work for them
programming is impossible without conidtional statements wtf 
although this is the best
I feel like youre misinterpreting
lol
anyways i want to do a sort of "mana" system with mana regeneration every tick and here's my idea
onPlayerJoin i insert the values inside a persistent data container, if the persistent data container does not have those values
for every tick i update the "mana" value for every player but i dont know how to do it in an efficient way cause my first idea was just use the scheduler on plugin enable, which i dont like cause it feels like an inefficient idea
any suggestions?
'modular code'
they're asking to do something better than if statements that could be expandable in the future
you want modular code? put your entire AST in a JSON document /s
so i used functions to make it expandable 😄
Just make a wrapper around the player object to store this mana
no you made it worse
ik
you actively made it harder
that's what they asked it
no
again, I strongly feel you are taking what they are asking for and using it to spite your face because of your nose
same thing goes for the regen?
Sure, and then it should make it pretty easy to save in permanent storage when they leave
alright, thank you
i've participated in this test before and they really want enterprise java, they want to test people for various knowledge of java, so that's why they wouldnt like the solution that they've provided trust me
then whoever is running this test is an idiot.
and is not a good reflection of skills
it's a reflection that you can cram concepts together where they don't belong
they know that its wrong to not use if cases for such a simple problem, its not as if you're putting 100 cases in fizz buzz problem 😄
okay
4 if statements vs 6 functional inteface implementations ofc is worse
so why did you do it like this
also you violate the do one thing and do it well principle
because they've asked for something that could be expandable, so i've made almost everything in fizzbuzz modular, so that way you can do whatever you fuck you want
with functions
Application#fizzbuzz does not do fizzbuzz
yeah you did it wrong
this is not modular
this is enterprise
what the fuck is this
private static <T> void execute(Integer number, Consumer<T> executor, List<Function<Integer, T>> functions, Function<Integer, T> fallback) {
for (Function<Integer, T> function : functions) {
T object = function.apply(number);
if (object != null) {
executor.accept(object);
return;
}
}
executor.accept(fallback.apply(number));
}
I don't know what this does by looking at it
why are you guys arguing about fizzbuzz
it executes function if returned value is not null
because someone must be taught the correct way today
otherwise fallback consumer will kick in
which is set to integer.ToString() in the args
so it prints integer if the divisor in fizzbuzz was not found
with functions i can combine multiple fizz, buzz, bazz, jazz words in to multiple cases
so that way i can print FizzJazz, FizzBuzz
without rewriting the logic for each case
if Fizz function returns null it means FizzJazz wouldnt get printed
neither Fizz also
that's why u see CombinedStringFunction class
so i can combine multiple function output into one
... use... +?
"combine output"
why do you need to make it so generic and functional
modular
how is this modular
you can plug whatever words, output storing functions in the call
why can't you make it simple
fizzBuzz(105, (string) -> builder.append(string).append(' '), functions, Objects::toString);
again
they dont like simple
😂
its dumb
ik
then stop entertaining it?
any possible accreditation from this place is worthless.
I might even actively exclude people based off of it
because of how awful they teach, it seems.
or you're misrepresenting the requirements
and trying to justify making it the worst it can be
I don't see it mentioning premature optimization?
that's not even premature optimization
how functions are premature optimization
they're worse to performance
optimisation is not all about performance
you could optimise for development, future proofing
this is pristine
the best code you will ever see in your life
it can do all the fizzes and buzzes
and more
its not for my project, im sorry that this angered you guys so much 😂 its for my upcoming test its a bonus task
how about you provide a list of divisors and they're associated with some string
if do this the way they want i get extra points
that's it
its not about performance
its about knowledge of various java syntax features
..
'it's not about performance'
you clearly care about it here
no, but you are a CS student I assume
yes
and eventually you will be writing production code
That's not what i would write normally
just stop
misinterpreting
its getting ridiculous now
Whoever runs this course needs to find a real job lol
I feel like the requirements were just "Write an extensible fizzbuzz solver program"
I wonder what would happened if I submitted fizzbuzz enterprise
immediate graduation
ok if lets say i would not send this code
how would you write it
with a map?
two arrays to associate divisor indexes with strings
One moment...
all of those are just as dumb
as mine
its not as if if statements would not beat the other data structures
I wanna try writing hello world enterprise
Actually 
object FizzbuzzProgram {
fun fizzBuzz(fizzes: Map<Int, String>, number: Int): String {
val sb = StringBuilder()
for ((fizz, name) in fizzes.entries) {
if (number % fizz == 0) sb.append(name)
}
if (sb.length() == 0) sb.append(number) // If not divisible by any, put the number plainly.
return sb.toString()
}
}
// test
FuzzbuzzProgram.fizzbuzz(hashMapOf(3 to "Fizz", 5 to "Buzz", 7 to "Bazz"), 105)
something like this
you pass in a map of applicable divisors and their fizz names
oh yeah a hashmap is trully better than if statements
actually any Map but
its just as dumb as mine
I doubt that.
the whole concept of extensible "fizzbuzz" is dumb
What is your guys favorite
jne, jeq, jlt, jle , jgt, jge
jz
Personally I love jeq
Actually this is the 8 bit arduino architecture 
Oh I thought you were just joking
that just assumes that it will onyl check divisibility
of course not I had to study assembly the past 2 days
my mind is mush
and assembly
to be fair I did say 'something like that'
Depends how many if statements it is going to take in comparison to a single hashmap. Hashmap isnt significantly slower or have a great deal of impact.
But if you can replace 100 if statements with a hashmap then hashmap is going to be the way to go
You could change the Integer to a predicate<Integer> if you want more than just divisibility
Ig
you could but that's outside the scope of fizzbuzz
FizzBuzz scope creep
such a thoughtful and productive discussion here about enterprise fizzbuzz
Now we are doing enterprise development
IntPredicate gang
scrum agile sprint
sorry this isn't exposed in Bukkit API its outside the scope of the project
Right int gets a special one
just how mama used to say
Neither have I
you-
Yo guys
why use springboot when I could just use idk something that's not springboot
@rough ibex would pull its hair off if he used it 😄
QuickSort is sm easier than I expected
wazuppppp
and I learned how to do things without recursion by just using a Stack
quicksort suckz tho
why
But it’s called quick sort
isn't quicksort worst case n^2
How could it be slow
how could it lie to us
its name as bad as imaginary numbers one
yeah so its trash 
BogoSort
I use StalinSort exclusively
BogosBintedSort
this may sound counter intuitive but I highly reccomend looking at insertion sort for smaller data sets and something like Shell Sort for larger ones
BogoSort would be called BozoSort today
GaslightSort - it's sorted already what are you talking about
Insertion Sort is great given that the data is atleast somewhat sorted already
that's why it works better on smaller datasets there's less of a chance the cost to sort skyrockets given its not partially sorted
Merge sort is also awesome, but it kinda fucks your call stack
How about usersort
insertion sort is not bad for small sets
Just tell the user to sort it
lmao
Some ppl call it monkey sort
insertion sort is also really intuitive too
there's a sorting algorithm called assume sort
Stalin Sort is the best sorting alogrithm
It’s not cheating it’s called offloading work to another machine
what's the hardest one
well the intuitive ones are Selection and Insertion i also think merge sort is intuitive
Selection sort is by far the worst applicable one being O(n^2) guarenteed
Insertion sort is O(n^2) but is only O(n) best case meaning if your data is partially sorted its pretty damn efficent
OutOfScopeSort - sorting is not the goal of this project and is left unimplemented (see #42 for tracking)
Merge sort is O(n log n) worst case, but it is a recursive algorithm so you use a lot of your callstack for bigger data sets
Stalin sort is O(n) though its by far the best sorting algorithm I also find it to be the most intuitive
private static final List<Integer> sorted = List.of(1,2,3,4,5);
public static Collection sort (Collection input) {
return sorted;
}
Boom O(1) sorting
that's not sorting anything though
the input is ignored
let me show you stalin sort implementation
And you go in the bin
its pretty simple yet effective
Why is there so much
okay stay away from geeks for geeks with sorting algos please
they suck ass
shitty ass website
I just googled sorting algorithms
thank me later goodbye
yep which Is why I'm warning you
they're like the first result
I think I used programiz for quicksort
nerds trying to 1 up eachother
So is merge sorting usually the best
fun <T> stalingSort(arr: Array<T?>) {
val first = collection[0]
for(int i = 0; i < arr.length; i++) {
if (arr[i] > first) {
arr[i] = null
}
}
}
or smthing
no I'd go with another n log n algo
mostly because merge sort is recursive in nature
I remember the website compared something with quicksort
so your call stack kinda commits suicide after a while
well ofc its better than quicksort since quicksort isn't guarenteed n log n
but again still wouldn't be as effective as shell sort on a super large data set
I learned stuff like using a random pivot for security and making algos without recursion
just to fit my rubric for apcsp
the thing about merge sort is Idk if you can really implement it well without recursion
its recurisve in nature
isn't quicksort also recursive in nature
I honestly don't think you can implement it without recursion
I could be wrong but I believe its impossible
oh you can its just more complex
algorithm IterativeMergeSort(A, n):
// INPUT
// A = the array
// n = the size of the array
// OUTPUT
// sorted array
len <- 1
while len < n:
i <- 0
while i < n:
L1 <- i
R1 <- i + len - 1
L2 <- i + len
R2 <- i + 2 * len - 1
if L2 >= n:
break
if R2 >= n:
R2 <- n - 1
temp <- Merge(A, L1, R1, L2, R2)
for j <- 0 to R2 - L1 + 1:
A[i + j] <- temp[j]
i <- i + 2 * len
len <- 2 * len
return A```
look at how I did it for quick sort
function quickSort(list) {
var stack = [];
stack.push(0);
stack.push(list.length - 1);
while (stack.length !== 0) {
var maxIndex = stack.pop();
var minIndex = stack.pop();
if (minIndex >= maxIndex) {
continue;
}
var nextLowerValueIndex = minIndex;
swap(list, randomNumber(minIndex, maxIndex), maxIndex);
for (var i = minIndex; i < maxIndex; i++) {
if (list[i] <= list[maxIndex]) {
swap(list, i, nextLowerValueIndex);
nextLowerValueIndex++;
}
}
swap(list, nextLowerValueIndex, maxIndex);
stack.push(minIndex);
stack.push(nextLowerValueIndex - 1);
stack.push(nextLowerValueIndex + 1);
stack.push(maxIndex);
}
}
function randomNumber(min, max) {
return min + Math.floor(Math.random() * (max - min + 1))
}
function swap(list, indexOne, indexTwo) {
var temp = list[indexOne]
list[indexOne] = list[indexTwo]
list[indexTwo] = temp;
}
var list = [1,1,2,-555,5,0,0,111,10,-2,7,9,1,22,3];
quickSort(list)
console.log(list)```
well it's apcsp
really we did python in CSP
for my final project I used Java
damn your highschool has a CS club
and yk I couldn't let anyone win
APCSP you should be able to use any language.
so I made a 3d maze search game
APCSA uses Java.
Show up with a baseball bat
iirc its actually limited to 8 or so high level languages
I learned a lot from that on how basic 3d games are made
Show me in the rules where it says no breaking the fingers of the opponents
like I don't think they allow C
They generally mean interpreted, cross-platform, high level languages
My teacher asked me to explain how I made it
I was so happy to
I won 40$
in Amazon giftcards cards
DUDE where was this in my highschool
I want to farm money from all the inexperienced children!
now it's kinda boring
💤
I promise you it's not
again where was this in my HS
Doesn’t sound much like cs though
Legos are awesome
who tf cares bro its legos
Is Lego Turing complete
is the universe turing complete
I don't think they can be turing complete without technic, It might be possible if you can jank some stuff together with some parts that softlock together vs snapping
iirc there's iterative merge sort though?
yeah I posted the algo later
I was wrong
its just a more complex implementation than its recursive counterpart
Every recursive algorithm can be implemented iteratively I'm p sure
si senior
You’ve just unlocked my memory of going to a robotics competition in like, 5th grade
the only time recursion > implementation is in purely functional languages
where not every function call is put into the callstack
there is some other thing that goes on in functional langs I forgot what it is under the hood
My teachers told us in data structures my dumbass forgot though
I'm convinced that those who do pure functional are into torture
Don’t kinkshame
I didn't say it was bad
I'm just saying they're likely into bdsm
well pure functional doesn't even make sense like the world isn't stateless not even your CPU is stateless
don't wanna mutate state?
stop time
even assembly isn't stateless
hello yes I would like milk but without the milk
every program has state so the goal to "not mutate state" is not only futile but idiotic pursuit imho
important distinction between functional and purely functional
functional has its uses for sure
oh yeah def
purely functional is stupid
yes
we live in a universe where maybe a little bit of both works best 
don't tell that to the far OOPs or the far Functional bros
you'll get torn to shreads
i'll just rename myself to the unit type

Do you guys think someone will ever invent a o(n) sorting alg
no I do believe such a task is impossible
think what sorting requires
inspection and comparisson
I'll ping u tmr when I create one
its impossible to both inspect your current element and compare it with anything that could be larger or smaller in O(n) time complexity
@quaint mantle if you create one don't tell anyone
consult a professor at your local university immediately and ask them how to write a proper thesis
you will become an instant millionaire
What if we do quantum computing
I think I'll make an o(1) search algorithm too
its FAKE NUMBERS AND SHIT
Just for fun
StalinSort is already O(N) though btw
its impossible to beat that
gaslightsort is O(1) though
fun <T : Comparable<T>> Iterable<T>.gaslightSort(): Nothing {
throw IllegalStateException("Already sorted.")
}```

computing the function actually takes negative CPU cycles
You want it sorted? Fuck you I already sorted it yesterday
if you keep going you eventually create a vacuum of space
and eventually loss of entropy
and now it's
fun <T: Comparable<T>> Iterable<T>.unsort(): Iterable<T> {
return this
}
I remember when I was really young and saw the time machine tool on a macbook and thought it was literally a time machine
you select a time and date and it does it
Man Steve jobs was a genius
If macs had an actual Time Machine do you think the diehard Windows and Linux uses would switch
yeah so I can invent linux earlier
Yeah I guess if anyone ever invented a Time Machine they could just go back in time and invent it earlier
Fairly solid proof we never invent a Time Machine
orrrr.... ok here me out.
in 100 years, all life on planet dies
in 1000 years, it restarts over
in 2000 years, they're more advanced than us, invent a time machine, come back an realize the crap shoot this planet is, go back in the future and break the time machine
"we dont want them stealing our futuristic technology"
I agree humans go exitnct and we are replaced with an advanced species of panda bears
No way it would be pandas
panda bears would have died naturally if not for human intervention
They are the least capable bears
panda bears are supposed to be extinct
i think lady bugs have a better chance that pandas
which was humans #1 mistake panda bears are going to evolve into the most formiddible and advanced speices on earth
but we decide to defy nature and keep them because they're cute
It would probably be the dolphins
sloth
new movie idea ... Planet of the Apes Panda Bears
grabs onto own arm thinking it is a branch
falls to death
bruh even the sloth is better at staying alive than a panda
sloths are also stupid
what do you think is stupider (more stupid (Fuck English)) though
my money is on the panda
I guess someone has to come last in the evolutionary race
bruh I wonder what earth would be like if humans ended up coexisting with neandrothals instead of genociding them
probably sexier /s
we also kinda genoicded the homo erectus
God fears his creation
Probably for the best
If homo erectus was still around they would just get constant boner jokes
dude fr actually maybe it was for the best there
imagine just tryna live your life and you just constantly get poked fun of cuz of boner
Racism but it’s about boners
Specieism
good talk today
well I think we are CMarco free for like a week or 2 so let the party continue!!!
what's the method to show something on the action bar
Hello everyone, is this a mcpig discord?
Oh, I'm sorry, I just got it mixed up! If anything, I'm Russian.
Does anyone know what this error means (kotlin + Gradle) https://media.discordapp.net/attachments/989510388188065866/1209692988607823923/image.png?ex=65e7d963&is=65d56463&hm=64d61dc3b64e96547ef94f0ecc53e169287b81d88a32c0aacbef381a607f43e8&
say I create a custom item, I know how to create an item and put it in a GUI with lore and stuff like that but whats the best way to store a custom item? Like is it through assigning it a command to give to players or is there a better way to store it?
You mean how to obtain it?
That’s up to you
Give command, crafting recipe, loot chests
Hey guys im helping out on a server plugin and I am trying to set a players nametag color to black, im trying a couple of different things at once but nothing's working, any ideas?
Im on 1.18.2, this is essentially what I am doing:
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
scoreboard.registerNewTeam(key + "_2");
scoreboard.getTeam(key + "_2").prefix(mm.deserialize("<black>HOME "));
scoreboard.getTeam(key + "_2").color(NamedTextColor.BLACK);
scoreboard.registerNewTeam(key + "_3");
scoreboard.getTeam(key + "_3").prefix(mm.deserialize("<black>AWAY "));
scoreboard.getTeam(key + "_3").color(NamedTextColor.BLACK);
Whomst dared to ping me for no good reason
Hell, I don't even have ANYTHING to do with bungee - I've never even used it
no, it's all your fault geol
declaration: package: org.bukkit.scoreboard, interface: Team
Hello. I am having problems with NBT. So I made a items adder item with nbt: '{mynbt: "hello"}' , but when I get the item it says that has 1 more nbt tag, but then I am trying to get that nbt tag with PersistentDataConteiner with DataType String. It says it doesn't have it. Any help?
PersistentData is stored in a nested NBT tag called "PublicBukkitValues"
So I have to set the item's nbt to '{PublicBukkitValues:{...}' ?
{PublicBukkitValues: {"mynbt": "MyString"}}
oh and the key has to be a namespacedkey
so not just "mynbt" but "myplugin:mynbt"
myplugin will be the artifact ID or the main class name?
it's what you defined in plugin.yml as name but in lowercase
Why it is called PublicBukkitValues?
because it's visible to the client and hence public
on entities it's just called BukkitValues because the client can't see that, hence not public
Ok thx I will test it.
does itemsadder not support PDC tags natively though?
I can only find nbt in the wiki.
ah ok. yeah anyway PublicBukkitValues is correct
Ive looked through this already, should i be using setdisplayname to set their color?
Oh wait i may have been using the wrong documentation? This one said setColor was deprected: https://jd.papermc.io/paper/1.16/org/bukkit/scoreboard/Team.html#prefix()
I see now that its the wrong paper version, so ill take a closer look thanks for the link
anyway to set the ender dragon's or of any mob's health to unlimited?
@tender shard how do i merge upstream changes into a fork with autosync disabled
preferably from idea
i want to merge the master of the repo that is forked into the master of the fork
do i have to add a separate remote?
ideally you would have two branches
elaborate if you are willing to listen to my dumb questions
so how it works is one branch is for pulling upstream
which every so often you keep updated with the second branch
this way if something goes wrong you don't lose everything lol
okay, one sec, check out the following
--- Y2K_/Bukkit (master) <-- NOT AUTOMATICALLY SYNC'D WITH UPSTREAM BY STASH
--- brunoooooooo/Bukkit_y2k (master) (autosync'd to y2k_'s)```
i want to sync my own fork's master with the original spigot upstream
(it shouldn't have any conflicts)
assuming the changes in y2k you forked from doesn't have changes that causes issues
anyways, all you do is change the remote to the further upstream
yep
and then if i want master to be up to date i just merge the new branch into my master?
sure and this way you have two repos you are keeping up with 🙂
that you can pull in changes separately
thanks for the help
i guess i could keep the branch synced with spigot and master with unsynced y2k then
can't do it
it tries to push to spigot/bukkit for some reason
i made a new branch called bruno_from_upstream and then set its remote tracked branch to spigot/bukkit/master
then i cleanly pulled the changes in from it
and pushed them back to my fork
but it tries to push to spigot and i have no perms there since only md has
it shouldn't, but idk how you are doing stuff
never had git do something I didn't want it to do
i really can't tell if that's sarcasm
i think it's trying to push to the
oh yeah
it's totally doing that
one sec
did it :)
i forgot to switch the remote BACK to my fork before pushing
so it was trying to push to the readonly upstream
o.O
never had my repos try to push to upstream
maybe you are using incorrect commands?
or maybe git has some autosync function now and that function causes it to want to send stuff upstream? would be weird to have this
git remote add upstream https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
git fetch upstream
git branch -u upstream/master
git pull
git branch -u origin/bruno_from_upstream
git push
?
you do know there is tracking branches?
it shouldn't be necessary to update the remote
pushing to your local branch also shouldn't cause it to want to send changes upstream either
no that set of commands worked fine
i forgot the second branch upstream change first
k figured it all out with tracked branches
i think
i made a pr and pinged y2k on stash to see if it's ok with them
git remote add upstream (url)
git fetch upstream
git merge upstream/master
Hi, could someone help? I'am trying to make API for my plugin but I can't get it done.
Here is what I done so far based on informations I found online.
I created project with interface
public interface AgamasEconomyAPI{
double getMoney(Player player);
void giveMoney(Player player, double count);
void removeMoney(Player player, double count);
}
Then I ran mvn clean install
And implemented the dependency into my 2 other plugins, one main plugin, the one I want the api to be in and other one for testing
Here is what I done in main plugin
private AgamasEconomyAPI apiManager;
@Override
public void onEnable() {
apiManager = new APIManager(this);
Variables.main = this;
getServer().getServicesManager().register(AgamasEconomyAPI.class, apiManager, this, ServicePriority.Normal);
}
And then this in test plugin
@Override
public void onEnable() {
ServicesManager sm = Bukkit.getServer().getServicesManager();
Plugin economyPlugin = Bukkit.getServer().getPluginManager().getPlugin("AgamasEconomy");
RegisteredServiceProvider<AgamasEconomyAPI> serviceAPI = sm.getRegistration(AgamasEconomyAPI.class);
if (serviceAPI != null) {
msgAll("Everything is fine!");
economyAPI = serviceAPI.getProvider();
for (Player player : getServer().getOnlinePlayers()) {
player.sendMessage("Your money: "+economyAPI.getMoney(player));
}
return;
}
if (economyPlugin != null) {
msgAll("API not found!");
return;
}
msgAll("Plugin not found!");
}
But when I run it I get the API not found! message.
because you print "API not found" if the plugin instance is not null
you should check if serviceAPI == null, instead of economyPlugin != null
oh now I get your logic
does the API plugin enable before the other one?
is the second plugin soft-depending on the API plugin?
yes
in config of test plugin I have
depend:
- AgamasEconomy
and I tested and main plugin loads before the test
are you relocating any classes?
I don't know what you exacly mean by that
are you using maven-shade-plugin in your test plugin to include AgamasEconomyAPI.class ?
I get it now, yes I'am using 3th project I specificaly have just for interface for AgamasEconomyAPI and I have it implemented in test plugin
Integer a = 2;
How would a construxtor look if i try to do with a custom class
MyObject a = 2;
show the pom.xml of your test plugin pls
?paste
not possible
set <scope>provided</scope> for your API dependency
right now you're shading (including the API class file) in your test plugin .jar. So when it asks for "give me the registration for this class: ..." it asks for the registration of that INCLUDED class which ofc was never registered
Oh god, that was everything I needed to make?
I spent so much time looking for information online but nothing
Thank you so much for your help
np
Basically, it compiles to Integer.valueOf(primitiveInt)
or well
At runtime thats what happens at least
and then the other way around, it will use Number#intValue()
(Integer extends Number)
Signature polymorphy: lol
okay, thanks
:)
why does everything in java oop have to be called like this?
what?
their name for a variable is like polymorphic nonhomogeneous dynamically synchronized object signature inheritance
Polymorphy is OOP stuff
unrelated
polymorphism is oop
there
@override
Because its their language specification
and java is oop
yet it's anything but clean and understandable, and I don't see it strongly relating to enterprise (?)
Enterprise wants stability, stability requires clearly and unambiguously defined semantics, behavior, rules etc
Programmers love Latin and Greek
if its unclear, its hard to know whether a program may behave correctly or incorrectly
that's the answer I was looking for :D
polymorphic inheritance is "clear" and "unambiguous"
?
java isn’t strictly and monotonously strong oop
I mean sure it was the case 20 years ago
Poly = multiple
Morph = forms
Or something idk I didn't do Latin
But they have been actively trying to incorporate for instance functional style to it
im want to have an interface that implements a static method to get the real class object of a class instead of the lying getClass() class<?> object, is this possible? From what I've tried its not. (generics arent available for static methods, at least not in the class scope)

yet now we're left with a half baked mess and several attempts to implement functional programming, async and other "trendy features" on top of a strong oop base
eh
async doesn't have anything to do with it but it's an example
I can ignore them all I want but it doesn't change the fact that they're features in the language that others might write and that you have to understand to read code not written by you
it also doesn't change the fact it's a mess
any way i can make this work without using generics?
Signature polymorphy (like intrinsics) is something only the JDK can do btw
And well compilers need to cater to it
Why do you need to get rid of it?
cuz generics dont work with static
red underline
under C
One message removed from a suspended account.
Brian Goetz acknowledges that a ton of mistakes were made 25 years ago or so, but there are two sides of java, the enterprise and the devs, the enterprise wants stability, the devs wants up to date/modern features, java also wants to target as wide of an audience as possible, making it reasonable develop for instance games in java (which has been in retrospect no very well w java)
Sure, if you think its a mess, thats ur opinion, but they want to add things such that it becomes easy to use for the average developer, one reason why project valhalla has been taking a long time. They need to care about stability for all the new features whih is why they don’t just shove it up like kotlin, take union types for instance, sure its semantically powerful, but type inference becomes a dry desert horrible to even step in.
They’re not really making attempts, they have been able to incorporate functional style and enhancing their concurrent framework a lot which is generally well received by the community nonetheless, altho 90% of concurrent framework is just AQS under the hood.
I need to get it statically when i already have an instance of the object then there is no need ofr me to get the class in my dsign
How would i define T then
first of all, what are you trying to do
Inferred by the compiler?
second, why
It is intrinsically unsafe tho
Its not like the java devs today embrace System.out and java’s verbose main method brunoo
never implied anything I said should be taken as fact, it's obviously my subjective opinion, and my previous points still sort of stand
But radically changing it isn’t a solution
Unless the type can be inferred via a param
Registry -> obejcts isntanxe -> registered under class
What exactly do you consider to be a half baked mess?
It's cool and well justified, so I veto your idea
:/
new useless language features piled onto an already complete and stable language that really don't make it easier to use for anybody, but just add more complexity, more to learn, introduce undefined and buggy situations
Definitely not true
pretty true imo
lightweight threading has been wanted for pretty long
not binding jvm threads to os threads bijectively
then your opinion is trash