#help-development

1 messages · Page 890 of 1

remote swallow
#

thats so long

young knoll
#

Cope

worldly ingot
#

The /kill @s is brutal

#

Like you could have just /kill Max

#

But naw

remote swallow
#

gotta do it urself

young knoll
#

Exactly

quaint mantle
#

jokes aside is this a good way to handle waves of "stuff"

public class ZombieApocalypse extends AbstractApocalypse {

    public ZombieApocalypse(Plugin plugin) {
        super(plugin);
    }

    @Override
    public void start() {
        super.getEventBus().subscribe(CreatureSpawnEvent.class, this::handleCreatureSpawnEvent);
    }

    @Override
    public void update() {

    }

    @Override
    public void end() {
        super.end();
        System.out.println("Ended.");
    }

    private void handleCreatureSpawnEvent(CreatureSpawnEvent event) {
        if (event.getSpawnReason() != CreatureSpawnEvent.SpawnReason.NATURAL || event.getEntityType() != EntityType.ZOMBIE) {
            return;
        }

        Location spawnLoc = event.getLocation();
        for (int i = 0; i < 5; i++) {
            if (spawnLoc.getWorld() == null) {
                continue;
            }
            spawnLoc.getWorld().spawn(spawnLoc, Zombie.class);
        }
    }

}

To start an apocalypse I write

apocalypseManager.startApocalypse("zombie_apocalypse", new ZombieApocalypse(this)); // "this" is the Plugin class

I'm not sure if I should use an ID for all this but I used it anyway

drowsy helm
#

you dont really have any granularity per wave

#

or are you talking about the overarching structure

quaint mantle
#

wdym

#

idk why I said waves, but an apocalypse could have a wave

#

like certain apocalypses can stack up another

flint coyote
#

I would add some randomness. Not always spawn 6 in instead of 1 but to 1-6

quaint mantle
#

oh well yeah that's just concept

flint coyote
#

Also you might add some initial velocity to the spawned ones so if you manage to see them spawning it doesn't look like a "cluster" but more spread out. Could technically also alter the Location but then you'd have to check for save locations to spawn

quaint mantle
#

ill make it configurable

#

it's just like an example

flint coyote
#

So what's the question? Sorry I just tuned in

quaint mantle
#

a state meaning something that occurs over a time period

flint coyote
#

Yeah it looks reasonable to me

#

If you'd use that for many different events (e.g. listening to 70 different events) I'd wonder if it's better to register the listener "when needed" or to register it at the start and just return if it isn't needed. For this case it's definitely register and ignore but for many listeners I'd wonder what's better. Especially when you don't need most of the listeners for long periods of time

quaint mantle
#
public abstract class AbstractApocalypse implements Apocalypse {

    protected final Plugin plugin;
    protected final BukkitEventBus eventBus;
    protected boolean active;

    protected AbstractApocalypse(Plugin plugin) {
        this.plugin = plugin;
        this.eventBus = new BukkitEventBus(plugin);
        this.active = true;
    }

    @Override
    public void end() {
        this.active = false;
        this.cleanUp();
    }

    protected void cleanUp() {
        this.eventBus.unsubscribeAll();
    }

    @Override
    public boolean isActive() {
        return this.active;
    }

    protected final BukkitEventBus getEventBus() {
        return this.eventBus;
    }

}
#
/**
 * A simple way to register an event without having to go through the class creation process.
 * <p>
 * Credit to <a href="https://github.com/IllusionTheDev">IllusionTheDev</a> for the idea.
 */
public final class BukkitEventBus implements Listener {

    private final Plugin plugin;

    public BukkitEventBus(Plugin plugin) {
        this.plugin = plugin;
    }

    public <T extends Event> void subscribe(Class<T> eventClass, Consumer<T> listenerConsumer) {
        this.subscribe(eventClass, listenerConsumer, EventPriority.NORMAL, true);
    }

    public <T extends Event> void subscribe(Class<T> eventClass, Consumer<T> listenerConsumer, EventPriority priority, boolean ignoreCancelled) {
        Bukkit.getPluginManager().registerEvent(eventClass, this, priority, (listener, event) -> {
            if (eventClass.isInstance(event)) {
                listenerConsumer.accept(eventClass.cast(event));
            }
        }, this.plugin, ignoreCancelled);
    }

    public void unsubscribeAll() {
        HandlerList.unregisterAll(this);
    }

}
#

I cut out the docs except for the credit ofc

#

@flint coyoteso when I execute .end() it will execute .cleanUp()

#

and unregister all those listeners

flint coyote
#

Well creating listeners is reflection based an has some overhead. Therefore I'm unsure whether registering und unregistering is the way or if you should register them at the start. It probably depends on the amount of listeners you need and the percentage of time you actually need them vs. they are doing nothing when called

#

I'm open for opinions on this

quaint mantle
#

uh

#

im just saying its not that deep

remote swallow
#

yeah registering 1 event when needed isnt the best, much better to do something of registering 1 of every event and passing that instead

flint coyote
#

But what if you for example need 70 different events but most of the time you simply don't need them

#

Would you still register them at the start or would you register them as needed?

quaint mantle
#

now you're really making me think lol

remote swallow
#

you could technically register them dynamically but only ever make 1 and still pass it

#

but the easier route is just registering all of them

flint coyote
#

That's reasonable yeah. You would still need multiple per event if the priority differs though

remote swallow
#

wouldnt most stuff not require any priority if you just ignore cancel

quaint mantle
#

I feel like you guys are thinking too hard about the worst case possible

flint coyote
#

That's what developers do 😛

quaint mantle
#

I gtg for dinner brb

flint coyote
remote swallow
#

yeah

flint coyote
#

You can delegate them all to the same function as in using the same executor and then delegate them to wherever you need. But that probably doesn't change a lot

hot reef
#

is there a way to detect if a player enters a region?
i know that makes zero sense, but imagine a like box of sorts, an invisible one, how can i detect if someone enters it, is there a class to make such a region too?

flint coyote
#

BoundingBox is what you are looking for

hot reef
#

do you have an example by chance i can refer to? ❤️

young knoll
#

If you register it once you will probably see a bit more benefit from the JVM optimizing the reflection

#

Idk how much unregistering and re-registering will affect that

flint coyote
hot reef
#

❤️

young knoll
#

That’s basically how worldedit does it

#

Although they might use the move event, idk

flint coyote
#

Yeah it depends on the timing accuracy

#

If it's a 1 tick scheduler might aswell use the move event

#

WorldGuard optimizes the regions by not checking the "irrelevant" ones.
For a long time they simply looped them all though

#

As it ain't easy to optimize

flint coyote
young knoll
#

Pretty sure they have a spatial partitioning system

#

Probably just by chunk

flint coyote
#

Yeah that's what I'd do. Save all chunks that are contained in the region and only check the region when one of those chunks is loaded (tracking via load and unload event)

#

Could be that they are doing something more complex. Did not dig into their code

young knoll
#

Only check regions that overlap the chunk an action is in

flint coyote
#

Yeah basically "enable" a region when a chunk gets loaded which has one of it's bounds within the region and "disable" once all chunks are unloaded that contain the region based on the same logic

#

Or preload the chunk instances and check it with a hashmap

flint coyote
#

Can always extend it within a "WorldBoundingBox" :)

young knoll
#

Pretty easy to just make a wrapper that holds a world and a bounding box

fervent robin
#

https://pastebin.com/x1vdrNip

In the getDatabases method it always returns before added is printed on line 80. How is that possible as they all have to be finished?

#

When I print the size to return in the getDatabaseQuests method it always prints 0

#

Line 88-94

