#dev-general

1 messages · Page 165 of 1

prisma wave
#

@heady birch

steel heart
#

alex true but I guess people gets missleaded when in reflection to get those you'd call getMethod or getDeclaredMethod

prisma wave
#

lol

jovial warren
#

love how we both instantly thought Niall as soon as I mentioned Spring

prisma wave
#

method is a general term

#

but technically, those are functions

steel heart
#

ye

surreal quarry
#

bruh im so confused what the pattern even is for this code clash thing

prisma wave
#

||reverse the numbers||

surreal quarry
#

well yea

prisma wave
#

||the first number is how many there are||

surreal quarry
#

but which one do i removel mao

#

ooo

jovial warren
#

|| first number is the amount of items after it ||

prisma wave
#

nice one

jovial warren
#

zsh: command not found: brain today alright

#

hey who reckons I'm gonna get pinged and DMed a lot with my current status lol

steel heart
#

a setter should be enough, I'm thinking of going all in with a UnaryOperator and Consumer as well

prisma wave
#

🙄

surreal quarry
#

this is pretty cool lol

prisma wave
#

yea it is

jovial warren
#

just switch to Kotlin maybe? @steel heart xD

surreal quarry
#

they should make an intellij plugin tho so i can get auto complete

steel heart
#

yeah ik

#

but first clojure

prisma wave
#

clojure

#

clojure

jovial warren
#

lisps are just one of those annoying, useless things in the world, a bit like wasps

surreal quarry
#

lmao

prisma wave
#

not useless

#

and not annoying

jovial warren
#

@surreal quarry share code

empty flint
#

I am not very good at this xD

jovial warren
#

||reverse the numbers||

steel heart
#

||first number is length||

jovial warren
#

||^^^^||

jovial warren
#

||shall we just talk in spoilers now lol||

steel heart
#

imagine having 100 devs

jovial warren
#

100 devs?

empty flint
#

I knew what to do

steel heart
#

||no I have auto spoiler thing||

empty flint
#

but I didn't know the java methods to do it xD

steel heart
#

ah

jovial warren
#

|| @steel heart you bot ||

empty flint
#

like sort the list

#

forgot how to write a comparator

#

off the top of my head

steel heart
#

||its convenient||

jovial warren
#

||how?||

empty flint
#

Also joined late but that's just an excuse

steel heart
#

||less clicks||

surreal quarry
jovial warren
#

||what you running? MS-DOS? lol||

prisma wave
#

||(println (join " " (reverse (sort list))))||

steel heart
#

||yo mom||

empty flint
#

What I've been meaning to ask was

jovial warren
#

||did somebody say Python time?||

viscid charm
#

line 32

empty flint
#

Does kotlin have some sort of class names?

#

something comparable

prisma wave
#

what

viscid charm
prisma wave
#

String::class.java.name ?

empty flint
#

I mean it uses the java name, I meant like the kotlin version of those?

viscid charm
#

OK So its

#

me.freshpeppermint.utils.ItemUtils.getItem(ItemUtils.java:27) ~[FreshCrates.jar:?]

#
        Material material = Material.getMaterial(main.getConfig().getString("custom-items.<customitem>.customdiamond.material".replace("<customitem>", customitemname)));
#

that line

prisma wave
#

@empty flint if it's a jvm class, it's the same

viscid charm
#

o9k wait nvm

#

i think if ound it

jovial warren
#

@prisma wave sorry just had to leave that as I realised I added my school publicly available for the internet to see lol

prisma wave
#

oh lol

surreal quarry
#

this one was hard lmao

prisma wave
#

lol the challenge was the smallest code size

surreal quarry
#

Lmao

#

I uhh

#

didn't know that

#

I was wondering why you formatted it like that

steel heart
#

one more

surreal quarry
#

^

prisma wave
#

Ye

surreal quarry
#

send link

viscid charm
#

U guys know why this code's giving a null pointer error at line 27?

So i have this in my listenr class I know the listener class aint the problem:
ItemUtils.giveItemToPlayer(player, ItemUtils.getItem(main.getConfig().getString("customdiamond"), 1));

And here is my itemUtils class:
https://hasteb.in/uquhaziq.java

my config:

