#help-development

1 messages Β· Page 2184 of 1

humble tulip
#

Wow

#

Didn't know that

quaint mantle
#

boolean[] bools = { true, false, true };
bools[0] = false; == bools << 1;

waxen plinth
#

Yeah, it just doesn't make sense to index anything smaller than that

humble tulip
#

So does it store it as 111111111

waxen plinth
#

No

#

Just 0 or 1

humble tulip
#

Or 00000001

waxen plinth
#

The reason it takes a bit longer to access is because you need to do 3 operations rather than 1 to mutate a boolean in that kind of setup

#

You have to read the value, flip the individual bit, then write the value back into memory

#

Whereas with a regular boolean you only have to write the value into memory

waxen plinth
#

Reads are faster than writes so the difference won't be huge

humble tulip
tender shard
waxen plinth
#

Anyways I'm gonna go get ice cream for real now

tender shard
#

what ice cream

quaint mantle
waxen plinth
#

Chocolate oreo milkshake

#

πŸ‘Œ

tender shard
#

good choice

#

have a good one

quaint mantle
#
public Void a() {
    return Void.valueOf(b());
}

public void b() {
    return void;
}
tender shard
#

"return void"?

#

btw why the heck does PlayerTextures#getSkin return a URL

crisp steeple
#

kotlin πŸ™‚

tender shard
#

it should return a String

waxen plinth
#

Kotlin users are the Python users of Java

crisp steeple
#

true

quaint mantle
#

@crisp steeple

crisp steeple
#

lol

#

good luck with that

waxen plinth
#

return void lol

winged anvil
#

what is happening

quaint mantle
#

java

tender shard
#

does anyone know why does CraftBUkkit still have the version in the package name?

quaint mantle
#

idiots

#

thats why

worldly ingot
#

To ensure that developers are updating their code between versions if they insist on using NMS

tender shard
#

hm that's a pity

quaint mantle
tender shard
#
final Field profileField = skullMeta.getClass().getDeclaredField("profile");
#

this could look so much cleaner when there was no version in the package name in CraftSkullMeta

#

(And yes, I know that meanwhile PlayerProfile exists, it was just an example πŸ˜› )

worldly ingot
#

Beat me to it lol

tender shard
#

if spigot would now also add a method to send the totem animation, I could get rid of NMS and craftbukkit code almost completely πŸ˜„

worldly ingot
#

I mean πŸ‘€ PRs are open

tender shard
#

yeah I wish I could do that but

worldly ingot
#

I don't know how that animation is sent though. I'd imagine it's an effect

tender shard
#

when I clone the repo from stash, I always get some weird errors when building. I don't remember them right now

#

people always told me to just use the code that buildtools generates but that seems like a dirty workaround lol

#

i'll try it again tomorrow

worldly ingot
#

Hm. It's not an effect. Lemme browse the item

tender shard
#

an effect? wdym?

#

the totem animation?

#

that's simply a packet

#

this is my 1.18 NMS code to send the totem thing

    @Override
    public void playTotemAnimation(final @NotNull org.bukkit.entity.Player player) {
        final ServerPlayer entityPlayer = ((CraftPlayer) player).getHandle();
        final Packet<?> packet = new ClientboundEntityEventPacket(entityPlayer, (byte) 35);
        final Connection playerConnection = entityPlayer.connection.connection;
        playerConnection.send(packet);
    }
limber mica
#
    at java.base/java.lang.Class.getConstructor0(Class.java:3585)
    at java.base/java.lang.Class.getConstructor(Class.java:2271)```  ```java
public record Provider(String name, String description) {

      }  