river oracle
#

if you do this I'm going to mess up that inventory Pr

#

Bukkit.createInventory_Y2K_AddedThis(MenuType, String Title)

tender shard
#

Bukkit.y2k().createInventory(...)

#

Bukkit.y2k() returns a Server.Y2K instance

buoyant viper
#

its shrimple

#

just replace all string methods with Components

tender shard
#

yeah someone Ctrl+R through bukkit, that should do

young knoll
#

Hrmmm

river oracle
remote swallow
#

org.bukkit.y2k

quaint mantle
#

Is there an event for when a zombie hurts a door

#

like the process of breaking it

#

not fully breaking the door

tender shard
#

don't think so

worldly ingot
quaint mantle
#

yeah it's not sadly

river oracle
#

did you know NMS kills 1 in 20 spigot developers each year?

#

be careful out there!

remote swallow
#

so 21 devs die each year?

river oracle
remote swallow
#

brain moment

hot reef
#

hello i have another issue

#

is there an event i can have that runs every single tick?

tender shard
#

no

quaint mantle
young knoll
#

Yeah that’s basically just a scheduler

hot reef
tender shard
#

?scheduling

undone axleBOT
quaint mantle
#

here

tender shard
#
Bukkit.getScheduler().runTaskTimer(myPlugin, () -> {

  // Code here runs every tick
  doSomething();

}, 0, 1); // 0 = initial delay, 1 = each further delay
quaint mantle
#

bro beat me to it

#

here's another way to do it

#
        new BukkitRunnable() {
            @Override
            public void run() {
                // something here
            }
        }.runTaskTimer(this, 0, 1);
river oracle
quaint mantle
#

yeah

#

I never knew you could make a class in a method

#

like Ive tried it once but it didn't work because for some reason I thought I need a public or private modifier

rough ibex
#

what are you talking about intellij, I only have 7 methods

quaint mantle
#

is that an error?

#

wtf

rough ibex
#

no

quaint mantle
#

or warning

#

I mean

rough ibex
#

I just have warnings on

#

really strict

quaint mantle
#

whats that warning for

rough ibex
#

what it says on the tin lol

young knoll
#

For having too many methods

hot reef
young knoll
#

If you have too many methods you might

#

Uhh

#

Die

rough ibex
#

it's messy and a sign of needing to decompose

#

but I don't have 26 methods

quaint mantle
#

@hot reefI think his method returns an ID

rough ibex
#

and the 3 interfaces I implement have... 3 total methods

quaint mantle
#

which you can cancel with some methods

#

my way you can

        new BukkitRunnable() {
            @Override
            public void run() {
                this.cancel();
            }
        }.runTaskTimer(this, 0, 1);
rough ibex
young knoll
#

Smh all code is too messy these days

#

Back in my day!

remote swallow
tender shard
#

?scheduling

undone axleBOT
quaint mantle
#

I found it

#
scheduler.runTaskTimer(plugin, task -> {
  if (Bukkit.getOnlinePlayers().isEmpty()) {
    task.cancel(); // <--
    return;
  }
  Bukkit.broadcastMessage("Mooooo again!");
}, 0L, 20L * 60L);
#

in the examples

astral basin
#

Hey does any1 know where i can get support on a mycommand issue

river oracle
#

👀 what is a mycommand issue

young knoll
#

The discussion page of the plugin

river oracle
#

I smell wrong discord

young knoll
#

Or perhaps a discord if they have one

rough ibex
#

I smell... ANCHOVIES!

astral basin
#

or no discord

rough ibex
#

what plugin

#

"mycommand" is way too generic

astral basin
#

mycommand

rough ibex
#

lmao thanks

hot reef
#
if (player.isGliding() && !playerData.recentFlyer) {//if the player is flying
             Bukkit.getScheduler().runTaskTimer(EMC_CORE.main, task -> {
                playerData.score += 0.5;
                playerData.scoreBoardScore.setScore((int) (100.0 - playerData.score));
                 playerData.scoreScheduler = task;
            },50L,50L);
            playerData.recentFlyer = true; //marks the player as in a state of flying
            return;
        }
rough ibex
#

Link me.

astral basin
#

thats the name of the plugin

hot reef
#

is this a good implementation?

remote swallow
hot reef
#

💀

rough ibex
#

?di

undone axleBOT
rough ibex
#

basically

lost matrix
rough ibex
#

pass in an instance of your plugin as an argument

hot reef
#

lol

#

EMC_CORE.main

young knoll
#

It has 84 pages

rough ibex
young knoll
#

Static singleton for a plugin isn’t that bad tbh

tender shard
#

oh no, not this discussion again

rough ibex
#

alright

hot reef
#

theres like 6 things loaded in EMC_CORE

young knoll
#

It’s already an enforced singleton

hot reef
#

so i just have the plugin labeled "main"

lost matrix
young knoll
#

What if my field is only public and final

#

😈

lost matrix
rough ibex
#

kid named List

tender shard
#

main as field name is fine imho

public class MyListener implements Listener {
  private final MyPlugin main; // I don't see any issue with this

  // ...
}
hot reef
#

trust me i didn't show you the gory stuff

#

where i don't even follow simple java rules

young knoll
#

Actually what if I just make the field standard public

#

Maybe I’m JOML

tender shard
young knoll
#

JOML’s fancy vector stuff is all public field based

#

Presumably to get that bit of extra speed when doing graphics rendering

drowsy helm
#

I'm really behind with mc dev lately, are noteblocks still the way to go for blocks or has 1.20+ added something for that

young knoll
#

Ehh

#

Display entities are an option

#

Otherwise still noteblocks

tender shard
#

ok

mild cloak
#

hi someone can help me

#

i try making one scoreboard but everytime give me this error

#
            Player p = (Player) commandSender;
            User user;
            String nextrank;
            String nextrankcost;
            try {
                user = LuckPermsProvider.getPlayerAdapter(Player.class).getUser(p);
                nextrank = api.getPlayerNextRank(p.getUniqueId());
                nextrankcost = api.getRankCostFormatted(RankPath.getRankPath(nextrank, "default"));
            } catch (IllegalArgumentException exception){
                return false;
            }

            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard scoreboard = manager.getNewScoreboard();
            Objective objective = scoreboard.registerNewObjective("Cristal", DUMMY, ChatColor.BLUE + "Cristal", INTEGER);
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);
            OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(p.getUniqueId());
            Score score = objective.getScore(ChatColor.GOLD + "Dinheiro: " + econ.format(econ.getBalance(offlinePlayer)) + "€");
            Score s2 = objective.getScore(ChatColor.AQUA + "Nivel: " + ChatColor.LIGHT_PURPLE + p.getLevel());
            String prefix = user.getCachedData().getMetaData().getPrefix();
            if(nextrank != null) {
                Score s3 = objective.getScore(ChatColor.LIGHT_PURPLE + "Rank: " + ChatColor.BOLD + ChatColor.translateAlternateColorCodes('&', prefix));
                Score s4 = objective.getScore(ChatColor.LIGHT_PURPLE + "Proximo Rank: " + ChatColor.BOLD + nextrank);
                s3.setScore(3);
                s4.setScore(4);
            }
            if (nextrankcost != null) {
                Score s5 = objective.getScore(ChatColor.YELLOW + "Rank Custo: " + ChatColor.BOLD + econ.format(econ.getBalance(offlinePlayer)) + "/" + nextrankcost);
                s5.setScore(5);
            }

            score.setScore(1);
            s2.setScore(2);


            //s6.setScore(6);
            p.setScoreboard(scoreboard);
#

the code

#

but the scoreboard work sometime appear the error in console

