#general

3141 messages · Page 71 of 4

austere ivy
#

public static String formatString(MessageType type, String category, String configkey, String... formats)
and
public static String formatString(MessageType type, String configkey, String... formats)

#

oh

#

just no overloading?

pulsar wigeon
#

where format just calls formatWithPrefix(configKey, "defaultPrefix", args...)

#

which is essentially overloading

#

but with good method names

austere ivy
#

I thought about that

pulsar wigeon
#

instead of shitty ones

#

well if you thought about it do it

fringe quartz
#

Sometimes it helps to think backwards

pulsar wigeon
#

why do you always think of the things we suggest

#

but then show us shitty code

fringe quartz
#

think about how you want to write the END COMMAND

#

like what wiz posted

#

then make your code make that work

austere ivy
#

huh that's a good idea

#

wait but that brings me back to tthe thing, I also want to have

#

multiline

pulsar wigeon
#

so make a method when you need that

#

stop coming up with excuses

#

and just do the things we tell you

austere ivy
#

uh

#

but with it split up into other methods

worn ember
#

if only java had string interpolation

#

¯_(ツ)_/¯

pulsar wigeon
#

that's really not an issue here

austere ivy
#

and wiz

worn ember
#

it'd still be nice

austere ivy
#

player.sendMessage(Misc.format(configKey, args...))
player.sendMessage(Misc.formatWithPrefix(configKey, "customPrefix", args...))

#

this thing that you gave me

#

so essentially I want it to read my mind, cause I want Misc.format("you_died", player.getName()) to give me no prefix and Misc.format("msg_prefix", "rules") to give me msg_prefix as prefix lol

pulsar wigeon
#

I want it to read my mind
please abandon this project and go back to school

fringe quartz
#

You know what you want, and you know how to do it; you're just stuck

#

Ignore wiz, cause he's a mad lad

#

Take a break from whatever you're doing for a bit and come back to it

pulsar wigeon
#

not sure how this fits being a madlad

#

but i assure you i'm speaking rationally and not emotionally

austere ivy
#

rationally ≠ jerk

fringe quartz
#

abandon this project and go back to school

#

That's not helpful

#

nor rational

pulsar wigeon
#

it is a perfectly rational response to someone saying that code should read their mind

austere ivy
#

that was a joke

#

to how silly this entire thing is

pulsar wigeon
#

i understand that

#

and it changes nothing about what i just said

stiff yarrow
#

@austere ivy you can do this with just signature overloading

pulsar wigeon
#

not the way he just described

austere ivy
#

I tried that, nossr. Thing is because I wanted it to be able to have unlimited formats I use String... formats

#

So it gets confused and doesn't compile.

pulsar wigeon
#

both of those methods called #format(String,String)

#

those are the same signature

stiff yarrow
#

I don't even know what you mean

#

you need different signatures to do the overloading I meant

pulsar wigeon
#
Misc.format("you_died", player.getName()) # to give me no prefix and Misc.format("msg_prefix", "rules")
austere ivy
#

(String configKey, String msgKey, String... formats) and (String msgKey, String... formats)

#

If you notice, if you put "configKey" and "msgKey" and "format" as the arguments, then..

#

it could call either one.

#

they're all strings.

pulsar wigeon
#

and yes i already told him to make different names

#

he doesn't seem to understand

#

so whatever

austere ivy
#

that's what I'm doing right now, wizjany

#

but with different methods.

#

I mean I'll try it, that's what I'm doing right now.

stiff yarrow
#

I am a bit confused about what you are doing right now tbh

#

your code is confusing me and I didn't understand your descriptions

#

I'm not sure what thing you are stuck on at the moment

woven otter
#

is it reasonable to add 20% of plugin price for long term support

stiff yarrow
#

define long term support

woven otter
#

6 months - 1 year? not sure if it would count as long term support

stiff yarrow
#

jesus

#

how much are you getting paid

#

that doesn't seem worth it

#

to me long support would be like 2 weeks

#

then they pay me again after that

woven otter
#

well honestly haven't told any prices yet
Pretty much it's a big plugin and I estimated my prices and amount it will take and in the end it was 45 hours at 4.5$/h

stiff yarrow
#

don't take that fucking job

#

jesus

#

ABORT

unreal quarry
#

You're cheap

stiff yarrow
#

ABORT

#

ABORT

#

you're literally working child slave labour wages and offering a year of support

#

🤢

austere ivy
#

I'm writing an essay

#

lol

woven otter
#

I rather not think about my current commission. I think I currently average at 0.75$/h 😄

stiff yarrow
#

what the fuck

vestal jasper
#

HMMMMM

unreal quarry
#

Want to come work for me? I'll double your current wage lmao

vestal jasper
stiff yarrow
#

why the fuck are you working for pennies bro

#

what the fuck

woven otter
#

well not anymore fuck that

unreal quarry
#

Fun fact: I don't work for less than $20/hr

stiff yarrow
#

don't even lift a finger for below 20/hr

unreal quarry
#

And I'm cheap af

stiff yarrow
#

yeah 20/hr is basically the lowest price any freelance dev should work for

austere ivy
#

@stiff yarrow okay,

#

I want to send messages to players like any plugin would.
player.sendMessage("Hello there!");

#

But hardcoding each message in is a pain and I like separating logic and text, so I put that in the config.
player.sendMessage(main.getConfig().getString("msg_hello"));

woven otter
#

clearly I have to think about my prices 😄

austere ivy
#

Another thing is, I also like adding formats, so in the config I can put msg_hello: "Hello, %s!" and then it puts in the playername there.
player.sendMessage(String.format(main.getConfig().getString("msg_hello"), player.getName()));

#