``` kinda confused why this method is giving me an error first time using records so
tender shard
#

mojang decided to use 35 for totem animatino

tender shard
worldly ingot
tender shard
worldly ingot
#

Nope

#

Been around for a while

tender shard
#

did this exist in 1.16?

#

anyway, thanks, that's nice!

#

one method less to have to update for every release :3

tender shard
#

oh shit

worldly ingot
#

So that's like 1.10 or something

dusk flicker
#

lol

tender shard
#

I googled and the only thing I found was the packet thing

#

back when 1.16 came out

worldly ingot
#

1.12.2

#

is when that effect was added

tender shard
#

niiiice then I can completely get rid of the whole NMS thing for that. thanks

worldly ingot
#

That effect was added in 1.11 though so it's really not too far out

tender shard
#

tbh I only found out that EntityEffects exist when I decompiled some totally shitty plugin a few months ago lol

worldly ingot
#

Yeah they're underused

tender shard
#

there should be some kind of blog

worldly ingot
#

Effect and EntityEffect

tender shard
#

that announces new API features

#

that would definitely be useful

#

I also only found out about PlayerProfiles by accident

tender shard
worldly ingot
#

PlayerProfile was probably only a couple months ago, so it's easy to miss that

tender shard
#

it was in 1.18 definitely

worldly ingot
#

md tries to state notable additions in majors, but between majors, those often get overlooked

limber mica
tender shard
#

yeah exactly, I'd love if we have a forums thread where people (or md if he has time) will simply reply with
"yo we now added PlayerProfile class"

shadow gazelle
#

Is there any way to get a player's Mojang UUID?

tender shard
#

Player#getUniqueId()?

shadow gazelle
#

That returns an entity ID

worldly ingot
#

No, getId() does

#

getUniqueId() returns the UUID

drowsy helm
#

unless server is offline getUniqueId will

tender shard
#

a thread in the forums would be more than enough to announce new features I guess, so not really much work for anyone

shadow gazelle
tender shard
#

but a huge benefit for users

worldly ingot
#

idk what API you're using then

#

because getUniqueId() is part of Entity, from which Player inherits lol

limber mica
#

Is it because im java 17 im getting that error?

shadow gazelle
worldly ingot
#

Yes. A UUID is a persistent id

#

That is their Mojang UUID

shadow gazelle
#

I know

tender shard
#

for players it will return the "actual mojang" id

drowsy helm
tender shard
#

for everything else it'll be a more or less random UUID

drowsy helm
#

you can return a class that is a record

#

but not a record itself

tender shard
#

huh? of course you can "return" a record

drowsy helm
#

like they keyword record itself

#

idk i could be wrong

quaint mantle
#

no shit

tender shard
#

I don't really understand what you're talking about

quaint mantle
#

you cant return class

drowsy helm
#

its like doing public class test(etc){} as a method

tender shard
#

are you drunk or sth lol

quaint mantle
#

what are you talking about

tender shard
#

being drunk is my job and I'm not drunk

drowsy helm
#

youre not catching my flow lol

limber mica
#

So what something like public record Provider(String name, String description) { public String getName() { return switch (name) { case "t" -> "WA"; case "e" -> "LOO"; default -> "Unknown"; }; } }

tender shard
paper viper
#

that looks like bad oop

#

lol

tender shard
#

yeah

limber mica
#

okay okay it's just an example

quaint mantle
paper viper
quaint mantle
#

😠

limber mica
#

ugh I still get the error

quaint mantle
#

have you even sent your actual code yet

limber mica
#

yes

#

that is all I have in that record

quaint mantle
#

im not even gonna bother

paper viper
#

why do you have a switch statement for a variable inside your record?

limber mica
#

IT WAS JUST AN EXAMPLE

quaint mantle
#

you just said

quaint mantle
paper viper
#

so then wheres your code

#

lol

paper viper
#

that's all you have and its giving that error?

quaint mantle
paper viper
#

com.test.base.command.commands.TestCommand.<init>

public record Provider

dusk flicker
#

lmao

quaint mantle
shadow gazelle
#

nice job follow the class and method naming conventions if that's what those are supposed to be

quaint mantle
#

what

limber mica
#
 for (ClassInfo cls : result.getAllClasses()) {
            Class<?> loadClass = cls.loadClass();
            if (!loadClass.getName().contains("Command")) continue;
            Constructor<?> cons = loadClass.getConstructor();
            cons.newInstance();
dusk flicker
#

tf

quaint mantle
#

it clearly states whats wrong in the error message

paper viper
#

Dude

#

Why would you do that

#

???

dusk flicker
#

im so fucking confused

quaint mantle
limber mica
#

why lmao

quaint mantle
#

lmao

paper viper
#

What is that for?

limber mica
#

initializing classes with ClassInfo

quaint mantle
#

why

paper viper
#

You gotta give us more

limber mica
#

Because it's nice

paper viper
#

this is def an XY problem

dusk flicker
#

fr

paper viper
#

?xy

undone axleBOT
tender shard
#

i think they just smoked too much or too few crack

limber mica
#

lmao

dusk flicker
#

too few

limber mica
#

It was working when I had the project in jdk 1.8 but ever since I switched it over to java 17 it just broke

paper viper
#

You are asking an issue about Y (which doesn't really make sense), which is an attempt to solve issue X

#

Well whats your goal?

#

Here

limber mica
#

To not have that error and learn how I can fix it

dusk flicker
#

that isnt the true goal tho

paper viper
#

Dude you're gonna have to give us more than that

quaint mantle
#

how do i return void

paper viper
#

Please send us like

limber mica
#

Maybe ClassInfo doesn't support jdk 17

paper viper
#

all of your code

#

not just a section

quaint mantle
dusk flicker
#

yes they are

limber mica
#

no

dusk flicker
#

you are tho

limber mica
#
@SneakyThrows
    public void initialize() {
        ScanResult result = new ClassGraph().acceptPackages("com.test.base.command.commands").scan();
        for (ClassInfo cls : result.getAllClasses()) {
            Class<?> loadClass = cls.loadClass();
            if (!loadClass.getName().contains("Command")) continue;
            Constructor<?> cons = loadClass.getConstructor();
            cons.newInstance();
        }
    }
#

No just thinking

quaint mantle
#

my guy

maiden vapor
paper viper
#

Instead of using that hacky strategy, just make a collection of all your commands

#

Rather than doing a hacky init strategy

#

to create a new instance of all of them

#

also this can be slow too

#

just sayin

quaint mantle
#

instead you write all of this (Horrible) reflection bs

#

that doesnt even work

tender shard
#

reflection is awesome but you're abusing it for stuff that doesn't erquire it. your way is hacky, dirty, prone to errors, and simply sucks. and not in the good way

paper viper
#

Something like

Set.of(new CommandOne(plugin), new CommandTwo(plugin)...)
#

Then do whatever you need to do

carmine valley
#

hey guys, any idea on how I can affect the amount of knockback a player would get?

quaint mantle
limber mica
#

uh

paper viper
quaint mantle
#

hes on 1.8

#

πŸ’€

paper viper
dusk flicker
#

bro

quaint mantle
carmine valley
paper viper
#

setVelocity

dusk flicker
#

i will jump off bridge now

#

anyone wish to join?

crisp steeple
dusk flicker
#

like I thought my command system was hacky

#

lol

paper viper
#

i honestly given up on using built in one and just use a library cause its easier

limber mica
#

My system is fine just slighty broken

carmine valley
paper viper
quaint mantle
paper viper
#

well

quaint mantle
#

its shit and unnecessary

paper viper
#

Entity technically

dusk flicker
#

slightly broken != fine

paper viper
#

but

#

you can use it for Player

limber mica
#

It's not shit

quaint mantle
#

yes it is

dusk flicker
#

from the current shit we see, it is

quaint mantle
#

instead of writing

getCommand("a").setExecutor(new MyCommandA());
getCommand("b").setExecutor(new MyCommandB());
...

he writes

@SneakyThrows
    public void initialize() {
        ScanResult result = new ClassGraph().acceptPackages("com.test.base.command.commands").scan();
        for (ClassInfo cls : result.getAllClasses()) {
            Class<?> loadClass = cls.loadClass();
            if (!loadClass.getName().contains("Command")) continue;
            Constructor<?> cons = loadClass.getConstructor();
            cons.newInstance();
        }
    }
limber mica
#

It's not for a mc plugin....

carmine valley
paper viper
quaint mantle
paper viper
#

its a vector one second

quaint mantle
#

@limber mica whats it for

crisp steeple
carmine valley
limber mica
limber mica
dusk flicker
#

why are you asking here tf

paper viper
dusk flicker
#

go to the JDA or javacord discord

paper viper
#

nobody really likes to do math so i just decided to spoonfeed ig

#

But yeah play around with the values

#

listen to the event

crisp steeple
#

ah yes, i’m allowed to ask how to make a discord bot in the spigot discord so that means i should

dusk flicker
#

FUCKING HELL

tender shard
dusk flicker
#

?paste Put it in a fucking paste you are filling this entire channel

undone axleBOT
paper viper
#

Chunk getEntities call java.lang.Throwable: null

dusk flicker
#

Actually just delete that entire message and leave

#

go to Paper

quaint mantle
#

damn EliteSkull

tender shard
#

what happened? I was afk for 3 seconds

limber mica
#

so uh

dusk flicker
#

dude posted an entire big ass stacktrace and code

crisp steeple
quaint mantle
#

im looking through the jda and i see this

        private byte[] generateNonce() {
            long nonce = this.nonce.get();
            byte [] n = new byte[nonceLength];
            for (int i = 0; i < nonceLength; i += 8) {
                n[i+0] = (byte) (nonce>>> 0);
                n[i+1] = (byte) (nonce>>> 8);
                n[i+2] = (byte) (nonce>>>16);
                n[i+3] = (byte) (nonce>>>24);
                n[i+4] = (byte) (nonce>>>32);
                n[i+5] = (byte) (nonce>>>40);
                n[i+6] = (byte) (nonce>>>48);
                n[i+7] = (byte) (nonce>>>56);
            }
            return n;
        }
dusk flicker
#

lmao

quaint mantle
#

what is this

paper viper
#

they couldve just wrote a loop inside of the loop

waxen plinth
#

generateNonce

quaint mantle
waxen plinth
#

generate pedophile

quaint mantle
#

imma pr that

waxen plinth
#

Don't

quaint mantle
#

y not

dusk flicker
#

i dislike jda

waxen plinth
#

It's most likely that way for a reason

dusk flicker
#

I dislike javacord

tender shard
waxen plinth
#

nonce

dusk flicker
#

we need a good java discord api

crisp steeple
#

british

tender shard
#

Optional<Pedophile>

quaint mantle
#

lmao

tender shard
#

let's hope that it's not present

quaint mantle
humble tulip
#

πŸ‘€

waxen plinth
#

I mean

humble tulip
#

wtf is going on here

paper viper
#

.ifPresentOrElse

waxen plinth
#

Yeah basically

dusk flicker
#

thread local random 1 in 5, if you are 5 you become pedophile

crisp steeple
#

it uses >>> so it must be efficient

#

best code ever

tender shard
dusk flicker
#

I have honestly never seen >>> before lol

quaint mantle
humble tulip
#

:slides_out_of_chat:

waxen plinth
#

optionalPedophile.ifPresent(Person::stab);

crisp steeple
dusk flicker
#

ah

quaint mantle
#

what is >>>

#

redempt

waxen plinth
#

Bit shift ignore sign

humble tulip
#

unsigned bit shift

quaint mantle
limber mica
#

So back to my issue how would I about to fixing this

waxen plinth
#

will keep negative numbers negative

tender shard
# quaint mantle what is >>>

The unsigned right shift operator ">>>" shifts a zero into the leftmost position, while the leftmost position after ">>" depends on sign extension.

waxen plinth
#

But >>> will not

quaint mantle
dusk flicker
#

gonna forget about that in 5 minutes, and never use it

limber mica
#

I am normal

waxen plinth
#

I've had to use it before

crisp steeple
#

don’t use google classpath to register commands

waxen plinth
#

When I was writing a compression algorithm

#

But other than that never

humble tulip
#

i've never used bit shifting except for finding chunks

tender shard
waxen plinth
#

Yes

quaint mantle
#

who hasnt

tender shard
#

I am thinking about the scene where the child gets crushed into a garbage cube

river oracle
#

Only used bit shifting to encode messages in images for school lol

limber mica
humble tulip
#

imagine being smart enought to write a compression algorithm

waxen plinth
#

It's not as hard as it sounds

tender shard
#

yeah I know

humble tulip
#

actually nvm i can write one, but will it be good?

waxen plinth
#

Probably not compared to what's available

tender shard
crisp steeple
waxen plinth
#

I'm highly motivated by making tools

#

It's kind of discouraging how good a lot of existing tools are lol

quaint mantle
#

Hi there, I have this BlockBreakEvent handler, but it never fires when I mine a block. Ideas? ```java
public void onBlockMined(BlockBreakEvent event) {
// Check if the player is mining a block
int randomNumber = (int) (Math.random() * 100) + 1;

    log.info("Block RandomTNT: " + randomNumber);

    if(randomNumber <= 50) {
        plugin.getServer().broadcastMessage(ChatColor.YELLOW + event.getPlayer().getName() + ChatColor.RED + " tried to mine " + event.getBlock().getType().name() + " but got TNT instead!");

        // Change the block to a primed TNT block
        event.getPlayer().getWorld().spawnEntity(event.getBlock().getLocation(), org.bukkit.entity.EntityType.PRIMED_TNT);
    } else {
        return;
    }
}```
waxen plinth
#

I can write my own but often they will not be useful

#

I've managed to take a few niches though

humble tulip
#

yeah kinda hard to compete with the rest of humanity

waxen plinth
quaint mantle
#

omg

dusk flicker
#

lol

waxen plinth
dusk flicker
#

def didnt

quaint mantle
#

I'm tired lmao

dusk flicker
#

we all do it

quaint mantle
#

thanks

dusk flicker
#

I, more than most

tender shard
quaint mantle
#

Making minecraft cursed

quaint mantle
#

:)

waxen plinth
#

There are TONS of different niches to be filled

quaint mantle
dusk flicker
#

dont even want to say how many times ive forgot an annotation or forgot to register it

humble tulip
#

im not even a comp sci person

#

im a med student

waxen plinth
#

You can find one to make a useful tool for eventually

#

So?

humble tulip
#

i do this for fun tbh

waxen plinth
#

You can be good at cs without being a cs student

tender shard
quaint mantle
#

I'm evil. java @EventHandler public void shootBowEvent(ProjectileLaunchEvent event) { Projectile proj = event.getEntity(); float offX = ((random.nextFloat()) - 0.5f); float offY = ((random.nextFloat()) - 0.5f); float offZ = ((random.nextFloat()) - 0.5f); proj.setVelocity(proj.getVelocity().add(new Vector(offX, offY, offZ))); }

waxen plinth
#

Jeff Winger

tender shard
quaint mantle
#

@tender shard are you Saul Goodman

humble tulip
#

OMG

#

IMAGINE

tender shard
dusk flicker
#

time for me to get sleep, and as always, fuck you Imajin ❀️

quaint mantle
#

goodnight and fuck you @dusk flicker !

waxen plinth
#
@EventHandler
public void onMove(PlayerMoveEvent e) {
  Location to = e.getTo();
  to.setPitch(Math.random() * 360);
  to.setYaw(Math.random() * 180);
  e.setTo(to);
}```
tender shard
river oracle
#

