#dev-general

1 messages · Page 573 of 1

empty flint
#

I could use some gradle help again, maybe somebody knows what's going on:

I have a rootProject projA with no sources and only nested modules projB and projC.
projB is a library that provides methods that projC uses, so I included like so:

projA settings.gradle.kts

rootProject.name = "ProjA"
include(":projB")
include(":projC")

projC settings.gradle.kts

include(":projB")
project(":projB").projectDir = File("../projB")

projC build.gradle.kts

dependencies {
  implementation(project(":projB"))
}
#

The problem is now that projB builds fine but projC imports module projB, which includes a couple of plugins like kotlin, dokka, a versioning and the shadowJar plugins and then projC also tries to define them but since they are already on the classpath, that doesn't work.

#

Now the solution would be to place those plugins in the rootProject, and I can't get that to work.

I've declared them inside the projA settings.gradle file like so:

pluginManagement {
  repositories {
    ...
  }

  plugins {
    /* Java */
    id("java")

    /* Kotlin */
    id("org.jetbrains.kotlin.jvm") version "1.5.30"

    /* Dokka (Kotlin Javadoc) */
    id("org.jetbrains.dokka") version "1.5.0"

    /* Versioning plugin */
    id("eu.davidea.grabver") version "2.0.2"

    /* ShadowJar plugin */
    id("com.github.johnrengelman.shadow") version "6.0.0"
  }
}

and tried to reference them from the submodules, but gradle can'f find the plugins in question.

#

Any ideas on what to do?

#

I am trying to load them in the submodules in build.gradle.kts like so:

plugins {
    /* Kotlin */
    id ("org.jetbrains.kotlin.jvm")

    /* Dokka (Kotlin Javadoc) */
    id("org.jetbrains.dokka")

    /* Versioning Gradle plugin */
    id("eu.davidea.grabver")

    /* ShadowJar packaging plugin */
    id("com.github.johnrengelman.shadow")
}

and it compiles fine, but when I try to execute a task it throws an error:

#
Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources:
...
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
  ...
crude crystal
#

.

prisma wave
#

Ok

empty flint
#

Yeah that's about as far as I got with helping myself as well :/

#

Worth a try tho

#

I hate gradle

surreal quarry
#

gradle good

hot hull
#

gradle good maven bad

surreal quarry
#

sometimes when it can't find kotlin plugin, you need to add the mavenCentral() repo to your root project

sly sonnet
#

only beta males use maven

ocean quartz
#

Gradle is good, Gradle's API in other hand

prisma wave
#

What do we bet that's just base64

surreal quarry
#

it will be stored in a private github repo

static zealot
#

xD

surreal quarry
#

did you guys know you can hit . while looking at any gh repo and it will open vscode in the web browser

#

idk how im just finding this lmao

static zealot
#

yes

sly sonnet
#

vscode bad

static zealot
#

. is the shortcut

surreal quarry
#

yea thats pretty cool

static zealot
#

it is

surreal quarry
#

vscode isn't my favorite but it makes it pretty easy to make small changes lol

static zealot
#

yeah.

#

I use sublime as well

#

but still. I like it

sly sonnet
eternal compass
#

my Webstorm can connect to my SFTP server just fine in the SSH config section, but the SFTP connection errors with 'Connection Reset'. thoughts?

ocean quartz
#

Does your server allow non SSH connections?

eternal compass
#

the account is only allowed for sFTP

#

and infact, it worked last night

#

perfectly

ocean quartz
#

Oh, idk then, witchery

eternal compass
#

;-;

prisma wave
#

didnt the version part of the nms package get removed in 1.17?

old wyvern
#

Yes

prisma wave
#

does that include craftbukkit?

#

apparently not

old wyvern
#

ah

prisma wave
#

bukkit always gotta make things difficult

eternal compass
prisma wave
#

with reflection you can still grab the version from a CB class, and then just don't add it if it's above 1.17

#

with abstraction nothing has changed

eternal compass
#

ah

cinder palm
#

who wants to help me with something

ocean quartz
#

Someone

prisma wave
#

maybe

cinder palm
#

plssss

#

just 5 people

prisma wave
#

pls what?

#

what are we getting into?

cinder palm
#

just testing something out idk why

#

dont know what im doing in my life but yeah

#

its like if someone join a group

#

if i invite 4 people and they join then i get 25 gifcard but idk

#

i think its fake but its just fun

#

idc if its fake

ocean quartz
#

Oh you should have mentioned it earlier! If it is for you to definitely get a giftcard on a totally not scam thing we can definitely help!

cinder palm
#

cool

#

wait i will send:)

onyx loom
#

💀

ocean quartz
cinder palm
#

nvm it cant

prisma wave
#

that's a shame!

dawn hinge
#

look at the image jake

cinder palm
#

ah

#

its says this:Your message could not be delivered. receiving this comes personally allows you not to share a server with the recipient of only private messages from friends. The full list of reasons can be found here

prisma wave
#

💀

cinder palm
#

i think thats a scam

prisma wave
#

?

#

it's literally my website

#

look at the url

cinder palm
#

owhh

#

real or not

prisma wave
#

real ofc

dawn hinge
#

It's real

dawn hinge
#

I got a few for my family

prisma wave
#

😄

#

day 1230981 of wishing spigot docs had @since

old wyvern
#

🥲

#

Imagine having good documentation

cinder palm
#

but does someone wanna help to join that group??

onyx loom
#

shall i make a pr adding them all

prisma wave
#

please

old wyvern
obtuse gale
old wyvern
#

Take a hint

prisma wave
cinder palm
old wyvern
#

😂

cinder palm
old wyvern
#

Then dont pull others into it

prisma wave
#

