#dev-general

1 messages ยท Page 553 of 1

prisma wave
#

but it is an interesting philosophy i saw on an SO post

potent nest
#

and it's better than groovy obviously

prisma wave
#

oh no, "constraints liberate, liberties constrain"

cinder flare
#

Almost any language I can think of is more free than Java

prisma wave
#

tbf the post was talking about something totally different but it was still an interesting point

cinder flare
#

I dunno, I guess being ramrodded into the Java model can be a good forceful mold to constrain a lot of individuals to produce semi-normal code

potent nest
#

basically all mainly functional languages are more restrictive

prisma wave
#

yeah definitely

cinder flare
#

Well not in the same way

#

And that's not really what I meant, I'm talking more about the use cases for a language like Java

#

Or really an imperative or OOP language of any kind

prisma wave
#

i do think that "having to" write code in a certain way does make things easier

#

there's less to think about, and you get a more consistent codebase

#

so that's probably it

potent nest
#

^

cinder flare
#

I mean you can enforce restrictions on any codebase

prisma wave
#

whereas in kotlin you can mix OO and functional and extension functions and everything together until you've got a mess

cinder flare
#

I feel like you can get a lot more done in a lot less time with Kotlin than with Java

#

Due to that paradigm mixing, it borrows from a lot of sources

#

There's a lot of things that feel really awkward being forced into Java's mold

prisma wave
#

yeah im not doubting that it's more productive but faster != better

cinder flare
#

I dunno, I mean this is why you have code reviews and linters

#

And contribution guidelines

#

To ensure a project doesn't get too out of hand

prisma wave
#

well what's the point of getting something done quickly if you're inevitably going to have to refactor the hell out of it?

cinder flare
#

I think the point is that you're always going to have to refactor the hell out of it

#

That's the essence of working in a large codebase

prisma wave
#

sure

cinder flare
#

Kotlin allows you to use a lot more nicety and get to the refactor stage a lot quicker

#

And maybe someday, emilyy's 5-paragraph essay will be complete ๐Ÿ™‚

obtuse gale
#

This actually, I remember reading in an article something along the lines of "A paradigm brews from taking away certain factors from complete freedom" or something like that, basically restraining your possibilities and you have design patterns you have to work with
e.g. in assembly language you have all the freedom, all of it, you can do whatever; the moment you start adding abstractions and you prevent access and control over certain things you end up with higher level languages that abstract things away and you can't everything you could do before, yes the things you can do you may (and probably will) be able to execute easier, but not everything

prisma wave
#

Interesting

cinder flare
#

True, though I feel like that applies less to differences between like Kotlin and Java than it does Assembly and any higher level language

prisma wave
#

but yeah that does make sense

prisma wave
cinder flare
#

Yeah exactly, but that's a lot less of a difference than assembly to a higher level lang

prisma wave
#

they have similarities but kotlin's multi-paradigmn-ness is essentially saying "let's not take away any factors from complete freedom"

cinder flare
#

I think it allows you to do so much more than you can with Java, at least without awkward work arounds

prisma wave
#

meh

obtuse gale
#

Java is like in the top 3 or top 2 languages any programmer thinks when you mention "OOP" lol

cinder flare
#

Coroutines are a great example

#

I do agree that forcing compliance can definitely be useful

prisma wave
#

coroutines are nice but they're not really much more than a library with a bit of syntax sugar

cinder flare
#

But I feel that the vice of Java is a little too tight

prisma wave
#

maybe

obtuse gale
#

loom ๐Ÿฅบ

prisma wave
#

all i know is that i've written 82 classes in the past few days and i've never really felt myself missing kotlin

obtuse gale
#

Lmao

#

Just a heads up if anyoneโ€™s looking into doing MahootSoโ€™s Request He will Scam you ๐Ÿ˜

cinder flare
#

Wow, I think you've evolved backwards lol

#

Any time I work on a Java project, I yearn for Kotlin's syntax and easy resolving of issues that plague Java

#

Maybe all the projects to improve Java will remedy this

obtuse gale
prisma wave
#

java 16 + vavr is all you need to be productive

cinder flare
#

But as it stands, all that boilerplate really hurts

prisma wave
#

nah

obtuse gale
#

Heh

cinder flare
#

java 8, no build tools

prisma wave
#

records, proper encapsulation, etc, you don't really need much boilerplate

cinder flare
#

true records are magical

obtuse gale
prisma wave
#

i think only like 3 or 4 classes have getters and setters

obtuse gale
#

Some get to be on 7

cinder flare
#

And its version trancendence is nothing to be scoffed at

#

If you're making a plugin for Minecraft 1.8 - 1.17, you sure as hell can't use any new java features

prisma wave
#

jabel ๐Ÿ˜Œ

obtuse gale
#

Funnily enough 1.8.8 runs on Java 16 lmao

cinder flare
#

And how many server owners are using Java 16 ๐Ÿ™‚

prisma wave
#

b-but my custom made 1.7.10 cannon jar doesn't work!!

obtuse gale
#

Yeah tell that to the fork of a fork of a fork of a fork of ...

cinder flare
#

when that number is less than 4%, I'll consider going back to Java

obtuse gale
#

46% hot damn

prisma wave
#

ok on a more serious note, what do you think about this pattern?
i have a config wrapper that looks something like this: ```java
public record LangConfig(
@SerializedName("party") PartyLang partyLang
) {
public static final Configuration<LangConfig> CONFIG = new Configuration<>(LangConfig.class, "lang.yml");

public record PartyLang(
        @SerializedName("invite-sent") String inviteSent
) {}

}

and parts of the program will need to retrieve messages from the langconfig and pass them to LangService#sendMessage(Player, String)

i was thinking about making a method `LangService#sendMessage(Player, Function<LangConfig, String>)` to avoid having to pass around the LangConfig everywhere, so it only gets injected into LangService. thoughts?
cinder flare
#

yeah that's actually way better than I thought ngl

obtuse gale
#

That's huge

prisma wave
#

and then you could do stuff like lang.sendMessage(player, config -> config.partyLang().inviteSent())

cinder flare
#

uh well I hate what you're doing with the parens and brackets

prisma wave
#

that's not important smh