I wish I could hate imajin but he's so based

waxen plinth
#

Someone else do it

#

I'm on my weak-ass laptop

waxen plinth
#

It can barely handle the 3 intellij windows I have open

quaint mantle
paper viper
dusk flicker
#

you aint a mod

quaint mantle
#

helper

#

shut it

dusk flicker
#

haha

river oracle
quaint mantle
paper viper
#

lool

waxen plinth
#

Having seen lamp I realize the competition in command libraries is actually more fierce now

#

Lamp looks cooler than most

humble tulip
#

Lamp commands?

dusk flicker
#

turn on the lamp

river oracle
quaint mantle
#

i was making a plugin that gave a brick called shit to every player whenever the console executed a command

waxen plinth
#

I will make my library cooler accordingly

dusk flicker
#

lol

humble tulip
#

Lamp commands library is really amazing

quaint mantle
dusk flicker
#

fucking hell I need to go through my entire command lib at some point and update it to adventure

humble tulip
#

I use it as well

waxen plinth
#

I'll make a better one

tender shard
humble tulip
#

ill switch

waxen plinth
#

It's in the works

paper viper
#

lol

waxen plinth
#

Already shaping up

quaint mantle
waxen plinth
#

It's not gonna be ready for a bit longer but it's getting there

quaint mantle
river oracle
quaint mantle
tender shard
humble tulip
#