Another important thing is, is color. I don't want to have to put ChatColor.RED + "Hello, " + ChatColor.BLUE + "%s" + ChatColor.WHITE + "!", rather, I want to put "&cHello, &9%s&f!"
player.sendMessage(ChatColor.translateAlternateColorCodes('&', String.format(main.getConfig().getString("msg_hello"), player.getName()));

#

(as you can see this is where it starts getting messy for such a seemingly simple task)

#

I then realized ChatColor.translateAlternateColorCodes was a giant thing, and it would always use &, so I just put that in a tiny method:

public static String colorString(String string) {
        return string == null ? null : ChatColor.translateAlternateColorCodes('&', string);
    }

Now it's shortened to:
player.sendMessage(colorString(String.format(main.getConfig().getString("msg_hello"), player.getName()));

unreal quarry
#

If it takes you 5 hours to do what most can do in 1 hour, then sure $4/hr is fine.. but damn, get it together soon

austere ivy
#

But, my server has a nice style guide so all the messages look nice and consistent. This means every message has a prefix.
player.sendMessage(colorString(main.getConfig().getString("prefix") + " " + String.format(main.getConfig().getString("msg_hello"), player.getName()));

#

I realized, hey, this is getting pretty tiring for every single message. I can put this in a method!
player.sendMessage(formatString("msg_hello", player.getName()));

public static String formatString(String configKey, String... formats) {
    return colorString(main.getConfig().getString("prefix") + " " + String.format(main.getConfig().getString(configKey), formats));
}
#

That worked well for a while.

unreal quarry
stiff yarrow
#

@unreal quarry even if thats true still charge 20 hr LUL

austere ivy
#

I don't think such an official channel would want it, you sure Billy?

unreal quarry
#

You're talking code. That's where code goes

austere ivy
#

alright nossr take on over to paper-dev pls

stiff yarrow
#

mtm have you told the guy commissioning you that you're gonna work for slave wages yet

#

if you haven't then tell him 20/hr

#

otherwise abort

woven otter
#

I haven't told him anything yet

stiff yarrow
#

tell him 20/hr and don't take less

#

also DO NOT signup for a year of fucking support

#

charge for support

#

like a normal person

unreal quarry
#

$100/call + $20/hr after that for support

#

Fun fact: Geek Squad charges $399/hr to work on stuff. I do it for $99/hr and stole a lot of their business ^_^

woven otter
#

Lol now that I think about it it's not actually 4.5$/h because those are features themselves not including testing and what not

stiff yarrow
#

you are literally getting outearned by sweatshop kids

unreal quarry
#

Like, spending 2 minutes to hook up someone's xbox to WiFi. Me, $99. GS $400.

stiff yarrow
#

didn't know GS was fucking people that hard

unreal quarry
#

It's insane

#

I applied to work there, said I was 1) over qualified and 2) bad credit so best buy won't hire me

woven otter
#

400$/h holy fuck

#

that's actually insane

unreal quarry
#

People pay it

stiff yarrow
#

mtm I need to know how much you sell your soul for keep me updated

unreal quarry
#

I once started doing home networks, too. $100/hr + parts. Was great 15 years ago, but these days everyone and their dog knows how to setup a home network lol

austere ivy
#

help me

woven otter
#

@stiff yarrow pretty much calculate how much an average worn-out soul is worth in hours and multiply it by 4.5$/h 😄

austere ivy
#

nevrmind I think I got it.

stiff yarrow
#

idk why you ever set your prices to personal hell levels

austere ivy
#

Would you guys ever..

#

Rather than working and stuff for say, 50/hour

unreal quarry
#

@woven otter you should apply at Mineplex. Their starting wage is $30-35/hr for junior plugin devs

austere ivy
#

you get 1000 hours deducted from your life and you get 50,000$ instantly?

#

So basically think of work as just deducting time from your life, and would you rather have to work that time or would you just trade time off from your life for the money you'd get for it either way?

cosmic raft
#

@austere ivy no, I'd rather work the 1000 hours

austere ivy
#

I would too.

cosmic raft
#

because you don't know what could have happened during them

austere ivy
#

I think you should always enjoy your life.

#

You have a very limited supply of it so..

#

try to find happiness wherever you are..

cosmic raft
#

says you

austere ivy
#

that's my opinion anyway lol

cosmic raft
#

I have 9 lives

unreal quarry
#

Without work you'll go crazy. Trust me.

woven otter
austere ivy
#

at least 10 million, mtm

unreal quarry
#

That's why old ppl work at Walmart as door greeters. They go insane just sitting at home

cosmic raft
#

even billionaires are "working" - see bill gates and melinda gates

#

all the work they do

austere ivy
#

No actually let me see how it is, MTM

cosmic raft
#

@unreal quarry yup. Quite a few old people working at my local Walmart, not just as greeters - quite a few work on other easy tasks, such as taking returned merchandise back to shelves, etc

native thunder
#

Can you lend me one of those lives kashike?

cosmic raft
#

no

#

get your own

native thunder
#

Don't be so stingy

#

You have 9

deep shoal
#

so if I want to stop item merging I just need to spawn an Item with lore

fringe quartz
#

he's on 9/9

austere ivy
#

rip

#

can we have an F in chat for our boy kash

#

F

#

(or girl???)

limber knotBOT
#

@deep shoal you could also just set some other nbt value, maybe even the pickup delay

fringe quartz
#

or just cancel item merge event

cosmic raft
#

what gender do you think I am @austere ivy

austere ivy
#

cat

fringe quartz
#

anime boy

unreal quarry
#

You could also just cancel the item merge event...

#

;)

native thunder
#

He duh

deep shoal
#

@fringe quartz server might not necessarily be having item merge

#

oh

#

oh wait

austere ivy
#

Probably boy, Kash.

fringe quartz
#

o.O

deep shoal
#

hmm

austere ivy
#

tunasub

deep shoal
#

does craftbukkit have item merge

#

or just spigot

fringe quartz
#

just spigot

#

and paper

austere ivy
#

who uses bukkit

#

just

#

don't support bukkit servers

cosmic raft
#

me

#

and many others

austere ivy
#

I don't think literally you can find anyone who uses actual bukkit.

unreal quarry
#

Don't worry about cb. No one Important uses that junk

cosmic raft
#

15% of WorldEdit users use CraftBukkit

austere ivy
#

hold up

#

you, as a paper dev, don't use Paper?

cosmic raft
#

correct

austere ivy
#

kash, also, that's biased too

#

what version?

#

wait hold on, why Kash?

cosmic raft
#

I don't like the gameplay changes that have been done in favour of performance

#

(Spigot mainly)

austere ivy
#

yeah that bothers me.

#

a lot.

#

servers are supposed to handle stuff, not change stuff.

stiff yarrow
#

@woven otter price will never be based on quality of code, just whether or not it works, complexity, time involved

fringe quartz
#

servers can do whatever they want

cosmic raft
#

ah going through my imgur library

#

found a particle Spongie

austere ivy
#

don't mess with my cactus farm >:(