cinder flare
#

but it sounds like you're trying to mix paradigms Kotlin-style!

prisma wave
#

nah

cinder flare
#

First-class functions? In Java?!

prisma wave
#

just trying to reduce coupling

#

my PartyService shouldn't depend on LangConfig just to be able to send a single message

cinder flare
#

I mean yeah it should

#

How else does it know what language to send it in

prisma wave
#

it just gets the config from the function

#

LangService#sendMessage would encapsulate all of the logic of actually getting the language file and stuff

obtuse gale
prisma wave
#

bruh

obtuse gale
#

lmao

cinder flare
#

ooh I got clojure

#

is that a sign

prisma wave
#

simon

obtuse gale
#

Nice

prisma wave
#

how fitting

#

ok

#

well

#

since none of you have got anything useful to say i'll assume it's fine thank you ๐Ÿ™‚

cinder flare
#

BM I think you are working at much too high of a level for any of us to meaningfully contribute to your whimsical ideas

prisma wave
#

๐Ÿ˜Œ

#

well

cinder flare
#

I mean you literally progressed so far you went backwards in the normal chain

prisma wave
#

i dont think it's a bad idea, just wondering if there are better ways lol

cinder flare
#

hey speaking of bad ideas

#

i was thinking of making a new deluxemenus configuration DSL for fun

obtuse gale
cinder flare
#

it started as a lisp because then I could make the interpreter for it and it would be fun

obtuse gale
#

It's called BetterJails

cinder flare
#

but now I am open to more ideas

#

thoughts BM?

prisma wave
#

uh

#

i mean

#

is a lisp the most user friendly thing in the world

cinder flare
#

i mean no

prisma wave
#

you know the average iq of a deluxemenus user

cinder flare
#

but im going for power over usability

prisma wave
#

then maybe a lisp is good

cinder flare
#

yaml might be easy to look at, but it's also easy to mess up

#

and hardly powerful

prisma wave
#

code as data, very concise and expressive

cinder flare
#

yea that's what i was kinda thinkin

prisma wave
#

but

#

if you can't have any logic then can it really be called a lisp?

cinder flare
#

who says I can't have any logic?

#

maybe we can inline a few JS placeholders

prisma wave
#

hmm perhaps

#

clojure yaml

cinder flare
#

hmmm

#

that is very interesting

reef maple
#

Hi,
For a school project, I have to create an android application for Android 8.0 (SDK 26) or less. Proble, My application is on SDK 31 (started on 14 but maybe I increased the version without taking care). When I try to decrease the version, I got these kind of errors
https://pastebin.com/nk5N98yy

I tried to fix it by implementing "com.android.support:preference-v[version]" but it doesn't help.

Thanks in advance for your advices '-

hot hull
#

[version]

#

Please do tell me you replaced that with the actual version

reef maple
#

yes

#

For SDK 26 I use com.android.support:preference-v7:26.1.0

steel heart
#

Someone tell me I ainโ€™t copying emily pfp

jovial warren
#

anyone here know the cause of an error like class org.kryptonmc.krypton.registry.ops.RegistryReadOps$readAndRegister$result$1 cannot be cast to class kotlin.jvm.functions.Function0 (org.kryptonmc.krypton.registry.ops.RegistryReadOps$readAndRegister$result$1 and kotlin.jvm.functions.Function0 are in unnamed module of loader 'app')?

timber oak
jovial warren
#

well, figured it out

#

I switched from using Supplier<E> to using () -> E, and forgot to change one of the returns to match that change

cinder flare
#

that does make sense

jovial warren
#

rule #1: don't mix Java and Kotlin functional types, you're probably gonna break something

hot hull
jovial warren
#

lol

half harness
#

wat

#

do u mean the pricing?

#

tbf it is a survival server

ornate edge
#

Anyone know of the pluging called "Terra"

#

Im trying to set it up and its not letting me.

half harness
ornate edge
#

Thanks!

half harness
#

np

timber oak
#

Is it possible to make an automatic upload to github every 2 minutes or so?

cinder flare
#

uh well you'd need to commit

#

so you probably want to be careful about that

timber oak
#

Why be careful?

#

What can the danger be I mean

cinder flare
#

sometimes you don't want to commit things

#

commits are supposed to be very intentional

#

or sometimes there are things you don't want to commit, like changes to config files or whatever

timber oak
#

This is just for a javadoc

#

So I guess it won't be dangerous? The commits can just be named something like automatic update to docs

prisma wave
#

why not just make a service that redeploys the docs every time you commit a change

timber oak
#

Or that

half harness
#

github actions fingerguns

timber oak
#

Can that be done within a gradle task?

prisma wave
#

^

#

no

#

well, not exclusively

timber oak
#

Or can gradle run scripts?

half harness
#

wat

timber oak
#

So like if I could run a .bat file with gradle, then that file could just upload the docs to github

#

Just wondering if I can run a .bat file with a gradle task

prisma wave
#

you can... but why would you

#

just use github actions and github pages

timber oak
#

Don't know what either is, I think

prisma wave
#

are you not publishing the javadocs to pages?

timber oak
#

They will be pushed to a private organisation on github

prisma wave
#

wha?

timber oak
#

I want to push this to the repository

prisma wave
#

and how do you plan on hosting those html documents?

timber oak
#

Dunno yet lol

#

index.html can just be opened and it opens the docs

prisma wave
#

yes i know

#

just

#

use github pages

#

free hosting

#

you don't need another repository

timber oak
#

Oh

prisma wave
#

and it integrates with CI (actions)

timber oak
#

Does it go through the same organisations from standard github?

#

To make them private etc.

cinder flare
#

psst BM

prisma wave
#

private ๐Ÿคข

#

but yes,

cinder flare
#

how do I paste into Doom Emacs ๐Ÿ™‚

prisma wave
#

just p if you're using evil mode

#

or shift + insert should still work

cinder flare
#

and it copies from my OS?

prisma wave
#

uh i think so

#

maybe shift + insert

#

or ctrl shift v

cinder flare
#

Oh snap it did!

prisma wave
#

ez

cinder flare
#

okay it was just being weird tyvm โค๏ธ

prisma wave
#

โค๏ธ