lamp is poorly documented

waxen plinth
humble tulip
#

i have to ask questions in the discord alot

river oracle
#

Lamp docs suck someone needs to make then

humble tulip
#

so pls document urs

waxen plinth
#

I will

#

I already have a command library

#

It's well-documented

tender shard
# quaint mantle fuck you

just imajin what'd happen if everyone would actually go fuck themselves whenever they were told to. everyone would be so unproductive

waxen plinth
#

Honestly it's really great, it works amazing and is unlike any other command library

quaint mantle
waxen plinth
#

Only issue is the internals suck and it's unmaintanable, hence the new library

crisp steeple
#

how to get easy commits onto intellij

quaint mantle
#

@tender shard go fuck yourself

river oracle
waxen plinth
#

The new one is going to be largely similar to the old one

tender shard
quaint mantle
#

@waxen plinth go fuck yourself

tender shard
#

done

waxen plinth
#

later

quaint mantle
vocal cloud
#

Again!

paper viper
#

Imajin has said fuck 547 times

waxen plinth
#

Too busy self-promoting now

vocal cloud
#

Buy my merch

river oracle
#

Only 547 fucking hell

paper viper
#

Lol

humble tulip
#

I'm making a plugin and i basically have to copy code from another project but im too lazy to do it

quaint mantle
waxen plinth
#

Also holy shit I can't believe this has 71 commits already

#

I'm committing to it much more frequently than normal

tender shard
waxen plinth
#