#

Kash, you're a boy, right?

cosmic raft
#

maybe

stiff yarrow
#

my fetish pog

woven otter
#

fair enough

stiff yarrow
#

I have had limited exposure to Sponge but it seems better than Bukkit, I'd probably just use that

cosmic raft
#

accept friend request @austere ivy

austere ivy
#

why thonk

stiff yarrow
#

sliding into Brians DMs peepoGiga

cosmic raft
#

ah memories

austere ivy
#

My eyes have been opened.

#

i have seen da trueth

stiff yarrow
#

did kashike dm you some kittens

rugged tulip
native thunder
#

Ah the good 'ol kashike selfies

rugged tulip
#

Hey everyone!

austere ivy
#

selfies

#

with kittens?

#

so, yes

pulsar wigeon
#

6:17 PM] kashike: 15% of WorldEdit users use CraftBukkit based on what

limber knotBOT
#

Me4502

pulsar wigeon
#

bstats doesn't agree

#

that said bstats is only in 7.x

austere ivy
#

who would use craftbukkit in 1.13 anyway

#

is that

#

eh

pulsar wigeon
#

we already went over this

austere ivy
#

is that like a thing?

#

yeah but is craftbukkit in 1.13 a thing?

pulsar wigeon
#

...

austere ivy
#

seems like they'd have to rewrite it for 1.13

#

or change a lot of how it works under the hood.

pulsar wigeon
#

no, it's not a thing, we're literally just making this all up to play a prank on you

rugged tulip
#

Hey, could someone tell me... how fast is paper compared to spigot?

acoustic pilot
#

wow it's not like spigot is built on top of craftbukkit and depends on it

stiff yarrow
#

mcMMO doesn't even support CB and 6% of servers are using it on bstats

austere ivy
#

oh.. yeah

pulsar wigeon
#

also did bstats break at some point

#

huge number of "failed to parse" MC versions

austere ivy
stiff yarrow
#

I think those are just custom servers

pulsar wigeon
#

like what

stiff yarrow
#

1.8 special snowflake shit bought on mcm

#

if I had to guess

acoustic pilot
#

WorldEdit is used everywhere so it's not surprising that a lot of custom servers are popping up on bStats

#

You'd be surprised how many private forks exist

pulsar wigeon
#

why would they change whatever bstats uses to get the MC version

stiff yarrow
#

they do

#

there's one called like tacospigot or something

pulsar wigeon
#

that's nonexistant these days and

#

still reports version properly

acoustic pilot
#

TacoSpigot isn't non-existent

#

Countless private forks are based on it

pulsar wigeon
stiff yarrow
#

yeah bstats is not accurately counting tacospigot if I had to guess

austere ivy
#

Taco?

#

How is TACO 0.2%

acoustic pilot
#

Private forks are often built on Taco

austere ivy
#

Kash is there a secret fork of paper that we don't know about

#

I've never heard of this before.

upper flicker
#

There are many secret forks you don’t know about

austere ivy
#

Wait hold on

pulsar wigeon
acoustic pilot
#

Any server with more than 50-70 players is going to be on a secret fork

pulsar wigeon
#

you can literally build your own fork

acoustic pilot
#

Generally speaking

pulsar wigeon
#

well, not you because you're probably too stupid

#

but in general, one can build their own fork quite easily

austere ivy
#

thanks wiz

#

I do have my own fork

#

fyi

pulsar wigeon
#

so why are you so fucking surprised that other people do too?

stiff yarrow
#

if you play 1.8 its basically a requirement to use custom shit

austere ivy
#

I didn't expect other people to be as smart as I am

acoustic pilot
#

For sure anyone using 1.8 is using a private fork

pulsar wigeon
#

i mean, there's a lot of retarded people in the world

austere ivy
#

lol jk no I'm kidding you

#

no I just didn't expect that people would make another fork on top of a fork on top of a fork

#

seems like a lot of forks

#

and then that fork of a fork of a fork of a fork for their own server.

pulsar wigeon
#

oh hold up

#

bstats just calls Bukkit.getVersion() and then parses it server side

#

ok

acoustic pilot
#

I think that returns unknown or some variation of it on a lot of forks

austere ivy
#

why would a server with more than 50-70 be on a secret fork?

#

what kind of benefits would there be anyway?

acoustic pilot
#

Secret performance patches, usually

#

Nobody wants to contribute their fixes upstream

#

They're trade secrets

austere ivy
#

why not pr to paper itself

#

