#help-development

1 messages · Page 1150 of 1

quaint mantle
#

wait

#

it's uwu animated?

#

nope right

#

huh

blazing ocean
#

you suck

frail hull
#

i need plugin help pls

echo basalt
frail hull
#

what?

#

i need help to make a command /timer disable to disable the timer that tere is no actionbar any more

#

i got the /timer disable i just need to know how to disable the action bar now

#
            if (disabled) return@task
            What Here now
        }
    }```
obtuse hedge
#

whats that mean

frail hull
quaint mantle
#

read

frail hull
#

?

quaint mantle
frail hull
quaint mantle
#

💀

#

nvm

frail hull
#

can you help?

#

?

#

/ask

#

?

agile anvil
#

What is your timer exactly?

#

You need to be more precise

frail hull
#

its a action bar that couts up

#

and i wane have a command to disable the actionbar

agile anvil
#

Can you show the code wher eyou have this action bar count?

#

?paste

undone axleBOT
modest barn
#

Hi, i Can help for config data shaving

quaint mantle
#

bro keeps spamming

frail hull
#

there it is

agile anvil
#

Is this kotlin?

frail hull
#

ye

#

why?

quaint mantle
#

nvm

frail hull
quaint mantle
#

*💀 *

frail hull
quaint mantle
#

*💀 *

frail hull
#

whai _Rolyn is typing he he he

agile anvil
#

Mhhh I don't know how to write it in kotlin so I'll just give you the idea:

  1. have a boolean set to false in your object
  2. When having the command /timer disable, set this boolean to True
  3. In your loop, check if the boolean is True. If this is the case just stop the Timer
  4. When stopping the timer, send an emptu action bar to the players
quaint mantle
#

why is ppl like this

frail hull
quaint mantle
frail hull
agile anvil
#

I don't understand

quaint mantle
#

he wants you to make the code for him

agile anvil
#

You want to make the action bar like "Timer is disabled" ?

frail hull
frail hull
quaint mantle
#

yeah he definitely

frail hull
frail hull
agile anvil
quaint mantle
frail hull
quaint mantle
#

he's doing nothing to solve his problem

frail hull
quaint mantle
#

whatever

agile anvil
#

I think he's just having trouble explaining what he wants and also parts of his code

#

What you're doing frsvn is really not helping the situation

frail hull
#

@agile anvil you know a DC server where i can get help?

#

or some 1?

quaint mantle
#

bro

frail hull
agile anvil
#

It won't change anything. This server is meant for help

quaint mantle
agile anvil
#

Just try to explain clearly what you have, what you do and what you want to achieve

#

Figuring out this will maybe allow you to solve your problem by yourself

#

If you have trouble with english, try using a translator

frail hull
#

:)

cobalt comet
#

What's the best way to get the NMS version string? It seems Bukkit.getServer().getClass().getPackage().getName() no longer contains the NMS version

chrome beacon
#

Anyways Paper should have a guide for that

cobalt comet
#

Ah I didn't realize that was a paper thing, thanks :)

upper hazel
#

if I change the damage of a player's hand and pick up a sword will the damage add up or is sword+hand damage the total damage that changes through attributes?

#

Is the player's damage from the attribute affected by the weapon or is it pure damage from the hand?

sly topaz
dry hazel
#

in like 1.17 yea

fading drift
#

[19:32:42 ERROR]: [XinCraft] Plugin XinCraft v1.0 has failed to register events for cl
ass dev.tommyjs.xincraft.listener.ArrowPickupListener because org/bukkit/event/player/PlayerPickupArrowEvent does not exist.

#

yet intellij shows it exists?

#

very confused

dry hazel
#

well what version are you compiling for and what version are you running it on?

fading drift
#

both 1.8.8

#

literally the same jar file for the pom library and the server

remote swallow
#

Run the clean goal for maven then recompile

chrome beacon
#

Assuming obc means org bukkit craftbukkit

hardy anchor
#

Hey! How do i make it so i can use & anywhere i want instead of §?

floral drum
#

ChatColor

#

there is a method that allows translation from ‘&’

#

or just use raw colorcodes

hardy anchor
#

I meant on making a plugin

remote swallow
#

ChatColor.translateAlternateColorCodes

pseudo hazel
#

if you are making a plugin, dont use color codes like that to begin with

fair rock
#

Wanna tell him what he should use instead. Reading that without context and solution can be confusing

quaint mantle
#

Is there a way to create a world using random uuid as name but have chunk loader from a different saved world?

fair rock
wet breach
fair rock
#

Okay so you saying comments on deprecated instead use xyz is stupid as well

#

because you could search

wet breach
#

well you could

fair rock
#

True be nice and communicate is a bad behaviour for developers

#

Good that you cant communicate and be nice

wet breach
#

I am not always nice that is true 🙂

fair rock
#

I know, i saw that ^

#

Have a good day xD

quaint mantle
#

🤷‍♂️ can someone help me with a world management system for my minigame?

wet breach
#

While it is true people can just shove info into your face just because, it is also equally true that you don't need to sit and wait for answers when they are at your fingertips most of the time as well

quaint mantle
#

I have the worlds for arena saved. but how do i create new world on the go using that same world

wet breach
#

when you are done with it, you will do the same process again but create a new directory for the arena world when copying, unload the old arena, load the new one

#

rinse and repeat

#

oh, when you unload the old one, you can delete that arena directory

#

since its not needed anymore

quaint mantle
#

So like
Request for a new game -> create a world named with that game's uuid -> load world -> do game -> unload world -> delete world.

wet breach
#

typically you should always have one already loaded and ready to go

#

so that your players are not waiting on it

remote swallow
#

to not have lag, you should have all the worlds you want to use loaded

#

with nothing inside them loaded till its needed

wet breach
#

^

quaint mantle
#

I see

remote swallow
#

because you can unload spawn chunks and have them take basically nothing

quaint mantle
#

What if someone placed some blocks during game? I would have to refresh world right

remote swallow
#

probably something like having a schematic or something that you overlay and remove other blocks from

quaint mantle
#

I see thank you

wet breach
#

if so, you just delete the world and load up a new copy and not worry about trying to restore the world

quaint mantle
#

I probably need to profile amount of lag caused while creating and deleting worlds

floral drum
#

if you’re so worried about that, just go with slimeworldmanager or something

fading drift
#

would there be any reason why I cant spawn entities during onEnable

young knoll
#

Loading a pre generated world with spawn chunks disabled takes like

#

5ms

fading drift
#

ah i had to load the chunk first to spawn the entities

#

that means spawn chunks must be disabled right?

young knoll
#

They may just not be loaded yet

#

Not sure

fading drift
#

is there a way to check?

#

if spawn chunks are enabled that is

young knoll
#

There’s a gamerule for them now

#

I believe there’s also World#keepSpawnInMemory or something

fading drift
#

wait I read something about postworldload

#

is onEnable called after world load

#

is that configurable

#

spawn chunks are enabled but they must not have loaded before I spawn my entity

pliant topaz
#

either post world or on startup

#

i believe you can also forceload a chunk using getEntities on it as it will load any entities in it resulting in the chunk being loaded (iirc, not completely sure)

#

but setting your plugin to post world would probably be the best

pliant topaz
#

but you can check if a chunks loaded either with Chunk#isLoaded or Chunk#load (which returns a boolean returning if it loaded)

eternal skiff
#

How can i use api mineskin to get texture value and sygnature because i only found how to save image to file

worldly ingot
#

You have to use the generate/upload endpoint, but it will yield you a body with a bunch of information, of which includes a data.texture object holding value and signature

fading drift
#

so at startup I spawn an armor stand with a custom name and cache the object. later on I asyncly run stands.get(line).setCustomName("test");. it does not actually update the custom name for some reason

worldly ingot
#

What object are you caching? The ArmorStand?

fading drift
#

yeah

#

I tried without it running async

#

it updates the custom name the first and second time I run it

#

but not anymore?

#

very confused

worldly ingot
#

Think of Bukkit's Entity objects as wrappers around a snapshot of an entity. If you're getting an instance of one from somewhere, it's referencing that entity at that current point in time, but it might not reference it later.

#

The reason people tell you not to hold reference to a Player is because while you might do Bukkit.getPlayer(UUID), if the player leaves and rejoins, that's not the same player

#

The same is true with entities being unloaded and loaded again

fading drift
#

oh shit

#

that would make sense

#

because I'm unloading the entity when changing worlds which changes my stats which is what im trying to display on the armor stand

worldly ingot
#

The best way to work around that is to hold their UUIDs and use Bukkit#getEntity(UUID) instead

fading drift
#

genius

worldly ingot
#

Or a WeakReference to that ArmorStand entity and fallback to getEntity() when that reference is lost

#

Should work then 🙂

fading drift
#

weakreference?

worldly ingot
#

Yeah. It will hold a reference (just like you would in a field) but it's not a hard reference, so it can still be garbage collected

fading drift
#

thank you so much

#

should I use weakreference as it would reduce the performance time if I always call getEntity

worldly ingot
#

WeakReference would be ideal I think, but it's not the end of the world if you don't. Bukkit#getEntity() is a Map lookup so you're not going to kill your server by calling it

#

I would still call it once in scope and hold in a local variable though, obviously

#

Don't need to call it 3 times while in the same method

fading drift
#

I'll try weakreference and see if I can figure it out, otherwise use the latter method

#

thank you a lot I appreciate it

worldly ingot
#

o/

fading drift
#

ah shit Bukkit.getEntity doesn't seem to exist on 1.8.8

#

may have to loop through world.getentities

glossy laurel
#

Can I somehow set player permissions in luckperms with the vault dependency?

worldly ingot
#

Yeah Bukkit#getEntity(UUID) was added later, potentially in 1.9 or 1.10?

slender elbow
#

choco can't use that because they use 1.7 at work

fading drift
#

this code is so cooked

#

it works holy

worldly ingot
slender elbow
#

idk about that

fading drift
#

I am going to send for code review

worldly ingot
#

Also, TECHNICALLY we have latest features!

slender elbow
#

seeing is believing

worldly ingot
#

Slowly but surely

slender elbow
floral drum
#

Woo Hygot

worldly ingot
#

Ah you're a visual learner

fading drift
#
    // we use weakreference here as the armor stand entity differs if its unloaded. if the weak reference is garbage
    // collected, we can regain the armor stand through Bukkit.getEntity(UUID)
    private final Map<UUID, WeakReference<ArmorStand>> stands;

    public Hologram(Location location) {
        this.location = location;
        this.stands = new LinkedHashMap<>();
    }```