For most projects I write like 200 lines and commit it all at once lol

#

For this one I've been committing every time I make a minor change

river oracle
waxen plinth
#

It's good for my contributions chart

humble tulip
waxen plinth
#

That very bright section at the end is Ordinate

quaint mantle
#

im surprised actually

tender shard
waxen plinth
tender shard
#

opticfusion has mentioned "malware" 1310 times lol

humble tulip
#

fucked myself over once though

waxen plinth
#

I'm taking it much slower with this project though

humble tulip
#

had to rollback

waxen plinth
#

I've lost hours of work from a mistyped git command

humble tulip
#

switched branches improperly in intellij

waxen plinth
#

That'll do it

#

Ugh

#

How did all this stuff get on my glasses

vocal cloud
quaint mantle
tender shard
river oracle
#

My favorite part about when I had intellij was uninstalling it

quaint mantle
humble tulip
vocal cloud
#

I then shared it with someone and they were very confused with why everything looked so weird and why things were named the way they were

tender shard
waxen plinth
#

When you learn git well it's a super powerful tool

river oracle
waxen plinth
#

Of course I never really use it like that because all my projects are solo

humble tulip
#

btw should i obfuscate my premium plugin?

waxen plinth
#

No

river oracle
#

Nah

waxen plinth
#

Fuck obfuscation

tender shard
waxen plinth
#

Open source your premium plugin 🧠

humble tulip
#

i'm thinking that tbh

#

NO

#

LOL

waxen plinth
#

Do it

#

Genuinely

quaint mantle
#

@waxen plinth copilot made this for me

tender shard
quaint mantle
#

the whole thing

humble tulip
#

i've seen ppl do it

#

and i getvwhy they do

waxen plinth
#

Make the plugin open source, don't offer support to those who don't buy it

#

And don't distribute the compiled jar for free

#

It works

#

I mean, premium plugins, ehh

#

They're hard to make money on

#

I did a lot of commissions

river oracle
humble tulip
#

China

tender shard
humble tulip
#

πŸ³οΈβ€πŸŒˆ

waxen plinth
quaint mantle
waxen plinth
#

[^a-z]

humble tulip
#

i think i signed up for that and got in

waxen plinth
#

He's making a RedLex clone

tender shard
quaint mantle
waxen plinth
#

πŸ₯±

quaint mantle
#

but more freedom!

river oracle
tender shard
quaint mantle
#

lmao

tender shard
waxen plinth
#

beautiful

#

what happens if you jump

quaint mantle
tender shard
#

oh

quaint mantle
waxen plinth
#

do it

quaint mantle
waxen plinth
#

I gotta see what it looks like

uneven fiber
#

ahem

tender shard
#

RIP

#

fuck myself

river oracle
waxen plinth
#

The asexual spectrum flag has no right to be as aesthetic as it is

humble tulip
quaint mantle
tender shard
waxen plinth
#

Like this is so visually appealing

tender shard
#

I didnt even know that it's pride month rn

crisp steeple
quaint mantle
waxen plinth
#

Hence why it is my background

#

Asexual flag is nice too but asexual spectrum flag is great

#

I'm just a big fan of purple

humble tulip
waxen plinth
#

I give myself a purple role in every server I can

quaint mantle
#

your name literally has Red in it, liar

river oracle
tender shard
tender shard
humble tulip
#

when you log on to spigot and think someone reviewed your plugin or something exciting happened

river oracle
quaint mantle
tender shard
#

the people who were the most popular in my class are now the biggest losers lol

#

the nerds are making the most money meanwhile

crisp steeple
river oracle
#

The nerds are the popular kids where I go lol

tender shard
waxen plinth
uneven fiber
#

my school is accepting

river oracle
#

All the top athletes are straight A students lmao

uneven fiber
#

there was a non binary person in my english class this year their fits were awful bruh

#

they were chill tho

#

just had awful drip

river oracle
#

My drip is fire as fuck

tender shard
river oracle
#

Outfits

tender shard
#

aah

uneven fiber
#

cant explain drip to someone unless they have it

tender shard
#

I will check urban dictionary

humble tulip
#

read the readme then look at the code

tender shard
#

adjective to describe your outfit similar to swag, sauce, steez, swank

river oracle
#

Goodbye time to sleep

tender shard
#

how were you not able to explain this?

river oracle
#

πŸ‡¨πŸ‡³ πŸ’– πŸ‡¨πŸ‡³

crisp steeple
waxen plinth
#

save data in data.yml

#

cringe

tender shard
crisp steeple
#

yml, the worlds best database system

uneven fiber
#

respect πŸ’―

humble tulip
river oracle
#

Nothing happened on June 4th of 1989 in China

waxen plinth
#

I saw that

limber mica
#

So I've gotten multiple keys from a json how can I add them automatically to options in a slash command without adding each one manually?

waxen plinth
#

This plugin is so advanced

humble tulip
#

LOL

waxen plinth
#

Truly ascended

crisp steeple
humble tulip
#

that's why imade this

tender shard
humble tulip
#

cuz it has a bug for the longest while that he coudlnt fix

limber mica
humble tulip
crisp steeple
#

non-static utility class

#

cursed

humble tulip
#

with static fields

tender shard
#

that makes no sense at all

humble tulip
#

not my plugin bro

tender shard
#

whoever coded that was drunk

#

or not drunk enough

#

idk

limber mica
tender shard
#

anyway they were weird

humble tulip
#

that's "advanced java"

crisp steeple
#

the inventory is static lmao

#

it would only work for 1 person at a time

#

???????

humble tulip
tender shard
crisp steeple
#