when was player.spigot().sendMessage(ChatMessageType.ACTION_BAR, added, 1.13?

prisma wave
old wyvern
#

^

cinder palm
#

0_-

old wyvern
prisma wave
#

i guess so

onyx loom
#

well not 1.12, so prob

#

d;1.13 Player.Spigot#sendMessage(ChatMessageType)

prisma wave
#

virgin spigot docs vs chad docdex

ruby craterBOT
#
void sendMessage(java.lang.String[] messages)```
Description:

Sends this sender multiple messages

Parameters:

messages - An array of messages to be displayed

ocean quartz
#

I could be wrong but i think it was a thing in 1.8

prisma wave
#

🥴

onyx loom
#

damn it

old wyvern
#

Piggy should add a "since" check into docdex

prisma wave
onyx loom
#

is this to do with the docdex thing pig said earlier in devden?

prisma wave
#

maybe

old wyvern
#

Is this for actionbar messages?

prisma wave
#

yeah

old wyvern
#

If so I think at some version it was under player.spigot().blahblah

prisma wave
#

it still is

old wyvern
#

And then they moved it to the new one you mentioned

#

oh really?

prisma wave
#

yup

old wyvern
#

welp

onyx loom
#

?docs

compact perchBOT
old wyvern
#

md_5 the chad back at it again

prisma wave
#

you can't return inside of a static init block?

#

wtf

onyx loom
#

sendMessage(ChatMessageType) is in 1.12 too, its prob a 1.8 thing too like matt said

sweet cipher
prisma wave
#

hmm

ocean quartz
#

Actually 1.8 doesn't have the enum

#

1.10 might though i think

#

I remember playing with this before

#

But then said fuck it and used adventure

obtuse gale
ocean quartz
#

Does the .spigot() stuff show in the docs?

prisma wave
#

WOW

#

yeah

#

under Player.Spigot

obtuse gale
#

Mhm

#

That site is awesome

onyx loom
#

smh

obtuse gale
#

Too bad it's spigot only

onyx loom
#

imagine not using helpchat docs

obtuse gale
#

HelpChat docs 😵‍💫

ocean quartz
#

d;1.13 Player$Spigot#sendMessage(ChatMessageType)

ruby craterBOT
#
void sendMessage(java.lang.String[] messages)```
Description:

Sends this sender multiple messages

Parameters:

messages - An array of messages to be displayed

ocean quartz
#

Huh

prisma wave
#

oh 1.9 apparently

#

well kind of

#

1.9.2???

#

wasnt that a patch update

#

im going to cry

onyx loom
#

indevidual

prisma wave
#

it's also a static method that takes a Gun IN the Gun class for some reason

#

it's so cursed

onyx loom
#

🥴

prisma wave
#

not to mention the evil method name, presumably to stop him from forgetting what method to use

#

💀

old wyvern
#

What the fuck

#

@ocean quartz HelpChat CTF after Plugin Jam???

#

👀

ocean quartz
#

Oh boy

#

Idk how that'd go xD

old wyvern
#

Doesnt have to be anything too hard xD

#

Might be fun

ocean quartz
#

Could be fun yeah, bring it up with Piggy see what he thinks

old wyvern
#

Alrighty

#

@quiet depot ^^^

sweet cipher
#

What is CTF?

old wyvern
#

Capture the flag

distant sun
#

Not bad

#

Don't send pictures of code

ocean quartz
#

@old wyvern Is this comment correct?

old wyvern
#

Definitely not xD

#

Probably remains from copy-pasting the above function

#

🥲

#

The function name is mostly self explanatory

ocean quartz
#

Okay lmao, i thought i was in the right place but the comment made me confused xD

old wyvern
#

xD

eternal compass
#

is this person trolling?

#

the !ping shows a message saying not to ping

prisma wave
#

!ping

ocean quartz
eternal compass
eternal compass
prisma wave
#

...

eternal compass
#

what do I reply?

#

like... why?

ocean quartz
#

Please delete the image

#

Lmao

eternal compass
#

what do I say?

prisma wave
#

Please delete the image

#

You will be hearing from my lawyer

eternal compass
prisma wave
#

🙃

eternal compass
#

actually he's not english, that makes me feel better. he's not just an idiot

prisma wave
#

lol

#

figures

#

no native speaker would say "This is not intentional"

eternal compass
#

true true

prisma wave
#

unless they were an idiot

#

which is a possibility

ocean quartz
#

@old wyvern Do you know why this file always gets deleted on run?
Like file.exists will always be false

old wyvern
#

oh what

#

It shouldnt get deleted unless its a clean build

ocean quartz
#

Exactly, but it's always deleted for some reason

#

Huh, the entire folder gets nuked on rebuild

old wyvern
#

rebuild as in the rebuild option in the ide?

#

Or did you just run shadowJar

#

it shouldnt get deleted on shadowJar

ocean quartz
#

Yeah running shadowJar always removes the folder

#

Really odd

old wyvern
#

ah

#

weird

gusty glen
ocean quartz
#

He's entirely cursed

gusty glen
#

JUnit is skipping one of my tests without any errors, hmm

steel heart
#

assertTrue(false) helu

prisma wave
#

hmmmmmmmmm

#

arrays

#

acting rather sus

quiet depot
#

@old wyvern how would we run a ctf

#

don’t you need a bunch of servers

half harness
prisma wave
#

I don't know

#

It just doesn't compile without it

#

It's extremely cursed

half harness
#

context? ;-;

#

now im curious

prisma wave
#

seems like kotlin has never heard of the functor laws

#

Uh

#

Generic types and guice and stuff

#

binding a parameterised type but reflectively

distant sun
quiet depot
#

plugin?

#

I think we’re thinking of different types of ctf

rotund egret
jovial warren
#

lol

ocean quartz
#

Google's definition is like:

#

Capture the flag is a traditional outdoor sport where two or more teams each have a flag and the objective is to capture the other team's flag, located at the team's "base", and bring it safely back to their own base.

#

Image it shows

quiet depot
#

In hacking, a wargame (or war game) is a cyber-security challenge and mind sport in which the competitors must exploit or defend a vulnerability in a system or application, or gain or prevent access to a computer system.A wargame usually involves a capture the flag logic, based on pentesting, semantic URL attacks, knowledge-based authentication,...

ocean quartz
#

"Outdoor"

rotund egret
#

It takes it from wikipedia, hence the images 😛

jovial warren
#

yeah

quiet depot
#

matt is wargame the ctf u were thinking of?

ocean quartz
#

No no, i knew it was the security one, was just commenting on google's stuff

sweet cipher
#

First to find Barry's ip address wins

jovial warren
#

I mean, that definition of capture the flag is correct, CTF is usually played outdoors

quiet depot
#

ctf’s just sound really aids, hard, and expensive to set up

steel heart
#

I like

ocean quartz
#

Oh god

#

That's so old

jovial warren
steel heart
#

Old as gold

ocean quartz
steel heart
jovial warren
#

MF JDA bad Brigadier good lol

ocean quartz
#

What? lol

jovial warren
#

not even kidding either, BardyBot uses Brigadier lol

obtuse gale
#

brig is nice

jovial warren
#

Brigadier is really good

#

I might actually try suggestions with it in BardyBot at some point as well lol

#

not exactly sure how suggestions would work with Discord commands though

obtuse gale
#

it would be better with:

  1. CommandContext::getOptionalArgument instead of ::getArgument and throwing an exception
  2. Flags
jovial warren
#

Yeah

obtuse gale
#

But hey I quite like it as-is, I really like the tree structure it designs around the concept of a "command"

#

I like trees lol

jovial warren
#

It also would be better if Mojang fixed all of the currently open issues, but hey ho

obtuse gale
#

Well they did merge a few PRs and worked on a few issues for 1.0.18 for 1.17

#

which leads me to believe it's definitely not abandoned

#

it's also not top priority, I mean, it's expected

jovial warren
#

Still haven't fixed that redirect arguments issue though

obtuse gale
#

This is th

#

BARDY

#

I was gonna link that

#

lmao

#

that's quite important if you ask me

jovial warren
#

Yeah, it is

obtuse gale
#

and the issue is so well explained lol

#

love it

jovial warren
#

I had to port Velocity's shallow copy fix to sort the issue out properly lol

obtuse gale
#

I really like the way the community engaged with that project though

distant sun
obtuse gale
#

unlike the unnamable

jovial warren
#

Name it

obtuse gale
#

n0

jovial warren
#

Thought that was the one

#

In fact, I'm dumping that completely once I have finished porting the data converter and making my library for the serialisation stuff because it sucks

#

The DFU is slow, convoluted, and is a perfect display imo of why that level of functional programming isn't suitable in Java

obtuse gale
#

they shoulda made it in clojure 😌

jovial warren
#

Lol

#

I think that would translate over worse in Java than the current DFU

#

From the excessive optional usage, the data result shit, and the dynamic stuff, it's all round trash

#

Functional programming in Java of the DFU's kind sucks

obtuse gale
#

vavr tho

#

speaking of vavr

#

@prisma wave hi

prisma wave
#

HELLO

prisma wave
#

All the value types have that

#

It's apparently safe for some reason

obtuse gale
#

man java generics are so weird

prisma wave
#

yes

jovial warren
#

Oh yeah, Either sucks too

#

DataResult (I guess a kind of Option) and Either in the DFU are two of the worst classes

half harness
#

#showcase message @hollow walrus make sure to set allowed mentions to none, or else people can ping everyone depending on the bot's perms lol

hollow walrus
#

what

#

dkim look man

#

im over you

#

im seeing other people

half harness
#

?

hollow walrus
#

ik you want me so bad

half harness
#

wat

hollow walrus
#

but its over

half harness
#

ok

hollow walrus
#

OVER

#

fucking loser

half harness
#

lol

ocean quartz
#

im already with blitz
I wonder if Blitz is also with youthonking

half harness
#

nope

#

🥰

urban sleet
#

Hey dkim the other day you mentioned something about a packet listener, how'd you set that up if you don't mind telling?

half harness
#

wdym?

#

oh

#

protocollib?

urban sleet
half harness
#

oh

#

i can give the exact code if u want

urban sleet
#

Sure

half harness
#

its not in java.. but it should be simple enough to understand

#

hopefully

urban sleet
#

But how do you then use it? Do you inject it into mc or something?

half harness
#

well

#

idk

#

protocollib handles it

#

all i do is "run this when this packet gets received"

urban sleet
#

Interesting

half harness
#
val types = mutableSetOf<PacketType>()
types.addAll(PacketType.Play.Client.getInstance().values())
types.removeAll(setOf(
    PacketType.Play.Client.KEEP_ALIVE,
    PacketType.Play.Client.PONG,
    PacketType.Play.Client.POSITION,
    PacketType.Play.Client.POSITION_LOOK,
    PacketType.Play.Client.LOOK,
))
ProtocolLibrary.getProtocolManager().addPacketListener(object : PacketAdapter(this, types) {
    override fun onPacketReceiving(event: PacketEvent) {
        Bukkit.broadcastMessage("Packet: ${event.packetType.name()} from ${event.player.name}")
    }
})
```this is the code
#

oh hi matt

ocean quartz
#

Also Dkim, now sure if you already found it or not but you can turn this on again

#

The big icons

hollow walrus
#

what the fuck does protocol lib do

half harness
#

oh wait yea

#

it automatically fixed

#

when i updated

#

(since i already had it enabled)

ocean quartz
#

Well not fixed it's to-gabble now

half harness
half harness
#

it seems back to normal for me

#

¯_(ツ)_/¯

ocean quartz
#

Means it's off by default and you have to turn it on

half harness
#

oh

urban sleet
half harness
#

_ _

hollow walrus
#

like what packets like client side packet like i can show npcs to only some players or open a check for only some players or do stuff for a player that others can see

half harness
half harness
#

if you cancelled all movement packets

#

no one would see any other players moving

#

since they wouldn't be receiving the movement packets

hollow walrus
#

sick i can use that to scare players

half harness
#

👀

hollow walrus
#

😳

ocean quartz
#

I mean that's basically just cancelling move event

half harness
#

but for some players

hollow walrus
#

okay i kinda have this question

#

so you know my Mafana Inventory api

half harness
#

nope

urban sleet
#

Lol

hollow walrus
#

i sent it in the showcase

#

my issue is for me to use the api fully i can to add the bot in the plugin my issue is what if i want to use something that uses the api thats out side the plugin

#

what do i do

obtuse gale
#

@urban sleet tier 2 woooo!

#

Now you're a cool kid that can send images and attach embeds

hollow walrus
#

ofc thats all you say

#

what

urban sleet
#

Yay now I no longer have to upload all my images to my site

hollow walrus
#

what what what

#

thats what you did when we were dating

half harness
#

wat

#

isn't your api meant to be in a plugin

#

so it'd be impossible to use it.. outside of a plugin?

hollow walrus
#

"oh its my birth day" dkim: wat

half harness
#

fake

hollow walrus
#

so i can use it out side the plugin

half harness
#

then... run the api code outside of the plugin?

#

what is limiting you from using it inside of a plugin

hollow walrus
#

issue is i need to decode the bite 64

#

to itemstacks

half harness
#

bite 🥲

hollow walrus
#

stfu

#

you know what im talking about

quiet depot
#

go spigot source

#

copy code

hollow walrus
#

ok

obtuse gale
#

@quiet depot

quiet depot
#

@obtuse gale

half harness
#

@quiet depot

obtuse gale
#

😌

quiet depot
#

@half harness

hollow walrus
#

i cant wait any longer

quiet depot
#

paste

hollow walrus
#

thats it?

obtuse gale
#

Lmao

quiet depot
#

then use pasted code

hollow walrus
#

if its that easy then thank u piggy man

#

always there to sav the day

quiet depot
#

did you just assume my gender

quiet depot
#

that’s racist

hollow walrus
ocean quartz
#

That moment you get back to working on something after a few months and you have no idea what past you meant

obtuse gale
quiet depot
#

phew

hollow walrus
quiet depot
ocean quartz
#

Damn, that's actually possible

half harness
ocean quartz
#

Nice lol

eternal compass
#

@everyone

loud gyroBOT
#

The 'everyone' mention is disabled so you can't annoy people.

eternal compass
#

Why on earth do people try pinging everyone

sweet cipher
eternal compass
#

yes I agree

#

@sweet cipher

sweet cipher
rotund egret
#

Remember when you could @ someone

#

I miss that

pallid gale
#

quality update that was

sweet cipher
#

@tight fern?

#

oops

pallid gale
#

banned

sweet cipher
#

It was autocorrect

#

Definitely

eternal compass
ocean quartz
#

@prisma wave Implementation works well now, basically you can have different implementations for the same subcommand, using the priority due to complicit for things like String, if you have Int then Enum the priority wouldn't be needed, but String, Int and you don't give higher priority to Int then it'd always be String
no idea how this will work out with completion yet though, i'll figure that later
also ignore the printstream, just needed something to act as sender

ocean quartz
#

Rewriting command lib

rotund egret
sweet cipher
rotund egret
#

Yeah, but like

#

Not actually someone

old wyvern
sly sonnet
#

@someone

obtuse gale
#

Custom resource pack only for server?

#

I didn't know that can change... once I change it, every chest is changed... is it connected to specific plugin?

vivid sleet
#

Custom resource pack and yeah can apply texture to any GUI

#

And multiple

#

That texture works with any crate plugin that has a csgo style “spin”

obtuse gale
#

Waa... Didn't know that.. there no tutorial in youtube sadly... I'm too dumb to understand

vivid sleet
#

But it was a commission

#

Yeah it’s kinda new no tutorials really

obtuse gale
#

Hmm i'll wait till someone can teach

obtuse gale
vivid sleet
#

I have a couple public resources anyone can reverse engineer for a couple bucks

#

If they don’t want the hassle or wait for it to become more general common knowledge

#

¯_(ツ)_/¯

prisma wave
#

Looks good, I can't actually remember why I needed that though 🙃

cedar jolt
#

I'm having an issue with one of my font-awesome icons not showing - every icon shows apart from the tiktok one.

#
<div class="social-links">
<a href="#"><i class="fab fa-discord"></i><span>discord</span></a>
<a href="#"><i class="fab fa-twitter"></i><span>pinterest</span></a>
<a href="#"><i class="fab fa-youtube"></i><span>youtube</span></a>
<a href="#"><i class="fab fa-reddit"></i><span>reddit</span></a>
<a href="#"><i class="fab fa-tiktok"></i><span>tiktok</span></a>
    
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">


</div>```
tight fern
#

lol

quiet depot
#

@cedar jolt ur fa is outdated

#

tiktok was released in 5.13.1, you're on 5.8.1

cinder flare
#

fat awk

quiet depot
#

latest fa is 5.15.4

obtuse gale
#

how did they get to use an external emoji without boosting ??

quiet depot
#

not sure

#

won't happen again

#

well I mean the permission was set to true for some reason

#

just not sure why

#

@pallid gale any insight on this?

cinder flare
#

i think discord borked bots

#

so barry couldn't use external emoji without that perm

#

i vaguely remember us talking about it lol

obtuse gale
#

huh

#

also btw

quiet depot
#

k turned it back on then

obtuse gale
#

HI @cinder flare !!!

cinder flare
#

sahhh dude

#

wanna play dead by daylight with me 🙂

#

remence and i play sometimes

obtuse gale
#

a game I don't have nor have intentions of having?

#

hmm

#

maybe

cinder flare
#

your loss /shrug

obtuse gale
#

lol

#

in other news

#

I booked a uh.. thing, to renew my Italian passport and gtfo of here within the next 10 years

#

woo

quiet depot
#

ur italian?

cinder flare
#

damn g, italian!

obtuse gale
#

nope

cinder flare
#

and 10 years, phew

quiet depot
#

what r u

cinder flare
#

brazil

obtuse gale
#

a human

quiet depot
#

r u even human

#

argentina star

cinder flare
#

she has confirmed

obtuse gale
#

you're a pig

cinder flare
#

yeah whatever

obtuse gale
#

:\

quiet depot
#

try those seed things i was talking about before u leave

#

I can't remember what they're called

cinder flare
#

man argentina a long boi

#

look at it go

obtuse gale
quiet depot
#

no that's the chemical in the seeds

obtuse gale
#

I too can read

quiet depot
#

shocking news

cinder flare
#

english do be kinda hard tho

obtuse gale
#

'cause

#

that's what the name reminded her of

cinder flare
#

is NC North Carolina lol

obtuse gale
#

yeah

cinder flare
#

wow never seen someone abbreviate a state name like that lol

obtuse gale
#

lol

ocean quartz
quiet depot
#

I never knew it meant north carolina

#

I've seen that abbreviation quite a few times and never knew what it meant

cinder flare
#

there ya go

#

wait how often are you talking about a shitty state like North Carolina as an Australian lmao

obtuse gale
#

🤣

quiet depot
#

idk probably seen it on reddit

distant sun
#

can py programs be made to run on computers that don't have py installed?

ocean quartz
#

I think you can make .exe file with it which will install .dll stuff

cinder flare
#

using python for more than just scripting upsidedowntears

old wyvern
#

You could use Cython and compile to C

cinder flare
#

ooh that would actually be pretty cool

gusty glen
quiet depot
#

it's open source

gusty glen
#

But maybe he didn't commit it yet

empty flint
#

Quick software paradigm I wanna ask you guys. Say you have states A and B, and you want to guarantee that if you change state A, then state B changes as well and if state B has changed, you can infer state A has changed as well. Changing state A can be rolled back or committed (like in SQL) but changes to state B are final. Changing a state can fail though and if you change A and it fails, then B must not change either (and vice versa)

#

How would you go about this?

old wyvern
#

if you change state A, then state B changes as well and if state B has changed, you can infer state A has changed as well Sounds like they are just the same property

#

Single source of truth is better. I'd say go with just one property

empty flint
old wyvern
#

from your description I assumed both were properties in some table in the same database

surreal quarry
#

strings not workin!

old wyvern
#

workin not workin!

obtuse gale
#

@ocean quartz speaking of TODO messages

ocean quartz
#

Nice, i'm glad i'm not the only one lmao

distant sun
#

🤣

#

Iij now adds the date to // todo, can't wait to see TODOs from 2021 in like 2025 :))

ocean quartz
#

Yeah, that's temporary

gusty glen
#

I see, btw nice idea for that lib, let me ask you how the user would register the BaseCommand?

ocean quartz
#

You just instantiate the class that extends it

@Command("foo")
class YourCommand : BaseCommand() {
  @Default
  fun default(sender: Player) {}
}
// then
commandManager.register(YourComand())
empty flint
#

@old wyvern got a minute now by any chance?

frail glade
#

Roasted.

obtuse gale
#

which is an incredibly stupid name but it does the job

prisma wave
#

is there a way of getting a BlockData without actually placing a block

distant sun
#

d;spigot Material#createBlockData

ruby craterBOT
#
@NotNull
public BlockData createBlockData()```
Description:

Creates a new BlockData instance for this Material, with all properties initialized to unspecified defaults.

Returns:

new data instance

distant sun
#

@prisma wave

prisma wave
#

ahhhhhhhhhhhhh

#

thanks

obtuse gale
old wyvern
obtuse gale
empty flint
#

I mean studying is more important so don't stress about me. I just can't get this damn gradle plugin to work and you seem to be the only one who knows this shit

distant sun
#

Ikr em

ocean quartz
#

Thanks Gradle, very useful

ocean quartz
#

@old wyvern 😩

steel heart
#

😌

ocean quartz
#

First build

#

Subsequent

#

However there is an issue, Gradle doesn't consider dependency changes to be a task change so it'll stay "up to date" even though the dependencies are different thonking

steel heart
#

And me who gave up on the maven mojo

ocean quartz
#

Understandable lmao

steel heart
#

Btw I’m watching fog wars

#

It’s good

ocean quartz
#

Fog wars? You mean Food wars? xD

steel heart
#

Yeah

#

But holy moly

#

There’s just so many episodes

ocean quartz
#

It's alright, it was fun in the beginning, but then it got very repetitive

steel heart
#

Well imo

#

Understandable

ocean quartz
#

Ubuntu is so threatening "This incident will be reported"

prisma wave
#

relevant xkcd

ocean quartz
#

Lmao

obtuse gale
#

lmao

old wyvern
#

Could probably use that

sly sonnet
obtuse gale
#

for java 16 sure

#

this is worldguard lol

wind patio
#

wg java 16 when

ocean quartz
old wyvern
#

I think its a method on task

ocean quartz
#

Can't seem to find it

ocean quartz
#

Let me play around with it

#

Okay found something that might work

#

This completely prevents the caching

#

Which means we can do some checks inside to see if dependencies changed

old wyvern
#

😮

#

That would affect the slimjar.json as well I guess

ocean quartz
#

Only if we set it to affect it too

old wyvern
#

ohh

empty flint
#

Anybody know what the kotlin-dsl version of this piece of groovy code would be?

dependencies.ext.printStr = { final String str ->
  println(str)
}
#

I can call that piece of code from another .gradle file in build.gradle.kts using printStr("bla"), but I would like to convert the other file into kotlin as well

old wyvern
#
fun DependencyHandler.printStr(str: String) = println(str)
fun DependencyHandlerScope.printStr(str: String) = println(str)
empty flint
#

what's the difference between DependencyHandler and DependencyHandlerScope? and do I need both?

old wyvern
#
dependencies // DependencyHandler

dependencies {
  // DependencyHandlerScope
}
empty flint
#

gotcha, thanks a bunch!

old wyvern
#

You wont be able to call this in the same way from groovy btw

empty flint
#

that's fine, I'm only using kotlin anyhow

old wyvern
#

Alrighty

empty flint
#

what's the syntax for referencing the instance of the class you are extending again?

old wyvern
#

What?

empty flint
#

like how do I get the DependencyHandlerScope instance

old wyvern
#

oh I get what you mean

#

use the this keyword

empty flint
#

ah I wasn't sure anymore, thanks!

#

well shit, that didn't work either xD

old wyvern
#

That should work just fine

#

make sure you define it in the top level

#

And import it

empty flint
#

I did, here's the code:

spigot-version.gradle.kts

#

and the import:

#

the apply works just fine, I can print stuff from that script

old wyvern
#

There isnt an import there

#

try Alt + Enter on the red coloured function call and import it

empty flint
#

nah it just prompts me to create the function

#

shouldn't the apply from file work?

#

the script is there

old wyvern
#

I assume its because apply doesnt really let the compiler know that that script is actually executed

empty flint
#

works if the script is groovy tho :/

old wyvern
#

Yea, groovy can do dynamic typing

empty flint
#

any ideas to emulate that?

#

because it seems like in this case, kotlin bad 😦

old wyvern
#

I'm not really sure, sorry. I usually stick with the groovy dsl

empty flint
#

hmm it's alright, you've helped already as is

#

Do you have any ideas how else I could accomplish this?

#

But if I use a .kt file, I don't have access to the gradle api

jovial warren
#

you need to put it in buildSrc

#

or make your own build-logic folder and include it in the build

empty flint
#

I did

#

struggling with the buildSrc dependencies now

jovial warren
#

you gotta add the kotlin-dsl plugin btw

empty flint
#

can't get the project.repositories.maven to work

jovial warren
#

to buildSrc's build script

empty flint
jovial warren
#

rebuild?

empty flint
#
plugins {
  groovy
  `java-library`
  `java-gradle-plugin`
  `kotlin-dsl`
  kotlin("jvm") version "1.5.30"
}

repositories {
  mavenCentral()
  maven("https://plugins.gradle.org/m2/")
}

dependencies {
  implementation("org.codehaus.groovy:groovy-all:3.0.8")
  implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.30")
}
#

IntelliJ code completion shows it's there but I get this error:

spigot-version.gradle.kt: (21, 26): None of the following functions can be called with the arguments supplied: 
public abstract fun maven(p0: Closure<(raw) Any!>): MavenArtifactRepository defined in org.gradle.api.artifacts.dsl.RepositoryHandler
public abstract fun maven(p0: Action<in MavenArtifactRepository!>): MavenArtifactRepository defined in org.gradle.api.artifacts.dsl.RepositoryHandler
#

and closureOf<String>(...) also isn't recognized for some reason

jovial warren
#

you tried just naming it spigotVersion.kt or something?

#

also, this is in src/main/kotlin right?

empty flint
#

yep and no, I didn't try to rename it

#

but sure, I guess i should

empty flint
#

dude finally

#

project.repositories.maven { url = URI(dependency.url) }

#

this worked

jovial warren
#

lol

half harness
#

btw @ocean quartz if you press Q with an item in the GUI the item drops...

#

and does it use PDC?

ocean quartz
#

Cancel the event

#

And depends on the version

half harness
#

i used disableAllInteractions

#

1.17

ocean quartz
#

Still, cancel the event

half harness
#

ok

ocean quartz
#

And yeah in 1.17 it uses PDC

half harness
#

ill test with event cancelled

#

it should work i think

ocean quartz
#

Well Secretx forgot a few interactions i think

urban sleet
#

Not sure where to ask this, maybe some of you here know:

What's the best way to create a server that can be scaled? I'm looking into methods like sharding the servers
The best way for me to describe the game without talking about what we're doing is saying it's similar to skyblock

surreal quarry
#

kubernetes

#

depending on how much you will be doing it you could manually do it with just docker yourself, but i believe kubernetes can help automate it a bit

#

i don't have much experience, but i know its possible

#

@urban sleet

urban sleet
#

Interesting, I wonder if that's possible to use though since I use pterodactyl

surreal quarry
#

yea i kinda doubt it

urban sleet
#

As do I

surreal quarry
#

you could manually do it yourself and just make a ton of servers in ptero and turn them on/off as you need

#

but thats no fun

urban sleet
#

Yeahh

surreal quarry
#

when you say similar to skyblock, im assuming you mean hypixel skyblock
i obviously don't know exactly how they do it, but my best guess is they have a docker image for each of their different servers, so maybe hub, mining, farming or whatever the worlds are called its been a while since i played, then they have some sort of kubernetes orchestration spinning up new instances or shutting them down as needed.

obtuse gale
#

i obviously don't know exactly how they do it

#

why not

urban sleet
#

Like I said - the game isn't exactly Skyblock, the game is close enough though that I can say that and the same steps will apply

ocean quartz
#

Yo, wtf @obtuse gale, have you ever had gradle yell at you about not being able to find compileOnly when using com.github.hierynomus.licenses?

urban sleet
ocean quartz
#

Literally copied the same thing i have on another project but on this one it screams lol

obtuse gale
#

is IJ yelling or gradle yelling?

#

like, does gradle run?

ocean quartz
#

Gradle

obtuse gale
#

hm

ocean quartz
#

Let me show you, join room 1

obtuse gale
#

wait a sec this is being filtered through the jpeg machine

surreal quarry
ocean quartz
#

Oh was it bad? lmao

obtuse gale
#

yes lol

ocean quartz
#

Let me try again

obtuse gale
#

just send a screenshot ig, does it really matter?

ocean quartz
#

Yeah i'll just screenshot

obtuse gale
#

kek

ocean quartz
#

Wtf is happening

#

this is inside subprojects btw

obtuse gale
#

hm lemme check rq

ocean quartz
#

Imma try the good ol invalidate caches

obtuse gale
#

Matt you doofus

ocean quartz
#

o

#

What did i do

obtuse gale
#

it's not licenses, it's license

#

lmao

ocean quartz
#

Wtf

obtuse gale
#

gotta say gradle does the weirdest shit when something fails

ocean quartz
#

I shouldn't be coding at 3am

#

Imma go kill myself now

obtuse gale
#

can i go with you?

ocean quartz
#

Sure

tranquil crane
#

since when can roles other than nitro booster use external emotes EmiPeek

obtuse gale
#

since

ocean quartz
#

Happened earlier today too i think

#

Cubeeee

tranquil crane
#

quick spam bees while I still can minecraftbee

surreal quarry
obtuse gale
#

oh god

surreal quarry
ocean quartz
#

How many bees do you have?

tranquil crane
#

that's all of them

surreal quarry
#

at least mc_bee

tranquil crane
#

hang on one more

#

there

ocean quartz
#

Good job Matt, good job

#

Also, slack has a really cool feature, you can add kinda like verified badges to some users

#

Maybe Discord can copy that as well

obtuse gale
#

"HypeSquad" 🤡

ocean quartz
#

Kek

#

Seemed cool at launch, turned out to just be really useless lol

obtuse gale
#

what even is it

ocean quartz
#

Basically, you get spam emails

#

That's all

obtuse gale
#

oh sweet

#

the problem is how discord started moving more towards a "corporate" position

#

eeeeeeeeee

#

discord used to be cool

ocean quartz
#

Yeah, i just got an email today from hypesquad with a survey to give them feedback

#

I feel like they won't be too happy with the results

tranquil crane
#

Ah yes thank you

obtuse gale
#

huh today I found out about this

#

@ocean quartz you'll love that one

tranquil crane
#

He should just put it on every line of his code

ocean quartz
#

Haha, i just saw your message and went to spam it on my code and you ping me right after 🥲

obtuse gale
#

xD

half harness
#

did i report it as spam or something

#

lol

#

or maybe theres an unsubscribe button?

#

¯_(ツ)_/¯

half harness
obtuse gale
#

would i use paper or spigot for a anarchy server

jovial warren
#

always use Paper

#

anyone here know if it's possible to break an encoded value encoded like this: ```java
public static int getLocationKey(final int x, final int y, final int z) {
return (x & 15) | (((z & 15) << 4)) | ((y & 255) << (4 + 4));
}

#

and if so, how?

#

nvm, finally figured it out lol

#

bitwise is annoying

distant sun
#

share 😄

jovial warren
#

with pleasure

#

right, let's break this down first

#

x & 15 just makes sure the X value is less than or equal to 15, same with z & 15, and y & 255 makes sure the Y is between 0 and 255
so, we encode the Y value in the first 8 bits, then the Z value in the next 4 bits, and the X value in the last 4 bits

#

then we decode like this: ```
x = encoded & 15
y = (encoded >>> 8) & 255
z = (encoded >>> 4) & 15

#

we use an unsigned shift to tell the sign bit to fuck off

#

also works with a regular signed shift though

#

the way you figure out how to decode this sort of stuff is by breaking down how it is actually encoded

#

take the algorithm, get some random (or known) values, print them in to binary, then encode them and look for the binary in the encoded value

#

e.g: Original: 9, 140, 12 Original (bin): 1001, 10001100, 1100 Encoded: 36041, bin: 1000110011001001here, I can clearly see that first 1001 (X) is all the way on the right, and then 1100 is to the left of that value, and then 10001100 is all the way to the left

#

once you do that, it's really easy to know how to break it down, you just want to get the bits of the value you want to extract all the way to the right so they become the value

oak coyote
#

(Y)(Z)(X) is your example, so good lecture; clear, concise and has some examples to aid in learning

jovial warren
#

you complimenting my ability to teach? 😊

#

if so, thanks

oak coyote
jovial warren
#

I mean, teaching is the career I want to go in to, so it's good to see I'm already quite good at it

#

if anyone gets stuck anywhere in what I said btw, feel free to ask away

oak coyote
#

Now you sound like a true teacher

half harness
#

lol

jovial warren
#

lol

#

man, this has reminded me that I need to keep writing Krypton's wiki lol

half harness
#

the part i got confused was what the & and | did..

but i never used bitwise stuff so that's probably why xD

half harness
jovial warren
#

& is a bitwise AND operator, let me show you how it's done with 2 really easy 4 bit numbers, let's say 15 and 7 for example

#
  1111
& 0111
------
  0111
```now, this may seem confusing at first, but basically, what AND does is returns true only if both inputs are true, so in this case, when both binary values are 1, the value is 1, else the value is 0
half harness
#

oh

#

so it'll just max out at 7?

jovial warren
#

yes

half harness
#

so what you did with z & 15

#

if z was > 15

#

it would just max out at 15?

jovial warren
#

it would clamp it to 15, yes

half harness
#

ooh

#

interesting

jovial warren
#

and the | is a bitwise OR

#

now, where AND requires that both inputs are TRUE to output TRUE, OR only requires that one input is TRUE to output TRUE

#

so, if both inputs are FALSE, it will output FALSE, else it will output TRUE

#

in this case, if both values are 0, it will output 0, else it will output 1

wind patio
#

0, 0 -> 0
1/0, 0/1 -> 1, right

#

1, 1 -> 1

half harness
#

oh

jovial warren
#

0 | 0 = 0
1 | 0 = 1
0 | 1 = 1
1 | 1 = 1

half harness
#

so if it's either one

jovial warren
#

yeah

half harness
#

it'll go to 1

jovial warren
#

yes

#

there are a few more, like NOT and XOR

half harness
#
Original (bin): 1001, 10001100, 1100
Encoded: 36041, bin: 1000110011001001
```but how does that make that huge number?
jovial warren
#

let's break it down

#

so, first, let's get our encoded values

#

our encoded X is 1001, our encoded Y is 10001100 and our encoded Z is 1100 (same as input values because we have no clamping)

#

so, what we do is we shift the Y value all the way over to the left, to end up with 1000110000000000, then we shift the Z value over by 4, so we put it in those next 4 bits, then ending up with 1000110011000000, then we put the X value in there, so ending up finally with 1000110011001001

half harness
#

ohhhhhh

jovial warren
#

if you put spaces in there, you can see the values broken down easier: 10001100 1100 1001

#

now can you see the Y, Z, and X we just encoded?

half harness
#

oh so that's what the << does?

#

yes

jovial warren
#

<< is a shift left

half harness
#

so if i did 5 << 2 it'd be 10100?

jovial warren
#

lemme show you an easy example with 204 and shifting right by 2: ```
11001100

2


00110011

#

can you see what we've done here?

half harness
#

yes

jovial warren
#

we've shifted the bits of the value over to the right by 2

#

now, with left shift, we just go the other way

#

so, ```
11001100
<< 2

00110000

half harness
#

btw, afk for a min, ill brb

jovial warren
#

and you can see that we fill the left/right with 0 when we shift

jovial warren
half harness
#

alr back

half harness
#

so if you did 11001101 << 2would the outcome still be 00110000?

#

it just removes the stuff on the right?

jovial warren
#

no, it would be 00110100

#

since we need to move that very right bit over as well

half harness
#

oh wait

#

wait i went the wrong way

jovial warren
#

if it was a right shift, it would be 00110011

half harness
#

i just copied and pasted from the one above and forgot that it was left shift

#

oops

jovial warren
#

right shifts are also split in to signed and unsigned, one carrying the sign bit, and another not

dusty cypress
#

Hi on vote partyt i can't set when the vote counter is at 50 , the plugin give the rewards when the party start but i want to give the rewards when the party is end

half harness
jovial warren
#

yes

#

if you don't know what the difference between a signed and unsigned integer is btw, I can explain that too

half harness
#

isn't unsigned positive only?

#

¯_(ツ)_/¯

graceful lily
#

my head hurts trying to understand yall

jovial warren
#

unsigned integers don't have any concept of positive or negative values, so they are all positive

half harness
#

oh

#

if I do 1010 << 1will it be 0100?

jovial warren
graceful lily
#

i just dont code

half harness
#

Mr. Bardy

graceful lily
#

never tried

jovial warren
#

we're working with operations on binary numbers

#

fair

jovial warren
half harness
#

hmmm

graceful lily
#

im only here for help on a plugin, not trying to fry my brain

quiet depot
#

@dusty cypress When did you buy voteparty?

jovial warren
half harness
# jovial warren yes

wait then before how come the extra 0s were added to the right? to make 10001100 end up as 1000110000000000

graceful lily
#

i already posted there, just watching this

jovial warren
#

1010 << 1 = 0100

half harness
jovial warren
#

in a 4 bit value, no, the left value would be dropped

#

but in larger values, yes

half harness
#

uhhhhhh

#

👀

#

what is considered "large"?

jovial warren
#

I guess a long, which is 64 bits

#

64 binary digits

#

so 1010 in a long would be 0000000000000000000000000000000000000000000000000000000000001010

half harness
#

then how can the z, which is less than 15 do that too/

#

woa

jovial warren
half harness
#

but doesn't the rule affect longs only?

jovial warren
#

no

#

it affects anything where the number is large enough to accomodate the bits

half harness
#

oh

jovial warren
#

so, for example, with 8 bits, 00001010 << 1 = 00010100

#

the toString(2) function I used to get those binary values truncates the result, so we don't see all of the excess zeros

#

in reality, all of those values in my original example are 32 bits, but the toString(2) result won't print all of those 28 other zeros in the result, it'll just print the 4 where the actual value is

half harness
jovial warren
#

00001010 << 4 = 10100000

jovial warren
#

so the Y value gets put 8 digits over to the left, and we have it padded with zeros because that's what shifting does

jovial warren
#

values only get dropped off the end when we don't have enough space to accomodate

#

so if we have 8 bits to accomodate, and we have a value like 111111, and we shift that left by 2, that becomes 11111100, because we have 8 bits to accomodate

#

whereas shifting left by 4 would give us 11110000 because we don't have any more space

#

imagine it like a shelf, and you only have a fixed amount of space, and you are adding books from the right side of the bookshelf

#

what happens when you run out of room? books fall off of the left side, right?

half harness
#

yes

jovial warren
#

but the shelf is a fixed size, and when there is space, the books just move over on the shelf

half harness
#

but wouldn't the z 1100 have 8 bits to accomodate?

#

wait a minute

#

lol

jovial warren
#

in our case, Z only has 4 bits of value, but it's 32 bits long

half harness
#

oops

half harness
jovial warren
#

basically, the way we insert values in to a binary sequence is with an OR

#

you don't

#

lemme show you how insertion works

#
  1000110000000000
| 0000000000001100
------------------
  1000110000001100
#

because 1 | 0 = 0, remember

half harness
#

wait what

jovial warren
#

but that's not what we do here actually

half harness
#

i thought 1 | 0 = 1

jovial warren
#

yeah, my bad lol

half harness
#

oh

jovial warren
#

we shift the Z first, so we get 11000000 because we shifted it left by 4

half harness
#

yes

jovial warren
#

then inserting that, ```
1000110000000000

0000000011000000
1000110011000000
#

you see how we inserted that Z in to those 4 bits in our value?

half harness
#

yes

jovial warren
#

then we do the same with the X

#
  1000110011000000
| 0000000000001001
------------------
  1000110011001001
half harness
#

would this be possible if the y was 15 or less?

jovial warren
#

then to get the values out, we can use our trusty and to just drop bits we don't want

#

lemme show you

half harness
#

👀

jovial warren
#

so, to get the X: ```
1000110011001001
& 0000000000001111

0000000000001001

#

we & with 15 to drop all the bits that are larger than 15, meaning we get the 4 bits we want

half harness
#

😮

jovial warren
#

now, to get the Z, we have to shift right by 4, because we know the Z is shifted to the left by 4

half harness
#

then u shift by 8 for y?

jovial warren
#

yes

#

because shifting right by 8 will drop the 8 rightmost bits

#

and then give you the 8 bits you want in the value places you want

#

you don't even have to & for the Y since it's the last 8 bits and so there are no bits to drop

#

do you understand how this works now?

half harness
#

mhm

jovial warren
#

right, now time for a slightly more difficult example