:(

pulsar wigeon
#

or because they're dumb/bad code

austere ivy
#

that too.

acoustic pilot
#

Or a combination of both

austere ivy
#

sometimes hackier code is better performance for your specific use case?

acoustic pilot
#

Our network's Spigot can probably hold 400-500 players

#

Can't do that with Paper

#

(1.8)

austere ivy
#

Why not?

acoustic pilot
#

Paper would shit itself with that kind of player count

#

Yet, there are plenty of networks that can support it

austere ivy
#

What about Spigot?

acoustic pilot
#

They simply don't contribute those patches upstream.

#

Paper is a high performance fork of Spigot, tf do you think?

#

Use your brain.

austere ivy
#

Yeah, you just said our network's Spigot.

#

Do you fork Spigot over forking Paper?

acoustic pilot
#

Nope, it's forked off of TacoSpigot, if I remember.

austere ivy
#

TacoSpigot is forked off Paper

acoustic pilot
#

Off of PaperSpigot, as it was called back then

limber knotBOT
#

@acoustic pilot [Auto] We're now known as Paper.

austere ivy
#

LOL

#

Thanks Korobi

#

Yeah what a shame they won't share that with us. What kind of performance updates can you do anyway, to Paper? I haven't even peeked at the code that runs paper so I wouldn't really know.

acoustic pilot
#

I'm bound to secrecy, it's part of the job.

austere ivy
#

What a shame.

#

I'm gonna guess edawg was just running off Paper lol.

acoustic pilot
#

Like I said, they're trade secrets.

#

The knowledge doesn't come easily or cheaply.

austere ivy
#

That server had 500-1000 players at all times.

#

TPS was like 9.

#

Constantly.

acoustic pilot
#

Edawg made no strong effort to optimize

austere ivy
#

They then split it up into separate servers, they have like 30 players now.

acoustic pilot
#

The avg TPS on edawg with 500 players was 3-5 TPS

#

We can that with 20 TPS

stiff yarrow
#

I thought you got out of the server game byte

acoustic pilot
#

I don't run a server, I work for a server.

austere ivy
#

hey wait a minute Electronicboy commited something to TacoSpigot

acoustic pilot
#

I got out of the business of running a server.

#

Now I just do grunt development work

austere ivy
#

You guys are just all over the place, aren't you.

pulsar wigeon
#

🤦

austere ivy
#

What a small world.

#

No it's weird I'm on a random server forum and I see some of your guys' names and it's odd.

stiff yarrow
#

if you know of any sweet server dev jobs leme know byte

austere ivy
#

would you consider it if I paid you 200/hour to develop, Nossr?

acoustic pilot
#

our team's full atm but if there's ever an opening I'll toss your name in the ring lol

austere ivy
#

how is 200/hour anyway?

pulsar wigeon
#

have you looked

stiff yarrow
#

my magnum opus

pulsar wigeon
#

it's a whole 10 lines of functioning code, it's not too hard to figure out

austere ivy
#

it's wonderful

stiff yarrow
#

when you write a plugin in 2 minutes because md5 has a silly policy

#

you get that

austere ivy
#

wait but

#

./gamerule weatherCycle false

pulsar wigeon
#

what policy lol

austere ivy
#

./gamerule doWeatherCycle false

stiff yarrow
#

80 posts, 20 likes, 3 free resources, 8 week old account

pulsar wigeon
#

for what lol

stiff yarrow
#

🤑

austere ivy
#

but why not just

pulsar wigeon
#

oic

austere ivy
#

OH LOL

#

That's brilliant, 3 free resources, very good very nice

stiff yarrow
#

he didn't say they had to be good resources

austere ivy
#

hold up a momnt here nossr

stiff yarrow
austere ivy
finite wave
austere ivy
#

what is that

stiff yarrow
#

useless code

austere ivy
#
oH NO NOT
{
    this;
}
#

NO

stiff yarrow
#

?

#

what are you even complaining about

austere ivy
#

I do not like that code style xD

stiff yarrow
#

like what

pulsar wigeon
#

brace style

stiff yarrow
#

oh

#

that's a habit I have when writing Java

austere ivy
#
public static void main(String[] args)
{

}
pulsar wigeon
#

K&R style

golden gust
#

Literally the worse

acoustic pilot
#

hang him

pulsar wigeon
#

gets me all the time since i do c# full time these days

austere ivy
#

I dislike it a lot, it infuriates me everytime I read something from geekstogeeks.com

pulsar wigeon
#

checkstyle always yells at me

austere ivy
#

it's horrible wizjany

#

java should ban it

#

I would instantly update to Java 13 if it just disabled that style

pulsar wigeon
#

i mean, java should ban you

acoustic pilot
#

Brian your existence is more offensive than his braces

pulsar wigeon
#

but that's not an option

stiff yarrow
#

its just something my brain does in Java idk how to stop

austere ivy
#

made it un-compilable

pulsar wigeon
#

unfortunately

austere ivy
#

java should ban a lot of people /shrug

pulsar wigeon
#

until you learn how to write code at a kindergarten level, don't rag on other people's braces

stiff yarrow
#

correct spelling of kindergarten PogU

pulsar wigeon
#

how tf else would i spell it

#

i'm half german

acoustic pilot
#

some would spell it as garden

#

lol

stiff yarrow
#

guess it'd be hard to mess up then

pulsar wigeon
#

can't get me with that

austere ivy
#

what

#

wiz I dropped out of kindergarten because people were bullying me don't bully me here ;-;

acoustic pilot
#

can't get bullied if you're not in the server

void void
#

at least its not md_5 style

tropic flame
#

1TBS best brace style ever

austere ivy
#

Howdy.

#

How's that?

woven otter
#

allman best style. looks at forge

stiff yarrow
#

remove case none

#

stop one lining your case statements

tropic flame
#

Lmao I dislike Allman's style as well especially when I'm looking at code from like, github wikis and README.md's @austere ivy

void void
limber knotBOT
stiff yarrow
#

what the hell is allman

tropic flame
#

The style Brian Hayes

#

*hates

austere ivy
tropic flame
#

(wtf "Brian Hayes")

stiff yarrow
#

better

austere ivy
#

Nossr, how would I officially get it to do none?

stiff yarrow
#

but your code is still confusing

#

is none different to your default statement?

austere ivy
#

Sometimes I don't want a prefix, I just want it to format and color code for me.

tropic flame
#

As far as I know this style is called Allman

public static void main(String[] args)
{

}```
austere ivy
#

No, I guess, but how would I get there?

stiff yarrow
#

then you need to add case none back in

unreal quarry
#

Eww @tropic flame get it away!

austere ivy
#

._.

#

srius

stiff yarrow
#

I told you to remove it because it just did fall through to default

tropic flame
#

@unreal quarry nossr asked for it I'm sorry

stiff yarrow
#

which is redundant

tropic flame
#

I personally prefer 1TBS 🤷

austere ivy
#

Nossr, sometimes I need to use NONE.

void void
#

are fall throughs allowed in java?

stiff yarrow
#

then you need to add it back

austere ivy
#

Fall throughs are allowed.

stiff yarrow
#

fall through doesn't work if you return

austere ivy
#

Nossr is there a way that you could syntactically correct while going straight to default?

void void
#

what language doesnt allow them

austere ivy
#

if I do Type.NONE and NONE isn't officially in the enum, it won't work.

#

Similarly, if I don't have DEFAULT: it might have an error.

woven otter
austere ivy
#

well

#

if there's ever somehow an error and it gets to default it just won't add a prefix

#

better than everything dying

#

other than return colorString("&" + config.getString(category + "_color") + "&l> " + formattedString); I feel like everything is okay.

#

oh wait I can just

#

How's that?

#

I can just put &c instead of just "c" and it'll make more sense in the config anyway

stiff yarrow
#

@austere ivy why have a type none if its just doing what default does

austere ivy
#

because I can't order an ENUM to be anything other than what it's specified as

#

oh

#

you're saying keep NONE in the enum

#

but just don't have it as a case?

#

in the switch statement?

stiff yarrow
#

if you want

#

but I also don't understand why type NONE exists

austere ivy
#

well I could:

#

but that's redundant

stiff yarrow
#

okay I dyslexia'd that

#

why does default exist

austere ivy
#

NONE is because sometimes I want it to handle formatting and color for me.

stiff yarrow
#

in the form it is in

austere ivy
#

I guess default would never really be able to get reached.

stiff yarrow
#

just do default return null

#

shuts the IDE up ez

austere ivy
#

I was doing that before

#

nossr

#

but if something somehow goes wrong and a wrong type gets in there

#

the messages will be appearing as "null"

#

which is very non-helpful to debugging

stiff yarrow
#

how does a wrong type ever get there

#

you're using ENUMs right

austere ivy
#

yeah

#

so why do I need default in the first place

stiff yarrow
#

because you have to return

#

and a switch statement is conditional

#

you could replace case none with default

#

its the same thing

#

if you have cases for the other enums

austere ivy
#

so like I said before

stiff yarrow
#

which is why I told you to remove none originally

austere ivy
#

you're saying keep NONE in the enum

#

but don't have it in the case?

stiff yarrow
#

well you made it sound like NONE was going to do something different

#

I misunderstood you

austere ivy
#

it.. does.

stiff yarrow
#

its different than what default does?

austere ivy
#

yes?

#

oh okay

#

I guess not

stiff yarrow
#

then remove it

austere ivy
#

default just falls BACK to none

#

MULTI, PREFIX, and NONE are all unique.

stiff yarrow
#

I mean you could have it there it just looks UGLY af to me

#

either remove default or remove none

#

err

austere ivy
#

Okay, so MULTI, PREFIX, and NONE, are all unique. They do something different.

stiff yarrow
#

when I say remove default I mean make it return null

austere ivy
#

I can technically

#

and you said make it return null

#

I say to that, if somehow SOMEHOW an incorrect type gets in there, I would rather it just default to NONE rather than doing a silly thing and making me debug trying to find out why it's returning null.

stiff yarrow
#
            case PREFIX:
                return colorString(config.getString(category + "_prefix") + " " + formattedString);
            case MULTI:
                return colorString(config.getString(category + "_color") + "&l> " + formattedString);
            case NONE:
        return colorString(formattedString);
            default:
        return null; // your ide shuts the fuck up
                ```
austere ivy
#

your argument is "an incorrect type will never get in there"

#

hold up

#

my ide isn't complaining in the first place

stiff yarrow
#

its not complaining because you have fall through

austere ivy
#

oh it is

#

lol

stiff yarrow
#

anyways this is mostly a style thing

austere ivy
#

it 100% is

#

alright

stiff yarrow
#

I would not put your code under default if its only for NONE

#

default is just return null to make it stfu

austere ivy
#
            case NONE:
                return colorString(formattedString);
            default:
                return null;
        }