error is only for things like stackoverflow or outofmemory

#

isnt it

tender shard
#

the funny thing is that the try/catch only has player.playSound inside

#

what are they trying to catch? PlayerDidntLikeThisSoundException?

humble tulip
#

1.8-1.12 sound names

tender shard
#

o0

crisp steeple
#

wouldnt even work since its not catching an exception lol

tender shard
#

of course it does

humble tulip
#

Β―_(ツ)_/Β―

tender shard
#

Exception extends Error

#

oh wait

#

no

#

mb

humble tulip
#

throwable

tender shard
#

Exception extends Throwable

#

yeah

#

and Error extends Throwable

#

but that's it

crisp steeple
#

this application is not reasonable according to java documentation

#

this is making me want to look back at my old projects but they all got deleted because intellij decided to be stupid

humble tulip
#

i never made stupid stuff like that

#

even as a beginner

crisp steeple
#

damn i really was not happy

humble tulip
#

while (false)

#

that is a first

#

ik you probably did it so it skipped the loop tho

crisp steeple
#

most people arent smart enough to understand it

waxen plinth
#

I'll do you one better

#
IntStream.range(0, 100).forEach(System::exit);```
humble tulip
#

nice

tender shard
#

looks good to me

#

very useful

humble tulip
#

i wanna make regular java programs but making guis are hard

#

pretty guis

waxen plinth
#

No

#

Don't do frontend

#

It is awful

humble tulip
#

not the ugly stuff java has

waxen plinth
#

Join the dark side, write backend code only

humble tulip
crisp steeple
#
    public static void z() {
        try {
            while (true) new Thread(Main::z).start();
        } catch (StackOverflowError | OutOfMemoryError e) {
            z();
        }
    }
humble tulip
#

i said this earlier

#

nice

#

catching errors

tender shard
#

my city is flourishing

waxen plinth
humble tulip
#

btw I'm thinking of a plugin where people can 'call' each other in mc

crisp steeple
#

most readable c++ code

waxen plinth
#

Oh my god

humble tulip
#

a call just means all chat messages that aplayer sends goes to the player in the call

waxen plinth
#

I'm imagining it listening in on their mic and translating the sounds into note block sounds

#

lmao

waxen plinth
#

Yes

#

It must be done

humble tulip
#

that'll sound like the talking piano

crisp steeple
waxen plinth
#

I've seen that before

#

It was called /pmtoggle

#

You'd just do /pmtoggle <username> and then it would direct all your messages to that player's private messages

humble tulip
#

i guess i can have a PhoneCall object that stores uuid of participants

#

and map uuid to phonecall?

#

for each player?

waxen plinth
#

Well

#

It depends

humble tulip
#

That's the easy part. The harder part is that I want to have an Admin channel that player can call

waxen plinth
#

I would model it like this

humble tulip
#

when u call the admin channel, player can connect to any one admin

waxen plinth
#
private Map<String, Set<UUID>> callMembers;
private Map<UUID, String> activeCalls;```
#

Something like that

#

I could whip that up in a few minutes with my config + command library if I was on my desktop

#

It has my plugin template which skips all the annoying setup

humble tulip
#

It's not hard to implement, Im just thinking of how i should go about it

summer scroll
#

Don't forget to create a preset of ringtone too lmao

tranquil viper
#

Map of players in a channel would be fine

humble tulip
summer scroll
#

hahahahaha

humble tulip
#

one sec

summer scroll
#

pog

waxen plinth
#

RingtoneBuilder

#

lmao

humble tulip
#

sometimes the sounds come in a bit late and it sounds weird

#

not sure why that happens because it's a localhost server

brave sparrow
#

Your computer is lagging

#

Lol

humble tulip
#

nah mate

#

pretty sure it's not that

#

actaully you can never be sure

brave sparrow
#

I mean that is the only explanation

#

It’s not network lag

humble tulip
#

i waas running intellij, my bungee and test server and mc

brave sparrow
#

Something in your computer is experiencing a delay

#

Or you’re having a mini stroke lol

humble tulip
#

so could be that

lethal coral
#
        Splegg.getInstance().getSongHandler().addPlayer(player);
        Splegg.getInstance().getSongHandler().resume();
        System.out.println(Splegg.getInstance().getSongHandler().getSongPlayer().isPlaying());
        System.out.println(Splegg.getInstance().getSongHandler().getSongPlayer().getPlayerUUIDs());
        System.out.println(Splegg.getInstance().getSongHandler().getSongPlayer().getPlaylist().getSongList());

||ignore all of the method calls I was doing it quick for debugging||
I'm not hearing anything in-game despite the fact that it says it's playing and my UUID is in the list.

humble tulip
#

can we see your resume method?

lethal coral
#

it just sets the playing to true

humble tulip
#

well can we see what plays the song?

lethal coral
#

like the songhandler class?

humble tulip
#

yeah

lethal coral
#

πŸ˜“

#

?paste

undone axleBOT
humble tulip
#

not the entire thing

#

maybe just the runnable

lethal coral
#

it's fine

humble tulip
#

if u wanna paste the entire thing, that works too

#

Lol

#

well then we need to see the songplayer

lethal coral
#

πŸ’€

#

wdym

#

ah