quaint mantle
#

Use fastboard

#

also if there's an error

mild cloak
#

but i want fix this error

#

can help me?

quaint mantle
#

Read the error it should tell you

mild cloak
#

yeah already see its because prisonranksx

#

but who can i fix

#

i new in development

drowsy helm
#

getRankupName()

#

is null

lost matrix
drowsy helm
#

this line tells you where the error is

mild cloak
#

i already see is this part of code: nextrank = api.getPlayerNextRank(p.getUniqueId()); how can i put to detect if is null

#

i try this
if(nextrank != null) {
Score s3 = objective.getScore(ChatColor.LIGHT_PURPLE + "Rank: " + ChatColor.BOLD + ChatColor.translateAlternateColorCodes('&', prefix));
Score s4 = objective.getScore(ChatColor.LIGHT_PURPLE + "Proximo Rank: " + ChatColor.BOLD + nextrank);
s3.setScore(3);
s4.setScore(4);
}else{
return false;
}

#

but give me error

lost matrix
#

Show the error

orchid brook
#

Hi I want to create a plugin with a command that gives a 'bee hive' block. After placing it, when right-clicked, it should open a menu where players can put a bee inside. When a bee is present inside, it generates honey every x minutes, available in the storage menu of the block, accessible via right-click. The block should make honey only when the chunk is loaded.

Do i need to use NMS u think ?

In fact i don't know when do i need to use NMS or not :/ i have lot of trouble with that

chrome beacon
#

You don't need nms

rigid loom
remote swallow
#

have you ran buildtools with the --remapped flag

rigid loom
#

the dependency thats added has to be remapped?

remote swallow
#

thats what the classifier says

#

run buildtools for 1.17.1 with the --remapped flag

rare rover
#

what's the best way of making a system that wait's like 2 seconds before updating the pickaxe's lore?

#

I was debating on just using PDC and adding to a value every block

#

but i wanted some input

#

was just going to do this originally, but it still accesses the meta every block broken

echo basalt
#

I believe you should just have a uuid on your pdc

#

and update a mutable object

#

and then like.. save it back

rare rover
#

okay, should i make it update like this or every block?

#

the lore

#

i'm guessing this would be a bit faster but

young knoll
#

Could distribute it if needed

#

I doubt it’ll matter too much

rare rover
#

wdym distribute?

orchid brook
young knoll
#

Distribute the updates over multiple ticks for all the active players

rare rover
#

ahh

clear panther
#

guys how do i make a system for my items

#

and ability

#

so i dont have to face eye issue

lost matrix
quaint mantle
#

Does anyone else find github workflow complicated

clear panther
quaint mantle
#

Send it

#

Also what type of abilities

lost matrix
#

I would encourage you to completely separate those two.
Create an entire system just dedicated to abilities first.
An ability should have

  • A trigger
  • A target
  • An effect

After that you can simply bind an ability to an ItemStack via its PersistentDataContainer

#

Abilities should be mapped to an owner.
This can be done in a simple Map<UUID, AbilityHolder> where the AbilityHolder contains all current abilities owned by this UUID.
If an entity changes its equipment, you simply scan if the new equipment has any abilities and add it to the holder.

#

So most def, start by creating an AbilityManager and an abstract class Ability.
Then an AbilityHolder which contains abilities.

#

Triggering is the actual hard part. But you will figure that out.

clear panther
#

oke :d

#

so u copied it from somewhere

#

or u typed it..

lost matrix
#

I just typed that

clear panther
#

so can u make an example

lost matrix
#

I have written ability systems half a dozen times

#

Sure

clear panther
#

for easier to understand
cuz my english is ass

lost matrix
#
public class AbilityManager {

  private final Map<UUID, AbilityHolder> holderMap;

  public AbilityManager() {
    this.holderMap = new HashMap<>();
  }
  
  public void initHolder(UUID playerID) {
    Preconditions.checkState(!holderMap.containsKey(playerID), "Holder for player already exists.");
    holderMap.put(playerID, new AbilityHolder());
  }
  
  public void removeHolder(UUID playerID) {
    holderMap.remove(playerID);
  }
  
  public AbilityHolder getHolder(UUID playerID) {
    return holderMap.get(playerID);
  }

}
public class AbilityHolder {

  private final List<Ability> abilities;

  public AbilityHolder() {
    this.abilities = new ArrayList<>();
  }

  public void addAbility(Ability ability) {
    this.abilities.add(ability);
  }

  public void removeAbility(Ability ability) {
    this.abilities.remove(ability);
  }

  public List<Ability> getAbilities() {
    return List.copyOf(this.abilities);
  }

}
quaint mantle
lost matrix
#

But honestly thats already pretty spoony

echo basalt
#

7smile7 has inconsistent code 2024 colorized

quaint mantle
#

Hm

#

I had that same idea for my plugin

#

but I think the 1.8 api was missing some events

lost matrix
#

It always does 🙂

#

And a PDC for that matter

quaint mantle
#

yeah I was just going to use nbt api

#

That wasn't a big deal

#

it was the armor equip events

#

and the ones online are bugged

#

I thought about making my own but I took a break

lost matrix
#

Hm im actually wondering why only the fork has those

quaint mantle
#

maybe like

public boolean hasAbility(Class<¿ extends Ability> abilityClass)

#

Idk how I typed that wildcard

lost matrix
# quaint mantle maybe like public boolean hasAbility(Class<¿ extends Ability> abilityClass)

My AbilityHolder would look more like this:

public class AbilityHolder {

  private final Map<Class<?>, List<Ability<?>>> abilities;

  public AbilityHolder() {
    this.abilities = new HashMap<>();
  }

  public <T, A extends Ability<T>> addAbility(A ability) {
    this.abilities.computeIfAbsent(ability.getTriggerType(), k -> new ArrayList<>()).add(ability);
  }

  public <T, A extends Ability<T>> removeAbility(A ability) {
    this.abilities.computeIfPresent(ability.getTriggerType(), (type, list) -> {
      list.remove(ability);
      return list.isEmpty() ? null : v;
    });
  }

  @SuppressWarnings("unchecked")
  public <T> propagateTriggerEvent(T trigger) {
    this.abilities.getOrDefault(trigger.getClass(), List.of()).forEach(ability -> ((Ability<T>) ability).execute(trigger));
  }

}

Not actual prod code but just the idea.
I never expose the abilities but simply forward trigger events to each ability.

clear panther
#

it wont work

#

Abilityholder and get just

#

doesnt exists

lost matrix
#

Those are classes you need to write yourself...

#

AbilityManager
AbilityHolder
Ability

Thats the bare minimum

clear panther
#

so ability are just the ability i want to create?

#

or its something else

spare mason
#

Is It possible to use inverse kinematics to control the shape of a block display?

quaint mantle
#

Ah

#

@clear panther Are you new to developing

clear panther
#

kinda

#

i just forgot everything

#

since i didnt touch this stuff for a long time

lost matrix
quaint mantle
#

Is your current code base using a lot of static keywords

echo basalt
lost matrix
#

Illusion are you wildin again?

echo basalt
#

it works tho

lost matrix
#

String keys?

echo basalt
#

woeisme they're file names

#

but yeah I use string keys quite often

#

because I can't bother making a namespaced key system

lost matrix
#

probably fine

echo basalt
#

And I validate my inputs

#

so it's fine

lost matrix
#

*As long as you use constants

echo basalt
#

I guess I could make the template name a constant

lost matrix
#

I meant for the keys. For example your "battle-island" could very well be a public static final String KEY = "battle-island" if thats important at other places

echo basalt
#

I mean yeah but

#

