#dev-general
1 messages · Page 226 of 1
Kotlin gradle is pretty meh
yes
how to i make it so tpa doesn't work when someone is in spectator mode, or goes into spectator mode after they have accepted the tpa request
Doesn't sound like a dev related question, also this is not support channel, you might wanna ask in #general-plugins
isnt getClass() just ::class.java in kotlin?
Depends
Oh, from an instance it'd be skullMeta.javaClass
on a scale
of 1 - 10
how bad is this:
meta.setLore(Arrays.asList(Arrays.asList("Ewww Stinky", "Dirty Mess", "Dusty!").get(new Random().nextInt(3))));
- Lists created from
Arrays.asList(T...)are immutable, (and even if it wasn't) so creating one each time you call that method is a bit.. :yikes: new Randomno, please don't, have an instance of random somewhere or useThreadLocalRandom.current()instead
yeah it was a joke
geez
lol
.javaClass also doesnt work
What does it say?
Can't you just copy the method and let IJ convert it?
It changes it to .javaClass when IJ converts it
Send the code
SplittableRandom though 
fun Entity.getHead():ItemStack?{
val textureId = config.getString(type.name)
val itemStack = XMaterial.PLAYER_HEAD.parseItem() ?: return null
val meta = itemStack.itemMeta as SkullMeta
val profile = GameProfile(UUID.randomUUID(), null)
profile.properties.put("textures", Property("textures", textureId))
var profileField:Field = meta.javaClass```
val meta = itemStack.itemMeta
as SkullMeta
2 spaces???
fun
Entity.getHead():ItemStack?{
No spaces???
Ye it’s pack priv
You disgusting creature
what
no it isn't?
so how do i get the java class
the skull meta class is package private
It's not
what is the error
the implementation is in cb... so yeah...
is it because im making an extension function thats in a class or something?
i doubt it
will that just compile to the same just not static?
nop
why have explicit typing at all
thats hwaty it should be
val profileField = blah?
anyway
https://img.bristermitten.me/10-53-36.png invalidate caches and restart
works fine for me
my thing?
if you're on 1.4+ just the plugin
actualyl ive got the stdlib there anyway
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
}
group 'org.aj3douglas'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
dependencies {
implementation 'com.github.cryptomorin:XSeries:7.6.0.0.1'
implementation 'org.spigotmc:spigot:1.16.3-R0.1-SNAPSHOT'
implementation "org.jetbrains.kotlin:kotlin-stdlib"
}
bruh
what
tell that to IJ i didnt add it
how
change the plugin version
:kek:
use implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' for the dependency
and id 'org.jetbrains.kotlin.jvm' version '1.4.20' for the plugin
bruh I just did
New project > Gradle > Kotlin / JVM
don't need the dependency with 1.4 
it adds it automatically
eyyy
ok so I just removed the dependency for it and now the .use thingy doesn't work 

maybe they changed the function in 1.4 or something
¯_(ツ)_/¯
it works most of the time
anyone up for some clash?
clash?
of code
i will
I do not know of this
i thought it used to use AutoClosable not Closable
alrighty lemme make a clash
it's good
private fun chance(chance:Double):Boolean = (1..100).random() < (chance * 100) if i pass this like .16 will it give me a 16% chance?
aj why are you using implementation for spigot
oh god
idk should it be compileOnly?
yes
Why not just Math.random()?
I think that will work yeah
what have i done now
but jeez
or random() if thats a thing in kotlin
just Math.random() < chance is all you need lol
it's not exactly readable lol
uhh sure this is what I was planning to do at 4am
yeah it is
Deff
you won't regret it
Sure
eh I say keep all modes
that would actually be interesting
ok i think that's everyone
Java+Shortest
kotlin tho
oh god no
fuck, shortest
BRUH
xD
My PC is going brrrrrrrrrrrrrrrrrr rn so I'll join later if y'all still doing it
how in the fuck am i meant to do this
I don't even know what I'm reading
^
in java so automatic loss D:
rip
yikes
lol yikes
ew math
hardly
nah i give up
i had something somewhat similar to urs piggy
but different
i was splitting it @ weird places
yugi where'd you learn python?
aww python 😦
yeah that's why I said java only
because if someone goes lua or python, instant win for them
wdym?
oh just for random coding competitions
They didnt teach us python since I am from the gaming dept
probably next sem maybe?
not sure
piggy go look how I did the sum :)
they gave us our OS course only this sem as well
eso you need to click share
oh
none of yall got 12 characters tho did you
My theory is still that most people don't learn python consciously
I agree with that theory
lol
is chars() java 11?
nah 8
No
IntStream
it's 8, returns an IntStream
i see
Shortest+Java now?
that python code is crisp wth
sure yugi
I like Aj's answer
mines the best, only 12 chars
https://paste.helpch.at/itozijesek.cs @lunar cypress (map int) worked this time 
bm fix your fucked up pfp on clash thx
shes a bit squished
shortest, does that mean I should delete all spaces and newlines
yeah
dunno if it counts those
it does
it shouldnt
lol
Yeah, you're calling int on char, which is like casting
makes sense
lmao
did you shrink it to a single line
rip
I have to actually read it? Can it speak the instruction for me?
dont think so lol
is it required to close the scanner?
Hi, how do I connect the LiteBans Material UI?
no
Candies
candles
you right it's candles now
im not crazy....
for (int x = 0; x < 16; x++) this will never be 16 right?
lol
elara beating me by literally 3 characters
oof
"Shortest Mode"? I didnt know it had modes
class CandleContext {
private final int numberOfCandles;
private final int sizeOfMouth;
public CandleContext(final int numberOfCandles, final int sizeOfMouth) {
this.numberOfCandles = numberOfCandles;
this.sizeOfMouth = sizeOfMouth;
}
}
class CandleContextFactory {
public static CandleContext getContextFromInputString(final String string) throws CandleInputParseException {
final String[] parts = string.split(" ");
if (parts.length < 2) {
throw new CandleInputParseException("Error");
}
}
}
class CandleInputParseException extends Exception {
private final String message;
public CandleInputParseException(final String message) {
this.message = message;
}
public String getMessage() {
return message;
}
}
``` What I had going
LMFAO
I just did that
bruh
doesn't work though lmfao
Lmao Niall
welp
Your ENTERPRISE CODE
enterprise clash of code
You didnt submit?
bruh how did you all get 0%
You could have changed the class name to S
tf
oh true
I would've got like 5% but I was trying to fix other shit
I had a soln
wow if I renamed args to a I would have beaten you
I was waiting for its final submit button
rip
how did aj do kotlin
i crashed
I accidentally clicked outside the box and it exited me to results
i didnt submit anything did i?
it submits automatically if you run out of time
not 0 now
tf lol
Lemme open google, gimme a bit, I'll join 
https://paste.helpch.at/unuwojaneb.cs it was just this lol
Wait was it Candies or candles?
food
candles
ah overcomplicated it didnt i
candles
a little bit lol
yeah ok mr smarty pants bm
I swear the questions in random are fucking much harder than these
ok
all use c
imma be googling stuff left right & centre but ill try
I guess maybe to not remove their hard questions to bots?
Please start the competition
c and shortest?
c is probs better tho
just cos its probably easier
you making me try to remember random C jank
me neither lol
I can’t join 😦
c is just java but impossible
😦
why lemmo
you making me try to learn c
15 mins to learn
not anymore
will it pick one at random?
unless you wanna join a new one
again lemmo, why
yeah
^
shortest only 😬
shortest sucks because i'm bad at it
oh we werent going for that?
Alrighty
ayy time to suffer
good luck everyone
Note: The product will be very large, you have to optimize your code well
oh no
shortest
you want me to optimize c code
bruh the whole reason I'd ever write c is so I won't have to optimize it
both
yea
that's a long long
tf us scanf
input function aj
I've no idea what I can delete and not lmao
technically whatever you want
reads from io using the specific format in args 1
scanf("%lld", &x); brings the next long long to the x variable or some shit?
also tf is long long
long but longer
A long long 
128 bit iirc
long long long
yeah, takes a pointer to x and fills it with the scan() data
really long long long
oh jesus the impossible test
much longer long long log
wth is the impossible test
cpp does in boost lib
google to the rescue
dont think c has it
it has everything you need I think?
unsigned long long is in theory longest
Tried that, still failed :p
afaik there aren't any premade collections which kinda sucks
yeah gonna need something clever
odd * even optimisations etc
nope
You're all doing C right now?
image ur code compiling
or vb.net
but yeah i think most are using C
I still don't even know what the first sentence of the problem means
product(N) % D == 0
wdym product(N) it only gives you one integer N
is it supposed to be fibonacci or something
sorry I mean uh
I can't think right now it's 5am
idk possibly
it w h a t
take the product of N integers
is that not a single integer that N is assigned to
i feel like im misunderstanding this lol
N is how many integers there are
oh that's a for loop
yeah
sorry I'm working with 2 brain cells right now
yes
besides the point tho niall, vb good 
then if theres a decimal doesnt that mean its not perfect?
is that it?
Product Mod D = 0
god
i feel like you could do prime factorising or something
So Impossible 2 succeeds, Impossible doesn't :sad:
Yeah I just submitted it but I want to edit it now 😦
for whatever eason ive gotta invert isDigit for most to work
If only you could specify more time for these kinds of questions
ok ive scrapped isDigit
yo got it
i still fail the impossible one
||just properties of modulus||
yeah like i know what that means
😂
what is fancy in that?
yeah nah I can't do this
modulus = %
I've literally got no clue
imma just accept im failing the impossible one
lol what
Yugi didn't even try to minize it smh
does yugi know c tho
I still dont' even know what the question is
oof
What does Yugi not know
oh you modulus it while doing the product
yeah
he's right that it's just a basic modulus property lol
Piggy how the heck does your work?
still have no idea what the question is
My brain too small to understand that Nicole so..
^
wym niall
anyone here used D before?
The fuck is D
The D programming language is an object-oriented, imperative, multi-paradigm system programming language. D language originated as a re-engineering of C++, and D's design goals try combining the performance of compiled languages with the safety and expressive power of modern dynamic languages
you've probs got a better idea than I do
yeah I've used it once where we all used langs we've never used before
yeah
not that interesting tbh
oh
(a%b)%b = a%b
my shortlist is:
D
Dart
F#
Lua
Objective-C
OCaml
Pascal
Perl
Ruby
Swift
ah
any preferences?
do you get taught this shit in school?
rust
Let's go down the list I guess BM
lua bm
let's just suffer with Lua
oh no, I have a habit of reading very random stuff
i'm not playing, gonna go get some food
I think I was taught that in discrete
There we go with mentions of food :((
D docs pulled up 👍
I hate not having an IDe for this shit
D looks like C++ kinda
like normally i use scratch files in ij
oh no a long one
ayy got into 3k
fuck calvin
Yeah D is just another c family one
this is just c but with auto
yeah
and it's excited !
has the same stuff as any other of those
I hate that way of casting
auto?
but I'm impressed it can do that
syntax is different here an there but yea
yeah
oh inference
like val or var etc
I see
shortest really sucks here because none of us can do anything interesting
unless someone is lucky and finds something by accident
yeah true
Would be nice to have more time available tho
yeah sorry but screw this I'm too tired at this point
Very
wait
how do we get the amount of gifts he can give
since isnt that in the first input?
Thats where im stuck atm
I've no clue, I didn't get the question at all
the number of gifts he can give is G
int N = inputs[0].to!int;
int G = inputs[1].to!int;```
?
o
yes
Yes Aj
writeln
its writeLn
smh
What a massive 4head you have
wow nice
no lol
Okay good
I made like arrays and shit
if(b == true){
writeln("true");
}else{
writeln("false");
}```
😐
and sorted them
you can probably just do
import std;
void main() { writeln(true); }
``` and get the smallest with best score
Nicole, was thinking of doing that, but that's cheating
lets just ignore that tho
bruh
dang
go look at my code
Went with a better output instead
you're using ~= and everything wtf
will mine still submit?
yeah
I got 100% i think
nice
nice
but I choked
the algorithm confused the shit out of me
You piece of shit Nicole
oh or not
LOL
shit
welp
nvm
it sucked ngl
the question sucked
now you go view my code
the language was kinda nice
:)
tbh tho i probs wouldve failed this on java as well so
Let's do D again
alrighty
the question was completely fine, you are all such crybabies
But hope we get a better question
no shortest now
Johnny
:C
same?
that wasn't because the question was hard
no shortest anymore
I feel like Aj's code just picks random true/false values
wow
Could probably make a random and just output randomly and get the highest score lol
mine should in theory work 100%
in theory
I'll join just to see the question
johnny you joining?
just adds everything to an arrays, sorts it backwards, loops over the first X values, where X is the amount of gifts given, and if whats his names value is in there then it is true
you didnt need that tho?
no
its sorts ascending by default from the docs
tf do I know
i think i meant to do a > b tbh i cant remember
oh wtf is this
we're playing a puzzle
I got the soln but the language..
I also think I know just from that lol
i dont got the language
that was worded wrong
sajme lol
help
core.exception.RangeError@Answer.d(14): Range violation
??:? _d_arrayboundsp [0x7ff5976cdd01]
??:? _Dmain [0x55e55a72271c]
i wish i knew
finally
maybe its a index out of bound sor something similar??
god that took so long
How did you define your array?
string.split
have you used any other arrays?
Yugi, hulp
part.toCharArray()
oh boy
its accessing the array thats giving the error
No need
string sentence = readln.chomp;
string[] split = sentence.split(" ");
string output = "";
for(int x = 0; x < split.sizeof; x++){
string str = split[x];
}
string is just a char array
^
sizeof is a function
@obtuse gale d foreach (string str; split) { blah }
call it?
bruh what
char[9] greeting1 = "Hello all";
pretty sure function calling doesn't need parens
This is supposed to be valid, yet it's not eee
really?
possibly
void main()
{
stdin
.byLineCopy
.array
.sort!((a, b) => a > b) // descending order
.each!writeln;
}```
this for example
doesn't have any parens
is there if(conditionOne || conditionTwo)?
.length worked for me to get array length
like or
yes there is
is it just ||?
yes?
ok
idfk
mixed with c#
The docs are fucking shite
bruh i timed out
meh meh xD
alrihgt imma go
maybe
i'll be adding "proficient in D" to the portfolio
kek
lol
Am I just being hella dumb right now or?
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
final PreparedStatement dbCreationStatement = connection.prepareCall(
"CREATE DATABASE IF NOT EXISTS `?`;"
);
dbCreationStatement.setString(1, getDatabaseName());
dbCreationStatement.execute();
^
Tried using just ?
Gave me errors for invalid syntax
Also it's ` not ' which is supposed to be correct no?
Can you even use ? for db name?
You're not supposed to use prepared statements for that afaik
Dont think so
^
its only for column values
Yup
Ah
yeah, just values, not names
if you want to make that dynamic you can most likely just format it regularly
because if users can create databases with your app something is wrong
Ah, I see what you mean yea
I assume this is for a plugin or something and the server admins can set a name in the config?
is there anything for free i can use as maven repo for private projects, other than my local repo?
I can try github packages but I heard is a pain to setup >.<
that sucks though
ye ik
local repo is better, why not that
I assume coop project?
oh wow mr fancy pants
hehe
of course you could also host a repo yourself
That's effort tho
meh
AsyncPlayerPreLoginEvent#setKickMessage
I could've swore \n worked for this
$$ and resources xD
you can use mine if you want
Will let you know, thanks bm

@ocean quartz Can I get the repo and dep for mf messages, I really don't wanna open google cause my pc go boom
https://repo.mattstudios.me/artifactory/public
me.mattstudios:mf-msg-bukkit:2.0.2
me.mattstudios:mf-msg-adventure:2.0.2
❤️
I mean just use gh pickages or a private github repo as your maven repo
Smh
How does system env variables for github and other services login work? I have to set them manually?
pls just take bm up on his offer for a repo
Ok but I still need an answer :(
Most examples use system env for passwords and usernames
they're provided by github
you place them in, and github will inject them
think of them as placeholders
Ye I figured that out
But my question is, do I have to set them manually on my pc env or?
yes
yes
Great, ty p1g
y'all hating on gh packages for no reason
cuz gh packages is anti open source imo
it requires auth to access public stuff, that's not very open
bristermitten repo is pro open source 🙂
Pls don't hate on gh packages, we all need more MS in our stack >:(
Isn't one of the js dialects also from ms
good point
How long do you think until the big monopolies control the rest of open source and you'll have to watch a 20 second ad before you can download a package
Oh wait that already happened with npm once
nah, there will always be more startups
and elara package manager will destroy microsoft
@marble flame hi
is it normal if I don't have a settings.xml file on my .m2 folder? I see on the github packages wiki that you have to add smth there
nvm Create a new ~/.m2/settings.xml file if one doesn't exist.
Is possible to upload a javadoc jar to github packages?
yo anyone know a plugin to stop natural monster spawners from spawning
no but you could prob #772310218104897580
It stops all mobs
oh right
He asked specifically for monsters
well any natural mob spawners
yep
check dms
search on google for copy paste symbols
@prisma wave any reason why a project on kotlin 1.3.21 would compile "nullableOnject >= x" and many others?
how would one add a config default like this for each mob
ZOMBIE:
chance: 10
texture: X```
private fun setupConfig(){
for(entity in EntityType.values()){
// What here?
}
}``` I just dont know how to like make a category or section or whatever
how make multiple conifgs?
val texturesConfig = YamlConfiguration.loadConfiguration(File(dataFolder.path + "/textures.yml"))?
????
ConfigurationSection#createSection(String)
YamlConfiguration.loadConfiguration(File(Plugin#dataFolder, "textures.yml"))
yall how know to put symbols in text? \u27a4 doesn't work and putting the main symbol doesn't work either ✫✫✫
fr ill pay u if u help me w this
Wdym?
old
@prisma wave I have to fix someone's project and it has like 30 errors related to null stuff
And I was wondering how they were able to compile the plugin in the first place lol
Ok
Well probably warnings?
Maybe it wasn't nullable for them?
If it's coming from java then it could be a platform type
Maybe because you have the source available (and therefore nullability annotations) whereas they didn't
idk 😦
I thought it might be because of the difference between kotlin version and my kotlin plugin version
but even then, I assume kotlin always had ?. and stuff
yes it did
Using Gradle I assume?
ofc
Feels bad
The IDE is running low on memory and this might affect performance. Please consider increasing available heap.
....
omg this shit is getting annoying
http://mcapi.us/server/status?ip=play.chasecraft.gg Hey, so click the link. On the bottom is says "duration": bla bla
Is this millis or what
That definitely millis or tick
Duration of what potatoes?
Ticks then mostlikely
ok
Format it using date and you'll see what it is :p
oki doki
that would be converted into 4.38month
then its ms
imagine not restarting your server when Gianluca said it in his optimisemyserver post
smh
Which is never?
fuck his website 💯
You're looking to optimize your minecraft server?
Well fortunatelly for you, Gianluca was kind enough to make a website that will somewhat guide you on the path to get better performance from your server.
well his website is in this faq
You're looking to optimize your minecraft server?
Well fortunately for you, Gianluca was kind enough to make a website that will somewhat guide you on the path to get better performance from your server.
no
k
k
time to go thru all FAQs and see what needs uptdating lol
updating*
@static zealot I think we need more faqs
?more-faqs
made this for Conclure LOL
faq for change.org music channel pls
how do i link accounts?
read that
also I think now its =mspigot instead of =spigot
but read that page first
then just use =mspigot instead of `=spigot
yo
Poll:
Should I name it ?java-dependency-injection or ?java-di ?
Leave as is
first one is long
no
well they said
It's totally fine.
its missleading