slender elbow
#

it's spooktober (i'm scared of hypixel source code)

fading drift
#
    public void setLine(int line, String text) {
        ArmorStand stand = new ArrayList<>(this.stands.values()).get(line).get();
        if (stand == null) {
            // if the reference has expired AKA the chunk reloaded and the entity changed,
            // we can regain the entity through Bukkit.getEntity(UUID)
            stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
                    .filter(armorStand -> armorStand.getUniqueId().equals(
                            new ArrayList<>(this.stands.keySet()).get(line)))
                    .findFirst().orElse(null);

            if (stand == null) {
                return;
            }

            stands.put(stand.getUniqueId(), new WeakReference<>(stand));
        }

        stand.setCustomName(Utilities.parse(text).trim());
    }```
worldly ingot
#

You know what? I'm impressed you actually managed to figure it out correctly. Usually I tell people "Yeah you can do <insert thing here>" and they follow up with like a dozen questions about how to do it

#

👏 Good job. Looks good

fading drift
#

I am impressed with myself tbh

#

never touched this type of shit before

floral drum
#

net.hypixel.gm.player.HypixelPlayer:

#

gm is GameManager/Master

fading drift
#

does it actually look good or is the whole

            stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
                    .filter(armorStand -> armorStand.getUniqueId().equals(
                            new ArrayList<>(this.stands.keySet()).get(line)))
                    .findFirst().orElse(null);```
specifically `new ArrayList<>(this.stands.keySet()).get(line)))` cooked
slender elbow
#

gm is gChocom

floral drum
#

HypixelPlayer is a cool class

worldly ingot
#

Or I guess technically that's not the same

floral drum
#

also net.hypixel.hynet.network.protocol.Packet is cool if hypixel still has hynet

shadow night
#

Hynet?

shadow night
#

Why do you even know so much about hypixel stuff

floral drum
#

think about viaversion

worthy yarrow
floral drum
#

lolol

worldly ingot
#

Actually yeah just make a variable, that's probably what you want. I also wouldn't worry too much about doing a defensive copy of your list, unless you're doing some async stuff. But even then, a lock is probably safer

#

Ohhhh, I see what you're doing lol. That's certainly a creative way to go about it. You're using a LinkedHashMap to retain insertion order. Eh.

fading drift
#

I kinda just thought new ArrayList<>(this.stands.keySet()).get(line))) is the only way to go about getting a specific index in a hashmap

#

linkedhashmap to retain insert order

#

yeah

worldly ingot
#
private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) { }
private final List<Line> lines = new ArrayList<>();
#

I'd probably do something like that instead

#

And if you desperately need to get an armor stand from a UUID, you could have, in addition to that list, a Map<UUID, Line>

#

Also if you don't have records because you're using Java 8, you can have a simple data class, that works fine too

fading drift
#

curious does hypixel run java 8

floral drum
#

yeah Hynet is in the HypixelDev user/organization on github, it’s just private

lilac dagger
worldly ingot
lilac dagger
#

they don't really have to run on java 8 if they want to no?

floral drum
#

Java 17 is compatible with them versions, just update a few dependencies and you’re good

lilac dagger
#

newer java versions are generally much faster

fading drift
lilac dagger
#

wait, i think they talked about it somewhere

#

about uuid i think

#

they use newer java version for sure

worldly ingot
#

Well, no, that Map would just be for reference if you wanted to get a Line from a UUID. You don't care about order there. The order would be defined by the List

#

Because ArrayLists retain order. They're arrays

floral drum
#

pretty sure

lilac dagger
#

wait a sec, array list and weak references, how do they work? do they leave gaps in the array?

fading drift
#

hang on sorry I'm a bit confused so, if I need to get an armorstand by uuid, I have a map in addition to a list, but wouldn't I then be having two line objects that I need to pray are the same

lilac dagger
#

oh nvm, the weak reference keeps its place instead

worldly ingot
#
private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) { }
private final List<Line> lines = new ArrayList<>();
private final Map<UUID, Line> linesByUUID = new HashMap<>();

public Hologram() {
    // whatever
}