timber oak
half harness
#

why private โ˜น๏ธ

timber oak
#

It's for a server

prisma wave
#

and?

timber oak
#

They want it private for some reason

#

If a user is set up as an organisation isn't it an enterprises user then?

cinder flare
#

no, enterprise is where you pay a lot of money, usually you also self host a version of github

timber oak
#

Ugh then github pages does cost quite a bit to have hosted private

ocean quartz
#

Host public fingerguns

steel heart
#

๐Ÿ˜Œ

cinder flare
timber oak
cinder flare
#

if only there were access control methods to stop unauthorized individuals from viewing private websites ๐Ÿ˜ฎ

timber oak
#

Wait are there? Or are you being serious lol

cinder flare
#

bro obviously

#

you can put anything behind a password in nginx

#

also like any other website schema

ocean quartz
#

Wait a private website? As in only you can access?

timber oak
#

Well, multiple people

#

But not public

ocean quartz
#

Localhost it and open the ports then select allowed ips

cinder flare
#

lol ip whitelisting

#

what a pain

timber oak
#

Hmm, I would prefer the password option with oracle if possible

#

Well, if it can be done without too much struggle

cinder flare
#

i mean yeah obviously it's possible

#

literally any CMS of any kind

#

even nginx itself has password requirements

timber oak
#

Dunno what CMS is

cinder flare
#

content management system

#

django, rails

#

ktor

ocean quartz
#

Ktor ๐Ÿ˜Œ

cinder flare
#

uh there's one for rust I forget what it's called

ocean quartz
#

Actix?

cinder flare
#

oh yeah that might be it

ocean quartz
#

Super speedy

cinder flare
#

Diesel is good for ORM too

steel heart
#

Korm ๐Ÿ™‚

static zealot
steel heart
#

Myes

cinder flare
#

emilyy likes korm? lmao

steel heart
#

Well gonna change soon, just a temp one while finding a bette one

cinder flare
#

i thought she liked cpp

static zealot
#

nah

#

was talking about pfp

#

xD

cinder flare
#

ohhh

steel heart
cinder flare
#

that's it

steel heart
#

Out of your mind!?

obtuse gale
steel heart
#

Hai

ocean quartz
#

Conclureee uwu

steel heart
#

MwMatt

timber oak
#

I heard mavenCentral is a good replacement for jcenter, but what do I do with the repositories that doesnt exist in mavenCentral but they're in jcenter, or bintray. I think bintray in this case

steel heart
#

Yeah jcenter got a function I think if you wanna add it

#

Bintray has a plugin iirc

fluid cove
#

Any good and decent login and register system "secure" with session, because im making a panel and i need one. If make one its would be really insecure.

#

Btw

old wyvern
old wyvern
fluid cove
#

Im using plain code, Php

old wyvern
#

ew

#

Php user

obtuse gale
#

๐Ÿฅธ

fluid cove
#

Its in github?

#

Or where?

steel heart
prisma wave
fluid cove
#

Xd

#

It shouldnt be really secure because its only for saving my license panel secure from other people

old wyvern
fluid cove
#

Yeah i made the same question

#

Why its not mainted when its really used

old wyvern
#

What?

lunar cypress
#

jcenter/bintray are already down

#

Wait, no

#

in 4 days or something they will be

#

anyway, they can be considered dead already

distant sun
#

F

fluid cove
#

Use maven2

#

Instead of that yeath

prisma wave
#

Not bloody likely

obtuse gale
#

lmao

onyx loom
#

only 21 memes smh

prisma wave
#

you only need 1

#

Simon

cinder flare
#

man he really looks similar to the guy in the right side meme

ocean quartz
#

I love TypeScript ๐Ÿ˜ƒ

#

indentation() calls the function, indentation prints the entire function's code ๐Ÿ˜ƒ

obtuse gale
#

yoooooo

#

paper supports full rgb text on console???

#

if the terminal supports it that is lol

ocean quartz
#

Yeah, since 1.16.5

obtuse gale
#

I thought it would've downsampled or something

ocean quartz
#

Meanwhile Spigot

timber oak
#

Forgot what variables like int double long etc. is called?

#

Primar variables or something like that

obtuse gale
#

primitives

timber oak
#

Ah yeah ty

surreal quarry
#

Numbers

cinder flare
#

the prime directive

obtuse gale
#

prime ministers

ocean quartz
#

Peoples, opinions so far?
I hate frontend

surreal quarry
#

The design is cool, but idk how much time people are going to spend on a site where all the buttons say Lorem Ipsum

ocean quartz
#

True good point

surreal quarry
#

other than that though, its great

obtuse gale
old wyvern
#

There was an xss vuln in discord last year apparently with an embed or something

cinder flare
#

spices it up

surreal quarry
#

agreed

ocean quartz
#

Ofc

steel heart
#

Anyone knows why discord pixelates my pfp

ocean quartz
#

Tried Kotlin react again today, it's gotten much better, it now allows functional react ๐Ÿ˜Œ
Though still kinda unstable

old wyvern
#

wdym functional react matt?

#

as in it was not working earlier?

ocean quartz
#
val Home = fc<RProps> { h2 { +"Home" } }

fun main() {
  switch { 
    route("/", component = Home)
  }
}

Basically using functions as components instead of just classes

#

That wasn't a thing before

old wyvern
#

ah

onyx loom
#

Home ๐Ÿคจ

ocean quartz
#

Was excited to try it again, but

route("/test", component = Test) // Doesn't work
route("/", component = Home) // Works

Basic routing wasn't working correctly

surreal quarry
#

lol how do they mess that up

#

that seems pretty important

old wyvern
#

Try it in the reverse order matt

ocean quartz
ocean quartz
old wyvern
#

ah

ocean quartz
#

The versioning is great right now ๐Ÿฅฒ
1.0.0-pre.221-kotlin-1.5.21

old wyvern
#

๐Ÿฅฒ

ocean quartz
#

I'll be stuck with stupid TS for now ๐Ÿ˜ฉ

old wyvern
#

๐Ÿ’€

#

btw matt

#

did you check that pr?

#

I think it can be merged

ocean quartz
#