#

is bad

stiff yarrow
#

yes this is better because if you add more ENUMs then your default returns null like a good boi

austere ivy
#

because in my head, IF something something goes wrong

#

it returns null

#

which breaks literally everything

stiff yarrow
#

its impossible

#

you're using a switch case on an enum

austere ivy
#

hmm

#

what about this

stiff yarrow
#

you have only 3 enums variants of whatever the fuck type you made it

#

the only thing going wrong is you adding a new enum and not adding to that switch

#

btw if you want you can have default throw a custom exception too

austere ivy
#

eh ok

stiff yarrow
#

throw new YouDoneFuckedUpException();

austere ivy
#

how is this

stiff yarrow
#

do not name your enum Type

austere ivy
#

that's what I was gonna say

#

but you know what's infuriating?

#

every single time I do player.sendMessage I have to type out

#

MessageType.NONE

#

EVERY SINGLE TIME

stiff yarrow
#

change your IDE then

#

you dumbo

austere ivy
#

I wish you could just have inferred enums based on the signature

#

is intellij bad?

stiff yarrow
#

you can

austere ivy
stiff yarrow
#

intelliJ is great

#

do you not know what tab complete is

austere ivy
#

yeah but

#

it makes reading code a mess

stiff yarrow
#

what?

austere ivy
#

see this:

limber knotBOT
#

I have a question concerning licenses: When I find some useful pieces of code on stackoverflow or a tutorial on a website, where no licencse is specified, am I allowed to use this code in my project then?

stiff yarrow
#

you'd prefer to go back to your magic number literals

#

?

orchid pelican
#

wtf even is this conversation

stiff yarrow
#

@pastel pivot technically you are not

#

and they own it

#

code without license is copyright to the maker

#

you use stack overflow as an example

#

not to copy paste

limber knotBOT
#

okay thanks.