custom-items:
 customdiamond:
  itemname: "&eHello"
  material: DIAMOND
  data: 0
  lore:
  - "&7Hello"
  - "&7You yoo"
 customdiamond1:
  itemname: "&eHo"
  material: DIRT
  data: 0
  lore:
  - "&7Hello"
  - "&7You yoo"```
surreal quarry
#

config is null, or customitemname isn't valid

jovial warren
#

^

steel heart
#

private static FreshCrates main;

public ItemUtils(FreshCrates main) {

    ItemUtils.main = main;

}
#

what

normal talon
#

Does anyone know how to make rank voucher scroll with arcane vouchers ?
like between ranks. Mvp,MVP+,MVP++ and you just get 1 of them ?

steel heart
normal talon
#

aint nobody answering and this channel is alive rip

steel heart
#

well

#

I've never used arcane vouchers

#

I can look up Ig

surreal quarry
#

we're all playing a game lmao

prisma wave
#

just us 3?

surreal quarry
#

i guess

steel heart
#

im not good but its fun

surreal quarry
#

^

steel heart
#

no Im serious

surreal quarry
#

so am i

steel heart
#

I fkn got 0%

prisma wave
#

lol

surreal quarry
#

fr lmao

steel heart
#

¨lol

onyx loom
#

LOL

#

i wonder why hell need that thonk

rugged compass
#

my code wont work :(

prisma wave
#

should've used clojure clojuremoon

rugged compass
#

anyone interested in helping me for a second?

prisma wave
surreal quarry
#

^

rugged compass
#

ah

steel heart
#

sure I can assist in development

prisma wave
#

well gg

steel heart
#

I did it now with much boilerplate

prisma wave
#

lol

#

28 lines of Java Vs 14 of kotlin

#

Or 18

#

Can't remember

surreal quarry
#

u had 19

prisma wave
#

🙄

#

would've been like 2 in clojure

surreal quarry
#

show me

steel heart
#

System.out.println(s.split(" ").length % 2 == 0 ? ""+arr[arr.length/2-1]+arr[(arr.length/2)] : arr[arr.length/2]);

prisma wave
#

Can't

steel heart
#

or msntg

prisma wave
#

Turned pc off

#

And I can't remember what the problem was lol

quiet sierra
#

what the

prisma wave
#

also my clojure skills are not so good

steel heart
#

same

#

I started reading some basics

prisma wave
#

i tried to do the last program in clojure

steel heart
#

ye

prisma wave
#

Needed the docs at least 4 times

steel heart
#

ah

empty flint
#

@prisma wave how would I go about making a list of strings into a list of pairs or better yet a map where every even index is the key and every uneven one is the value?

prisma wave
#

XY problem?

#

What are you trying to do

empty flint
#

trying to parse a command using Clikt framework and I can't figure out how to get a map from arguments.

#

But I can get a list of strings

#

and I want to have a list of pairs instead

#

and make those pairs into a map eventually

prisma wave
#

Uh I think you could use windowed() or group()

#

And then just map the Lists into Pairs

steel heart
#

@prisma wave

surreal quarry
#

omg

#

thats amazing

steel heart
#

yaaa

empty flint
#

Uh I think you could use windowed() or group()
@prisma wave I think I have to use zip. Dunno how to get the index via group.

#

But how do I get every even element and every odd element into a list?

surreal quarry
steel heart
#

maybe make the hands darker

#

yeap

#

@prisma wave

surreal quarry
#

thats really the best emoji

onyx loom
#

cursed

surreal quarry
#

@ocean quartz is the markdown messages gonna be a plugin/papi extension type thing or a library ||or both||

ocean quartz
#

Lib

steel heart
#

ayee

surreal quarry
#

awesome

steel heart
#

mb make an expansion of it as well

#

or smtng

surreal quarry
#

^

#

since you got the code for it already, but it might be hard to implement as an expansion

#

%markdown_{message}% or something maybe

steel heart
#

hard thing would be to allow other placeholders i think

ocean quartz
#

I have no idea how to implement it as an expansion but the lib will be legit just Message.create().parse("**your** markdown").send(player)

steel heart
#

does #parse have a vararg param as well?

#

like if you want to send multiple lines of messages

ocean quartz
#

No, just one
Though the correct way to use would be something like:

final Message message = Message.create();

final MessageComponent component = message.parse();
// Then here you decide what to do
component.send();
component.asBaseComponent();
component.toString();
surreal quarry
#

to implement it as a exansion,

public String onPlaceholderRequest(Player player, String identifier) {
  return Message().create().parse(identifier).toString()
}```
#

that might not be exactly right but you get the idea

#

then you would just do %markdown_**markdown** __message__% or smth

steel heart
#

well Matt I guess you'll support \n then?

ocean quartz
#

Need to think about that xD

quiet sierra
#

@ocean quartz how does it handle invalid text?

#

if I send a heart

ocean quartz
#

The same way minecraft does

surreal quarry
viscid charm
#

o

surreal quarry
#

ill help you there

obtuse gale
#

Wait

#

Since when does minecraft support hex colors?

surreal quarry
#

1.16

obtuse gale
#

its pretty hot

#

I missed it to be honest it is literally the only version that I didn't inform myself about lmao

#

By the way check out the new bingo update on #showcase, if you want give me a few suggestions.

surreal quarry
#

you may already be planning this, but try to clear the map first

obtuse gale
#

The map is not there

surreal quarry
#

or maybe make it so it doesn't give you that map until its prepared to look like the bingo board

obtuse gale
#

Its just because it was there from the previous test

surreal quarry
#

ah ok

obtuse gale
#

Anything else?

#

I don't know if to make the horizontal and vertical lines match the diagonal one or to do the opposite

#

Like the thickness of the line when you find the full line

surreal quarry
#

i think i like the horizontal one better

#

but it might just be personal preference

obtuse gale
#

Yeah but like idk it doesn't show the item behind almost at all

#

And it has to be a 3 player podium like win so 3 lines can be completed

surreal quarry
#

thats why i like horizontal more

#

its more narrow

#

you can see more of the items

obtuse gale
#

Yeah I don't know why I read diagonal lmao

#

Its not that easy tbh on a 128x128 canvas to make the lines look good haha

surreal quarry
#

yea lol

#

are you using a texture pack to do that

obtuse gale
#

?

surreal quarry
#

or is it somehow all done via code

obtuse gale
#

Code code

surreal quarry
#

damn nice

obtuse gale
#

It uses Image from the java Graphics selects random items and draws them on the background that is already saved in the folder and can be changed

prisma wave
#

@steel heart you deserve a medal

obtuse gale
#

Then the green tick is another file you can change and the red lines are drawn with the Graphics too

prisma wave
#

🏅

surreal quarry
#

damn thats cool

#

ive been wanting to figure out that image editing stuff for a discord bot lol

#

but ive just been too lazy and too busy

obtuse gale
#

I mean money drives it its for a client lmao

surreal quarry
#

ah that'll do it

obtuse gale
#

I would have not gotten myself into it alone too haha

#

It was like intimidating at first

#

But yeah it is not too difficult just 13 hours of coding lmao

#

Most of that was trying to draw the red lines hahaha

surreal quarry
#

yea i feel like once i got the basics down, i would be able to do it, i just gotta jump into it and actually figure it out lol

obtuse gale
#

Yup

#

I need to use another api but can't figure out how to use it

#

As that one has way more features with maps

tacit cave
#

hello i want to ask one more simple question

#