Do you want to drop support for older Gradle versions? If so sure ;o
I forgot to test it ๐Ÿ˜ฌ

old wyvern
#

oh wait what

#

welp

#

I only tested on gradle 7, so thats probably why I didnt run into any issues

ocean quartz
#

Yeah, it updates shadow to 7 as well, which depends on gradle 7, so no matter what if we update it'll be gradle 7 only

#

I don't really mind but just to keep it in mind

old wyvern
#

rip

#

Wouldnt the user defined shadow version override our shadow impl?

ocean quartz
#

I remember it not working with older shadow version after updating, but i could be wrong I'll test again

old wyvern
#

alrighty

half harness
#

lol i just put debugs on my code and the issue was that I didn't save the code ๐Ÿ˜–

surreal quarry
#

rookie mistake. i, personally, for one, have never done that, ever, personally

obtuse gale
#

Can someone help me? The Server was not working... It's always automatically shutdown

surreal quarry
#

send startup log

obtuse gale
#

I can't send full in here

surreal quarry
#

=paste

compact perchBOT
#
HelpChat Paste

Please use a paste service to share configs, errors, code and long logs.
โ€ข HelpChat Paste

surreal quarry
#

do you know what java version you are using

obtuse gale
#

I have to download Java 8?

surreal quarry
#

are you hosting the server yourself or through a hosting company

surreal quarry
#

run java --version and see what version you are using

obtuse gale
#

Java 16?

surreal quarry
#

yea switch to 8 (or maybe even 11)

#

but go with 8

#

and you should be good

obtuse gale
#

Where to download?

#

I got now, thanks mate

dense dew
surreal quarry
#

ye i couldn't remember if it was 11 or not, but i guess not

dense dew
#

I think you can use Java 11 if you disable use-something-transport in server prop but I had issues w some plugins

obtuse gale
#

Yeah Java 8 for 1.8

dense dew
obtuse gale
#

[11:49:44 INFO]: Disconnecting com.mojang.authlib.GameProfile@7124762d[id=0c2e0941-8a32-418d-9a80-5653769b98cd,name=SyntaxError01,properties={textures=[com.mojang.authlib.properties.Property@18315d8b]},legacy=false] (/0.0.0.0:0000): Took too long to log in

#

How to fix this? I cannot join

hot hull
#

Get better internet

obtuse gale
winged mica
#

Iโ€™m not very good with licenses, with the Creative Commons Attribution Share Alike 4.0 International license am I able to fork the repo and reupload it on spigot? (It is abandoned and I want to continue it)

fallow remnant
#

Is it possible to send packets via ProtocolLib inside a thread?

winged mica
#

Ok, so I can but I have to put credits and a link to the original license

lunar cypress
#

and indicate if changes were made
, yes

winged mica
#

Ok

reef maple
#

Hi, I try to create an Android application using java, with the objective to deploy an APK for Android 8.0.0 (API level 24) or lower.

As long I am in the API level 31, everything is fine. But if I try to put the API level 24, I got these messages in my IDE on almost every findViewById methods calls. Does anybody knows ?
Ambiguous method call. Both findViewById (int) in AppCompatActivity and findViewById (int) in Activity match

worthy sun
#

@winter iron

winter iron
#

yo

worthy sun
#

Really a maze?

winter iron
#

yes

worthy sun
#

It's got no entrance and exit

winter iron
#

its not finished but it will select a start point somewhere at the top

#

and and end point at the bottom

#

the end point will have a portal

worthy sun
#

But does the algorithm allow only 1 route?

#

And does the rest of it all connect?

winter iron
#

its randomized

#

and there should only be 1 route

turbid burrow
#

@ocean quartz I have been told that you know how to create custom gradle plugins and how to use the gradle api. Can you help me?

steel heart
#

Also yeah rather just ask your question btw (:

turbid burrow
#

my issue is that a load of functions that i am using have been deprecated in 7.1.1 and are going to be removed in 8.0

#

and I don't know what classes im supposed to replace them with

#

since the docs are very vague

ocean quartz
#

And the function is?

quiet depot
#

complains of vague docs

#

and literally cannot ask a more vague question

turbid burrow
#

One of them is the ConfigureUtil c;ass

#

and also conventions are deprecated. How do I get sourcesets? I am trying to create a sources jar task

ocean quartz
#

Can you give some examples? This is still pretty vague

turbid burrow
#

For the second one, I am trying to create a task that simply creates a sources jar. Currently i am doing this

#

task.from(p.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().getByName("main").getAllJava());

#

but getConvention and getSourceSets are deprecated (p is an instance of Project)

#

For the first one, I am using ConfigureUtil.configure to the data from a groovy closure (configured in build.gradle) into a java object

#

So basically, how do i create a custom closure in build.gradle and then get the data out of it?

#

And, how do I create a sources jar task?

#

I am writing this in java (not kotlin or groovy)

ocean quartz
#

Never done it in Java, so never really used any of this
All I can tell is that the deprecated message just say to use extensions instead

turbid burrow
#

ok

jovial warren
#

imagine writing a Gradle plugin in Java though

#

I say either write it in Groovy or write it in Kotlin

ocean quartz
#

@old wyvern Alright seems like it's fine to merge the PR, I tested and doesn't seem to break old versions, that's because it still depends on the older Shadow, since I couldn't find the repo for 7.0.0

turbid burrow
#

@jovial warren Its just im more familiar with java. Thought it would be easier...

#

but most of the time i ended up just looking at groovy/kotlin solutions and converting them to java

#

or find something similar in java

steel heart
#

Writing gradle plugin in Clojure do be superior ASowyea

boreal needle
#

do i go tabs or spaces

#

all my projects use a messy mix of both

ocean quartz
#

Spaces

boreal needle
#

spaces it is then

prisma wave
#

tabs

boreal needle
#

...

#

ill just go spaces

prisma wave
#

๐Ÿ˜ฆ

distant sun
#

Ctrl alt l

ocean quartz
#

com.github.jengelman.gradle.plugins:shadow:7.0.0 doesn't seem to be a thing on the gradle portal, so the internal dependency is still using 6.1.0, though that shouldn't be an issue

static zealot
#

hmm

#

indeed

normal talon
#

can you have too much stuff in a switch ?

#

this was working

#

then I added witherskeleton

#

and it stopped

cinder flare
#

jesus christ

#

dude just store the enum of mob

#

you're just converting it for no reason

normal talon
#

how

cinder flare
#

where are you using mobKill?

normal talon
#

its a string connector thing

#

String mobKill; switch (entity.getType()) {

cinder flare
#

oh my god

half harness
#

lol

cinder flare
#

you should make the name of those i18n strings the name of the mod type

#

then you could collapse all of those lines into a single one

half harness
#

thats what i did with magicitems :))