public void addLine(ArmorStand armorStand) {
    Line line = new Line(armorStand.getUniqueId(), new WeakReference<>(armorStand));
    this.lines.add(line);
    this.linesByUUID.put(line.armorStandUUID(), line);
}```
#

If you wanted to ensure the two collections remain the same, you could use a lock

lilac dagger
#

i would prefer a remove() method over weak reference

#

this way i can wipe the armor stands as well

worldly ingot
#

I would prefer u suck

fading drift
#

never used lock but nothings stopping me

lilac dagger
worldly ingot
#

Locks aren't terribly difficult, but they're kinda hard to wrap your head around at first. If you're wanting to do any thread-safe class, you generally want to either use a lock or some other thread-safe approach

#

One sec

#

I have an example, actually

#

This class, at least to my understanding, is thread-safe

lilac dagger
#

leaked hypixel code

worldly ingot
#

Any time I read from data, I acquire a read lock. Any time I write to data, I acquire a write lock

lilac dagger
#

oh wait, this is client

worldly ingot
#

The locks are a totally separate issue though lol. I think the biggest thing that you should look to change is replacing your LinkedHashMap with a proper List so you can random access rather than having to wrap a collection in an array list instead

worldly ingot
lilac dagger
#

yeah, dissapointed

#

i was wondering for a second why you needed locks for scoreboards

#

but in the client it makes sense

river oracle
#

Choco leaked the entirety of hypxdil spigot fork!

#

It's on his github rn

lilac dagger
#

i'd love to peruse hypixel code

#

but alas

#

i have mineplex code to learn what not to do from

floral drum
#

package net.hypixel.hynet.protocol.v47.play.server;

lilac dagger
#

are you coming up with these?

floral drum
#

no

shadow night
#

Why do you guys have hypixel or mineplex code randomly lying around

lilac dagger
#

why do you not?

shadow night
#

Where tf would I find it

lilac dagger
#

the internet

#

search net hypixel pastebin

#

you get 2 pastebin leaks

floral drum
#

correct

lilac dagger
#

if they weren't taken down

floral drum
#

I wonder what dev was dumb enough to do this

#

lol

lilac dagger
#

it wasn't a massive leak

fading drift
#

hang on I found a problem

worldly ingot
#

Hynet doesn't exist, at least as far as I'm aware. I've never seen that package before

fading drift
#

If I can't get the line as the reference is expired, and I need to get it from the uuid map, how do I know the uuid if the reference expired

lilac dagger
#

pretty sure the WeakReference object remains @fading drift

shadow night
#

Aha

lilac dagger
#

the object it stores gets removed

shadow night
worldly ingot
fading drift
#

this is hard to explain but

#
    public void setLine(int line, String text) {
        ArmorStand stand = lines.get(line).getArmorStand().get();
        if (stand == null) {
            // if the reference has expired AKA the chunk reloaded and the entity changed,
            // we can regain the entity through Bukkit.getEntity(UUID)
            stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
                    .filter(armorStand -> armorStand.getUniqueId().equals(
                            linesByUuid.get().getUuid())
                            )
                    .findFirst().orElse(null);```
#

linesByUuid.get().getUuid()

#

how would I use get(uuid) if I cant use stand.getuniqueid as stand is null

#

does that make sense

worldly ingot
#

Well that's why I held a Line object in the List which contains both the UUID and the reference to the armour stand

#

Line has your UUID that you want

fading drift
#

oh im silly

glossy laurel
#

Can I somehow set player permissions in luckperms with the vault dependency?

fading drift
#

ohhhh

#

fuck I get it

#

uuid is seperated from the weak reference

#

lool

worldly ingot
#

Yeah :D

#

You could maybe clean up your filter if you really want with a method reference

private static record Line(UUID armorStandUUID, WeakReference<ArmorStand> armorStand) {
    public boolean matches(ArmorStand armorStand) {
        return armorStand.getUniqueId().equals(armorStandUUID);
    }
}

// Later
Line line = lines.get(lineIndex);
stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
    .filter(line::matches)
    .findFirst().orElse(null);
fading drift
#

and then I would remove line(index) and add it again with the new weak reference

#

no

#

ill setArmorStand

worldly ingot
#

Yeah you would need a setter in that Line object

#

So I guess a record wouldn't work lol

floral drum
# shadow night

there used to be a skywars one up a couple years ago but seems like it’s gone

fading drift
#
    public void setLine(int line, String text) {
        ArmorStand stand = lines.get(line).getArmorStand().get();
        if (stand == null) {
            // if the reference has expired AKA the chunk reloaded and the entity changed,
            // we can regain the entity through Bukkit.getEntity(UUID)
            stand = location.getWorld().getEntitiesByClass(ArmorStand.class).stream()
                    .filter(armorStand -> armorStand.getUniqueId().equals(
                            lines.get(line).getUuid())
                            )
                    .findFirst().orElse(null);

            if (stand == null) {
                return;
            }

            lines.get(line).setArmorStand(new WeakReference<>(stand));
        }

        stand.setCustomName(Utilities.parse(text).trim());
    }```
worldly ingot
#

YES though you could definitely put lines.get(line) in a variable

fading drift
#

yeah I'm silly I dont even need the map

quaint mantle
#

is there any way I can just make a world in memory and have it load world from existing world?

worldly ingot
#

And then yeah if you really want to go above and beyond you can look at the example I sent regarding read/write locks (specifically ReadWriteReentrantLock for convenience), but that's only if you care about the thread-safety of your object

fading drift
#

do I even need to bother about locks if I don't use the map? even if I'm running all of this async

quaint mantle
#

I really dont feel like dealing with copying world files then deleting it later

worldly ingot
#

If you're accessing your object from multiple threads, then you should make it thread-safe

fading drift
#

sorry I definitely have not wrapped my head around locks

worldly ingot
#

If it's just one thread, it's fine

quaint mantle
#

🤷‍♂️ I never try making stuff thread safe but most of my code is immutable

fading drift
#

I am creating the hologram object in main thread but running setLine on async thread

worldly ingot
#

You could also avoid locks entirely and opt for a synchronized method. Some people say "always prefer synchronized over locks" but it's up to you

#

I kind of don't mind the explicitness of locks

quaint mantle
#

why are you running setline async?

fading drift
#

considering the guy before me decided to just run this awful awful method 6 times every 100 ticks and I don't want to rewrite it at the moment I'll probably stay async

fading drift
quaint mantle
#

what does the hologram do

#

o

#

Why don't make it update when a player tries viewing it

worldly ingot
#

I think what you should do in that situation specifically is run the lookup on an off thread, but the actual entity update should be done on the main thread. Async entity updates can always be awkward and sometimes just outright don't work

#

Spigot will occasionally throw exceptions to catch you doing async work on world state

fading drift
#

so I'm using runTaskTimerAsynchronously to run the method that calls setLine. should I just wrap setLine arround a runnable with runtasklater

glossy laurel
#

Can I somehow set player permissions in luckperms with the vault dependency???

fading drift
#

am I cooked or correct 💀

worldly ingot
#

Ideally you'd end up using a CompletableFuture. Those things are handy :)

fading drift
#

sometimes I ask questions and I'm not sure if I'm on the money or wildy wrong

#

I thought completeablefuture was just for running stuff async

#

tbh

quaint mantle
#

It is used for alot of stuff which I dont remember

#

I just remember using it for my database calls and it fixed everything

worldly ingot
#
CompletableFuture.supplyAsync(() -> {
    // Do your database lookup here, this is async
    return "Wow! Super awesome database value!";
}).thenAcceptAsync(value -> System.out.println(value), task -> Bukkit.getScheduler().runTask(plugin, task));
floral drum
worldly ingot
#

Then use Bukkit's scheduler in the futures, which you can do

fading drift
#

interesting

quaint mantle
#

Is there any easy way to handle worlds in minigames?

floral drum
#

handle worlds how

quaint mantle
#

I really dont want to go with copying and creating new world then deleting it after game is done

floral drum
#

do it in code

quaint mantle
#

what do u mean do it in code :o

worldly ingot
floral drum
#

use java and bukkit api to unload the world, delete directory, copy template world into directory, load it using bukkit api, profiy

fading drift
#

works like a charm

quaint mantle
#

you sure?

#

Idm coding it but it seemed like alot of hassle.

fading drift
#

it did but was worth it

quaint mantle
#

Alr then :)

fading drift
#

guy before me had one world and used schematics to paste maps 500 blocks apart

#

so buggy and laggy

quaint mantle
#

nah bro 💀

fading drift
#

I mean tbh I've been rewriting my minigame code for like 2 and a half weeks now so

#

kinda a hassle

quaint mantle
#

the only mini game I coded before was Among us

#

But it was coded in Minestom which handled worlds VERY differently 🤷‍♂️

#

Infact worlds did not even exist.

blazing ocean
#

you just copy the source world folder, load that new world, unload, delete

quaint mantle
#

alright

#

thanks :)

#

I am on it

fading drift
#
                    for (int i = 0; i < 10; i++) {
                        if (players.size() <= i) {
                            continue;
                        }

                        UUID uuid = players.get(i);
                        User user = users.loadUser(uuid).join();
                        LeaderboardPosition position = new LeaderboardPosition(i + 1, getPlayerSync(uuid).getName(), user.getCachedData().getMetaData().getPrefix(), result.get(uuid));
                        board.add(position);


                        if (hologram) {
                            if (holograms.get(type) == null) {
                                continue;
                            }
                            holograms.get(type).setLine(i + 2, "&e" + position.getPosition() + ". " + position.getPrefix() + position.getUsername() + " &e- " + position.getScore());
                        }
                    }```