Umm, is the inventory slot on GUI :java Inventory MainIsUpgradeGUI = Bukkit.createInventory(null, 36 is from 0?

obtuse gale
#

nope

tacit cave
#

is it from 1?

obtuse gale
#

Yup 36 is right

tacit cave
#

kay thanks

regal gale
#

Wut?

#

In real time code, slot starts at 0

#
> Inventory MainIsUpgradeGUI = Bukkit.createInventory(null, 36)``` but it's from 1 in this code
tacit cave
#

WOW

#

nnvm

obtuse gale
#

That is the inventory size and the size is a normal number starting from 1

#

Btw got the new map api working

#

Why is it not loading as a gif e.e

versed ridge
#

need a higher tier

obtuse gale
#

Yeah anyway that gif is scuffed lmao

#

Let me upload the video link

#

If you could resend it so it shows up that would be great

obtuse gale
#

Ty

tacit cave
#

uh hello

split talon
#

That’s pretty neato

tacit cave
#

what is lava + water generator event?

#

like when it generate a cobblestone

#

i want to cancel the event tho xD

split talon
#

BlockFormEvent @tacit cave

tacit cave
#
    @EventHandler
    public void OnDestroy(BlockFormEvent e, Island i) {
        
        UUID player = i.getOwner();
        Player p = Bukkit.getOfflinePlayer(player).getPlayer();```
#

vault is the best dependencies xD

obtuse gale
#

Wait why onDestroy() has another argument other than the event?

surreal quarry
#

^

#

events should only take the Event as parameters

tacit cave
#

Wait

#

mistakes

#

😂

obtuse gale
#

You should setup a method to get the owner of the island from the player object or something along those lines

surreal quarry
#

^

#

also i don't think the event has anything to do with vault unless im missing something

obtuse gale
#

yeah same I think he imported BlockFormEvent from Vault maybe(?) other than that I don't see it used.

tacit cave
#

also i don't think the event has anything to do with vault unless im missing something
@surreal quarry look the player p

surreal quarry
#

not vault?

#

thats a spigot method

#

or bukkit or whatever you wanna call it

tacit cave
#

not vault?
@surreal quarry it's casting UUID

#

from UUID To Player

#

and also im using 1.8 xD

obtuse gale
#

That is bukkit getting the offline player object from the uuid

tacit cave
#

oh kk

#

with vault i can check offline player perms

obtuse gale
#

also you should not get the player directly there and first run a check if the player is online

tacit cave
#

actually

#
        if (e.getBlock().getType() == Material.STONE || e.getBlock().getType() == Material.COBBLESTONE && i.getMembers().contains(p.getUniqueId())) {```
#

im checking the member is in the owner team

obtuse gale
#

Will avoid any errors down the line even if it is minor

tacit cave
#

yes ik

obtuse gale
#

I don't know how you are handling the members but it could still contain the player uuid even after being offline if not handled

obtuse gale
#

ghost ping :))

distant sun
#

Not again 🤣

obtuse gale
#

we talking about 1.8 users?

#

Somebody pinged?

#

user deleted message

#

Who pinged me?

#

@jesus01

#

pinged me

distant sun
#

RedEpic#7542

obtuse gale
#

@obtuse gale Can I help you?

#

yes

#

hellooooooo

#

coyote u there

hot hull
#

@ocean quartz Editor for what exactly?

old wyvern
#

Frost can you please get rid of the idiot who keeps pinging everyone randomly?

hot hull
#

Gaby is on it

tacit cave
#

we talking about 1.8 users?
@obtuse gale I'm one of it , why?

#

yes
@RedEpic#7542 who the fuck r y

#

R u

obtuse gale
#

na someone deleted their message

#

also 🤮

distant sun
#

Stop aj.

obtuse gale
#

ok angry_fingerguns

lethal wagon
#

hi has anyone used redirectplus

hot hull
#

@distant sun Why you call me stoopid? GWsetmyxPeepoCry

lethal wagon
#

Not sure if I can ask this in here but if I can that'd be unreal

distant sun
#

Why not @hot hull

lethal wagon
#

Looking for some help getting this setup

#

Can't seem to get it to work for my server smh

#

oof

hot hull
#

Okay 😣

analog crater
#

Secondly,

#

?help

compact perchBOT
#
FAQ Answer:
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait

Source

analog crater
#

Explain "can't get it to work". Is there an error, does it not download or is your machine on fire?

pastel imp
#

Or have you been hacked

empty flint
#

Does gradle import different dependencies for source files and test files?

#

aparently it does

#

testCompileOnly("dependency...") in case anybody is wondering

#

@prisma wave Oh wise one, I humbly seek your Kotlin wisdom:

I have the following extension function for org.bukkit.Effect

operator fun Effect.get(identifier: String): Effect? {
    return Effect.valueOf(identifier)
}

It is located in a .kt file in my src/main/<irrelevant packages>/util package and works fine when I use it from the source folder.

In my src/test/ folder, however, I can't use the function at all aparently. Not even if I define the extension function in the test script file. I can import it manually from the util package but it stays unused and the call
Effect[value] or even Effect.get(value) gives the compile error Unresolved reference: get

Any ideas why that is?

#

Oh I think I see now why it doesn't work. The extension function doesn't extend the static Effect but an instance of the Effect enum...

distant sun
#

Enums#getIfPresent is better

#

As Enum#valueOf throw an exception, doesnt it?

obtuse gale
#

eh

#

I dont like the way ive currently got it setup so i can work on the same project on two PCs

#

cos I always forget to commit changes to git so then ive gotta grab my laptop and do it

#

im gonna try using a remote server or something

analog crater
#

Host your files on a remote server instead of git

obtuse gale
#

yeah...

#

idk how well IJ will play with that but hopefully its nice

#

since I dont wanna have to like re-open the project everytime

analog crater
#

Probably easy if you have a nas

obtuse gale
#

nas?

analog crater
#

Network attached storage at home

#

Thats how I've got my school pipeline

obtuse gale
#

ah

eternal blade
#

Hi I have eclipse mc built in server and i wonder what VM arguments i need to add to remove the mc server default gui

#

like

#

-nogui

#

on .bat file

obtuse gale
#

why eclipse

eternal blade
#

i tried todo it on IntelliJ haven't found a tutorial for this

eternal blade
#

i am trying to do like live debuging and building i saw my friend has it like a built in server and the plugin recompiles and load its self to the server

obtuse gale
#

maybe that

eternal blade
#

ho nice

#

thanks

prisma wave
#

@empty flint because it's an extension upon an Effect member not the companion object yeah

#

There's an existing kotlin function that will do basically that

#

enumValueOf() or something

empty flint
#

enumValueOf() or something
@prisma wave Can't find it

old wyvern
#
enumValueOf<Effect>(string)
jovial warren
#

that'll be it

#

also that original function you posted btw @empty flint can literally just be this: ```kotlin
operator fun Effect.get(identifier: String) = Effect.valueOf(identifier)

old wyvern
#

Effect.Companion.get*

jovial warren
#

me love expression functions lol

#

Effect.Companion.get*
his original one used Effect.get so I just used that

old wyvern
#

That would have to called already on an instance of Effect

jovial warren
#

yeah ik

#

also when I quoted that, your original message contained double backticks, which is redundant, which may be helpful if you're on mobile

#

you can just use `single backticks`

old wyvern
#

No, on laptop rn

#

Just used to typing that tbh

jovial warren
#

fair enough

#

yeah Effect.Companion.get would mean that it's a factory function right?

#

does Kotlin have its own equivalent of getResourceAsStream btw?

old wyvern
#

It would simply mean its part of the Companion object of the class being referred to, as in not the part of an actual instance of the class
A factory function would mean you are creating an instance of something I presume, which isn't happening in this context as its trying to get a Enum value

jovial warren
#

It would simply mean its part of the Companion object of the class being referred to, as in not the part of an actual instance of the class
A factory function would mean you are creating an instance of something I presume, which isn't happening in this context as its trying to get a Enum value
yeah true

prisma wave
#

does Kotlin have its own equivalent of getResourceAsStream btw?
@jovial warren in what class?

meager cairn
#

Can I ask why Skull doesn't have itemmeta, then how can I set the name? NBT?

 ItemStack it = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
// it.hasItemMeta() <-- false
prisma wave
#

You can still do getItemMeta iirc

analog crater
empty flint
#

Heresy

obtuse gale
analog crater
#

I just saw it in a help server... I'm disgusted

empty flint
#

How do I say "not " and not whitespace" in regex?

#

[^"] and [^\s]

#

combined

hot hull
#

So I'm using this to "pretiffy" materials, however it only capitalized the first part, any other methods which capitalize every word?

StringUtils.capitalize(String.join(" ", item.getType().name().split("_")).toLowerCase())
heady birch
#

Day 1 Without a DI container: How do I improve this

obtuse gale
#

kotlin

distant sun
#

@hot hull wordutils.capitalizefully

#

Also, just replace _ with space instead of using two functions.

hot hull
#

Oh yea smart

jovial warren
#

@prisma wave KClass

#

the Kotlin equivalent of Class

heady birch
#

Day 1 Without a DI container: How do I improve this
@heady birch HELP

jovial warren
#

in Java you use Class#getClassLoader and then ClassLoader#getResourceAsStream

#

this is so good

#

being able to use Exposed instead of fucking shitty JPA

empty flint
#

I hate regex 🙃

heady birch
#

I hate dependency injection

prisma wave
#

JPA good

jovial warren
#

I haven't had to deal with any dependency injection harder than Spring

hot hull
#

DI is nice

jovial warren
#

nah fuck JPA

prisma wave
#

@jovial warren not that I know of

onyx loom
#

but eveeyone loves n.java

I hate dependency injection
@heady birch

jovial warren
#

@prisma wave ah okay

hot hull
#

n.kt much better Kali

heady birch
#

JPA

#

Think he means JDBC

prisma wave
#

N.clj

jovial warren
#

yeah JPA for me is just inconvenient, since I can't use data classes (which would make sense the way JPA is designed), I have to provide a default argument for all the params, and I have to manually annotate each one with @Column since my columns are defined differently to the default data types

#

@heady birch no I mean the Java Persistence API lol

obtuse gale
#

do you guys reckon intellij will play nicely with files on a server? Or am i gonna have to re-open the project every time

heady birch
#

Jpa is great

#

Just kotlin ruining the experience 🙂

jovial warren
#

I just can't get my head around it

obtuse gale
#

I wish something existed that meant I could just open up intellij on my laptop and my project from my pc is instantly there

prisma wave
#

you can use data classes

jovial warren
#

Just kotlin ruining the experience 🙂
@heady birch fuck you

prisma wave
#

there's a kotlin plugin that adds jpa support

#

so you can use data classes

jovial warren
#

you can use data classes
yeah but you need to provide a default argument for every parameter

obtuse gale
#

there's a kotlin plugin that adds jpa support
wait what

jovial warren
#

and anyway, personally I find Exposed much cleaner and nicer to work with, though it was made in Kotlin for Kotlin so... yeah...

onyx loom
#

I wish something existed that meant I could just open up intellij on my laptop and my project from my pc is instantly there
@obtuse gale thats what github is for fingerguns

prisma wave
#

yeah but you need to provide a default argument for every parameter
not sure about that

obtuse gale
#

I keep forgetting to commit and stuff from one pc tho

#

Ideally id like everytime I save it would automatically go to the other pc

#

which is why i was thinking a remote server, but i doubt ij will play well

prisma wave
#

just save the files to dropbox or something lol

obtuse gale
#

Hmm shouldn't it load it?

#

i feel like intellij will make me re-open the project everytime then bm

#

Well anyway the new api is working like a charm

prisma wave
#

it should refresh the files

obtuse gale
#

hm

#

ill give it a shot i guess

jovial warren
#

not sure about that
@prisma wave JPA strictly requires a default no-arg constructor for some stupid reason on all entities

obtuse gale
#

now to work out how to setup dropbox lol

obtuse gale
#

Thanks

prisma wave
#

@jovial warren which is what the kotlin plugin does

#

also

#

it makes perfect sense

#

how would it instantiate an entity without it

jovial warren
#

I didn't think it was the one that was supposed to instantiate entities

#

I thought that was my job

prisma wave
#

...

jovial warren
#

so I can provide the correct values

prisma wave
#

not if it's an entity being loaded from a database

jovial warren
#

but what if it's one being created and put in to a database

prisma wave
#

then you would instantiate it yourself

jovial warren
#

exactly

prisma wave
#

???

jovial warren
#

but why then would it need a no-arg constructor if it already has all the values it needs?

prisma wave
#

saves trying to work out which value is which

#

JPA is designed for beans

#

which have a no arg constructor as part of the spec

jovial warren
#

ah

prisma wave
#

however the kotlin jpa plugin can generate them automatically

#

so it's not a problem

obtuse gale
#

welp

#

That wouldve been nice to know like 3 months ago haha

prisma wave
#

lol

#

the spring initializr should've added it automatically

empty flint
#

Does anybody know why regexr stops after the first match?

surreal quarry
#

thats probably your regex pattern

jovial warren
#

can you actually create a bean of an object btw? I know it sounds like a stupid question since objects only have a single instance but ya never know lol

prisma wave
#

probably a bad idea

surreal quarry
#

using+ can make it match more than 1

#

thats not just regexr tho thats regex in general

heady birch
#

Anyone actually got an idea for this?

#

It looks pretty messy

old wyvern
#

I mean Nial do you need their instance kept?

tacit cave
#

Oh hello there

empty flint
#

using+ can make it match more than 1
@surreal quarry I know that, but if there are more than one matches in a string it usually tells you all the matches

#

due to the global flag

tacit cave
#

How do I fix intellij idea community 2020.2 stuck loading at Checking url git

#

?

empty flint
#

wait I guess it just doesn't work in the tests

#

but works with the text

#

weird

surreal quarry
#

nah tests are where you need it to work

tacit cave
#

I tried to restart it 3x times

surreal quarry
#

epic try file > clear caches & restart

tacit cave
#

epic try file > clear caches & restart
@surreal quarry yes I tried day to

#

Day*

empty flint
#

nah tests are where you need it to work
@surreal quarry Well yes and no. I don't want to match the whole test string, just want to split a string according to the matches

tacit cave
#

Dat*

#

It's still stucking at checking url git..

#

Since I updated it to 2020.2

surreal quarry
#

yea but tests are what accurate test the regex

tacit cave
#

Any solutions?

surreal quarry
tacit cave
#

I updated the git to the latest

surreal quarry
tacit cave
#

Unistalled then install the latest one

empty flint
#

yea but tests are what accurate test the regex
@surreal quarry I realize that but it's just not feasable in my case

obtuse gale
#

AHH

#

help

#

I just downloaded some intellij plugin and now theres an anime girl in the bottom corner of my intellij

#

AJHHHH

hot hull
#

lmao

tacit cave
#

I just downloaded some intellij plugin and now theres an anime girl in the bottom corner of my intellij
@obtuse gale hm

surreal quarry
#

ah ok blocky

empty flint
#

Is there a thing like a negated group?

#

I want to match any character that is not a ", but I want to match an escaped \"

#

[^"] just matches for not " and will also not match \", but I need it to match \"

obtuse gale
#

I am noticing with intellij & dropbox when I click on a class it takes like 3-4 seconds before the class is like 'loaded' and is coloured

empty flint
#

ah im stupid

#

([^"]|\")

#

lol

obtuse gale
#

bruh

#

2005 thonking

#

This intellij themes kinda nice

prisma wave
#

not enough rainbow

distant sun
#

Chained functions for builders are better

prisma wave
#

builder patterns in kotlin

#

kinda gross

obtuse gale
#

what?

prisma wave
#

builder pattern is not idiomatic

distant sun
#
    .setY()
    .setZ()```
jovial warren
#

Kotlin's builder pattern is alright I suppose

prisma wave
#

???

distant sun
#

CC noob

jovial warren
#

I mean I love builders ngl but idk whether builders really fit in with Kotlin

distant sun
#

Whats the kt pattern?

prisma wave
#

DSLs

distant sun
#

English

jovial warren
#

Domain-Specific Languages

prisma wave
#
val embed = buildEmbed {
  title = "Hello"
  description = "Blah"
  footer = "blah"
  color = Color.BLUE
}```
distant sun
#

Mhm

heady birch
#

Javascript lol

distant sun
#

^

#

Or annotations

jovial warren
#
val embed = buildEmbed {
  title = "Hello"
  description = "Blah"
  footer = "blah"
  color = Color.BLUE
}```

never knew builders were SAM

obtuse gale
#

eyy dropbox actually works

distant sun
#

Whos sam

jovial warren
#

SAM builders are actually really nice

obtuse gale
#

its not perfect - you do have to open/close the file for it to update

#

but its pretty good

jovial warren
#

@distant sun SAM stands for Single Abstract Method

prisma wave
#

they don't have to be

#

that was just an example

lunar cypress
#

Javascript lol
@heady birch except javascript is actually better in this regard because what you get is actual data, a map

prisma wave
#

true

distant sun
#

Named params allow you to have 2 methods with the same params tupes

lunar cypress
#

Doesn't work for everything but it's useful with json apis obviously

distant sun
#

So you can do method(param = true, param2 = false) and it will know which one to use

prisma wave
#

uh

#

yes?

distant sun
#

Nike

jovial warren
#

basically SAM conversions are for converting this: ```java
@FunctionalInterface
public interface Function<T, R> {

T apply(R value);

}

public class Main {

public static void main(String[] args) {
    Function<Whatever, Whatever> myFunction = something -> { whatever }; // I think lambdas like that are allowed in Java not sure
    myFunction.apply(whatever);
}

}
to this: kotlin
fun main() {
val myFunction = { whatever }
}

#

hard to explain but it just works

#

¯_(ツ)_/¯

prisma wave
#

fucntion

jovial warren
#

@prisma wave did I get it anywhere near right?

prisma wave
#

function

obtuse gale
#

imagine knowing how functional interfaces work

jovial warren
#

I'm terrible at explaining lol

obtuse gale
#

sam sounds like a nerd

#

fuck sam

jovial warren
#

lol

#

SAM stands for Single Abstract Method @obtuse gale

#

also how do you not know how functional interfaces work? lol

prisma wave
#

if you're trying to write java code that's wrong

obtuse gale
#

idk

prisma wave
#

wait

#

nvm

obtuse gale
#

just never learnt them lol

jovial warren
#

@prisma wave did I actually do well at that example?

prisma wave
#

there was no reason to define function again

#

but yeah

#

i guess

jovial warren
#

okay

#

wow from that comparison especially, Java is definitely not something I miss lol

prisma wave
#

I mean

#

syntactically they're basically the same

jovial warren
#

exactly

prisma wave
#
value -> {}
``` vs
```kotlin
{ value -> }
obtuse gale
#

still need a way to get ⛏️ in unicode

jovial warren
#

and Kotlin has 3 lines compared to Java's 5 (excluding empty spaces and the functional interface declaration)

#

\⛏️

#

@obtuse gale wdym?

obtuse gale
#

ive got an emoji in a string and I want its unicode

prisma wave
#

Function<Whatever, Whatever> myFunction = something -> { whatever };
val myFunction = { whatever } both 1 line

#

lol

#

don't ask to ask

#

ask your question

meager cairn
empty flint
#

OOff can somebody help me out with the following regex?

old wyvern
#

Sure borz, what are you trying to do?

#

is this require a resource pack?
No @meager cairn

hot hull
#

Nice class name fingerguns

DontCareFieldPosition

empty flint
#

this "is a" sam\\"ple reg\\'ex 'text with' spaces on your: screen and "has es\"ca\'ped quotes"

I need a regex that gets me all the spaces that are not between quotes, but the tricky part here is that I need to ignore escaped quotes. I have tried to do it with lookahead and stuff but it doesn't seem to be working very well. Another rule is that if the space is next to the word "on", it's ignored and if the space is next to a ":" or "," character it's ignored except if those caracters are escaped.

#

this is what I got so far

#

it has a couple of errors

#

nwA\" on \"worldA: "displaynam\"eA and b" is supposed to be one single match

#

oh sorry I forgot to say, I need either all the spaces so I can split the string there, or all the tokens so I can just put them in a list, idc which way

#

I feel like I fell into a rabbit hole and made this whole thing so much more complicated than it needs to be

hot hull
#

Anyone else having shadow spazz out occasionally? Mine just fails to delete a class from time to time, but after I rerun it, it works just fine

empty flint
#

Oh I think I made some progress: (([^\s"':,]|\")+|"(([^"]|\")*)"|'([^']*)') @old wyvern

#

now I just need to match the "on <word>: " thing

old wyvern
#

Holy xD. ok lemme catch up with the specifications you gave

empty flint
#

hold up

#

here u go

#

current best

old wyvern
#

Can you tell me what specifically you want?

#

Count space only between Quotes right?

empty flint
#

if you check out the last link

#

all the matches are tokens I need to parse

#

but

#

I just need to combine a certain combination of tokens

#

namely the word "on" should merge with both tokens on either side of it. So i.e. nwA\" on \"worldA becomes one single token instead of the 3 it currently is

#

and the same with the ':' character

#

otherwise it's done

#

and idk if I should maybe do this part in kotlin

old wyvern
#

I mean you them separately later on right?

#

You should have named groups for each type of token

empty flint
#

how do named groups work in regexr? Idk how to do that

old wyvern
empty flint
#

but how do I declare variables in regexr?

old wyvern
#

declare variables?

#

You have the named groups, 1 sec

empty flint
#

isn't that what the TokenType essentially does?

old wyvern
#

No, its just a easier way to create the huge | part of named regexes

empty flint
#

so you want me to do this in kotlin?

old wyvern
#

That would be easier to work with, writing a rather large regex is usually hard to maintain

empty flint
#

@old wyvern can you maybe explain to me why this matches?

#

shouldn't [^ "':,] exclude anything starting with "

hot hull
#

(Completelly dynamic lore)

obtuse gale
#

1.8 tho

empty flint
#

@hot hull I feel attacked by that tip...

hot hull
#

😦

#

That was the plan Blocky

empty flint
#

well screw you too then 😄

hot hull
#

❤️

empty flint
#

how did you make the lore dynamic?

hot hull
#

I mean how could I not thonking

#

I also have custom mob support, custom drops support, spawner tax, spawner stacking, and a shit ton of neat features fingerguns

#

Have I also mentioned the entire activation and spawning system is custom

old wyvern
#

@empty flint
That matches coz of this part (([^ "':,]|\"|')+)

#

You need to double escape the /

#

rn it considers the " as escaped

empty flint
#

ah got it

old wyvern
#

((\\")|(\\')|([^ "':,]))+This is possibly closer to what you wanted there right?

hot hull
#

Yugi, you just mashing your symbols section of the keyboard?

old wyvern
#

😢

empty flint
#

Hm no something doesn't seem right with the escaping

#

(?<nq>([^\s"':,]|\\"|\\')+) doesn't match \"worldA

old wyvern
#

Try the regex I gave ya

empty flint
#

specifically \\" matches \" of course but not with the +

old wyvern
#

order matters

empty flint
#

oh does it?

#

I did not know that

#

fuck

#

that's why

#

Thank you!

old wyvern
#

It tries to match the first or block to be valid

empty flint
#

Right, I think I finally got the words down

old wyvern
#

Awesome

empty flint
#

It tries to match the longest input it can, right?

#

can I re-use defined groups?

#

oh I can

#

neato

#

alright so this is my regex, right?

(?<word>((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)')))

simply called "word"

#

these are the matches

#

but now if I just append (\s*:\s*(\k<word>))?

#

whitespace, :, no whitespace, word

#

and I know that both "worldD" and value\"D are already matched as words

#

So what gives, @old wyvern ?

#

(Also sorry if I'm bothering you too much, feel free to tell me to fuck off and solve it myself)

surreal quarry
prisma wave
#

pretty much

#

although the term is "DSL"

surreal quarry
#

ah alr

empty flint
#

I DID IT!!!

errant geyser
#

That regex must be disgusting

#

But gj

empty flint
#

(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)')))((\s+on\s+(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)'))))?(\s*:\s*(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)'))))?)?

Chonker

#

rofl

errant geyser
#

Worse than I could possibly imagine

#

But still nice

empty flint
#

good luck to whoever gets to debug it

#

fuck you, future Blocky

#

I am making his life miserable

old wyvern
#

Yo

#

Holy

empty flint
#

Yeah without your tip that the order matters I would have struggled for another couple of hours before giving up. Thanks a lot, Yugi!

distant sun
empty flint
#

it doesn't seem to know lookbehind?

#

ah nvm gotta switch on the PCRE

#

yo that is actually hella useful, thanks gaby

steel heart
#

Anyone knows how to make automations/inspections do this on fix

@NotNull
public Object get() { return null; }

instead of

public @NotNull Object get() { return null; }
#

or if there is a nice regex to fix that with one click

distant sun
#

I noticed that on latest versions of iij tbh

#

and it's annoying O.o

ocean quartz
#

That should be a setting yeah

steel heart
#

Matt you're regex pro

#

pls fix this for us

ocean quartz
#

I don't think you need regex, there should be an option somewhere ;o

steel heart
#

uh I kinda tried everything and its still not rly functioning

#

or I mean the most relevant options like in code style etc

lavish notch
#

Is there anyway to dynamically add to an old configuration with YAML Configuration? (IE: So you don't have to reset a config)

empty flint
#

uh yeah? just make a new key?

#

Or what do you mean by reset a config?

#

Why would you have to?

steel heart
#

mackenzie depends on what you want to add

lavish notch
#

Let say I updated the config, I wouldn't want to have to reset it to get the latest config options.

steel heart
#

make an autoupdater or something

empty flint
#

why would you reset it? just add the new key and save to file

lavish notch
#

Yes, but how. I need examples, or references.

steel heart
#

Idk some people use config versions

#

others just add if certain paths isnt set

empty flint
#

Yes, but how. I need examples, or references.
@lavish notch Do you know how to set a value?

steel heart
#

He knows

lavish notch
#

^

empty flint
#

Then do that but for a new key.

lavish notch
#

I was wondering if there was a easy way, or if I literally have to hard code some shit for each option

steel heart
#

You might have to pseudo hardcode

empty flint
#

I was wondering if there was a easy way, or if I literally have to hard code some shit for each option
@lavish notch Probably hard code

steel heart
#

or maybe not

lavish notch
empty flint
#

I mean the config is as hard coded as it has to be, right?

steel heart
#

you could try comparing old vs new config

#

and

versed ridge
#

ConfigMe does that :P

empty flint
#

The keys aren't dynamic, they are static

steel heart
#

ew configme

lavish notch
#

I'm trying to get off ConfigMe

versed ridge
#

ah

lavish notch
#

as it inflates file size by 300kb

steel heart
#

I mean do like this

lavish notch
ocean quartz
#

ConfigMe is good

versed ridge
#

You could check how they do it

steel heart
#

I would say use helpers config system

#

its nice

lavish notch
#

ConfigMe is good, yeah - but the 300kb, no thank you.

ocean quartz
#

That's small

steel heart
#

a nice all in one lib

lavish notch
#

What does it add to file size?

versed ridge
#

More than configme

steel heart
#

oh well the one I use takes 2,2mb or smtng iirc

#

if you want to try it out I have a shaded version

lavish notch
steel heart
#

becasue dependencies are fucked up in the repo one

prisma wave
#

caring about jar size in 2020

#

imagine

steel heart
#

but it has other features like a fkn lot

oak coyote
#

It matters for me as my internet is awful so uploading 1mb actually takes a bit of time 😢

lavish notch
#

I get 0.1mb upload lol

steel heart
#

wth

oak coyote
#

That sounds similar to mine

lavish notch
#

and 2mb download

steel heart
#

Make your own spectator mode

lavish notch
#

How would I make my own?

steel heart
#

pretty sure that one is less or more hardcoded

#

uhm with packets

#

probably

lavish notch
#

You up to give me a crash course to packets?

steel heart
#

Uh I think there exist some good tutorial out there

hot hull
#

Conclure, that'd be a bitch to make :p

lavish notch
#

I just want to make a smooth freeze feature, non of that shakey stuff client side with the cancelling of movement.

steel heart
#

Well okay so basically you'd send a packet through casting a player to craftplayer then invoke getHandle and then get the connection and then invoke sendPacket

#

I'd recommend protocollib

lavish notch
#

send code

#

please

steel heart
#

okay so this is w/o (just nms)

Player player = ...;
((CraftPlayer)player).getHandle().playerConnection.sendPacket(...);
#

thats the packet types

hot hull
#

Wait so why don't you just use the spectator mode?

lavish notch
#

I am

steel heart
#

Idk he didnt like the view perspective feature

lavish notch
#

Read my issue bruh

steel heart
#

Maybe look into this

#

that might be what you're after

#

although some of that code is pretty wack it should give basic understandings of how to create your own spectator mode

lavish notch
#

That's for arrows lol

#

Not viewable entities

steel heart
#

no but like the code snippet he got

lavish notch
#

player.spigot().setCollidesWithEntities(false);?

steel heart
#

yeah that disables entity collision

lavish notch
#

but in hypixel spectator, you can still click on player's to view them.

steel heart
#

then make that work

lavish notch
#

and I don't want that.

static zealot
#

maybe they have a click listener or something

steel heart
#

just prevent what you dont want to happen

static zealot
#

and changes their gamemode to spectator

#

or something

#

not sure

#

just an idea

steel heart
#

start with a HashSet of UUIDs

lavish notch
#

just prevent what you dont want to happen
Wow, really? - being sarcastic lol

steel heart
#

I mean its not that hard if you dont want to make it hard

lavish notch
#

I literally tried have a dozen events

#

and cancelling them didnt work

hot hull
#

Mackenzie, you're overcomplicating this

lavish notch
#

@hot hull I just want a smooth freeze

steel heart
#

So PlayerInteractAtEntityEvent doesnt even get fired?

lavish notch
#

No.

vestal grove
#

Is there a UUID or some other form of salt per world, which is completely inaccessible to the client?

lavish notch
#

Well... tbh I can't remember - all i recall is event.setCancelled(true) didn't work

steel heart
#

I think pogmoment that once a player login they receive a unique session id

#

although thats just while they're online

#

mackenze let me see through docs

vestal grove
#

i'm making a server sided mod that prevents villager trade reroll, but allows ppl to change the profession

#

the thing is, i'm using the entity UUID which is viewable by the client, without any "salt" per se

steel heart
#

but cancelling doesnt work either?

lavish notch
#

I've tried that

#

and yes, cancelling didnt work either

steel heart
#

uh you might have to implement custom spectator gamemode then

#

@vestal grove is that a problem though?

vestal grove
#

The user can easily determine trades

#

i'm basically forced to opensource the mod because it's on a large public server

#

it isn't a huge problem

#

but I feel it'd sit better with the owners if they knew ppl couldn't determine stuff that is serverside

hot hull
#

i'm basically forced to opensource the mod because it's on a large public server
Huh?

vestal grove
#

it's going on github

hot hull
#

Yea but why public?

vestal grove
#

wat

hot hull
#

Is this a private plugin, or a spigot plugin?

vestal grove
#

so they know i'm not backdooring

#

bukkit

#

so yeah spigot

#

does the world UUID get sent to players?

#

on join or somethign

prisma wave
#

I don't think so

vestal grove
#

as i said, i'm using entity UUID to seed a Random

#

ok

#

ig i can just add the two longs together

hot hull
#

I mean I doubt anyone will bother with that, also would knowing that give you much of an advantage?

vestal grove
#

not really but you could probably set up a script to just quickly kill villagers if they didn't have good trades after calculating them from a uuid

#

granted it's pretty simple to also just check

#

as long as the world UUID isn't sent, it's fine though

#

i just used the modulus of the World UUID MSB and the Entity UUID MSB to seed the random

prisma wave
#

why do people dislike python so much?

steel heart
#

I like it

#

its powerful

prisma wave
#

yeah

#

ive been using it and I think it's pretty clean tbh

steel heart
#

Yeah I mean sometimes python can be kinda annoying to debug but I did work with it like a lot and really appreciated it

prisma wave
#

it's really easy

steel heart
#

it's really fun

prisma wave
#

surprisingly fast too

steel heart
#

yup

steel heart
#

Is there anything similar to unit in Java?

prisma wave
#

void

#

closest analogy

old wyvern
#

bm

#

that name

#

oof

prisma wave
#

cc*

old wyvern
#

🙃

prisma wave
#

it's great

surreal quarry
#

@prisma wave i don't wanna flood development cause its active so im moving here

which remote configuration are you sayin to use

prisma wave
#

when you make a new configuration in intellij

#

the one called "Remote"

surreal quarry
#

oh yikes i missed the one actually called remote i only saw the bottom ones

#

my b

prisma wave
#

nice

formal pier
#

Hi

surreal quarry
#

BM do you always leave the startup flags or just add them back when you need to debug

prisma wave
#

I always have them

#

no point removing them

surreal quarry
#

alright cool

analog crater
prisma wave
#

👀

surreal quarry
#

he had a 140k member discord lol

prisma wave
#

had?

surreal quarry
#

has*

analog crater
#

Wtf gg

#

Whats his server?

surreal quarry
#

its called lover fam

prisma wave
#

ah yes

steel heart
#

CC I was thinking making methods return null with the wrapper class Void idk if its an actual wrapper class anyways. I mean yes its dumb but oneliners fingerguns

hot hull
#

Ew null

steel heart
#

Objects,requireNonNull{ }

static zealot
#

do you guys recommend MiniMessages? Like for a private plugin.

steel heart
#

Yeah its nice

winter iron
#

Alright

#

idk how to use pdm

#

i suck

#

very bad

steel heart
#

@prisma wave help this man

static zealot
#

you and me buddy

#

you and me

winter iron
#

he tried but im stupid

#

i think

#

:?

steel heart
#

That’s sounds kinda psycho blitz

#

Yeah but he is the creator

winter iron
#

I like how pdm takes my jar file from 13mb to 150kb

#

but like

#

it not work

#

😦

steel heart
#

Oh well 13 mb

#

Ngl you’re bigger than luckperms

winter iron
#

kotlin man

#

and sqlite drivers

steel heart
#

That can’t take 12

winter iron
#

just so it works in 1.8 too

steel heart
#

Shaded or not?

#

Or I mean

winter iron
#

not shaded

#

but its in jar

#

minimized

steel heart
#

Maybe it has libs like guava or smtng

winter iron
#

ish

prisma wave
#

@winter iron your problem is simple

#

your main class uses classes that are from libraries

#

when the class gets loaded, pdm hasn't run so those classes can't be found

#

solution: do everything in different classes or inside onEnable AFTER pdm runs

steel heart
#

Or load in static block

#

Okay you’re allowed to flame me cc

winter iron
#
override fun onEnable() {
        PDMBuilder(this).build().loadAllDependencies()
        
        lang = LangFile(this)
        refundGui = RefundGui(this)
        purgeInventoryGui = PurgeInventoryGui(this)

        commandManager = CommandManager(this)
        commandManager.register(RefundInventory(this), PurgeInventory(this))

        server.pluginManager.registerEvents(PlayerDeath(this), this)

        serverVersion18OrLess = isServerVersion18OrLess()

        saveDefaultConfig()

        selectDatabaseType()

        if (config.getBoolean("autoPurge.enabled")) {
            purgeTask = AutoPurgeTask(this, config.getString("autoPurge.purgeByTime", "1h") + "")
            server.scheduler.runTaskTimerAsynchronously(this, purgeTask, 0L, config.getLong("autoPurge.interval", 72000))
        }

        if (isEnabled) {
            enabledMessage()
        } else {
            server.consoleSender.sendMessage("&bInventoryRefund has been disabled!")
        }
    }
#

so pdm runs first

steel heart
#

Forgot it’s kotlin

winter iron
#

or is that not right

prisma wave
#

send the full class

winter iron
#

=paste

compact perchBOT
#
HelpChat Paste

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

winter iron
prisma wave
#

what's the error you're getting

winter iron
#

classnotfound

#

for kotlin

#

sec

prisma wave
#

you need to wait for the dependencies for load

#

your code isn't

#

it returns a CompletableFuture

static zealot
#

ugh anyone got a few examples for MiniMessages please? And sorry for jumping in your conversation LOL xD

winter iron
#

so should I do PDMBuilder(this).build().loadAllDependencies().thenRun {}

prisma wave
#

no

#

you'd have to do all of the initialization inside the thenRun

#

or, you can just block with join()

winter iron
#

PDMBuilder(this).build().loadAllDependencies().join()

#

?

prisma wave
#

yeah

steel heart
prisma wave
#

that'll possibly lag the server at first tho

steel heart
#

@static zealot

winter iron
#

not working

#

same error

prisma wave
#

what's the error

winter iron
steel heart
#

You sure he can use kotlin when loading it?

prisma wave
#

should be possible

winter iron
#

thats what i was maybe thinking

prisma wave
#

it requires a few workarounds though

#

send your new code and your buildscript

steel heart
#

Cc how did you work around that?

static zealot
#

the thing is Conclure that if I use MiniMessage.get().parse("text") it returns a Component. Do I have to convert that to a string?

prisma wave
#

you just have to make the compiler remove all the null checks at first @steel heart

#

@winter iron what command are you running to build?

winter iron
#

build copyJarToServer

prisma wave
#

hm

#

can you send the jar?