wind patio
#

Is it possible to create a waterwalker like enchant, but instead of water it's lava and ice - obsidian or something?

cinder flare
#
String mobKill = HexUtil.chat(this.plugin.getDeathMessagesYml().getString("Killed_By_" + entity.getType()));
normal talon
cinder flare
#

oh my god

#

please do what I just said

#

and don't capitalize the first letter of variable names

wind patio
#

The capitalization makes it twice as worse

normal talon
#

So replace all those lines

cinder flare
#

rename your strings to be Killed_By_<ENUM NAME>

#

then replace all of that switch and those definitions with that one line I just sent above

normal talon
#

yea I don't really know how to replace all those things

#

with that one line

#

it's per mob message

cinder flare
#

literally exactly what I juts said

#

you can use the name of the enum to determine which string and get it programatically

wind patio
#

Well you're in a quite a situation

normal talon
#

String ThornsKill = HexUtil.chat(this.plugin.getDeathMessagesyml().getString("Killed_By_<ENUM NAME>"));

cinder flare
#

all you're doing is arbitrarily mapping the enum name to a different name

normal talon
#

like that

cinder flare
#

uh no

half harness
#

or do ```java
getString("killed-by-" + mobType.getName().toLowerCase())

cinder flare
#

you would replace <ENUM NAME> with the enum name

wind patio
cinder flare
#

that is much easier and well worth it

half harness
#

find & replace ๐Ÿ˜Œ

cinder flare
#

saves you a hundred lines of code or such

#

and makes your code like 50x better

normal talon
wind patio
normal talon
#

this is the config

cinder flare
#

okay so see how you have a switch statement

#

and you are mapping to the values of entity.getType()

wind patio
cinder flare
#

like SPIDER

#

or ENDERMAN

#

just make the name of the config values like that

cinder flare
#

yeah that's better dkim

#

kebab case is where it's at

fervent tinsel
# normal talon

what the point of hard coding every mob type?
Just do like:
YourMessageManager#getKillMessage
Params: EntityType

half harness
ocean quartz
#

"killed-by-${type.name.lowercase()}" ๐Ÿ˜Œ

half harness
#

๐Ÿ˜Œ

wind patio
#

You can edit your config to be something like that:

killed-by:
    zombie: ...
    creeper: ...

    ...
fervent tinsel
#

and do like:

getString("kill-message." + mobType.getName());

half harness
#

lol u and max_wainer big brain

normal talon
#

too much information

cinder flare
fervent tinsel
#

ye

normal talon
#

and I don't understand it anymore

fervent tinsel
#

that's it

cinder flare
#

no point in that

#

the mapping is the issue

normal talon
#

String mobKill = HexUtil.chat(this.plugin.getDeathMessagesYml().getString("Killed_By_" + entity.getType()));
where do you put this

cinder flare
#

Instead of your massive switch statement

wind patio
normal talon
#

Cannot resolve method 'getDeathMessagesYml' in 'WonderChat'

cinder flare
#

though use like dkim's thing

#

isn't that the name of your stupid thing

ocean quartz
#

And I oop

cinder flare
#

i dunno i just glanced at it

half harness
#

Yml is yml

#

intellij should be giving a warning

normal talon
#

getDeathMessagesyml

half harness
#

unless you added Messagesyml as a word

cinder flare
#

so much for consistency yikes

rotund egret
normal talon
#
if (projectile.getType() == EntityType.SPLASH_POTION && tirador instanceof org.bukkit.entity.Witch && damageCause == EntityDamageEvent.DamageCause.MAGIC)/* Witch throws splash potion*/ {
                                    e.setDeathMessage(WitchKill.replace("%player_name%", player.getName()));
                                } else if (projectile.getType() == EntityType.ARROW && tirador instanceof Skeleton) {
                                    e.setDeathMessage(SkeletonBow.replace("%player_name%", player.getName()));
                                } else if (projectile.getType() == EntityType.FIREBALL && tirador.getType() == EntityType.GHAST)/* Ghost fireball*/ {
                                    e.setDeathMessage(GhastKill.replace("%player_name%", player.getName()));
                                } else if (projectile.getType() == EntityType.SMALL_FIREBALL && tirador.getType() == EntityType.BLAZE)/* Blaze Fireball*/ {
                                    e.setDeathMessage(BlazeBallKill.replace("%player_name%", player.getName()));
                                } else if (projectile.getType() == EntityType.WITHER_SKULL && tirador.getType() == EntityType.WITHER)/* Wither throws his head*/ {
                                    e.setDeathMessage(WitherKill.replace("%player_name%", player.getName()));
half harness
#

O

normal talon
#

what do I do about this ?

cinder flare
#

oh my god

#

i am gonna cry

normal talon
#

same

#

I have this now

wind patio
half harness
#

๐Ÿฅฒ

ocean quartz
cinder flare
cinder flare
#

not even constants

#

this isn't even object oriented programming

half harness
#

constants are LIKE_THIS

rotund egret
#

No.

cinder flare
#

this is basic use of a programming language to solve a talk programatically

half harness
#

well in c# constants are LikeThis ๐Ÿ˜Œ

ocean quartz
#

Lmao, do you want or learn or devolve, that's what plugin tutorials do to you

half harness
#

devolve?

wind patio
rotund egret
#

Constants are always written in the code, never as a variable.

half harness
#

i hate c# naming conventions so much

#

i got used to it though

normal talon
#

I don't understand anymore

half harness
#

i just hate it

cinder flare
#

man this guy could really benefit from pattern matching instanceof too

ocean quartz
cinder flare
#

someone just rewrite this guy's entire plugin

half harness
rotund egret
wind patio
ocean quartz
#

Yes

cinder flare
normal talon
#

so Should I remove all my strings or what

cinder flare
#

you already have the name of the entity

#

just use that to index your config strings

ocean quartz
#

No one likes C#'s conventions

half harness
ocean quartz
#

The ones that say they do, are liars

cinder flare
#

how is that somehow worse than allman

half harness
#

isn't that allman tho?

#

OH

ocean quartz
#

No

#

That's all fucked

half harness
#

xD

cinder flare
#

no allman is aligned with the beginning of the line

#

this is 2 spaces indented

half harness
#

LOL

#

i mean

#

it's recommended

cinder flare
#

jesus christ by who

half harness
#

๐Ÿคฃ

ocean quartz
#

Recommended by who?

normal talon
#
if (projectile.getType() == EntityType.ARROW) {
                                        e.setDeathMessage(PvPBow.replace("%player_name%", player.getName()).replace("%killer_name%", killer.getName()));```