This plugin isn't standalone

#

it needs a game management service and that service just has uh

#

a list of template ids on a config

#

and it fetches data n stuff

lost matrix
#

Ouh i see

echo basalt
#

I need to make it more robust but in theory I can have 2 minigame server templates (Think hypixel's mini vs mega) and make my server picking strategy filter servers based on what templates they have

#

And I'd do that if this project's deadline wasn't like.. a week

quaint mantle
#

Illusion are you going to apply at hypixel again

echo basalt
#

uH not this soon

#

Like maybe at the end of the year or sumn

#

let me cook

#

I have a whole minigame network and a tycoon gamemode to deliver this month

#

still have to do my driving school stuff too

#

It's useful experience that I need if I want to actually expand my skills

quaint mantle
#

What do you even think caused you to get laid off last time

echo basalt
#

I didn't get laid off

#

I just did miserably on the interviews because I thought I was smarter than I am

#

And then I applied like 5 more times and they never bothered

quaint mantle
#

I remember you explained the process to me

#

They had you review code and explain what was bad

sullen marlin
#

It’s hypixel they probably did everything in each of the 5 different interviews

echo basalt
#

I had 6 interviews

#

only one or two were about code

sullen marlin
#

6 interviews is insane

echo basalt
#

One was asking about code and projects I've made and the other had actual technical questions

echo basalt
sullen marlin
#

Thats canonical levels of insane

echo basalt
#

I was a full-time intern at school, at the time

#

in like 40C summer weather

#

I'd get home, cool off for 15 mins and hop into like 2 hours of interviews

#

it was insane

river oracle
echo basalt
#

That's part of the reason why I fumbled hard

#

my brain was fried

#

I could barely remember anything about bit shifting after blowing dust off computers for 8 hours straight

river oracle
#

I doubt you'll ever get another response too I guarentee they don't let you reapply

echo basalt
#

I asked them reapplication time and they said like

#

there's no cooldown

#

I can reapply whenever

river oracle
#

Seem like the type of people who get flooded with apps and just deny repeats

quaint mantle
#

ask choco for a referral

#

👍

sullen marlin
#

Literally easier to get a real job paying hundreds of thousands a year

river oracle
echo basalt
#

I have

#

like 5 times

#

no response

rough ibex
#

well yeah they denied you once

#

why waste the resources trying 5 more times

river oracle
echo basalt
#

Still I spent like 1-2 years just thinking ab my flaws and getting better and better

#

rewrote my skyblock core project, been working on minigames for a few months

rough ibex
#

luckily hypixel is not the sole employer in the world

spare mason
#

Where I can learn more about quaternions? Block displays are making me turn crazy

echo basalt
#

I've been rewriting my minigame core

#

Branching out from just plugin development and writing services for things like infrastructure

#

Still doubt they'll even open my cv

river oracle
#

have you tried applying elsewhere Illusion?

echo basalt
#

Yeah I've been getting jobs here and there

#

I had a "job" for like 2 years that ended in nothing

river oracle
echo basalt
#

Right now I'm just hopping between projects every month because I go there, get things done and just move on

echo basalt
river oracle
#

MC servers work but they're unstable as hell

river oracle
#

i forget where you're from

echo basalt
#

like 1k/mo full-time

#

or 1.5k if you live in the capital

river oracle
#

damn that's ass

echo basalt
#

and full-time here is considered 45/week

river oracle
#

yeah Hypixel is your way out :P

#

actually smart for doing shit online then

echo basalt
#

I make more by just sitting my ass on my chair and coding for like 2 hours

river oracle
#

you ever thought about moving country eventually or just rather do virtual work?

echo basalt
#

I've had ambitions but like

#

eh

#

That just means I have to up my game to make more money because rent will be higher

#

Like I don't mind just getting a crappy IT job IRL, make a low guaranteed wage and dabble in plugins on my free time for that bag

river oracle
echo basalt
#

In my area rent is 600-800$/mo and engineers make 1k

#

no girlfriend because I have the social skills of a cockroach

young knoll
#

Relatable

river oracle
young knoll
#

And just like a cockroach

#

Im in your walls

echo basalt
river oracle
#

my GF thinks so but she is biased

echo basalt
#

That's all that matters

#

But nah even if I had one

river oracle
echo basalt
#

good luck finding an IRL job

river oracle
#

better to work online and scrape by until you can get somethinv virtually

echo basalt
#

The closest offices are like 2 hours away

#

aka on the other side of the country

#

I have a classmate or two that have a "real job" where they're in some basement for 8 hours a day doing embedded systems in a proprietary language

river oracle
#

yeah doubt you'll make decent money unless you A. get something online or B. move country and you kinda gotta do A to do B

echo basalt
#

for a spanish company

river oracle
echo basalt
#

1k/mo

#

(we all have degrees btw)

river oracle
#

crazy how people in other countries get extorted like this

#

for example I want to be an emphasis in embedded system and it easily pays 100K+ here

#

probably about same qualifications as far as degrees go too

#

kinda fucked up

quaint mantle
#

@river oracle u from US right

river oracle
#

yes

echo basalt
#

I mean

#

tech wages in the US are insane

quaint mantle
#

is the software engineering market rly that competitive rn

echo basalt
#

but that's because the tech market is well developed

#

we have a couple tech companies here and they're all just like

river oracle
quaint mantle
#

I feel like it's just those ppl who are only good at the mechanics

echo basalt
#

offices for some multinational

river oracle
#

@quaint mantle what area are you interested in

quaint mantle
#

Software engineering

#

Probably back end

river oracle
#

what part though there is a shit ton of stuff

#

back end is less competative than front end

#

if you're a Web Dev you'll get payed 60k a year and be wrung dry of all your ambitions

quaint mantle
#

💀

#

Yeah I'm not good at art

rough ibex
#

some markets are more saturated than others

quaint mantle
#

Believe me

river oracle
#

back end usually you can get a decent salary and job security

#

again though this depends on your area

#

in my area there is a lack of back end and embedded systems devs

quaint mantle
#

But I've always wanted to make my very own IO game

echo basalt
#

good luck finding a web dev job here

#

Most of the people I know that have degrees are doing random BS jobs

river oracle
#

so obviously I'd get payed more for doing embedded systems and back end 100k+ starting for 60k starting

quaint mantle
#

when I was little I mained io games because of my horrible pc

echo basalt
#

or being teachers themselves

river oracle
#

big difference just for area

quaint mantle
#

the language was Chinese and it was windows xp 💀

echo basalt
#

All my programming teachers come straight out of uni with no job experience

quaint mantle
#

I'm not even joking slither io would run at maybe 18fps

river oracle
#

@quaint mantle generally though as an engineer you'll get payed well if you are actually smart and know how to code you'll be way more likely to get a job than anyone else leaving college

#

it requires like 1 braincell to get a CS degree

river oracle
#

there are kids in my embedded systems class that have been through 3 or 4 programming heavy classes that can't hold a candle to me

river oracle
#

if yk yk

kind hatch
#

Dayum. Never been there before.

echo basalt
#

jk that's not a thing here

river oracle
#

we got beast ass cheese

kind hatch
#

It'd be quite the drive from where I am currently too.

echo basalt
#

philadelphia cream cheese

river oracle
kind hatch
#

Ye

river oracle
#

always thought you were european

kind hatch
#

Lmao

river oracle
#

yeah anyways backend and embedded are payed well here

kind hatch
#

It's cause of my vocabulary innit?

river oracle
#

the entire industry is short on good developers

#

the market is saturated just not with good candidates

quaint mantle
#

@river oracle what college are you in

river oracle
quaint mantle
#

Ah

#

have you heard of Michigan tech

river oracle
#

yes

#

but I'm going to crush your dreams

echo basalt
#

my sleep deprived ass read that as "minigame tech"

river oracle
#

your college doesn't matter

quaint mantle
#

I wanna stat in state

#

I just want the degree tho

rare rover
#

anyone see anything wrong with this? It doesn't seem to be calculating correctly. The values are the same every time:

#

the method is suppose to increase the cost by x% every level without looping

echo basalt
#

bet your progression is an int

rare rover
#

they seem to be all doubles

river oracle
echo basalt
#

you sure enchantPow is a double?

rare rover
#

i can specify directly just in case. one sec

echo basalt
#

hm

#

print your variables or sumn

rare rover
#

nope same thing

rare rover
echo basalt
#

all of them

rare rover
#

literally all the values

#

ohh

#

wait one sec

river oracle
#

@quaint mantle Idk where you live but just stay in state btw idk what your situation is, but generally tips are Attend an Accredited university, ensure the CS program is atleast average and they support the degree and minimize cost

rare rover
#

which it isn't

#

🤔

quaint mantle
#

I think my dad might pay for some of it

#

my dad can hire ppl too at his company

river oracle
quaint mantle
#

Do you think I'll get a referral

river oracle
#

do NOT go to an ivy league

#

don't even go to a top tier uni

quaint mantle
#

I got a full ride at Harvard

river oracle
#

your degree stops mattering the second you get your first job. And the more stuff you have on github thats finished and decent the less the degree matters

quaint mantle
#

idk but

#

I feel like they won't even check your github

river oracle
#

they do

#

put your projects on your resume too

quaint mantle
#

yeah all my projects are mc related rn

river oracle
#

it doesn't matter

echo basalt
#

As long as you can market WHY your projects are important you'll be fine

river oracle
#

^^

quaint mantle
#

Yall ever seen open src but on youtube

#

Go to the comments section

echo basalt
#

lmfao

quaint mantle
#

If only I could post imgs

echo basalt
#

get verified

quaint mantle
#

bro it's on my dead acc

#

@quaint mantle

echo basalt
#

ah

#

you're him

quaint mantle
#

yeah I thought it was obvious tho

rare rover
#

wth, it maxes out at hella low numbers ig?

quaint mantle
#

skinnynoonie was in all my packages

rare rover
#

even though its a double

river oracle
kind hatch
undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

quaint mantle
#

but it's not the same

river oracle
#

have you emailed support

quaint mantle
#

it doesn't have the pop up

river oracle
#

MD should beable to fix that

echo basalt
#

playing bloons rn I need a new hobby

quaint mantle
#

nah I haven't cause I ain't doing allat rn

quaint mantle
#

He's making a new plugin for every enchant LOL

#

I just realized

kind hatch
#

That sounds familiar....

young knoll
#

He’s posting the code as comments

#

GitHub is for betas

river oracle
young knoll
#

Still beta

#

Alphas use YouTube comments

quaint mantle
#

Nah bruh

#

I found his dc

rare rover
#

ohh i figured out the issue

#

its hitting the lowest possible double then when i do - 1 it converts it back to 1.002004008016032

#

so basically doo doo math

young knoll
#

Isn’t the lowest possible double like

#

-9 quintillion

rare rover
#

💀

young knoll
#

So you gotta pay ME for the enchantment

#

Stonks

rare rover
#

exactly!

#

definition of op prison

wintry lynx
#

Why does the top one return a list but the bottom one return Null?

echo basalt
#

because the one at the bottom is a config section not a stringlist

#

getStringList btw

wintry lynx
#

I feel stupid

upper hazel
#

what to do if the modules in the project have the same paths to their main class

wintry lynx
#

How does one loop through ConfigSections in a ConfigSection?

#

The commented out code doesnt work since I now have a config section instead of a string

minor junco
minor junco
misty garden
#

Hi, what can I do if I want to recover the maturity of a crop to the max?

tender shard
#

do you mean you want to set a crop's age to max age / make it fully grown?

pallid oxide
# minor junco ```java ConfigurationSection section = /* Your section */; section.getKe...

Would be better to use for loop for people who aren't that familiar with streams, functional interfaces, method references and lambda

        ConfigurationSection section = /*Section*/;
        // Possible nullcheck for section
        for (String s : section.getKeys(false)) {
            if (section.isConfigurationSection(s)) {
                ConfigurationSection sub = section.getConfigurationSection(s);

            }
        }
quaint mantle
#

stop skidding

pallid oxide
tender shard
tender shard
#

oh btw I haven't checked out any of the links in the new learnjava command

#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

tender shard
#

the jetbrains ones seem nice

pallid oxide
smoky anchor
#

Heyo, I have my own custom menu thingie
I currently handle all clicks in one InventoryClickEvent and cancel all InventoryDragEvents (since they're pain) but this means that if you try to place an item but move your mouse while holding mouse button, it calls InventoryDragEvent instead.
This is bad for the user and I was wondering if there is an already-existing solution to this, or will I have to hack a FakeInventoryClickEvent together from the InventoryDragEvent
I care only about that one slot, so if user tries to drag over multiple slots, I cancel it anyways and don't care about it.

chrome beacon
#

From what I've seen the DragEvent usually fires the same logic as the click event but for each slot

icy beacon
#

Is it possible in Java/Kotlin to have vararg generics in a class signature? I don't have a use case for this, just curiosity. E.g.:

class Clazz<A, B...> {
  // these would be legal:
  new Clazz<Int, Int>();
  new Clazz<Int, Int, Int>();
  new Clazz<Int, Int, Int, Int>();
}
#

I couldn't find any info on this and trying it in my ide is unsuccessful, maybe i'm missing something

tender shard
icy beacon
#

Yeah now that I think of it lol

pallid oxide
#

so it would be like ```java
class Clazz<A, B...>{
new Clazz<A, B>();
new Clazz<A, B, B>();
new Clazz<A, B, B, B>();
new Clazz<A, B, B, B, B>();
}

#

Interesting

tender shard
#

no, that can't work

rotund ravine
#

Why not yknow

tender shard
pallid oxide
#

ye ofc it doesnt but interesting logic he is chasing for:D

rotund ravine
#

Use a collection

tender shard
rotund ravine
#

List<String,Int,Int,Int,Int,Int> totally

shadow night
#

Is that a HashMap<List<List<List<List<Integer>>>>>>

#

Or wait

#

How would so many arguments even work

pallid oxide
#

its missing the value part

#

HashMap<List<List<List<List<Integer>>>>, List<List<List<List<Integer>>>>>

#

if u find use case for that then u have just next level brain

tender shard
# shadow night How would so many arguments even work
PersistentDataType<?, LinkedHashMap<String, EnumMap<Material, Set<Integer>>>> dataType =
    DataType.asLinkedHashMap(DataType.STRING, DataType.asEnumMap(Material.class,DataType.asSet(DataType.INTEGER)));
LinkedHashMap<String, EnumMap<Material, Set<Integer>>> map = pdc.get(key, dataType);
pallid oxide
#

i would just type var map = pdc.get(key, dataType); XD

But anyways loving it

#

Holy shit people actually have huge brain coding that

tender shard
#

i wrote that while I was drunk one night

#

does anyone know why checkstyle / ktlint love having a newline at the end of every file? what's the purpose?

pallid oxide
#

something to do with linux, just how linux handles sht

#

with some googling it was used to detect when file ends, reading multiple lines it was kinda like file separator, and if that empty line wasnt there it would handle it as a single file. So its some ancient rule just to be kept for compability

tender shard
#

uugh that's weird lmao

pallid oxide
# tender shard uugh that's weird lmao

Also in intellij u can switch default file ending format to lf from crlf, then im pretty sure it just automaticly adds the end of the line when creating new files

#

or u can change it from bottom right corner of the old ui atleast

icy beacon
pallid oxide
#

not sure if there is any disadvantages of having it as lf always, so far havent had any problems

#

also git can autoconvert end of the lines

Git can convert CRLF to LF when pushing to GitHub, depending on your Git configuration. The core.autocrlf setting controls this behavior:

git config --global core.autocrlf true on Windows: Converts CRLF to LF on commit, and LF back to CRLF when checking out code.

git config --global core.autocrlf input on Linux/macOS: Converts CRLF to LF on commit but does not convert back when checking out.

git config --global core.autocrlf false: No automatic conversion is performed.

For cross-platform projects, it's common to normalize line endings to LF in the repository, while allowing developers on Windows to check out files with CRLF line endings locally.
eternal night
#

Empty newline is pretty much standard no ?

tender shard
#

it's just so pointless

eternal night
#

Like that's just POSIX standard what

tender shard
#

it's still pointless

eternal night
#

Lines are terminated by a nswline

#

Okay then

pallid oxide
# tender shard it's just so pointless

For example if u do on windows System.out.println("hi") it actually does "hi\r\n"(on windows) and our school exercises has unit tests and some autograding systems so we have to use System.out.print("hi\n") so it would match the tests

#

System.out.println("hi") wont work

#

super annoying

#

i mean the thing is actually that when we run tests locally it wont work because its ran on windows environment, when we push to github it runs it on docker environment so there it works.
Problem with always pushing to see if it works:

  1. it takes ages to compile and run on github actions
  2. our teachers githubschool environment has some test limits how many times it can grade/run tests per month so we arent allowed to perma push to github:D So we dont hit the limit
tender shard
#

yeah but it's not like javac would ignore a line just because it's the last line of a file

pallid oxide
#

but ye stupid system, i have spent hours and hours trying to figure out why shit doesnt work and its always something to do with end of the line sht:D

eternal night
#

¯_(ツ)_/¯

upper hazel
#

Are there any errors when filling out the pom file?

tender shard
#

is your project on github? it's a pain to look at 3 poms in one paste and also can't see the layout etc there

upper hazel
#

oh sorry wait

tender shard
#

what's FakeOnlinePlugin supposed to be? You don't have any module with such a name

upper hazel
#

oh

tender shard
#

IIRC FakeOnlinePlugin is your whole project right? You don't have to depend on that

#

you must only specify it as <parent>, which you correctly did

#

so remove the dependency for FakeOnlinePlugin in all modules

upper hazel
#

i need add core i gess?

#

module

tender shard
#

i havent really looked at your whole setup yet, because I need to build all those spigot versions first lol

#

your NMS modules are supposed to extend PlayerGeneration from core, right?

#

If so, yes, your NMS modules must depend (with scope <provided>) on core

#

your 1.17 module looks correct

#

except that you should change scope to provided for FakeOnline-Core in 1.17 pom.xml

upper hazel
#

ok thenks

#

I again trusted auto-correction when I tried to use classes from the core module in another module

#

and he imported the project itself and not the main module

upper hazel
#

thenks

rough drift
#

The compliant code in the "don't expose collections" section is slow as it creates a new object for each call, instead you could do as follows:

public class MyManager {
   
   private final Map<UUID, PlayerData> playerData = new HashMap<>();
   private final Map<UUID, PlayerData> playerDataView = Collections.unmodifiableMap(this.playerData);

   public void setPlayerData(UUID uuid, PlayerData data) {
        this.playerData.put(uuid, data);
   }
   
   public Map<UUID, PlayerData> getPlayerData() {
        return this.playerDataView;
   }
}

Same functionality, much more performant

#

Also one more thing to note, it is especially useful to use the this keyword as it allows the reader at a glance to notice where you're using class fields/methods and where you're using parameters/variables or statically imported methods (i.e. in the context of LWJGL development)

upper hazel
#

the problem still remains why maven cannot find artifacts although they are in the local repository

upper hazel
rough drift
#

how did you run buildtools

upper hazel
#

constructor-> maven-> clean -> package

#

maven -> constructor

clear panther
#

guys how do i make

#

net.minecraft.

#

exists

chrome beacon
#

?nms

clear panther
remote swallow
#

?paste ur pom

undone axleBOT
clear panther
remote swallow
#

you just copied it without reading

#

you need to add it to the right place removing infomation you dont need

#

this will go on line 47

#

wait thats 1.8

#

your stick with obfuscated nms

deep crane
#

need a dev for my mc server dm me willing to pay

remote swallow
#

!services

#

?services

undone axleBOT
clear panther
#

whats Error: Invalid or corrupt jarfile BuildTools.jar
fatal: not in a git directory

chrome beacon
#

what did you do

clear panther
#

i just

#

entered the version

#

and it gives this

chrome beacon
#

entered where

eternal oxide
#

Did you run Buildtools in OneDrive?

tender shard
clear panther
#

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9489 0 9489 0 0 11963 0 --:--:-- --:--:-- --:--:-- 11981
Enter the version: 1.8
Error: Invalid or corrupt jarfile BuildTools.jar
fatal: not in a git directory

#

here

chrome beacon
eternal oxide
#

build 1.8.8

tender shard
young knoll
#

lol

tender shard
#

Many people are confused on how to use NMS classes when they’re new to writing Bukkit/Spigot plugins because their IDE doesn’t find those classes. Don’t worry. What is NMS? NMS refers to net.minecraft.server. This package contains all the classes that Mojang wrote for the vanilla Minecraft Server. You can use them to change the server’s...

young knoll
#

No remapping for 1.8, L

upper hazel
# tender shard show error message

[ERROR] Failed to execute goal on project FakeOnline-constructor: Could not resolve dependencies for project me.galtap:FakeOnline-constructor🫙1.0-SNAPSHOT: The following artifacts could not be resolved: me.galtap:FakeOnline-core🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.17🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.17.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.18🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.18.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.1🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.2🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.3🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.19.4🫙1.0-SNAPSHOT, me.galtap:FakeOnline-spigot-1.20.1🫙1.0-SNAPSHOT: Could not find artifact me.galtap:FakeOnline-core🫙1.0-SNAPSHOT

agile hollow
#

why that i never get that error:

i only tried to compile my plugin

agile hollow
#

yes

chrome beacon
#

Make sure it's up to date

tender shard
agile hollow
tender shard
agile hollow
#

thx

ocean hollow
#

can someone tell me how to create a method for adding to a location, depending on the rotation of the entity

eternal oxide
#

location.add(entity.getLocation().getDirection())

ocean hollow
#

I asked chatGPT, but it didn’t help

ocean hollow
#

or how can I use your method

eternal oxide
#

that method you posted just ignores pitch is all

ocean hollow
eternal oxide
#

if you already have an Entity it has a facing

#

a direction

ocean hollow
#

oh yes, I need to ignore pitch

eternal oxide
#

if you only want a flat plane then you zero out Y on teh Vector and normalize before adding it

clear panther
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

#

yea def for 1.8

#

not 1.17

ocean hollow
torn shuttle
#

Does anyone have a convenient way of creating custom events that removes having to add the event handler boilerplate to the class?

upper hazel
#

in tutorial

#

it worked

#

does the classNotFound error refer to a build issue? When i try get class for minecraft version

torn shuttle
#

this amount of boilerplate is cringe and I need like 15 events like this

lost matrix
#

Create a template in ij

torn shuttle
#

I especially don't want to do that because I'm on a temp setup right now

#

not even enough space for a mouse

lost matrix
#

I so dont get those

torn shuttle
#

they're called computers

#

get with the times

lost matrix
#

Good old days gone where you just play minecraft irl. Fking youth with their electromagic.

torn shuttle
#

next he'll be rambling about how he used to do electric circuits instead of redstone circuits

icy beacon
torn shuttle
#

fuck outta here grandpa

#

yeah it's great

icy beacon
#

Did it take time to get used to?

#

I kinda want a fancy keyboard lmao

torn shuttle
#

a bit yeah

icy beacon
#

I'll take this positive review into account then

torn shuttle
#

I think it was 3 months to get used to it and then 4 months to surpass my previous typing speed

upper hazel
icy beacon
#

What's your typing speed rn?

torn shuttle
#

last I check was 4 months in or something at I want to say 140wpm?

icy beacon
#

Damn, nice

torn shuttle
#

I'm not a crazy fast typer

icy beacon
#

Mine is about 90-100

#

Imma test rn

torn shuttle
#

the tests are pretty skewed anyway, typing speed is hardly ever an actual limiting factor

#

at least when I'm writing code thinking about the code makes typing much slower than actual typing speed

icy beacon
torn shuttle
#

I'm also much faster at typing off the top of my head than following a strict script on a website, recopying is an entirely different skillset imo

icy beacon
#

True

torn shuttle
#

but it's hard to measure

icy beacon
#

I wonder if there's a good test for that

torn shuttle
#

I still remember how I could type my ad for selling lobsters on runescape faster than bots did 15 years ago

torn shuttle
#

typed that thing so many thousands of times I was an actual machine at it

#

selling lobby 250 ea

icy beacon
#

Try writing the alphabet as fast as possible

#

I got 24 wpm on my first try lmao

#

Now 62

worldly ingot
#

But yeah, lots of boilerplate. Unfortunately just a consequence of the like 15+ year old event system Bukkit's implemented

young knoll
#

The good news is Choco has volunteered to remake it!

icy beacon
worldly ingot
#

The fuck I haven't lol

icy beacon
#

Please choco

lost matrix
#

So what you are doing rn is:

  1. Iterate through all players
  2. Remove the glowing effect
  3. Then add the glowing effect

But you expect them to not have a glowing effect after that?

sullen canyon
#

no

#

poland is

lost matrix
upper hazel
#

Question: through which module can I build a multi-module plugin? What button

agile hollow
#

why when i'm doing a command with the interaction
user.setPrimaryGroup(config.getString("prefix stage") + azienda); nothing appen?
my "prefix stage": prefix stage: stg
my azienda: String azienda = args[0];

upper hazel
#

ok what button

#

i need org.apache.maven.plugins ?

lost matrix
upper hazel
#

or instalall

lost matrix
#

install works as well

upper hazel
#

for what need "clean"

lost matrix
#

To clean the project from previous builds

upper hazel
lost matrix
#

I have no idea what your setup looks like. Are you trying to end up with a single jar in the end which has all modules shaded in?

upper hazel
#

yes

lost matrix
#

Then your module needs to depend on the other modules. After that you can shade them using the maven shade plugin as usual.

upper hazel
#

that is, build not through the parent module?

#

create a module of something like a constructor?

lost matrix
#

Are speaking about a multi-module maven setup?

eternal oxide
#

your parent shoudl define all modules and have the shade plugin

upper hazel
#

yes

upper hazel
#

but they are still collected separately

lost matrix
#

Why do you want a multi-module setup in the first place?

upper hazel
#

I'm working with nms

#

support 1.17.x -> 1.20.1

eternal oxide
#

I'll build my multi module as to be honest I've never actually compiled it to a jar

lost matrix
#

In that case:
Add the shade plugin in your plugin module.
Depend on each NMS module.
Your parent pom should look pretty empty with almost nothing in it.

eternal oxide
#

yeah parent doesn;t even need shade

upper hazel
#

this first try create multi-module plugin. I tried to do it through a training site that your colleague posted but it didn’t work and I turned to other sources and everything is completely different there

lost matrix
#

Dont we have a tutorial for that?

#

?nms

lost matrix
#

Nah thats not it

remote swallow
#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

lost matrix
#

This one

eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

this is my parent pom setup, and the jar it produces inclueds all teh modules

upper hazel
#

this is why i try find

remote swallow
#

you then use the jar from dist

eternal oxide
upper hazel
#

oh

wintry lynx
upper hazel
#

doesn't the parent class collect all this in a Jar at once?

#

why for it need dirt

eternal oxide
#

dirt?

upper hazel
#

"dist"

eternal oxide
#

yes, that dist module is teh Plugin

#

it's the entry point for the jar

#

um, alex does his plugin stuff in core

upper hazel
#

he create module in core?

eternal oxide
#

His core module is my API module

agile hollow
#

how can i set the parent of an user using the LuckPerms API?

upper hazel
#

what then i can create core module and create support modules inside?

eternal oxide
#

His is correct. His Core is my API and his dist is my Plugin

#

I do it differently. I create my basic plugin in it's own module where he creates it in core

upper hazel
#

how this looks like?

eternal oxide
#

His tutorial is fine

sand spire
#

Hey @lost matrix I'm making a template class to add new items to a shopGUI quickly (using your GUI classes), so I need to be able to change the title according to what item is being displayed.

It works with everything else like material, name, price but title is always null if I pass it like this, Do you know why?

String title = "test";

@Override
    protected Inventory createInventory() {
        return Bukkit.createInventory(null, 3 * 9,  title);
    }```
eternal oxide
#

Similar to mine, just slightly different in that I don;t provide access back from my NMS modules to my plugin

upper hazel
#

then how you add them?

#

how plugin know what module need use

#

you not use reflection?

eternal oxide
#

what do you mean? its shown in his tutorial

eternal oxide
#

Yes I use a helper method ot get teh correct NMS implementation```java
/**
* Find the Class at the specific Path which implements the provided clazz.
*
* @param clazz the Class of this target
* @param path a partial path to the target Class.
* @return a new Instance or null.
*/
public static Object assignField(Class<?> clazz, String path) {

    try {
        final Class<?> test = Class.forName(Tools.class.getPackage().getName()
                + "." + NMSUtils.NMS_VERSION + "." + path);
        // Check if we have a Class at that location.
        if (clazz.isAssignableFrom(test)) { // Make sure it actually implements the Class
            return test.getConstructor().newInstance(); // Return our handler
        }
    } catch (Exception e) {

        e.printStackTrace();
    }
    return null;
}```
echo basalt
#

I have a full reflection wrapper

eternal oxide
#

So if I call java this.nmsPlayerSkins = (Skins) Tools.assignField(Skins.class, "utils.PlayerSkins");I get back an NMS appropriate instance of that Skins class

rotund ravine
#

You can dream

echo basalt
#

add some extra checks for static fields n stuff

agile hollow
#

how can i set the parent of an user using the LuckPerms APi?

echo basalt
#

setting a parent is basically just removing all group nodes and adding your proper nice one

#

So just go over all the nodes in the user's data and do stuff

agile hollow
slender elbow
#

that is literally not what the example shows

#

like ImIllusion said, you need to remove the existing parent group nodes and add the one you want to add

#

which is what the example does

echo basalt
#

yurr

azure zealot
#

can someone tell my why i cant compile spigot with maven in inetllij?

#

i can compile but if starting this error occours

#
[17:28:44] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-c198da2-4c687f2 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT)
[17:28:44] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.IllegalStateException: @NotNull method org/bukkit/Bukkit.getConsoleSender must not return null
        at org.bukkit.Bukkit.$$$reportNull$$$0(Bukkit.java) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.Bukkit.getConsoleSender(Bukkit.java:1415) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.command.ColouredConsoleSender.getInstance(ColouredConsoleSender.java:91) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at net.minecraft.server.players.PlayerList.<init>(PlayerList.java:162) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at net.minecraft.server.dedicated.DedicatedPlayerList.<init>(SourceFile:17) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:183) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1000) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:git-Spigot-c198da2-4c687f2]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