#
    public void registerSongHandler(){
        Song song1 = NBSDecoder.parse(new File("plugins/Songs/Windy.nbs"));
        Song song2 = NBSDecoder.parse(new File("plugins/Songs/Pirates.nbs"));
        Song song3 = NBSDecoder.parse(new File("plugins/Songs/IndianaJones.nbs"));
        Song song4 = NBSDecoder.parse(new File("plugins/Songs/Megalovania.nbs"));
        Song song5 = NBSDecoder.parse(new File("plugins/Songs/Clocks.nbs"));
        Playlist playlist = new Playlist(song1, song2, song3, song4, song5);
        this.songHandler = new SongHandler(new RadioSongPlayer(playlist));
    }
humble tulip
#

can we see the RadioSongPlayer

#

since that plays the songs

lethal coral
#

that's noteblockapi

humble tulip
#

oh

lethal coral
#

songhandler is my only thing

humble tulip
#

then im not sure what's causing it

#

your code seems fine

#

idk abt noteblockapi

lethal coral
#

I tested the api using a skript addon beforehand just to listen to the songs before deciding if I wanted to use it in my plugin

humble tulip
#

so maybe youre not using that properly, cant say

lethal coral
#

I tested it on a 1.17 server

#

the only thing I can think of is the version

#

(the server version my plugin was tested on is 1.18.2)

humble tulip
#

try on 1.17 i guess

#

btw how is your game sound?

#

is it up?

lethal coral
#

yes

#

unchanged from when I tested it earlier

#

I'm not sure I can test it on 1.17

#

it would be an extreme pain as I use methods provided by the 1.18 paper api

humble tulip
#

Change api-version to 1.17

#

ah

#

does it play for the other player that is listening?

lethal coral
#

no

quaint mantle
humble tulip
#

i vouch for that to be a public plugin

quaint mantle
#

its going to

#

first person to beat minecraft with EVERYTHING ENABLED

#

and have VIDEO PROOF

#

20 USD PayPal

humble tulip
#

LOL

#

should post to speedrunning forums

quaint mantle
#

yup

humble tulip
#

should've made it a mod but a plugin works ig

#

post it with no documentation

#

just that it's a troll plugin

quaint mantle
sullen fox
#
package me.rudiemc.plugins.holoplus;

import me.rudiemc.plugins.holoplus.Commands.CreateHolo;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;

public final class HoloPlus extends JavaPlugin {