austere ivy
#
player.sendMessage(formatString(MessageType.NONE, "tfc", "my_msg", player.getName());
player.sendMessage(formatString(MessageType.NONE, "tfc", "my_msg", player.getName());
player.sendMessage(formatString(MessageType.NONE, "tfc", "my_msg", player.getName());

vs

player.sendMessage(formatString(MT.NONE, "tfc", "my_msg", player.getName());
player.sendMessage(formatString(MT.NONE, "tfc", "my_msg", player.getName());
player.sendMessage(formatString(MT.NONE, "tfc", "my_msg", player.getName());
#

Which is easier to read at a glance

#

this is the most stupid question I've ever asked

#

what am I doing

#

goodbye

#

also I decided on MsgType, it gets the job done but it's not MessageType

stiff yarrow
#

bro if you really want to be lazy

#

static import the enum

#

beware of namespace conflicts

#

tho

#

with a static import you can just write NONE

#

its like the wild west

#

Java normally doesn't let you blow your dick off but you can bend it sometimes

#

also you need to stop being so OCD about how things look HmmCoffeeSmile

upper flicker
#

I would pin that because its amazing but Im pretty sure I'd have to flag the channel as 18+

stiff yarrow
limber knotBOT
stiff yarrow
#

if he says you can use it somewhere on his site

#

you are probably fine

limber knotBOT
#

Sorry, it's german ..

stiff yarrow
#

I doubt he'd ever come after you

#

but you should generally write your own code

#

and use guides as examples

limber knotBOT
#

It's not that I just copied it, but the principle is the same ..

stiff yarrow
#

code that has no license is copyright to the owner so it is technically a copyright issue if you use it without asking

#

but only he can copystrike you anyways

#

if you didn't copy it you are fine

#

I wouldn't worry too much about it

#

just don't go wholesale lifting code

limber knotBOT
#

Okay thanks. Actually I don't care much about it, I am just curious ..

stiff yarrow
#

well you should care peepoHmmCoffee

#

@austere ivy also you should turn the string literals into constants

#

ctrl + alt + c

austere ivy
#

nossr

#

also

#

I'm just saying it should INFER enums

#

like

#

formatString(MsgType type, String category, String configKey, Object... formats) {

#

"oh okay this one HAS to take MsgType enum so I'll do MsgType"

#

kinda like the diamond

stiff yarrow
#

if you want to do that retarded shit use polymorphism

austere ivy
#

List<String> stringList = new List<>

#

see that how it just infers the second part

#

magic

#

how on earth would polymorphism help me solve that

#

the heck?

stiff yarrow
#

because it does exactly what you want

#

even though what you want is bad

austere ivy
#

what

stiff yarrow
#

and you should feel bad for wanting it

austere ivy
#

gonna be honest I've never really used polymorphism

stiff yarrow
#

polymorphism is a large part of the reason OO even exists

austere ivy
#

I'm gonna assume it's like dependency injection

stiff yarrow
#

no its nothing like that

austere ivy
#

25 dollar name for a 5 cent topic?

#

no not like dependency injection but

#

25 dollar name for a 5 cent topic

stiff yarrow
#

well I guess in some retarded skewed way you could think of it like dependency injection like if you got really high

#

and then thought about it

#

just remember if you're using polymorphism as magic numbers

austere ivy
#

oh I'VE GOT IT

stiff yarrow
#

you should feel ashamed

austere ivy
#

SO

stiff yarrow
#

you know you could do a lot of this stuff just by adding methods to the enum itself

#

then you don't need a switch case

#

I originally said you don't need 4 if statements to do this

austere ivy
#
class MessageType {
    String name;
}

class None extends MessageType {
    String name = "TYPE";
}

class Multi extends MessageType {
    String name = "MULTI";
}

class Prefix extends MessageType {
    String name = "PREFIX";
}

public static String formatString(MessageType type, String category, String configKey, Object... formats) {
        FileConfiguration config = main.getConfig();
        String configString = config.getString(configKey);
        String formattedString = String.format(configString, formats);
        switch (type.name) {
            case "PREFIX":
                return colorString(config.getString(category + "_prefix") + " " + formattedString);
            case "MULTI":
                return colorString(config.getString(category + "_color") + "&l> " + formattedString);
            case "NONE":
                return colorString(formattedString);
            default:
                return null;
        }
    }
stiff yarrow
#

you can simplify this code with abstraction

austere ivy
#

this is flawless code

#

change my mind

stiff yarrow
#

this code makes no sense

austere ivy
#

yes it does

stiff yarrow
#

you're not even using polymorphism correctly, and even if you used it correctly in the way I described it would be equally horrendous

austere ivy
#

lol

#

this is a joke

#

I'm going to go eat now.

#

Bye bye.

stiff yarrow
#

just add methods to your enum

#

ez

#

YourEnumType::getCategoryString(), YourEnumType::getFormattedStringPrefix()

#

etc

#

then you don't need a switch

#

I can think of at least a few ways to remove this switch, this is just one of them

#

I don't think you ever needed this switch

cosmic raft
#

that code makes no sense brian

native thunder
#

You're talking to a wall kashike

#

People have been telling brian for the last 3 hours

gloomy sphinx
#

What does this usually mean? WARN: handleDisconnection() called twice is this normal when a player is forcefully removed or kicked?

cosmic raft
#

handleDisconnection has been called twice.

golden gust
#

It's basically a bug, but it's harmless

gloomy sphinx
#

a bug in the plugin or in minecraft?

#

or a bug in spigot api

cosmic raft
#

can be either, plugin could be doing bad things

#

the message is from minecraft (vanilla)

golden gust
#

afaik, it's basically being kicked in a stage where the server doesn't expect you to be kicked

gloomy sphinx
#

thanks

void void
#

grrrrrrrrrrrrr

#

im stuck in china for the next 9 hours, no where lets me use a credit card and i dont wan exchange any cash into yuan

#

so, guess am gon starve and dehydrate

austere ivy
#

@stiff yarrow you're the one

#

who

#

SUGGESTED the switch

stiff yarrow
#

no

austere ivy
#

yes I know it's better than if statements

#

wait what

stiff yarrow
#

I told you to use switch over 4 if statements

austere ivy
#

yeah

stiff yarrow
#

I wasn't telling you to use switchc

austere ivy
#

you still told me to use switch

#

that

stiff yarrow
#

literally 30 seconds after telling you to use switch I told you that it didn't need a switch

austere ivy
#

okay what do I use instead

#

I always thought enums were gross

#

they're basically classes, hacked up to be something else

void void
#

lmao

austere ivy
#

it felt weird

void void
#

LOL

stiff yarrow
#

you can use methods in your enums to simplify that code

austere ivy
#

the way you can add methods to enums

stiff yarrow
#

that is one approach

austere ivy
#

I don't like it ._.

void void
#

I love when people don't understand enough of a language and call a very useful feature 'gross'

austere ivy
#

pft

#

Simple.

void void
#

just bc "idk wen do i use dat"

stiff yarrow
#

well to be honest it is weird I won't lie, but its a feature of Java

cosmic raft
austere ivy
#

Enums are the same as classes but they construct.. themselves.. as.. it's just weird

void void
#

lmao

austere ivy
#

it's a feature of Java

#

a useful feature

#

it's still weird

void void
#

lmao

stiff yarrow
#

ENUMs are just human readable magic numbers

#

in Java ENUMs can support methods

austere ivy
#

lol

#

no

cosmic raft
#

why are you uppercasing "enum"

stiff yarrow
#

ENUMs in Java are basically secretly objects

void void
#

they're namespaced final fields, syntatic sugar for that

#

yall wildin

austere ivy
#

THIS:

enum Color { 
        RED, GREEN, BLUE; 
} 

is the same as THIS:

class Color {
     public static final Color RED = new Color();
     public static final Color BLUE = new Color();
     public static final Color GREEN = new Color();
}
#

how on earth does that NOT feel weird to you

void void
#

thats...

#

what i just fucking said

stiff yarrow
#

@austere ivy what's wrong with that

void void
#

syntactic sugar; so how do you feel about varargs

#

void hey(String... blabla)

stiff yarrow
#

why does everything have to be weird to you brian

austere ivy
#

A new field that has different names constructing itself

void void
#

that's just an array

austere ivy
#

it looks and feels weird

void void
#

this is just inexperience talking methinks

stiff yarrow
#

@austere ivy you should stop focusing yourself over the implementation and just focus on learning

austere ivy
#

it just is weird ,_,

stiff yarrow
#

Java does a lot of weird shit

#

deal with it

void void
#

you could always pick up C++ runsfast

cosmic raft
#

@austere ivy not exactly

#
public enum Foo {
  BAR,
  BAZ;
}

is the same as

public class Foo {
  public static final Foo BAR = new Foo(0, "BAR");
  public static final Foo BAZ = new Foo(1, "BAZ");
  private final int ordinal;
  private final String name;

  private Foo(final int ordinal, final String name) {
    this.ordinal = ordinal;
    this.name = name;
  }

  public final int ordinal() {
    return this.ordinal;
  }

  public final String name() {
    return this.name;
  }

  @Override
  public String toString() {
    return this.name;
  }

  @Override
  public final boolean equals(final Object that) {
    return this == that;
  }

  @Override
  public final int hashCode() {
    return super.hashCode();
  }
}

equality is restricted to the same object

#

Enumerations come with the added "bonus" of an ordinal/id and name

austere ivy
#

that's it

#

this is garbage no wonder no one likes Java I'm moving to assembly

#

bye people

stiff yarrow
#

@void void I've done a few projects in C++

cosmic raft
#

ok bye

stiff yarrow
#

haven't worked with it in a long time though

void void
#

"this is garbage" but doesnt know enough to actually support the claim

#

top comedy

austere ivy
#

I'm back

#

what the HECK is ths

#

garbage

#

do these people not know what BRACES ARE!?

#

doesn't even have enums

#

0/10

cosmic raft
austere ivy
#

what the HECK

#

HOW IS THIS READABLE

#

it's not

#

these people are robots

#

these robots are robots

cosmic raft
#

lol

native thunder
#

iirc the apollo 11 code has some comment like "test code remove"

#

But it's pretty crazy that printed out this is like the height of a human

#

And that's what got man on the moon

void void
#

aight i really gotta find some place to exchange cash lmfao, this airport is insanity if insanity could be architected, and then managed as some sort of inane "how can we make this place barely function" zoo

native thunder
#

Here at TPE it's right before customs

stiff yarrow
#

I don't know how to say this but, try to only ping me if you are replying to something I've said or you need something from me that is at least semi-relevant

austere ivy
#

oh okay.

austere ivy
#

leaf

native thunder
#

@stiff yarrow potato

austere ivy
#

I agree with the above statement

rugged tulip
#

Hey, right now I have my anarchy minecraft server on spigot and it crashes when hackers go like bazillion miles an hour. Would Paper fix this or something.

limber knotBOT
#

paper fix this

#

it's called get an anticheat plogen

stiff yarrow
#

is it truly anarchy if you don't let them cheat weSmart

limber knotBOT
#

there's also that

golden gust
#

There is a configuration option in 1.13 to prevent players from moving into unloaded chunks

stiff yarrow
#

the anticheat I've heard has the least issues is Spartan

cosmic raft
#

lmao

void void
#

holla bebs i begged this lady to let me into the first class lounge and she let me

pulsar socket
limber knotBOT
#

prolly cuz nobody uses it nossr50

#

idk why there are so many private premium anticheats

stiff yarrow
#

they print money

pulsar wigeon
#

wtf lol

cosmic raft
#

@stiff yarrow downloads != sales

stiff yarrow
#

it is for premium plugins, it also includes gifted copies

cosmic raft
#

since when? each download of the JAR contributes to that count

stiff yarrow
#

not for premium

#

my download count is my sales count

cosmic raft
#

yet another stupid thing md has done to the xF RM

stiff yarrow
#

now you know that those premium plugins print money HmmCoffeeSmile

cosmic raft
#

that is spread out over nearly 4 years though

#

.wa 120510 / 4

limber knotBOT
stiff yarrow
#

yes you are correct

#

still 30k a year is pretty good

#

epic world gen is 140k gross over 4 years as well

#

.wa (3,426 * 40) / 4

limber knotBOT
austere ivy
#

whoa

limber knotBOT
#

btw nossr50 if Items_As_Unarmed is set to true do you disable the whole "move picked up item to free slot in inventory" stuff?

stiff yarrow
#

this is not the mcMMO discord peepoJuice , and that code is temporarily disabled because its broke and I forgot about fixing it.

#

I guess it broke sometime in classic

limber knotBOT
#

make an IRC channel and I'll join

#

otherwise imma ping u here

#

anyways, good. Cuz that feature breaks some of my plugins iirc

#

one of them in particular being SneakPickup

void void
#

Beauty. The airport lounge I scamazzed my way into gave me a free WiFi account. But China so VPN 🌝

#

Works fine

limber knotBOT
#

ur english degraded too?

stiff yarrow
#

okay I registed #mcmmo which I'll probably never look at because IRC is a dead bedroom

void void
#

wat robo

#

yeah nossr infected me

#

😠

stiff yarrow
#

typing degrades as you get older

void void
#

@stiff yarrow you better run for that comment about irc

#

and that one too

#

😠

stiff yarrow
#

IRC has never been good

#

it was just good enough

void void
#

just to be clear

#

this emoji in this context is chasing you so i can beat you up

stiff yarrow
void void
#

lmao aight, ima try to kill some time doing something maybe half productive idk

#

got 5.25 hours 😠

golden gust
#

simple

#

something productiv

#

psh

deep shoal
#

EventExecutor#execute(Listener listener, Event event)

#

what is the listener used for

#

?

limber knotBOT
#

to hear things

golden gust
#

It's the listener instance that's going to be called

stiff yarrow
#

@deep shoal I hope you aren't hotloading events still GWcmeisterPeepoLove

golden gust
#

I don't do that, that's horrible

stiff yarrow
#

Derp

#

Meant to tag tuna

#

forgive me senpai

cosmic raft
golden gust
#

There was actually a nice bug with the asm executor stuff caused by people registering/unregistering listeners as we'd keep hold of the generated class

shell vine
void void
#

yeeah tbh "productive" more like sit here and watch youtube and stuff

#

although, people are looking at me like "google????"

#

"youtub????"

#

am i gonna get arrested

stiff yarrow
#

just don't mention your dissent for the chinese government online

deep shoal
#

@stiff yarrow idk what hotloading means

stiff yarrow
#

remember our discussion the other day when you said you wanted to register and unregister events during the runtime of your plugin and you were going to do it fairly often

deep shoal
#

yeah

#

but I will do it on my own api

#

and only register one listener on bukkit

#

but I am reading craftbukkit's source to understand their system

stiff yarrow
#

that's a lot better HmmCoffeeSmile

#

still don't understand why you need to register and unregister events that often but I'll ignore that

deep shoal
#

I don't understand though

#

what the point of passing the listener to execute is

#

why would you ever need it

stiff yarrow
#

?

#

passing it where

deep shoal
#

to execute

stiff yarrow
#

the listener is the class that has the registered event, the event is the state representation of that event

golden gust
#

The event method is called using reflection, the listener is passed so it knows what instance of the method to fire

stiff yarrow
#

I assume bukkit maps it using reflection and then caches it

limber knotBOT
#

this listener discussion makes me want to resume work on a minigame plugin I haven't finished yet

#

RoboMWM: what game

#

microgames thingy

#

like warioware

#

.g warioware

#

(kashike) https://en.wikipedia.org/wiki/Wario_(series) -- Wario (series) - Wikipedia: "The Wario franchise comprises various video games created by Nintendo, starring the .... WarioWare (also Wario Ware), known in Japan as Made in Wario..."

The Wario franchise comprises various video games created by Nintendo, starring the character Wario. The franchise began with Wario Land: Super Mario Land 3, the first game to feature Wario as a playable character, and gained many further installments. The Wario series includ...

stiff yarrow
#

have the version strings for checking spigot/paper/craftbukkit been consistent over the last 4-5 years? and if they haven't does anyone have any boilerplate for detecting craftbukkit without false positiving for spigot

limber knotBOT
#

tf2ware is a good implementation of that in a multiplayer game

#

I think some server, cubecraft or something, has "minerware" but it sux big time

#

nossr50: version.contains("Spigot")

#

basically

stiff yarrow
#

doesn't spigot come up in the version string for craftbukkit?

limber knotBOT
#

no

stiff yarrow
#

oh okay

#

wario ware is a game where every 10 seconds or so it swaps you from minigame to minigame iirc

limber knotBOT
#

I see

#

4 seconds

#

10 is too long

#

I have a working version but I think I was last working on registering events to only fire in the world the game is running in

#

so every microgame's listener doesn't have to do a world check

#

Idea is to make this thing developer friendly so all u ppls can make lots of microgames easily

pearl ibex
#

I wanna get BTC. :>

void void
#

you mean the tianan*** ***** mass**** of ****? @stiff yarrow

stiff yarrow
#

?

pearl ibex
#

Does anyone want nude pics? :> /s

void void
#

if i type that out my internet will get cut

#

(probably)

cosmic raft
#

why

void void
#

the chinese government claims it didnt happen

#

but it did

cosmic raft
#

you're in china?

void void
#

i am for the moment yes

cosmic raft
#

neat

void void
#

for the next 5 hours

cosmic raft
#

bring me back a souvenir

void void
#

wat u want

cosmic raft
#

postcard

void void
#

ill look

cosmic raft
#

:D

#

accept my friend request by the way

void void
#

did

stiff yarrow
#

kashike sliding into everyones DMs aPPepeHug

pearl ibex
#

@stiff yarrow I'm selling a pepe... 50$ for you. :>

void void
#

nude pepe?

cosmic raft
void void
#

be back gonna go postcard hunting for kash

cosmic raft
#

:3

pearl ibex
#

No, a normal pepe. :>

stiff yarrow
#

aPPepeHacker I've hacked in using 10 GUI proxies in visual basic and stolen the pepe

cosmic raft
#

CSI should hire you

pearl ibex
#

WOAH!

cosmic raft
#

you can track down some killers

pearl ibex
#

You could track me wherever you want, Mr. Pepe. :> /s

stiff yarrow
pearl ibex
#

/s/wherever/whenever

#

That shit. :P

#

lefbad 50$. :P

pearl ibex
#

lefbad 100$, last offer. :>

stiff yarrow
void void
#

aight @cosmic raft i bought like 100 postcards

#

so

#

you hAVe choices

cosmic raft
#

:o

void void
#

They're all Xiamen University

#

Diff takes tho

#

@ anyone, if you want a china postcard hmu, you pay the postage

#

itll be a few weeks till im back but yh

cosmic raft
#

cool :D

#

@stiff yarrow see, i slide into dms for a good reason peepoJuice

stiff yarrow
#

📫

void void
#

Alright four hours left....wat to do

#

Mlep

cosmic raft
#

games!

#

word searches

void void
#

Yeah am gonna probably throw on some netflix

deep shoal
#

what's the most shittily coded server you guys have played on

static badge
#

paper tbh

deep shoal
#

I mean commercial server (not like, server software)

#

and if you do too then I didn't know paper had a server

cosmic raft
#

any of those one that offer the generic "i am a server" games

#

prison/kitpvp/etc

deep shoal
#

I think mineplex's codebase is pretty trash

static badge
#

whatever that server we played ttt on kash

cosmic raft
#

hivemc?

static badge
#

kept randomly dcing for bullshit reasons

deep shoal
#

lmao

static badge
#

evidently whatever their doing for packet handling is just fucked

#

which reminds me you boys should setup a paper server

void void
#

wats the one that made factions

#

massivecraft

#

lmao

#

shit was horrible

#

(/is?)

deep shoal
#

why is minecraft in Java why didn't it get ported to loads of other languages yet

static badge
#

actually doing it takes a lot of time and competence

#

as it turns out keeping up with people paid to dev the game with people who aren't paid and do it in free time is pretty hard

cosmic raft
#

The same reason there aren't any other feature complete versions of Minecraft in Java too

void void
#

(idk how truthful it is but pre sure mc was notch's "i wanna learn java" project)

#

(and now, here we are)

cosmic raft
#

pretty sure he knew java already

deep shoal
#

"knew"

#

loosely

void void
#

yeah idk, just something i heard a while back

static badge
#

pretty sure he just wanted a blockgame

#

and ended up getting a lot more than he asked for