[17:28:44] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Administrator\Desktop\crashtest\.\crash-reports\crash-2024-02-10_17.28.44-server.txt
[17:28:44] [Server thread/INFO]: Stopping server
[17:28:44] [Server thread/INFO]: Saving worlds
[17:28:44] [Server thread/INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
>
sleek estuary
#

Is it more performance to do this or set a packet with AIR with protocollib?

echo basalt
#

sending an air packet doesn't do as much as setting the block type

#

no clue why you'd have that code in the first place though

sleek estuary
#

the same? If you use packets, I don't make any changes to the server. imagine a mine that resets 100000 blocks every minute, that will make a difference

#

what is "worldload task" ?

sleek estuary
#

From what I understand, is it setting blocks in separate threads?

#

but if I do it with packets, I can set the blocks all at once

hazy parrot
#

What

drowsy helm
sleek estuary
# drowsy helm whats the reasonining behind this?

aBasically, instead of me setting AIR in a block, I send an AIR Packet to the player. The reason for this is that, if I set 100000 blocks at once every minute, the TPS will drop. And I wanted to know if setting 100000 blocks at once but with packages for a certain number of players, if the TPS will drop or not

#

mine plugin

drowsy helm
#

it definitely will drop more

#

it's more overhead

echo basalt
#

Thing is sending air packets is weird

#

because the client sees air but still collides with the real blocks

#

Pretty sure there's a way to modify the chunk data but you'd need to re-send packets

drowsy helm
#

not to mention you're sending twice as many packets

sleek estuary
echo basalt
#

I need context

sleek estuary
# echo basalt I need context

I want to make a mine plugin, but there were TPS drops because of it. Basically, it set AIR when calling blockbreakevent and then every minute it set all blocks to mine, but this resulted in tps drops. He wanted to do this with packets, where the mine would be just air, and just setting packets of blocks to give the impression that the player is breaking the block. I wanted to know if this way with packages I don't have TPS drops

echo basalt
#

Have you actually measured what causes the TPS drops or are you just assuming?

sleek estuary
echo basalt
#

Cool so it has nothing to do with blocks being broken

sleek estuary
echo basalt
#

Exactly

sleek estuary
#

And as I'm going to use packets to reset the mine, I'll have to use packets to break the block too

echo basalt
#

Well

#

There are different ways of setting blocks

#

You could use a workload distributed task

#

As seen in

#

?workdistro

echo basalt
#

You can also use NMS to set blocks faster

#

Packet mines are high complexity high reward

#

You basically have to reinvent everything but it scales really high

torn shuttle
#

remove and place every block in every loaded chunk 20 times per tick

sleek estuary
echo basalt
#

It has less complexity, decent reward

torn shuttle
#

nms is "better" until you have to maintain the project for more than a year

#

and suddenly minecraft updates

echo basalt
#

I think at akuma we used packet mines and had like 1.5k people on a single server

echo basalt
#

for a bit

shadow night
#

Illusion was everywhere

sleek estuary
#

I'll do this with protocollib to make it easier

#

I believe the performance will be the same

lunar shuttle
#

Does anyone know how I could listen for economy transfer events? I tried creating a wrapper around the current economy provider and just adding my own logic but Essentials doesn't use the Vault API directly for money transfers and whatnot so my code doesn't actually do anything. The other solution I saw someone mention was to fork Vault and add the listeners I need but I don't think that would work either for the reasons I mentioned.

torn shuttle
#

fun fact illusion is the best spigot dev currently in portugal, because I am currently visiting family in france

#

enjoy your moment in the sun illusion, I'll be back sunday

echo basalt
#

shut up magma no one misses you

torn shuttle
#

don't make me come back early to kick your ass

echo basalt
#

I'd say make a vault economy proxy class

#

but essentials is essentials

shadow night
#

About packets, I dislike protocollib because it requires the user to install an additional plugin. Any other good packet libs?

echo basalt
#

best approach is to probably for kit

shadow night
#

Hmm, I'll try it later, thanks

#

Wtf

#

Why did discord double my message

echo basalt
#

oh god discord is doing discord things

lunar shuttle
#

Lol4

#

Wait what

torn shuttle
#

discord does this constantly

lunar shuttle
#

Am I going crazy? My finger was nowhere near the 4 key.

quiet ice
#

Does anyone happen to know how to guard against path traversal when using java.nio.file.Path?

echo basalt
#

uh

#

didn't it have something to do with the security manager?

quiet ice
#

Using .toRealPath() is cool and all but it does not support non-existing directories (which needs to be done in my case since I want to create a directory somewhere)

#

Well aside from the fact that security manager is deprecated for removal (perhaps even entirely gone by now) I'd rather have something a bit less ... passive of a choice (i.e. I need something like if (x.startsWith(y)) {[...]} else {[...]} - but obviously Path#startsWith is too lax for this)

echo basalt
#

Hm

#

you can be extreme and build a path tree

lunar shuttle
# echo basalt best approach is to probably for kit

I'm not even sure this would work to be honest. I'm pretty sure there's no requirement that economy service providers actually use the API internally which means I'd only be able to reliably listen to interactions between the provider and other plugins using the Vault API. I think the only solution would be to add support for EssentialsX and other economy providers manually.

kind hatch
quiet ice
#

Meh, I'll probably go with toAbsolutePath and hope it does what I hope it does (why was I using Path#toRealPath in the first place?)

slender elbow
#

and what do you hope it does?

lost matrix
quiet ice
#

Well that question I cannot answer

mild cloak
#

i someone can help me? i try put this in my plugin https://github.com/MrMicky-FR/FastBoard but this script only work like dependecy and cant be started in folder plugins
how can I add it to my .jar with only .java files

quiet ice
#

But as long as it does not blow up, all is good. It isn't a reliable security mechanism anyways

mild cloak
#

i use normal idea

quiet ice
#

though uh, for shading you NEED to use maven (or gradle - whatever you prefer)

eternal night
#

(for your sanity you also need to use a build tool)

mild cloak
#

but in the github say manual

quiet ice
#

Don't.

mild cloak
#

Manual
Copy FastBoardBase.java, FastBoard.java and FastReflection.java in your plugin.

lost matrix
#

I mean... he could clone the repo, build the jar by hand and add the jar to the project as a dependency.
The build an artifact by copying the jar into his own.

mild cloak
#

i try use maven but give me error

#

when i try install

quiet ice
#

What kind of error?

mild cloak
#

Cannot invoke "java.io.file.mkdirs()"

lost matrix
#

Or he can download the jar directly by calling

mvn dependency:get -DremoteRepositories=http://repo1.maven.org/maven2/ \
                   -DgroupId=fr.mrmicky -DartifactId=fastboard -Dversion=2.0.2 \
                   -Dtransitive=false
quiet ice
#

http?

mild cloak
quiet ice
#

Yes, then shade it - and the only option to do that is to use either gradle or maven

lost matrix
#

This is not a standalone plugin. Its a library.

mild cloak
#

yes

#

but guy say i cant install manual

#

With .java idk

quiet ice
#

You can also go with your own solution if you wish, but it needs to be capable of shading