    public void saveCustomYml(FileConfiguration ymlConfig, File ymlFile) {
        try {
            ymlConfig.save(ymlFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static JavaPlugin plugin() {
        return getPlugin(HoloPlus.class);
    }

    public static File configuration;

    @Override
    public void onEnable() {

        // Saving config

        getConfig().options().copyDefaults();
        saveDefaultConfig();

        // Other

        configuration = new File(plugin().getDataFolder(), "./holos.yml");
        saveCustomYml(customConfig, configuration);

        // Registering Commands

        getCommand("createholo").setExecutor(new CreateHolo());

        // Registering Listeners

    }

  error = >  public static FileConfiguration customConfig = YamlConfiguration.loadConfiguration(configuration);

}
#

it says at line 49 that the file cannot be null

#

how do I fix that?

undone axleBOT
sullen fox
#

oh

#

sure

#

1m

quaint mantle
#

:)

#

@humble tulip I can't believe I did this ```java
public void spawnEvent(EntitySpawnEvent event)
{
Entity entity = event.getEntity();
Location location = entity.getLocation();
World world = entity.getWorld();

    switch(entity.getType())
    {
        case BAT:
        {
            world.spawnEntity(location, EntityType.PRIMED_TNT);
            break;
        }
    }
}
#

I made bats go boom

humble tulip
#

that's not v bad though

quaint mantle
#

give me i d e a s

humble tulip
#

cuz they wont spawn infront of you

lethal coral
#

as a 1.17.1 plugin

humble tulip
#

hitting a creeper can instanly explode it

quaint mantle
humble tulip
quaint mantle
#

everytime you fall

#

roll between 1 and 1000

#

if <500 = insta death

humble tulip
sullen fox
#

@quaint mantle

humble tulip
#

so they're confused

brave sparrow
humble tulip
#

like 1%

sullen fox
humble tulip
#

You can create getters

#

and get it in your other classes

#

?di

undone axleBOT
sullen fox
#

Will try

humble tulip
#

pass your plugin instance and use getters

lethal python
#

i want to send an inventory to a player who is already in an inventory, but without having the InventoryCloseEvent fire

humble tulip
#

make it non static

quaint mantle
lethal python
#

it seems to b firing it

#

like the last one gets closed

#

automatically

humble tulip
#

ah

lethal python
#

i think

brave sparrow
#

Pretty sure you can’t do it without firing the event

humble tulip
#

why dont u want it to call the event?

brave sparrow
#

I mean you might be able to if you hacked around with packets and NMS but I don’t know how far you want to take this

lethal python
#

because my inventory has multiple "pages" but i also need to check when the player closes the inventory

humble tulip
brave sparrow
#

Simple solution, unregister the previous page before you register the next one

#

Yeah that works too

lethal python
#

:v

lethal python
brave sparrow
#

They can

humble tulip
#

i know

lethal python
#

so how do i check when the actually closed it vs when they switched page

humble tulip
#

but when they wanna go to a next page

#

u put them in the set

#

and remove them when the inventorycloseevent is fired

brave sparrow
#

But when they proceed to a next page they can’t close the inventory in between the previous page closing and the next page opening

lethal python
#

ok lol

#

i will do that

humble tulip
#

so when they actually close it, they wont be in the set cuz they didnt try to go to a next page

sullen fox
#

@humble tulip

humble tulip
#

yes

sullen fox
lethal coral
#

@humble tulip I'm thinking I have to create one per player or smth? though that wouldn't really make sense (or add all the players before I start playing)

#
    @EventHandler
    public void onJoin(PlayerJoinEvent event){
        Song song = NBSDecoder.parse(new File("plugins/Songs/Windy.nbs"));; // Preloaded song
// Create RadioSongPlayer.
        RadioSongPlayer rsp = new RadioSongPlayer(song);
// Add player to SongPlayer so he will hear the song.
        rsp.addPlayer(event.getPlayer());
// Start RadioSongPlayer playback
        rsp.setPlaying(true);
    }

because this code - basically copied from the wiki works

#

and you add the player before in that

brave sparrow
#

Is the player set up to loop?

brave sparrow
#

Is there a chance the song is just over by the time your player gets added to it?

humble tulip
#

and in the other classes

lethal coral
#

and I join pretty much when the server starts (when the player is initialized & started)

sullen fox
# humble tulip
   FileConfiguration customConfig = YamlConfiguration.loadConfiguration(configuration);

    public static FileConfiguration getCustomConfig() {
        return customConfig;
    }

customConfig isn't accessable inside getCustomConfig()

brave sparrow
#

Sounds like you need to debug more then

#

Figure out what the example code is doing differently

sullen fox
#

im pretty new to java

humble tulip
#

ah ok

#

so in your plugin class, you're gonna make sure customConfig is private

brave sparrow
humble tulip
#

and remove static from the getter

sullen fox
#

But I need to use the getter outside of my main class

humble tulip
#

you pass your main class to the other classes

brave sparrow
humble tulip
#

^^

#

?di

undone axleBOT
humble tulip
#

it's called dependency injection

#

you inject the main class where it's needed

iron glade
#

Does anyone know if there's an option for like maximum spawnable particles in a world or radius?

sullen fox
humble tulip
#

nope

brave sparrow
sullen fox
#

ykw

humble tulip
#

one sec

sullen fox
#

forget custom dbs

#

im gonna use the config file

humble tulip
#

no wait

#

which class do u need to use the config in?

#

the custom config

sullen fox
#

file

humble tulip
#

and what is the name of your main

iron glade
humble tulip
sullen fox
#

HoloPlus is the name of the main

#

the file i need to use it in is DB

brave sparrow
humble tulip
#

which class needs to get the customConfig tho?

iron glade
# brave sparrow Show me
        final int points = 18;
        final double size = 8;
        int upper = 256;
        int lower = p.getLocation().getBlockY();

        Bukkit.getOnlinePlayers().forEach(all -> {

            for (int k = lower; k < upper; k+=4) {

                for (int i = 0; i < 360; i += 360 / points) {
                    final double angle = (i * Math.PI / 180);
                    final double x = size * Math.cos(angle);
                    final double z = size * Math.sin(angle);

                    final Location locnew = p.getLocation().add(x, lower, z);

                    all.playEffect(locnew, Effect.MOBSPAWNER_FLAMES, 1);
                    all.playSound(locnew, Sound.ENTITY_ENDERMAN_AMBIENT, 5L, 5L);
                }

            }
        });```
sullen fox
brave sparrow
humble tulip
iron glade
#

it's not lagging either

sullen fox
brave sparrow
#

Put a sysout for every location you expect it to play something

humble tulip
lethal coral
#

I'm so mad

humble tulip
lethal coral
#

the issue was me setting the sound category

brave sparrow
iron glade
humble tulip
brave sparrow
#

I would still print it out to test

sullen fox
humble tulip
#

actually much more

brave sparrow
#

I’ve played a crap load of sounds and a crap load of particles to the point where the client freezes

#

So you can do it

iron glade
#

I'll try to print it out give me a sec

humble tulip
#

@sullen fox

#

make sure ur DB class has this

spiral hinge
#

Is there a way I can use MiniMessages (from Adventure API) and also have it work with Minecraft color codes?

humble tulip
undone axleBOT
lethal python
#

i think the order the events fire is messing it up

#

there is nothing to paste

sullen fox
lethal python
#

i would have to paste my entire project

humble tulip
#

then u can do plugin.getCustomConfig

humble tulip
sullen fox
humble tulip
lethal python
#

yes

humble tulip
#

well can i see your inv closeevent listener

#

and the snippet where u open the next page?

lethal python
#

this is it rn

sullen fox
humble tulip
#

ok

humble tulip
brave sparrow
sullen fox
humble tulip
#

plugin.getCustomConfig

lethal python
#

https://i.imgur.com/zo0fMTl.png here is where they get added, i originally just had a getter and did = on the returned thing to set it but that didn't work so i tried using a setter too but it still doesn't work

humble tulip
brave sparrow
# iron glade

Your client would appear to be filtering it out then yeah

iron glade
#

There should be 18 points for every y value

humble tulip
#

just get and add

sullen fox
#

damn ily @humble tulip

humble tulip
lethal python
#

ok minion i changed it so there's no clone but it still won't work

#

why if contains

humble tulip
#

because then it'll always be like theyre changing pages

#

liek remove the uuid if it contians it

lethal python
#

no because i immediately remove it?

humble tulip
#

in the inventory close event

brave sparrow
lethal python
#

i will move the removing step to there and see what hpapens

humble tulip
lethal python
#

yeah it's in a separate place

humble tulip
#

can you show all your relevant code?

brave sparrow
#

Where is it

lethal python
#

no

brave sparrow
#

Show us where the removal is happening

lethal python
#

that line WaystoneInteractListener.renderWaystoneGUI() it is removed literally on the first lines

#

of that method

humble tulip
#

noo

lethal python
#

but it doesn't matter dude

humble tulip
#

that's why