What do I do about these things then ?
cinder flare
#

well you get back a single string

#

so you only need to do that once

half harness
cinder flare
#

GNU

#

WHAT

ocean quartz
#

Shot them dead

half harness
#

๐Ÿคฃ

#

๐Ÿ’€

normal talon
#

String arrowKill = blalalala.getString("Killed_By_Arrow"))'

cinder flare
#

well you wouldn't have a separate string for each kill anymore

#

you'd only have one and that would be whichever one you got from the config

ocean quartz
normal talon
#

please give me an example

#
} else if (projectile.getType() == EntityType.WITHER_SKULL && tirador.getType() == EntityType.WITHER)/* Wither throws his head*/ {
                                    e.setDeathMessage(mobKill.replace("%player_name%", player.getName()));
#

is this correct ?

cinder flare
#

so then you can just do like java e.setDeathMessage(mobKill.replace("%player_name%", player.getName()).replace("%killer_name%", killer.getName()));

ocean quartz
#

Oh shit webstorm is on 2021.2 ๐Ÿ˜ฎ

half harness
#

is the splash screen different?

#

iirc 2021.1 is the ugly one

ocean quartz
cinder flare
#

ooh

half harness
#

๐Ÿค”

onyx loom
#

thats nice

half harness
#

i still prefer the 2020 though ๐Ÿ˜”

ocean quartz
#

2019 best

cinder flare
#

it's certainly better than 2021.1

half harness
#

lol

half harness
ocean quartz
half harness
#

๐Ÿ˜ฎ

cinder flare
#

woah those were sick actually

wind patio
#

I like the modern one more

frail glade
#

So long ago ๐Ÿ˜ฆ

ocean quartz
#

IJ 2021.2 is very nice too

half harness
#

also are utimate and community ones different? iirc the 2020.latest were different - ultimate had some purple in it

normal talon
normal talon
#

This still doesn't prop out the message

wind patio
onyx loom
#

community

half harness
#

hmmmm

#

which one is better

cinder flare
#

definitely ultimate

onyx loom
#

ultimate, by a small margin

cinder flare
#

but i also hate 2021.1

onyx loom
#

both are ugly

half harness
#

lol

sturdy swan
#

What is up my fellow humans

wind patio
#

Pain

ocean quartz
#

Suffering

half harness
#

reminds me of that one person that keeps saying something like "What's up simps"

sturdy swan
#

good good

half harness
#

but instead of simps humans

#

๐Ÿค”

ocean quartz
#

Peaches would never call us simps

half harness
#

lol

ocean quartz
#

Beautiful

sturdy swan
#

daym

#

that does look hot

cinder flare
ocean quartz
#

@cinder flare THEY MADE IT UGLY AGAIN

cinder flare
#

WHAT

half harness
#

๐Ÿคฃ

#

๐Ÿคฃ

cinder flare
#

IT LOOKED SO GOOD BEFORE

wind patio
#

Vscode java devs where you at fingerguns

ocean quartz
#

IKR

sturdy swan
ocean quartz
frail glade
#

Is that still EAP?

ocean quartz
#

Yeah

half harness
#

matt do you have jetbrains rider installed

ocean quartz
#

Nay

half harness
#

oh

#

alr

wind patio
#

I tried java on vscode but it just doesn't feel good as IJ

ocean quartz
#

Well vscode isn't an IDE

cinder flare
#

so true tho

half harness
#

visual studio or rider?

cinder flare
#

wtf is that even a question

half harness
#

uh

#

yes

#

uh

cinder flare
#

the only people using visual studio are people that have microsoft's gun down their throat

half harness
#

O

#

so by "the only people" you mean everyone I see ๐Ÿฅฒ

cinder flare
#

i literally don't know a single person who uses normal visual studio

#

vsc is okay tho

half harness
#

"normal"?

#

oh

cinder flare
#

you do realize there's a difference between visual studio and visual studio code right

half harness
#

yes

wind patio
#

We were forced to use vstudio 2015 in our uni, a year ago when 19 was already out

ocean quartz
#

Rider is new

half harness
wind patio
#

C#

cinder flare
wind patio
#

Still used vscode at home though

cinder flare
#

oh vsc isn't bad at all

half harness
#

i was watching a unity beginner tutorial and they used an interesting theme:

cinder flare
#

for me, vsc just doesn't really have a place

half harness
#

embed didn't work โ˜น๏ธ

cinder flare
#

i'm either using all-out IntelliJ or similar, or I'm using vim/emacs

half harness
#

i guess discord didn't like me posting light mode version of vs

wind patio
cinder flare
ocean quartz
#

Rider was fully released in 2019/2020 iirc, ofc you won't have many using it

cinder flare
#

or like, vim/emacs lol

wind patio
#

Vim ๐Ÿ˜ฉ

#

How do I exit vim

half harness
#

so rider > vs?

wind patio
cinder flare
#

Shift + ZZ

cinder flare
half harness
#

๐Ÿ‘€ ok

ocean quartz
#

Dkim, what do you prefer IJ or VS?

half harness
#

I've never used VS before

cinder flare
#

keep it that way

half harness
#

soooooo

#

lol

ocean quartz
#

Then you have your answer

#

Rider is literally IJ for C#

cinder flare
#

^^^

onyx loom
#

visual studio = ๐Ÿ—‘๏ธ

wind patio
cinder flare
#

what the fuck

#

why do your teachers even care what you use

cinder flare
#

my uni doesn't give a crap

#

the prof uses notepad++ for pete sake

#

but you better believe I'm using CLion and IJ

wind patio
#

The only class we could use a normal IDE was data structures

#

Thats IJ

sturdy swan
#

only noob devs need an ide

#

profeshional devs dont make syntax errors

cinder flare
ocean quartz
#

We used Geany for C in school, what a nightmare

cinder flare
#

it's very bad to give noobies an IDE since it just does a million things for them and they don't actually learn anything

ocean quartz
#

And Netbeans for Java ๐Ÿคก

wind patio
#

Netbeans ๐Ÿ˜ฉ

cinder flare
#

that's why my intro to java class used notepad++ for most people, since they had never programmed before and they needed to suffer through dealing with exceptions and everything by looking at the javac output lol

cinder flare
#

if your IDE autocompletes everything for you, you won't understand what it's doing

sturdy swan
#

I mean ur wrong

#

but ok

wind patio
#

They told us to use netbeans for php, I couldn't bear it
Had to download phpstorm

cinder flare
# sturdy swan but ok

As someone who had to suffer through three into to java classes, I can definitely say I am not wrong

sturdy swan
#

I mean you are

ocean quartz
half harness
#

why did u take 3 intro to java classes

cinder flare
#

required courses in uni

half harness
#

oh

#

oof

cinder flare
sturdy swan
#

autocomplete doesnt mean u dont understand what its doing

cinder flare
#

it's way harder to figure out what you did wrong

wind patio
#

Compile-time langs without a error checking before compilation fingerguns

cinder flare
#

they definitely do not know what's going on

sturdy swan
#

obviously

cinder flare
#

And their IDE doing things for them does not help

half harness
quiet depot
#

back in my day i had to punch holes in cards and feed them into a machine, took 180 hours to run a hello world

ocean quartz
#

Lmao

half harness
#

xD

sturdy swan
normal talon
wind patio
#

Well, funny story
In my university back like 4 or 5 years ago, they had to write code on paper for C#

cinder flare
#

somebody rewrite this guy's code please

normal talon
#

UUhm I didn't know how to do your thing

sturdy swan
normal talon
#

and the message was still the default one

cinder flare
half harness
cinder flare
#

it's a problem when the test is literally about making those things yourself

sturdy swan
normal talon
#

hmm but those nature deaths don't popup anymore

half harness
#

BlueJ ftw ๐Ÿ˜Œ

wind patio
ocean quartz
sturdy swan
#

its amazing

half harness
cinder flare
ocean quartz
normal talon
#

I think so too

normal talon
cinder flare
quiet depot
#

youtube tutorials are what caused that code

cinder flare
#

exactly

#

so he can go back there and save my eyes from pain

wind patio
#

Not all of them are bad

quiet depot
#

no they're all bad

cinder flare
#

yeah i have yet to see a single good one

ocean quartz
#

Yo @prisma wave

cinder flare
#

ayyy I want more BM videos

wind patio
#

I mean, to learn the basics
But when it comes to refactoring and writing clean and readable code, then, I guess, not a place to learn

ocean quartz
#

Learning the basics wrong won't help you much

quiet depot
#

helpchatโ„ข๏ธ is the place to learn

wind patio
#

Where learnchat

half harness
#

helpchat just says ?learn-java ๐Ÿ˜”

quiet depot
#

yes

#

i thought i removed that

#

or did i remove something else

half harness
#

u removed the other thing

quiet depot
#

i removed a faq a while ago

ocean quartz
#

I think you removed asktoask

cinder flare
rotund egret
#

A what?

half harness
#

no isn't that just ?help?

normal talon
#

I know what variable is

ocean quartz
normal talon
#

but I dont understnad what to do with one freaking line

half harness
#

developer denโ„ข๏ธ ๐Ÿ˜Œ

cinder flare
#

i wasn't referring to you lmao

#

your problem is just a little higher-level than that

wind patio
#

Well, basically you're using 40 lines for a thing that requires 1 or 2

sturdy swan
#

^

normal talon
#

But I don't know how to fix that

wind patio
#

It was already answered

half harness
#

oh

wind patio
#

You dont need the switch there, you get the entity name or type from e.getEntity().getType() or smt, when you plop it into a variable to get the message you need from config

normal talon
#

okey then, step 1 is removing the switch

normal talon
#

String mobKill;

#

replace this with that

cinder flare
#

with that line he just replied to

normal talon
#

yea

#

then remove all those strings

#

Now I have this

#

but then this thing won't get Killed_By_ZombieVillager

#

because it isn't Zombie_Villager ?

wind patio
#

Well, you can edit the returned value

normal talon
#

but aren't all those mob types

#

Uppercases

#

like ZOMBIE or VILLAGER

wind patio
#

entity.getType().name() or .toString() . replace ("_", "")

#

Edit your config so it's all lowercase

#

Or do what I said earlier

normal talon
#
String mobKill = HexUtil.chat(this.plugin.getDeathMessagesyml().getString("Killed_By_" + entity.getType().name()));
                e.setDeathMessage(mobKill.replace("%player_name%", player.getName()));
wind patio
#

killed-by:
zombie: ...
creeper: ...

normal talon
#

is that like

#

"Killed-by.zombie"

wind patio
#

Yes

#

You would need to change your getString as well then

#

Do as you wish, but I'm just giving you a simpler way to do it

half harness
wind patio
#

If it returns capital letters, you can do tolowercase or smt

half harness
#

then it'd be Killed_By_zombie ๐Ÿ™ƒ

wind patio
#

As I said, he would need to change the config for that

#

Just giving him options

normal talon
#

okay now I tried that ZOMBIE thing

#

But the message didnt pop up

wind patio
#

Because your config doesn't match the string

#

Most likely

#

Well, if I'll have the energy, I'll be back on my computer in abt 4 or 5 hours

#

DM me if you will still need help

normal talon
#

I would like some help

#

If I don't figure this out

prisma wave
normal talon
#

so I changed all those mobs to upper cases

#

Can I do the same with the natural deaths like lava etc

cinder flare
#

yes

#

getting a message from that config should be a single line

#

no matter which cause

normal talon
#
Killed_By_WITCH: '&e%player_name% &fHas been killed by &eWitch'
Killed_By_WITHER: '&e%player_name% &fHas been killed by &eWither'
Killed_By_WITHER_SKELETON: '&e%player_name% &fHas been killed by &eWither'
Killed_By_WOLF: '&e%player_name% &fHas been killed by &eWolf'
Killed_By_ZOGLIN: '&e%player_name% &fHas been killed by &eZoglin'
Killed_By_ZOMBIE: '&e%player_name% &fHas been killed by &eZombie'
Killed_By_ZOMBIE_VILLAGER: '&e%player_name% &fHas been killed by &eZombie Villager'
#

this should work ?

#
String natureKill = HexUtil.chat(this.plugin.getDeathMessagesyml().getString("Killed_By_" + damageCause));
                e.setDeathMessage(natureKill.replace("%player_name%", player.getName()));
#

or this

wind patio
#

Well, you should first know what "damageCause" is

normal talon
#

it's LAVA etcc

wind patio
#

Then if you have
Killed_By_LAVA in the config

#

It should work

normal talon
#

it didn't

#

I don't know why

wind patio
#

Time to learn about debugging

normal talon
#
if (damageCause == EntityDamageEvent.DamageCause.ENTITY_ATTACK) {
                    String mobKill = HexUtil.chat(this.plugin.getDeathMessagesyml().getString("Killed_By_" + entity.getType().name()));
                    e.setDeathMessage(mobKill.replace("%player_name%", player.getName()));
#

yea that fixed that issue

prisma wave
#

storing UUIDs is like the most annoying thing every

#

500 Bukkit.getPlayer() != null checks

#

but

#

no alternative

steel heart
#

weak identity concurrent hash map (;

prisma wave
#

๐Ÿฅด

steel heart
#

No why isnโ€™t that in the std

#

Bad java

distant sun
#

Cute dog, conclure <3

cinder flare
steel heart
#

ty Gaby :3

#

Yeah new MapMaker().weakKeys().concurrency(4) but like verbose as hell

prisma wave
#

stop

#

ooh

steel heart
prisma wave
#

you should use Idris

#

you can make types with functions

#

crazy

steel heart
forest pecan
#

Do you guys think itโ€™s okay to abstract certain elements in an API into your API so the user doesnโ€™t have to directly use the hidden API and use yours

#

In other words, create an interface for existing API that is being used in your API and then allow the behavior of whatever class is implementing that interface to be similar to the api class whatever you are using

#

Idk if you guys understood that lol

prisma wave
#

sure

cinder flare
#

Encapsulation and layers of abstraction

forest pecan
#

True

prisma wave
#

mhm

cinder flare
#

if you make something significantly easier to use, I would say that is definitely worth abstracting

old wyvern
#

Yes

#

Use the functional abstraction

#

Move to haskell

distant sun
#

yugi had to ruin it

old wyvern
#

๐Ÿ˜Œ

steel heart
#

public

old wyvern
#

@prisma wave btw bm can you get the wiki thing to parse the url encodings properly?

#

Like for space = %20 and < = %30 (i think)

prisma wave
#

okay lmao

#

why?

old wyvern
#

I was using it to see if embeds could be exploited in a few places ๐Ÿฅฒ

prisma wave
#

๐Ÿ‘€

old wyvern
#

No, not for anything bad

#

dw

normal talon
#

Uuhm people, i was learning java via solo learn but that doesn't really help me with mc coding

#

Any other tips

old wyvern
#

How does it not help you?

#

you need the basics one way or the other

normal talon
#

Dunoo

steel heart
#

Did you take the entire Java course on SoloLearn?

distant sun
#

Yes

old wyvern
#

Yes

half harness
distant sun
#

Who wants to document my code? ๐Ÿ˜

old wyvern
#

pay me

steel heart
#

Review what you learned?

#

Wym

#

Also itโ€™s kinda your own responsibility to repeat what youโ€™ve just learned to put it in the long term memory

#

A course canโ€™t do that for you

old wyvern
#

I recommend pluralsight if you wanna give it a try, but you would only get a 1 month trial

distant sun
#

Question, are github packages shit compatible with kotlin?

old wyvern
#

Yea why not

turbid burrow
#

it uses maven

#

so yes

#

i think

distant sun
#

Alright

old wyvern
#

Its kinda shit tho

turbid burrow
#

i use it and it works fine

old wyvern
#

You need to authenticate to use any libraries

distant sun
#

Last time I tried to setup a package it wasnt accepting the javadocs

frail glade
#

You also have to auth for it, don't you?

old wyvern
#

yea

distant sun
#

F

frail glade
#

Yeah that's what I thought.

old wyvern
#

You got the oracle instance right gab?

#

just host one

distant sun
#

Yeah ik

#

Lets first learn how to use dokka :))

old wyvern
#

๐Ÿฅฒ

distant sun
#

Man I dislike the format of gradle and kt docs

old wyvern
#

Give the gradle plugin docs a try

#

Theres barely 1 page

distant sun
#

:))

old wyvern
#

You will need to ask on the slack for pretty much anything more than declaring extensions or something

ocean quartz
distant sun
#

How docs are structured, gradle in special

old wyvern
#

I think he means like the layout of the page

#

compared to javadocs

ocean quartz
#

Oh

distant sun
#

Actually I think that kotlin docs might be fine

#

But gradle ๐Ÿคข

ocean quartz
#

I love kdocs though, I hate that Java requires param, return, etc

old wyvern
#

I mean make fun of the groovy dsl, but kotlin dsl is so broken for me rn

distant sun
#

Do we have an answer about why is the groovy integration si poorly done?

old wyvern
#

Everything compiles, but the ide shows errors every fucking where

distant sun
#

Sounds like gradle

ocean quartz
#

Cuz jetbrains makes the kts version so they can't let groovy be good kek

distant sun
#

Fuck that lol

half harness
#

ยฏ_(ใƒ„)_/ยฏ