#
   private PlayerData getPlayerSync(UUID uuid) {
        FindIterable<Document> result = collection.find(Filters.eq("uuid", uuid.toString()));
        Document first = result.first();

        if (first == null) {
            return null;
        } else {
            Document stats = (Document) getValueOrDefault(first.get("stats"), new Document());
            Stats global = decodeStats((Document) getValueOrDefault(stats.get("overall"), new Document()));
            Stats solos = decodeStats((Document) getValueOrDefault(stats.get("solos"), new Document()));
            Stats doubles = decodeStats((Document) getValueOrDefault(stats.get("doubles"), new Document()));
            Stats threes = decodeStats((Document) getValueOrDefault(stats.get("threes"), new Document()));
            Stats fours = decodeStats((Document) getValueOrDefault(stats.get("fours"), new Document()));
            Stats ranked = decodeStats((Document) getValueOrDefault(stats.get("ranked"), new Document()));
            RankColor rankColor = RankColor.WHITE;
            StyleColor styleColor = StyleColor.BLUE;```
quaint mantle
#
    public static World createWorld(String worldName, Game game) throws IOException {
        //we must get the world files first.
        File templateWorld = new File(PillarsOfFortune.getInstance().getDataFolder(), "worlds/" + worldName);
        File newWorld = new File("/" + game.getUuid().toString());

        FileChannel templateChannel = new FileInputStream(templateWorld).getChannel();
        FileChannel newWorldChannel = new FileOutputStream(newWorld).getChannel();

        newWorldChannel.transferFrom(templateChannel, 0, templateChannel.size());
        //I hope everything went as per PLAN!
        World world = Bukkit.createWorld(new WorldCreator(game.getUuid().toString()));
        world.setAutoSave(false); //WE DO NOT WANT TO SAVE
        //holy I need to error handle this thing soo bad.
        return world;
    }``` this code should work if I did it correctly right
#

it requires some testing.

fading drift
#
       // copy preset world to matches directory
        String matchDirectory = BridgeMatchManager.MATCHES_DIRECTORY + File.separator + "match-" + id;
        try {
            // todo: map presets
            FileUtils.copyDirectory(new File(BridgeMatchManager.MATCHES_PRESET_DIRECTORY + File.separator + map.getName()),
                    new File(matchDirectory));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        WorldCreator creator = new WorldCreator(matchDirectory);
        creator.environment(World.Environment.NORMAL);
        creator.type(WorldType.FLAT);
        creator.generatorSettings("2;0;1;");
        creator.generateStructures(false);

        world = creator.createWorld();

        if (world == null) {
            throw new RuntimeException("Failed to create world");
        }

        // initialise world settings
        world.setGameRuleValue("randomTickSpeed", "0");
        world.setGameRuleValue("doMobSpawning", "false");```
#

this is mine

quaint mantle
#

thank you for sharing src :)

fading drift
#

ofc

quaint mantle
#

I should take sometime and make my own minigame lib for my own needs

fading drift
#

I wrote one for bridge and I still need to add support for 2v2, 3v3 etc but my plan is to abstract it so I can write any mini game for minecraft easily

quaint mantle
quaint mantle
blazing ocean
quaint mantle
#

oh

#

thanks :)

glossy laurel
#

Can I somehow set player permissions in luckperms with the vault dependency????!?!?

blazing ocean
glossy laurel
#

no dependency

blazing ocean
#

why

glossy laurel
#

cuz dependencies = bad

kind hatch
#

If you are going to be using LuckPerms on the server, then why would you not use its api?
Permission plugins are on almost every single server.

blazing ocean
glossy laurel
eternal oxide
#

just use the vault api

remote swallow
#

why not soft depend it then

#

if its there use it if not fall back to vault permissions

eternal oxide
#

Why are you wanting to ADD a permission anyway?

#

setting up permissions is generally not the plugins job, thats the server owner/admin

glossy laurel
#

well

#

set

#

permissions

#

I suppose

#

also thats exactly what I said

eternal oxide
#

none of that makes any sense. Did you just spam words?

pseudo hazel
#

chatgpt be like

glossy laurel
#

but I see your point

#

anyways, how common is recycling old code

#

also

#

wdyt of charging per byte of source code

blazing ocean
#

💀

glossy laurel
#

how much should I sell source code for

blazing ocean
#

don't

eternal oxide
#

You price teh contract not the code

glossy laurel
glossy laurel
blazing ocean
#

you charge for the product

#

not the code

glossy laurel
#

I see your point

#

good point :D

blazing ocean
blazing ocean
#

obfuscating your code?

glossy laurel
#

shouldnt it like decrease it or sum

blazing ocean
#

nope, it's designed to make it unreadable

glossy laurel
#

doesnt that devalue the code?..

blazing ocean
#

what

eternal oxide
#

no

worthy yarrow
#

You obfuscate your code in order to make it a bitch and a half for other people to read, beyond that not sure what else you’re obfuscating for

glossy laurel
#

no?

eternal oxide
#

only harder to pirate

blazing ocean
#

it's when you need to boost your ego and think your code is something special that's never been written before

worthy yarrow
#

I mean you obfuscate when compiling so no

paper viper
glossy laurel
#

bro I dont get it

eternal oxide
#

The only time I ever see a point of obfuscation is when protecting a Tradmark/Copyright. You have to make a minimum effort

paper viper
#

Increase if they use like the super long method names and string manipulation like the liI for example

glossy laurel
#

would that be selling a phone vs selling a phone that only has terminal on it

paper viper
#

Decrease sometimes too by reducing method names and stuff

worthy yarrow
#

The product works, you just don’t get to see what makes it work

#

That’s the point

glossy laurel
#

so uhm

#

knowing how it works

#

is bad?

remote swallow
#

some people think that

worthy yarrow
#

Not for you

#

But if you want to hide how it works from other people, that’s when you’d typically obfuscate

remote swallow
#

"no i must obsfucate my plugin i dont want people decompiling my plugin and stealing my code"

glossy laurel
remote swallow
#

no

#

obsfucating the code does fuck all to how it works

fading drift
#

customer wants product so they pay you for it. if they obfuscate you can go back to them asking them for new shit and spend more money

worthy yarrow
#

Obfuscation is literally just a mask

blazing ocean
#

it doesn't touch the actual logic

glossy laurel
#

my bad

#

not unusable

#

uneditable

paper viper
#

The point of obfuscation is to just make it harder to reverse engineer the JAR

remote swallow
paper viper
#

It doesn’t prevent it from reverse engineering

blazing ocean
paper viper
#

But it it makes it harder

remote swallow
glossy laurel
#

OH

#

OHHHH

paper viper
#

Not protection

glossy laurel
#

I finally got it

paper viper
#

It makes it harder

remote swallow
#

its not protection

#

it just makes it harder

paper viper
#

It crashes the decompiler and stuff

glossy laurel
#

interference

#

💀

remote swallow
#

obsfucation isnt security

glossy laurel
remote swallow
#

some of them can do that

fading drift
#

not really

remote swallow
#

not allowed to be used on spigot resources but ye

fading drift
#

only crazy obfuscation

paper viper
#

Not crash decompiler but make it like give up lmao

fading drift
#

deobfuscating also isn’t hard it’s just very time consuming

remote swallow
#

^^

glossy laurel
#

okay so if your source in jar is obfuscated that makes the unobfuscated source more valuable, right?

alpine urchin
#

don't obfuscate

paper viper
#

Yep, the point of it is to try and discourage reverse engineering

fading drift
#

worked on a project that deobfuscated lunar client once and it took months and never finished

paper viper
#

But there’s no point in obfuscation

alpine urchin
#

source code is defined as the preferred form for making changes, so it's not the decompiled or obfuscated code.

paper viper
#

You know these days, have a solid open source project is more valuable than anything for money

glossy laurel
#

why

paper viper
#

It’s great to use on your resume, to build upon, etc

glossy laurel
#

hm

fading drift
#

projects like lunar client use obfuscation so they can protect their code from getting stolen to reduce their competition in the market as they can more easily add unique features and stay ahead of the game

paper viper
#

And also you should keep in mind you aren’t gonna make shit out of my plugins or it’s gonna be so hard for you to make a living lol

#

You’re better off using it as an exemplary project in your resume to find other jobs

fading drift
#

or a side project for a bit of extra income

remote swallow
#

auxilors done pretty well on plugins

#

surprisingly

fading drift
#

how well

paper viper
#

Yes that’s because he made a ton

glossy laurel
remote swallow
glossy laurel
#

or is that someone's nick

remote swallow
fading drift
#

jesus

remote swallow
#

auxilor is a person

glossy laurel
#

alr

paper viper
#

Enough to live off is still very low tho

remote swallow
paper viper
#

It’s hard

fading drift
#

wait what type of plugins

#

like commission

remote swallow
glossy laurel
remote swallow
fading drift
#

ah I forget there’s a marketplace

glossy laurel
paper viper
#

And anything that isn’t “cool” or “unique” is pretty much gonna die

glossy laurel
#

valid

paper viper
#

Like why would anyone want to use another color chat plugin when millions exist

remote swallow
#

the only way you make a lot on premium plugins is something unique and adding 9000 features

worthy yarrow
#

Just make plugins because it’s fun and you enjoy practicing the craft

paper viper
#

^

quaint mantle
#

Would it be smarter to store an item in hashmap and clone it?

quaint mantle
#

Oh right, add the item to the player's inventory upon respawn?

rough ibex
#

these do different things

#

what are you ultimately trying to accomplish

#

add an item on respawn?

shut scroll
#

Hello dear all,
I hope this is the right place to ask. I've tried programmatically generating different kind of trees in a Spigot Plugin.
I made some research and I found that L-system generation should be the best option : https://en.wikipedia.org/wiki/L-system
I coded something which is supposed to be a coherent implementation. The problem is that the result is absolutely horrible, some pure garbage.
(If you don't believe me then just see this : || https://i.imgur.com/iBMkHfb.jpeg || )

Right now I'm not sure if :

  • The l-system might not be applicable to Minecraft due to scale and block-based coordinates ?
  • My implementation is incorrect/bugged ?
  • The rules I feed to l-system are incorrect

So I was wondering : have any of you ever tried to do generate trees ?
If so, did you use l-system ? Did it work well ?
Or did you use something else ?

worldly ingot
#

and I deny all sponsorship requests

remote swallow
#

dont you want to be sponsored by gamer supps

worldly ingot
#

It's usually server hosts

remote swallow
#

the choco flavour

worldly ingot
#

I always appreciate people reaching out to sponsor VeinMiner but out of principle I've only ever said no

remote swallow
#

get sponsored by lunchly kekw

slender elbow
#

oh god I never responded to that sponsorship offer on spigotmc 💀

remote swallow
#

oh no what are you gonna do

slender elbow
#

nap

#

fr

remote swallow
#

eepy emily

worldly ingot
#

Emily, brought to you by SpigotMC

kindred valley
#

?paste

undone axleBOT
worthy yarrow
orchid gazelle
#

Make some money lil bro

#

Money > No Money

floral drum
worldly ingot
#

I made my plugins free because I preferred larger reach over money. Vein Miner likely wouldn't have nearly as many people using it if it were premium

#

I also felt kind of shitty selling a plugin where I didn't come up with the concept

finite nova
#

@slate siren

slate siren
finite nova
#

yukaridaki elemanin yazdigini oku

#

isine yarayacak birsey varsa

#

kullan

#

free diyor

blazing ocean
#

english only

finite nova
#

Ah okay sorry

worthy yarrow
slate siren
#

nopee there's no need

finite nova
#

👍

worldly ingot
#

Nothing stopping you

worthy yarrow
#

Except for the fact it’s not done kek

worldly ingot
#

There's also nothing stopping you from selling something someone else came up with, so long as you're the one that wrote the code

#

Me not selling VeinMiner was a personal moral choice lol

worthy yarrow
#

That was another thing, if posting as a premium resource would it be advised against to release the source with it?

keen charm
#

Hey!

#

How can I send a plugin message from BungeeCord to Spigot without any players involved?

worldly ingot
#

I mean you can release the source for a premium plugin. Few plugins do it but I wish more did

worldly ingot
#

If you want communication between servers without plugin messaging, you need to use Redis or some other in-memory database/message broker

keen charm
#

Can I just pass the message through a random online player?

worldly ingot
#

Sure

keen charm
#

Perfect, thank you

#

But Spigot to BungeeCord allows sending a plugin message without any players involved, right?

worldly ingot
#

No it still requires a player

#

You're always going to need a player involved

worthy yarrow
remote swallow
#

what a lot of people do is charge for support

#

you can compile it for free but you get no support

worldly ingot
#

+1 on that model

worthy yarrow
#

Patreon sub in order to get the discord link kek

keen charm
worldly ingot
#

It broadcasts a plugin message to all online players. Player#sendPluginMessage() gets used internally

#

Which just sends the custom payload packet to the player

#

I'm not sure the technicals behind how the proxy handles that, but I believe BungeeCord intercepts outgoing messages along the bungeecord channel

keen charm
#

Oh, I see

inland hemlock
#
    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-api</artifactId>
      <version>1.21.1-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-server</artifactId>
      <version>1.21.1-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>```

Does anyone know why im unable to import GameProfile or dont you need it for EntityPlayer anymore? (Tried PlayerProfile/CraftPlayerProfile. Didnt work.,)
eternal oxide
#

spigot-server?

#

no way that is resolving

#

PlayerProfile is a part of teh Spigot API.

#

GameProfile is mojang libraries

#

AuthLib I believe

inland hemlock
#

So ig I gotta add that too? Since when do I have to add everything manually.. that wasnt the case back then..

eternal oxide
#

why do you want to use GameProfile?

inland hemlock
#

spawn npcs

eternal oxide
#

then you will be using nms

#

?nms

inland hemlock
#

yes I know

#

I can import everything but GameProfile

eternal oxide
#
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>3.5.41</version>
            <scope>provided</scope>
        </dependency>```
#

thats an old version, IF you insist on using game profile

#

if you follow the nms page you get all nms and remapped for easy names

inland hemlock
#

Im pretty sure I used the remapped version when installing it manually via cmd

#

stilll cant import game profiles...

   <dependency>
     <groupId>org.spigotmc</groupId>
     <artifactId>spigot-api</artifactId>
     <version>1.21.1-R0.1-SNAPSHOT</version>
     <scope>provided</scope>
   </dependency>
   <dependency>
     <groupId>org.spigotmc</groupId>
     <artifactId>spigot-server</artifactId>
     <version>1.21.1-R0.1-SNAPSHOT</version>
     <scope>provided</scope>
   </dependency>
   <dependency>
     <groupId>org.bukkit</groupId>
     <artifactId>craftbukkit</artifactId>
     <version>1.21</version>
     <scope>provided</scope>
   </dependency>
   <dependency>
     <groupId>com.mojang</groupId>
     <artifactId>authlib</artifactId>
     <version>6.0.54</version>
     <scope>provided</scope>
   </dependency>
   <dependency>
     <groupId>org.spigotmc</groupId>
     <artifactId>spigot</artifactId>
     <version>1.21.1-R0.1-SNAPSHOT</version>
     <scope>provided</scope>
     <classifier>remapped-mojang</classifier> <!-- Important! -->
   </dependency>
 </dependencies>```

also tried removing everything but the mojang remapping, still no gameprofile..
eternal oxide
#

spigot-server is not a thing

#

just follow the nms tutorial and it will all work

blazing ocean
#

sounds like gpt garbage

inland hemlock
#

it only is because I installed it locally from the jar build tools made. but now I followed the tutorial. also added <build> but that message would be too long.

  <dependency>
    <groupId>com.mojang</groupId>
    <artifactId>authlib</artifactId>
    <version>6.0.54</version>
    <scope>provided</scope>
  </dependency>
  <dependency>
    <groupId>org.spigotmc</groupId>
    <artifactId>spigot</artifactId>
    <version>1.21.1-R0.1-SNAPSHOT</version>
    <scope>provided</scope>
    <classifier>remapped-mojang</classifier> <!-- Important! -->
  </dependency>
</dependencies>```
inland hemlock
eternal oxide
#

you can;t manually add dependencies when using Maven

#

go back and follow the tutorial EXACTLY as written

#

all that junk in your pom is rubbish

inland hemlock
inland hemlock
eternal oxide
#

you don;t need to install anything

#

buildtools does all that

inland hemlock
#

Bruh.. just had to restart itellij, but after removing my garbage it worked, tyvm! 🙂

inland hemlock
eternal oxide
#

ServerPlayer

obtuse hedge
#

whats that, is it a is it a matrixstack?

#

am i able to apply the same methods/code from a fabric mod in the MatrixStack to that?

inland hemlock
torn shuttle
#

what's the easiest way of clearing a yml config file

remote swallow
#

File#delete 👍

worldly ingot
#

Yeah I'm not sure what the question is lol

#

Either delete the file or truncate it

torn shuttle
#

ok better question

#

I honestly don't remember how do you instantiate a FileConfiguration

#

because I can just create a new one instead

worldly ingot
#

A FileConfiguration? Or a YamlConfiguration?

torn shuttle
#

uh

#

FileConfiguration

worldly ingot
#

File can be anything, Yaml is specifically for YAML

#

I don't think File is instantiable

remote swallow
#

file is the api

worldly ingot
#

It may be abstract if I'm remembering correctly

remote swallow
#

yaml is an impl of file

torn shuttle
#

ah

#

so it's backwards

#

damn it

worldly ingot
#

YamlConfiguration.loadConfiguration() is what you're looking for probably

torn shuttle
#

I have this weird setup where I have a setting that makes a file clone another file's config and I just sort of wanted to clear the cloned fields if that is set but without going through the hassle of manually doing each one

#

was just going to wipe the file and write the two fields that do not clone

remote swallow
#

do you have the original

torn shuttle
#

yeah

remote swallow
#

could loop it

torn shuttle
#

it's basically linking files together

remote swallow
#

for config.getKeys(true)

#

other.set(key, config.get(key))

torn shuttle
#

I just want to make them vanish from the config file because I can already tell people will try to edit a file that is cloned without noticing it

#

it's fine I'm just going to do it manually

#

it's not that many fields

worthy yarrow
#

Why are there cloned files anyway?

#

Backups?

inner mulch
#

when creating bytebuffers, is it smart to allocate them at the size of the packet, or should i just have 1 buffer thats really large. Whats better allocating too much or creating bytebuffers all the time depending on size?

paper viper
#

Just create them based on size and you should use the netty ByteBuf instead of ByteBuffer

worldly ingot
#

Buffer what you need, usually

inner mulch
#

okay

#

thanks

junior thorn
#

can someone here code me a plugin

paper viper
#

?services

undone axleBOT
worthy yarrow
#

What's the plugin I want some $$

remote swallow
worthy yarrow
#

For the past 4 days I have literally said "x day of real work complete"

#

I forgot today actually

remote swallow
#

so go and do overtime

worthy yarrow
#

Hahaha you think the company allows that

#

It's ok, this week I got 33 hrs

remote swallow
#

do 7 more hours

worthy yarrow
#

That's a tomorrow activity

remote swallow
#

10-5 or 9-5

worthy yarrow
#

9

#

but I don't have a lot to do tmr so i probably won't even get the full 7 hrs

remote swallow
#

just dont clock out

worthy yarrow
#

The paperwork / payroll lady is dating my father...

remote swallow
#

so thats how you got the job

worthy yarrow
#

Perhaps we can make that work kek

#

yeah

#

I worked here before

remote swallow
#

how much they paying you

worthy yarrow
#

14

remote swallow
#

us?

worthy yarrow
#

yea\

remote swallow
#

dayum thats not minimum wage

worthy yarrow
#

Texas minimum wage is 7.25 iirc

remote swallow
#

solid like 2k a month if you get the 40 a week

worthy yarrow
#

My fridays are "supposed" to be really light

#

so realistically like 36

remote swallow
#

thats still 2k a month

#

it may be like 560 a week on 40 so 2 a month is way under

worthy yarrow
#

That's like 1.7k after taxes kek

remote swallow
#

i was gonna say whats ur min to be taxed but you make double minimum wage so that adds up

worthy yarrow
#

idk my bracket is prolly like 15%

#

or close to

fading drift
#

do people usually charge plugins by hour or by commission

remote swallow
#

a lot by comission

#

because you get punished for working quick

remote swallow
fading drift
#

I was wondering if it’d worth it to setup a sort of portfolio for plugin development to make even like $50 a week

#

like how hard is it to actually get customers

worthy yarrow
fading drift
#

what do u mean

#

like scams?

remote swallow
#

you have to look in the right place to find people

worthy yarrow
remote swallow
#

theres 2 types of people you find, people that want something huge for about 3$ or people that know how big it is and know its gonna cost a bit

fading drift
#

yeah surely they’re supposed to pay beforehand

remote swallow
#

most people wont pay 100% upfront

#

because some comissions can get big

fading drift
#

right

remote swallow
#

people also have higher chance of commissioning you if they know who you are

worthy yarrow
#

Most people probably do 50% upfront, 50% on completion

remote swallow
#

like alex (author of chest sort, angel chest and loads others) probably gets a lot of commissions because his plugins are big and known so they trust him

#

making it all work out is hard, you have to do free stuff and get a name for yourself and build a portfolio then know where to find people or post for people to find you

upper hazel
#

I found a plugin for weather and thirst and it looks like a mod. How is this possible water drops over the food icon and a balloon in the center

#

1.204

fading drift
#

client side

#

server side texture pack maybe

candid galleon
#

where did you find the plugin?

upper hazel
#

Not spigot site but my friend was checks it in hosting

candid galleon
#

i'd ask your friend then

upper hazel
#

This really plugin

#

Not texture

#

Wth

remote swallow
#

its a texture pack

#

its displayed on the action bar and uses positive and negative space

upper hazel
remote swallow
#

or well resource pack sorry

upper hazel
young knoll
#

Did they take the exact same textures from tough as nails

wet breach
echo basalt
#

I've found that people pay the correct amount in time about 99% of the time

#

Out of like 500+ projects only 2-3 have gone unpaid

quaint mantle
#

can someone help me with this? i'm creating a class that extends CraftPlayer and implements Player, but i can't cast Player to my class because i cant cast CraftPlayer to my class

public abstract class SkyblockPlayer extends CraftPlayer implements Player {
    private final Player player;
    private final ManaSkill manaSkill = new ManaSkill();
    private final LifeSkill lifeSkill = new LifeSkill();
    private final DefenseSkill defenseSkill = new DefenseSkill();
    private final CritDamage critDamage = new CritDamage();
    private final CritChance critChance = new CritChance();
    private final SpeedSkill speedSkill = new SpeedSkill();

    private final skyblock_builtins skybBuiltins = new skyblock_builtins();

    public SkyblockPlayer(@NotNull org.bukkit.entity.Player player) {
        super((CraftServer) Bukkit.getServer(),(ServerPlayer) player);
        this.player = player;
    }
#

That's my code

#

Use proxy

young knoll
#

Yeah that’ll never work

#

A CraftPlayer will never be an instance of your class

quaint mantle
#

How can i make it to implement Player?

young knoll
#

Use some sort of manager to map UUID to your custom class

quaint mantle
#

Use proxy

#

Proxy for what

quaint mantle
#

What

#

Do you know the proxy pattern?

#

What are u talking about?

echo basalt
#

implementing player sounds more of a convenience thing than an intended mechanic

slender elbow
#

inb4 "I want to add methods"

young knoll
#

You shouldn’t implement Bukkit interfaces

#

With a few exceptions

echo basalt
#

inb4 : Player by player kotlin ppl

quaint mantle
#

Oh

#

Okay

#

it was because i wanted to do Player.someCustomThing()

young knoll
#

Kotlin

#

MyPlayerManager.getPlayer(<bukkit player>).someCustomThing() is usually what you’d do

quaint mantle
#

Waitt

#

I can do

#

MyCustomClass customPlayer = new MyCustomClass.getPlayer(player);

#

And then customPlayer.myCustomThing

#

thanks

quaint mantle
#

Kotlin

young knoll
#

Extension methods are just static methods in disguise

#

Smh

quaint mantle
#

Decompiled java code: 😃
Decompiled kotlin code: 💀

echo basalt
#

might be ok if you have a main class singleton

#

tbf so much of my code at work is so scattered I haven't felt the need to use a player manager for the past few months

young knoll
#

That’s just sudo code

#

You can di it or have it a singleton or whatever

echo basalt
#

pseudo and sudo are two different things

young knoll
#

Yes

#

You have to run it with sudo

#

Don’t ask questions

remote swallow
#

Can I sudo shutdown myself

quaint mantle
#

lol

rough ibex
#

you should sudo shutdown now! ⚡ 🦹‍♂️

quaint mantle
#

yo

#

is there

#

a way

#

my pdc got erased?

echo basalt
#

corrupted chunk

#

maybe

quaint mantle
#

nvm

#

i changed

#

the

#

plugin name

echo basalt
#

mfs that use the minecraft namespace in pdc be like

quaint mantle
#

wdym

#

i use new NamespacedKey()

#

anyways idc it was nothing important

young knoll
#

Big brain

quaint mantle
#

What

#

is there a way to set beacon colors?

#

without the blocks

#

Nvm the god Choco solved it

young knoll
#

No

quaint mantle
quaint mantle
young knoll
#

EDIT2: After trying endlessly, it seems as though I can't get this to work. I believe this is due to the fact that the field "g" is being cleared every time #F() is called which is essentially the beacon's update method that gets called every tick. The tile entity searches for coloured glass above it every tick and recalculates. Therefore, this cannot be done without direct modification to the server (which I may or may not attempt to do at one point in time to create a PR. We'll see after 1.13).

#

No

#

:)

sly topaz
#

is that still the case today I wonder

young knoll
#

Probably

#

I don’t see why the server would calculate the colour

worldly ingot
#

Yeah only the client needs to decide that

worthy yarrow
#

Too much mathing

#

My head hurts

young knoll
#

You can hide stained glass panes in the beam

quaint mantle
young knoll
#

Since they are thin enough

worldly ingot
#

No, there are no packets to communicate that

quaint mantle
#

Shit

worldly ingot
#

It's client logic

quaint mantle
#

Okay

worldly ingot
#

Best you can do is send a client-sided block change using glass panes

quaint mantle
#

Oh yeah

#

And i can

#

change it to

#

Because i wanted to do smth like this

#

but animated

worldly ingot
#

Yeah, block changes is all you can do

quaint mantle
#

Okay okay

worldly ingot
#

At least though glass panes, if not connected, will be hidden inside the beam

quaint mantle
#

That's a good one

worthy yarrow
#

Anyone know when rolyn typically gets online kek

quaint mantle
#

how do i say dat

#

umm

#

so the player can pass through

#

like they don't exist

worldly ingot
#

Can't really do that unfortunately

quaint mantle
#

😭

young knoll
#

If you send a change to tell the client they are air

#

Then they won’t provide color anymore either

worldly ingot
#

Yeah I was gonna say, then it's not a glass pane lol

quaint mantle
#

Lol

young knoll
#

Unfortunately air is not glass

worldly ingot
#

Sad day

quaint mantle
#

😭

#

Lol

fading drift
#

how should I go about writing a duel system

#

just have a map of uuid and like an duel invite object

worldly ingot
#

Yeah pretty much

fading drift
#

should I use a runnable to remove the object after it expires or just keep an Instant where its checked on accepting the duel

#

I really want to avoid running something every x ticks I really don't like it in a plugin

worldly ingot
#

I guess it's up to you tbh. If you want a message to be sent when the invitation expires you'll have to schedule a task. Though you could schedule just a single task to run at a later time. It doesn't have to be repeating

fading drift
#

true

quaint mantle
#

you mean runTaskLater(plugin, object::remove, time)?

young knoll
#

Pretty much

fading drift
#

this old code is awful

#

final Map<UUID, Map<Entry<UUID, BridgeMap>, Long>> invites

worldly ingot
#

Yeah you might want to make some objects lol

#

I mean that could probably just be one object, I guess

quaint mantle
#

yo hey is it safe to make map inside of maps?

worthy yarrow
#

Shall I share my invite system?

quaint mantle
#

like Map<Smth, Map<Smth, String>>

fading drift
#

yeah that'd be great as a reference

worldly ingot
#

It's safe. It's just usually indicative of something that needs a better design

quaint mantle
#

Oh okay thanks

young knoll
#

I love maps in maps in maps in maps

quaint mantle
#

Bruh

quaint mantle
#

Map<Map<Map<Map>, Map<>>,Map<>>>

#

Someday i made 1000 if(true)

fading drift
#

thanks

worthy yarrow
quaint mantle
#

and code complexity intellij plugin said 23992% complex

worldly ingot
fading drift
#

code complexity plugin?

worthy yarrow
worldly ingot
#

Because you didn't use one!

fading drift
#

damn my match system is 315% complex

echo basalt
young knoll
#

Not standard library!

worthy yarrow
#

I've never used a multimap kek

quaint mantle
quaint mantle
echo basalt
#

it still places blocks but it calculates the color too

worldly ingot
#

It's literally just a Map<K, C extends Collection<V>>

quaint mantle
young knoll
#

It’s just a map with a collection but John Google deals with things for you

worldly ingot
#

put() adds to the collection, remove() removes from it, get() returns the values as a collection, or an empty one if there are none

fading drift
#

should I avoid static references in a plugin

worthy yarrow
#

Well that's written in the skyblock project (currently on backburner while I work on disc golf)

fading drift
#

for example if I had my duel invites static what would be the harm

worthy yarrow
#

So perhaps I will change it later

#

Well I will need an invite service for the disc golf rounds too so

#

Maybe I just rewrite it but better

#

Sigh I am just stuck on the maths right now... I hate it

echo basalt
quaint mantle
#

tankz

echo basalt
#
public void placeGlass(Block beaconBlock, Color color) {
    List<GlassColor> glassColors = GlassColorCache.calculateGlassColors(color);
    for (int index = 0; index < 4; index++) {
        final int y = beaconBlock.getY() + index + 1;
        final Material glass = index >= glassColors.size() ? Material.AIR : glassColors.get(index).getType();

        final Block glassBlock = beaconBlock.getWorld().getBlockAt(beaconBlock.getX(), y, beaconBlock.getZ());
        glassBlock.setType(glass);
    }
}
#

It isn't perfect because you don't have the full color space

quaint mantle
#

oh okay okay thankz

echo basalt
#

But you can update glass quite fast, IIRC my client handled ~a color change every 3 ticks

quaint mantle
#

damn

#

how do i set persistent data container key if item doesn't have meta?

echo basalt
#

you wouldn't be able to check the pdc because there's no meta anyways

quaint mantle
#

but then how do i do it?

#

how is it possible

young knoll
#

getItemMeta creates meta if it doesn’t exist

river oracle
#

Yes it also clones it if it exists so be careful!!! Ya gotta set it back and get ItemMeta isn't super cheap

blazing ocean
#

luckily it's a highly flexible system that is very close to the model adopted by vanilla

merry cove
#

So I was wondering, if you have multiple vault economies on one server and all of them vault registered if a third party plugin hooks, how do you control which it should interact with? baffles me. (Never mind ~ its impossible to have independent support for each using vault) so need to find a way around this 😦

pliant topaz
#

I never worked with vault, but when your plugin can interact with all of the economies, you could write an api for the other plugin

wet breach
merry cove
wet breach
#

Ah yeah you would see if it has its own api to interact with or you could use reflection and try to force inject into it lol

wet breach
#

So on that line you would do that and where it specifies the economy.class you would replace with the economy plugins class instead and you would then be able to interact with that specific plugin through vault

#

Or should be able to anyways

sly topaz
#

Vault isn't really limited in that sense, it just makes good use of the service provider API

pulsar pier
#

It's been ages since I last used Java (and even longer since I made mc plugins.) I'm using Eclipse (sorry :P), but I'm pretty much open to doing anything. I'm looking for a tutorial for getting a enviorenment up for PaperSpigot 1.8.8 :)

shadow night
#

?whereami

sly topaz
#

?1.8

undone axleBOT
sly topaz
#

also

shadow night
#

Paper (formerly known as PaperSpigot) is not affiliated with Spigot

cedar saffron
sly topaz
#

even if you go to Paper you'll be told 1.8 is unsupported anyway

shadow night
#

Yep

#

It is an ancient version and shouldn't really be used

sly topaz
#

it isn't that much different from using the API today, so you can probably make do with the current documentation, excluding all the paperweight sehanigans

eternal night
#

I mean, the API is extremely different lol

sly topaz
#

it is, but the gist of it is still the same

eternal night
#

I guess so

pulsar pier
sly topaz
#

err, excluding things like bootstrapping and commands I guess

shadow night
eternal night
#

Thing is, if you are running 1.8 you should not be using either paper or spigot. Both pieces of software have known exploits for that version

pulsar pier
#

well shit

eternal night
#

Idk what the common 1.8 fork is people run, but it is 100% not stock paper or spigot

pulsar pier
#

what exploits?

sly topaz
#

pandaspigot I think was the popular fork nowadays?

eternal night
#

I mean, mostly crash exploits I'd guess

#

e.g. clients crashing the entire server with some malformed input or funky actions

sly topaz
#

the fact that these crash exploits exist as well doesn't make that situation any better

#

you'll probably find support in whatever 1.8.8 fork is actively maintained nowadays, I wouldn't be able to tell you which one that is since I am not part of these communities though

pulsar pier
sly topaz
#

pandaspigot seems fairly relevant still so I'd look in that direction, if anything

pulsar pier
#

Thank you!

chrome beacon
#

Any plugins installed?

inland hemlock
#

Does anyone know why I get this error? pom.xml contains the specialsource remapper. Idk if its because something is wrong with my plugin building or something else.

Caused by: java.lang.NoSuchMethodError: 'net.minecraft.server.level.ServerPlayer org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer.getHandle()

    <plugins>
      <plugin>
        <groupId>net.md-5</groupId>
        <artifactId>specialsource-maven-plugin</artifactId>
        <version>2.0.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>remap</goal>
            </goals>
            <id>remap-obf</id>
            <configuration>
              <srgIn>org.spigotmc:minecraft-server:1.21.1-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
              <reverse>true</reverse>
              <remappedDependencies>org.spigotmc:spigot:1.21.1-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
              <remappedArtifactAttached>true</remappedArtifactAttached>
              <remappedClassifierName>remapped-obf</remappedClassifierName>
            </configuration>
          </execution>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>remap</goal>
            </goals>
            <id>remap-spigot</id>
            <configuration>
              <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
              <srgIn>org.spigotmc:minecraft-server:1.21.1-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
              <remappedDependencies>org.spigotmc:spigot:1.21.-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>```
chrome beacon
#

Also make sure you're actually using maven to compile your plugin

#

And not Artifacts

inland hemlock
fading drift
#

how to stop arrow pickup in 1.8 where arrowpickupevent doesn’t exist

torn shuttle
#

I was wondering why I was getting 40 fps