#help-development

1 messages · Page 719 of 1

lost matrix
#

lol

echo basalt
#

seems like an economical disaster

agile edge
#

facts xdd

echo basalt
#

last time I was there we had a hole in the floor if we wanted to go take a piss

#

and if you wanted to buy any goods you'd take the weekly bus at 6am for a whole like 10 cents

clever lantern
#

why particles are exploding everywhere when i spawn them?

echo basalt
#

just add ,0 ,0 ,0 ,0

#

you'll be fine

lost matrix
echo basalt
haughty granite
#

from a home-made plugin, is there a way to detect any fluctuations in a player's essentials balance? (installed plugins: essentials, vault, quickshop)

lost matrix
#

Wait. What is the english word for ökonomie.

clever lantern
#

thanks

tall dragon
echo basalt
lost matrix
echo basalt
#

it is

tall dragon
#

it is

echo basalt
#

fun thing

#

I was planning on visiting germany

#

a flight is like 50€ or somn

agile edge
#

night trains

echo basalt
#

thing is literally everyone I met online lives like incredibly far from each other

lost matrix
#

Ozapft is currently where i live

haughty granite
echo basalt
lost matrix
agile edge
#

someone selling plugins in spigotmc or other site?

#

here

lost matrix
#

Just ask...

echo basalt
haughty granite
#

so to get the account fluctuation I'll have to listen to the essentials plugin on send/receive money events (then get the total amount of the account after event) and listen to the quickshop plugin for buy/sell (then get the total amount of the account after event)?

echo basalt
#
public class ProxiedEconomy implements Economy {

  private final Economy base;

  public ProxiedEconomy(Economy base) {
    this.base = base;
  }

  @Override
  public EconomyResponse withdrawBalance(OfflinePlayer player, double balance) {
    // log something
    return base.withdrawBalance(player, balance);
  }

  ...
}
lost matrix
echo basalt
#

fun that's even further

#

p sure that alex is near nuremberg

#

I wonder if I can catch a flight between dusseldorf and munich

#

36€ train interesting

#

I might financially die with the price of everything given y'all earn like 4x more

lost matrix
#

Yeah a lot of things are unnecessarily expensive currently

echo basalt
#

thing is half the spigot market is in germany

#

and I'd like to meet y'all

#

better than meeting one of the only other portuguese devs, magma

#

who keeps threatening to yeet me off a cliff to this day

lost matrix
#

If we do a spigot creator meeting somewhere in germany then ill be there.
Unless its too far up.

echo basalt
#

think alex is in nuremberg

#

munster

#

which is up..

#

near dusseldorf actually

#

not sure if I'd feel safe near alex

agile edge
lost matrix
echo basalt
#

bro will jab me with sumn

agile edge
#

how much earn average spigot developer?

peak jetty
#

here is my code:
when a player kills a player, it should set the "first" to false and "second" to false, but after when they do /start it says "game is full"

pseudo hazel
#

yikes germany is like an 8 hour drive

agile edge
pseudo hazel
#

0

tall dragon
echo basalt
#

I charge 20-25$ / hr at the moment

#

but with commissions it varies

lost matrix
#

That was about what i made in my last contract as well

agile edge
#

where did you get the orders from?

echo basalt
#

ppl come to me

agile edge
#

I want one too

echo basalt
#

you remind me of that 14yo kid last week

#

saying he was gonna learn java to make plugins like me

pseudo hazel
#

wow, I want money too . 🥲

agile edge
#

)))

lost matrix
echo basalt
#

thing is I took like 7 years to get to this stage

#

where I'm comfortable living with the money I earn

agile edge
#

i'm asking that

echo basalt
#

only working part-time

agile edge
#

because this is my first time

#

in the western segment

peak jetty
pseudo hazel
#

nice job though illusion, i admire that 👍

agile edge
#

im based in asia, russian segment

echo basalt
lost matrix
pseudo hazel
#

but still

agile edge
#

earning less 5$ 🥸

echo basalt
#

yeah average wage here is like 4$/hr

peak jetty
# lost matrix Show where you register the command and listener

here:

package me.gizmo0o.bowduel;

import org.bukkit.plugin.java.JavaPlugin;

public final class BowDuel extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        this.getCommand("start").setExecutor(new System());
        this.getCommand("leave").setExecutor(new System());
        getServer().getPluginManager().registerEvents(new System(), this);
        getLogger().info("BowDuel Enabled.");
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
        getLogger().info("BowDuel Disabled.");
    }
}
echo basalt
#

mom's unemployed and dad's earning minimum wage thumbsup

agile edge
#

me too

echo basalt
#

and youngling illusion is buying christmas and birthday gifts for his international friends while we speak

pseudo hazel
#

oof, im glad it worked out for you

agile edge
lost matrix
agile edge
#

ethernet speed in kazakhstan so bad, average 0.5 kb - 1 mb

echo basalt
#

but oop clicked on my head when someone told me this 🙏

agile edge
lost matrix
echo basalt
#

you should also cache your items n stuff

peak jetty
lost matrix
peak jetty
#

ok thanks i think i understand it now

lost matrix
#

sure

echo basalt
somber night
#

im new to java but i made this plugin, it works amost completely fine but its really laggy, any tips on optimizing it? (here it is if you want to take a look https://paste.md-5.net/ewugimamil.cs)

tall dragon
#

oh dear

lost matrix
#

Yeah not touching that either

somber night
#

ik, its a mess

#

any tips on optimizing in general though?

tall dragon
#

run a spark profiler

#

and see why its lagging

lost matrix
#

Yes, let me just skim through real quick.

somber night
lost matrix
#

Oh yeah. You can start by installing spark on your server and send us the timings.
Make sure to trigger those events.

tall dragon
lost matrix
#

Ok so here is the first optimization:
Instead of iterating over all matrix slots several times, you can just iterate over them once and check each slot agains your custom items.

tall dragon
#

on player move id also check if the player has actually moved

#

since mouse move spams it as well

lost matrix
#

nvm, forget what i suggested. Completely other approach: How about you use actual recipes instead of the PrepareItemCraftEvent?

somber night
#

i couldnt make custom recipes with nether stars, depending on the namespaced key so i just did that

lost matrix
#

You need to use ExactChoice ingredients if your want the ingredients to match perfectly, including name, lore, pdc

somber night
tall dragon
#

an ItemBuilder would also... considerably cleanup your code

lost matrix
#
    @EventHandler
    public void onEntityTarget(EntityTargetEvent event) {
        Player player = (Player) event.getTarget();

This will throw a ClassCastException if a zombie targets a villager for example

#

Always do an instanceof check before casting.

somber night
#

btw how does spark profiler work...? i get that i add it to the server but what else

tall dragon
#

it should run a profiler automatically

#

just do some ur plugins stuff

lost matrix
#

I think he has to start it manually

#

/profiler start

#

or something

tall dragon
#

nah im pretty sure one always runs by default nowadays

#

/spark profiler open

#

try that

lost matrix
#

You are creating a memory leak with those runnables

                        new BukkitRunnable() {
                            @Override
                            public void run() {
                                for (Entity e : entities) {
                                    Location loc = player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(3));
                                    loc.setYaw(player.getLocation().getYaw());
                                    loc.setPitch(player.getLocation().getPitch());
                                    e.teleport(loc);
                                }

                            }
                        }.runTaskTimer(this, 0L, 1L);

You start many runnables but never stop them anywhere.

small current
#

my intellij falling to it's doom after i had the Material class openned for 10 minutes

somber night
tall dragon
#

huh

tall dragon
sleek ermine
#

Hello, I'm trying to create a Spigot plugin with dependencies on Pixelmon. Is there a way to capture events from the Pixelmon mod? Using:
Pixelmon.EVENT_BUS.register(new ListenerPixelmon());
causes a server crash when the event is triggered:
[ERROR] Exception caught during firing event: ListenerPixelmon

lost matrix
sleek ermine
#

im using mohist

lost matrix
#

Ah yeah, they exist. Show the whole exception

somber night
tall dragon
#

sure

sleek ermine
#

[17.09 17:27:03] [Server] java.lang.NoClassDefFoundErrorcom/ez/pixelmonez/listeners/ListenerPixelmon
[17.09 17:27:03] [Server] at com.ez.pixelmonez.listeners.ListenerPixelmon_onPokeBallThrowEvent_ThrowPokeballEvent.invoke(.dynamic)
[17.09 17:27:03] [Server] at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
[17.09 17:27:03] [Server] at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:318)
[17.09 17:27:03] [Server] at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:298)
[17.09 17:27:03] [Server] at TRANSFORMER/pixelmon@9.2.2/com.pixelmonmod.pixelmon.items.PokeBallItem.m_7203
(PokeBallItem.java:75)
[17.09 17:27:03] [Server] at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.item.ItemStack.m_41682
(ItemStack.java:328)
[17.09 17:27:03] [Server] at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerPlayerGameMode.m_6261_(ServerPlayerGameMode.java:376)

lost matrix
#

NoClassDefFoundErrorcom implies that the class could not be found on runtime.

#

Maybe try registering your listener a few seconds later.

clever lantern
#

does inventory.remove(eventItem); removes all types of this item in inventory? i have 2 special boxes in eq and both get removed

celest notch
#

What would be the best way to handle custom items, basically i have a class called CustomItem and i have various classes that extend that, but if i restart how do i make sure all the data of the item class is stored on that item and read back again once the server restarts?

lost matrix
#

And only if the item has the exact same stack size and meta

lost matrix
lost matrix
celest notch
#

yeah this looks good i'll try this

echo basalt
#

you should rewrite it

kindred sentinel
#

Does anyone knows about base components?

ivory sleet
#

yes

kindred sentinel
#

Sooo

ivory sleet
#

just ask

kindred sentinel
#

One moment

#

I'm trying to make something like buttons, but i have some problems

     TextComponent withSign = new TextComponent("§7[§2X§7]");
                        TextComponent withoutSign = new TextComponent("§7[§4X§7]");
                        TextComponent space = new TextComponent("                     ");
                        withSign.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithSign));
                        withSign.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake sign"));
                        withoutSign.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithoutSign));
                        withoutSign.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake no-sign"));
                        ComponentBuilder result = new ComponentBuilder();
                        result.append(withSign);
                        result.append(space);
                        result.append(withoutSign);
                        result.append("\n");
                        result.append(page);
                        newBookmeta.spigot().addPage(result.create());

but space and "page" extend click and hover events from withSign and withoutSign

upper hazel
#

someone know how regeneration work in the shaft

kindred sentinel
#

X1 is with sign X2 without sign

kindred sentinel
ivory sleet
#

what exactly is the issue?

kindred sentinel
#

I have 4 text components

#

2 with hover and click events

#

1 with hover and click event and 3 with hover and click event
it goes:
1
2
3
4

#

but 2 text component receive hovers and click event from 1 and 4 receives hover and click event from 3

ivory sleet
#

okay basically

kindred sentinel
#

and i need 2 and 4 text component be without hover and click events

ivory sleet
#

components are sort of represented as a hierarchy

kindred sentinel
#

🤔 mhm

ivory sleet
#

so basically if you have the text "Hello Jeff Goofy"
you could represent this as three components where the first one is "Hello ", second one is "Jeff" and third one is " Goofy", additionally it may be the case that structurally they are defined this way:

"Hello "
  "Jeff"
    " Goofy"
#

that means, if you add a click event or hover event to "Jeff" then " Goofy" will also receive/have that

kindred sentinel
#

Mhm

#

So how to make them not to receive/have that?

ivory sleet
#

well one way is to just unset hover and click events for the component " Goofy"

kindred sentinel
#

and how to do it?

ivory sleet
#

?jd-bcc

ivory sleet
#

alr let me show u code wise

#

actually idk if its possible with bungeecord chat, well I will show u another way of dealing with it

kindred sentinel
ivory sleet
#
"Hello "
  "Jeff"
    " Goofy"

^ that will give you the code below, note " Goofy" is a child of "Jeff"

BaseComponent[] component = new ComponentBuilder("Hello ")
  .append(new ComponentBuilder("Jeff")
    .event(new ClickEvent(...))
    .append(new ComponentBuilder(" Goofy")
      .create())
    .create())
  .create();
.
"Hello "
  "Jeff"
  " Goofy"

^ that will give you the code below, note " Goofy" is NOT a child of "Jeff"

BaseComponent[] component = new ComponentBuilder("Hello ")
  .append(new ComponentBuilder("Jeff")
    .event(new ClickEvent(...))
    .create())
  .append(new ComponentBuilder(" Goofy")
    .create())
  .create();
kindred sentinel
#

OHHH ok thanks!

#

just append another base component instead of text component

ivory sleet
#

yeah, its like a tree

#

can be quite confusing, which is why many prefer minimessage for instance (altho thats adventure)

kindred sentinel
#

Ohh yeah, i got it, thanks

wet breach
#

and its at this moment conclube demenstrates the contradiction scenarios

#

or maybe not lol

ivory sleet
#

elaborate :>

wet breach
#

idk was hoping you had something in mind, there is always some contradiction somewhere

ivory sleet
#

myea true lol

kindred sentinel
# ivory sleet myea true lol

So... it still doesn't work

String page = bookMeta.getPage(i);
TextComponent withSign = new TextComponent("§7[§2✎§7]");
TextComponent withoutSign = new TextComponent("§7[§4⏹§7]");
BaseComponent[] space = new ComponentBuilder("                     ").create();
BaseComponent[] pageComp = new ComponentBuilder(page).create();
BaseComponent[] hoverWithSign = new ComponentBuilder("X1").create();
BaseComponent[] hoverWithoutSign = new ComponentBuilder("X2").create();
withSign.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithSign));
withSign.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake sign " + i));
withoutSign.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithoutSign));
withoutSign.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake no-sign " + i));
ComponentBuilder result = new ComponentBuilder();
result.append(withSign);
result.append(space);
result.append(withoutSign);
result.append("\n");
result.append(pageComp);
newBookmeta.spigot().addPage(result.create());
undone axleBOT
carmine mica
#

smh, using legacy bad color codes inside components

kindred sentinel
# ivory sleet myea true lol

Even this don't work

String page = bookMeta.getPage(i);
ComponentBuilder withSign = new ComponentBuilder(new TextComponent("§7[§2✎§7]"));
ComponentBuilder withoutSign = new ComponentBuilder(("§7[§4⏹§7]"));
BaseComponent[] space = new ComponentBuilder("                     ").create();
BaseComponent[] pageComp = new ComponentBuilder(page).create();
BaseComponent[] hoverWithSign = new ComponentBuilder("X3").create();
BaseComponent[] hoverWithoutSign = new ComponentBuilder("X4").create();
withSign.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithSign));
withSign.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake sign " + i));
withoutSign.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverWithoutSign));
withoutSign.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/pagetake no-sign " + i));
ComponentBuilder result = new ComponentBuilder();
result.append(withSign.create());
result.append(space);
result.append(withoutSign.create());
result.append("\n");
result.append(pageComp);
newBookmeta.spigot().addPage(result.create());
smoky oak
#

is there a way to simulate server delay in a simple way? Like 50-100 ms?

wet breach
smoky oak
#

bleh

wet breach
#

and then once the packets in queue reach that time release them

smoky oak
#

yea no

#

ill just talk someone into testing it on me

wet breach
#

lol

carmine mica
kindred sentinel
#

yeah but how??

carmine mica
#

which is crazy. the default is to not take advantage of the tree structure

#

there is an append method that takes a FormatRetention enum as the 2nd param

kindred sentinel
#

oh i will try

kindred sentinel
echo basalt
carmine mica
#

that enum just determines what is copied from the previously appended component to the component being appended now

#

4 options, all, none, formatting, events, you probably want none

kindred sentinel
carmine mica
#

its an enum, that you pass as a parameter. there's nothing crazy here. you add another parameter to append with the enum constant you want to use

smoky oak
#

is there a way to partially copy an array in a simpler way than making an array of the desired length and copying the relevant entries in a for loop?

lilac dagger
#

plus this one gets serialized

kindred sentinel
echo basalt
#

Should I use a new one per player?

carmine mica
lilac dagger
#

if you have per player sidebar yes

echo basalt
#

I don't care about the sidebar

#

this is just nameplate visibility

lilac dagger
#

then just a new scoreboard

#

and use that everywhere

carmine mica
#

!learnjava

#

?learnjava

undone axleBOT
kindred sentinel
#

i'm just have problems with understanding anything at the evening

shell robin
#

how can i get custom head

kindred sentinel
#

thank you very much

kindred sentinel
#
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
headMeta.setOwnerProfile(PlayerProfile);
head.setItemMeta(headMeta)
shell robin
# kindred sentinel ```java ItemStack head = new ItemStack(Material.PLAYER_HEAD); SkullMeta headMeta...
    public void onJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        UUID myskin = UUID.fromString("0957d56b-7221-481e-8e89-60f941bde1b6");
        ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);

        SkullMeta meta = (SkullMeta) head.getItemMeta();
        meta.setOwningPlayer(Bukkit.getOfflinePlayer(myskin));
        head.setItemMeta(meta);

        player.getInventory().setHelmet(head);
    }```i tried something like this but it gives me alex's head
kindred sentinel
#

Do you have licensed minecraft?

shell robin
kindred sentinel
#

i mean.. You have account of minecraft?

#

Like..

#

Oh nevermind

#

try this

                    UUID myskin = UUID.fromString("0957d56b-7221-481e-8e89-60f941bde1b6");
                    ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
                    SkullMeta meta = (SkullMeta) head.getItemMeta();
                    meta.setOwnerProfile(Bukkit.getOfflinePlayer(myskin).getPlayerProfile());
                    head.setItemMeta(meta);
smoky oak
#

@eternal oxide ALRIGHT WHAT THE FUCK
Caching the damn handler does indeed not trigger the exception?!?!?!?!

#

I'd like an explanation

#

i tracked it down to this though
at io.github.moterius.GreekGodsPlugin.Event.Handlers.EventPlayerJoin.onJoin(EventPlayerJoin.java:14) ~[?:?]

shell robin
# kindred sentinel try this ```java UUID myskin = UUID.fromString("0957d56b-722...
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.profile.CraftPlayerProfile.validateSkullProfile(CraftPlayerProfile.java:38) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3862-Spigot-d2eba2c-db4ba28]
        at org.bukkit.craftbukkit.v1_20_R1.inventory.CraftMetaSkull.setOwnerProfile(CraftMetaSkull.java:244) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3862-Spigot-d2eba2c-db4ba28]
        at tr.enes.aetheriarankup.events.InventoryListeners.onJoin(InventoryListeners.java:63) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]```
smoky oak
#

hm this is irritating
when this glitch happens, multiple classes are not loaded and throw ClassNotFoundException
can someone please explain how this can possibly happen

  1. inconsistently
  2. at all
  3. on server start
upper hazel
#

wth with Bukkit.getScheduler().isCurrentlyRunning() - always return false

#

when i start task anyways return false

eternal oxide
eternal oxide
#

static {}

smoky oak
#

no

#

only static things are fields and methods

#

i know that for a fact

eternal oxide
#

it will be due to one of your static fields then

#

Your actual issue is getting null from the map

#

best explanation I could find.

#

you can cast null to anything

#

but when you try to actually instance it it will fail with a NoClassDef error

#

if you have a static init/field which fails

smoky oak
#

i dont do static initialization

#

i think

#

?paste

undone axleBOT
smoky oak
#

this is the first class that shows up in java.lang.ClassNotFoundException, when i try to call the last method

#

neither this class nor the class calling that method contain ANY static keyword except that string at the top

eternal oxide
#

If I remember the error was with yoru PatronHandler

clever lantern
#

how to get enchant by key

smoky oak
#

that too

#

it returns null and when it tries to cast that null it throws the error

#

but there's nothing returning null here

eternal oxide
#

line 48

#

can be null

smoky oak
#

well yea but it's not throwing an error there, its saying it cant find the class i posted

#
public class EventPlayerJoin implements Listener {
    @EventHandler
    public void onJoin(PlayerJoinEvent event){
        Player player = event.getPlayer();
                //ClassNotFoundException: PlayerDataHandler
        PlayerDataHandler.setupHandlerHooks(player);
        Echo.getInstance().getPlayerHandler(player).setup();
    }
}

eternal oxide
#

yes. It won;t throw an error there but it will pass null around

smoky oak
#

thats an issue for later me, I'd rather figure out why the class aint found first

#

ill handle the NPE later

#

also that patron handler line cant return null

#

its not the same i posted earlier

#

this is a call that returns at worst the empty interface implementation

eternal oxide
#

show you full PatronHandler

smoky oak
#

?paste

undone axleBOT
smoky oak
eternal oxide
#

abstract?

smoky oak
#

wym

#

im not messing with default methods but this class aint supposed to be instantiated either

eternal oxide
#

so what class extends this?

smoky oak
#

lots

#

all of em named in that method at the bottom

#

is it relevant?

#

cuz its this class its saying it cant find

eternal oxide
#

yes, whichever class you are creating which extends this is where your error is

smoky oak
#

well since i since then have restarted, i cannot test that easily right now

eternal oxide
#

actually that may be all it is

smoky oak
#

wym

eternal oxide
#

if your map returns null and you are casting that to an abstract class (PatronHandler).

#

it can;t be instanced so errors

smoky oak
#

its erring before that part tho

eternal oxide
#

its erroring when your map returns null

smoky oak
#

no it aint

#

?paste

undone axleBOT
eternal oxide
#

thats what you showed yesterday

smoky oak
#

yea but it also happens earlier

#

in onjoin

#

where it calls a static method

#
        Player player = event.getPlayer();
        PlayerDataHandler.setupHandlerHooks(player);//line 14
eternal oxide
#

EventPlayerJoin.java:14

smoky oak
#

yea, its saying it cant find that class

#

and that class is just public final

#

i posted it earlier i think

eternal oxide
#

ok thats odd

smoky oak
#

the REAL problem is that it aint reproducable

#

i cannot consistently encounter this error

#

like its so fragile reload/restart makes it go away

eternal oxide
#

if I were you I'd create your data instance in PlayerLoginEvent

#

then do the setup in join

smoky oak
#

data instance?

eternal oxide
#

your PatronHandler

smoky oak
#

that class is purely static methods

#

ah cant

#

it requires on the player PDC

eternal oxide
#

ah

eternal oxide
#

not a clue then

smoky oak
#

i mean the damn thing clearly exists

eternal oxide
#

I don;t see any reason for your util class to throw a no def found error

smoky oak
#

urgh

#

do u know anyone in this discord well versed in esoteric errors?

eternal oxide
#

conclube or 7smile7

smoky oak
#

well smile aint here so @ivory sleet it is

kindred sentinel
#

?nms

sullen marlin
#

Weird

#

Make sure you don't have an older version jar also on your server

smoky oak
#

you mean me?

eternal oxide
#

yes

smoky oak
#

i dont, this is after restarts

eternal oxide
#

I covered that yesterday, possibility of another plugin using the same classes

smoky oak
#

theres literally nothing there

#

im developing in a vacuum

#

the plugin folder contains one file

sullen marlin
#

Post your entire server log

#

Are you catching Throwable and hiding a different exception somewhere

smoky oak
#

yesnt

#

I have a custom log handler registered

#

but i am not stopping anything from getting written to console

#

nor am i doing try/catch more than necessary

#

?paste

undone axleBOT
smoky oak
#

here log until i did /reload to focus on another issue

#

after which this didnt happen anymore

#

i do have no clue how restarting or reloading makes this go away, it really shouldnt

#

the first class is responsible for assigning a handler to every player

#

since its not found and the joinevent crashes, its not present and returns null later on

#

but that should produce NPEs and not more ClassNotFoundExceptions

#

also i just checked, only try/catch are in a class for serialization and in a command

#

so it aint getting caught and thrown differently either

sullen marlin
#

No idea, what's your logger doing

#

Also any exception in a static field or constructor will cause a classnotfound

#

But there should be more log info on that case so idk really weird

smoky oak
#

my log handler is removing most of the message and sending the rest in chat so i can guess easier what the issue is, it's not really doing anything here

#

also, the first classnotfound has nothing to do with static fields or constructors

tender shard
smoky oak
#

uh

tender shard
#

same .jar?

#

probably not?

smoky oak
#

its the same file

#

maybe ive put a zero too much somewhere

tender shard
#

are you not using maven properties / filtering in plugin.yml?

smoky oak
#

wym

kindred sentinel
#

how to change result of craft using CraftItemEvent?

tender shard
sullen marlin
smoky oak
#

cant

sullen marlin
#

It sounds like it's hiding the issue

tender shard
smoky oak
#

its not reproducable

kindred sentinel
#

oh ok thanks

tender shard
#

wdym

smoky oak
#

thats one of the big problems

#

i cannot cause it

#

it just happens

#

or not

sullen marlin
#

Well remove the log handler and then we'll have a real error when it comes

tender shard
#

when does it happen and when does it not happen lol

sullen marlin
#

Don't mess with logs

tender shard
#

filtering log messages is ONLY acceptible to get rid of passwords or anything

smoky oak
smoky oak
# sullen marlin Don't mess with logs

I'm not doing anything to the passed LogRecord except reading it out

@Override
    public void publish(LogRecord record) {
          if(record.getThrown() != null){
            Throwable thrown = record.getThrown();
            StringWriter out = new StringWriter();
            PrintWriter out2 = new PrintWriter(out);
            thrown.printStackTrace(out2);
            String fullTrace = out.getBuffer().toString();
            String causedTrace = getCausedBy(fullTrace);//fullTrace.replaceFirst("((.|\\n)*?)(?=(Caused))","");
            String clean1 = causedTrace.replaceAll("\t","");
            String[] clean2 = clean1.split("[\n\r]");
            adminPublish(clean2);
        }
tender shard
#

comment out every of your log4j-changing methods

#

then check your logs again

kindred sentinel
#

Is there any event on changing writable book?

smoky oak
#

im not changing anything about log4j afaik

#

this is the only part im interacting with the logs apart from Plugin#getLogger().log

sullen marlin
kindred sentinel
#

Thanks

tender shard
#

makes no sense that getSlot() is deprecated

#

-1 is perfectly fine for offhand 😛

sullen marlin
#

What does PlayerInventory.getItem(-1) return

#

Or InventoryClickEvent.getClickedSlot for offhand

small current
#

me in my death bed, seeing single letters on my heart monitor, remembering the time when i used nms unmapped

tender shard
#

but I mean the javadocs specifically mention it returns the HOTBAR slot, or -1

#

it doesnt not say it returns anything that's on-par with the normal inv numbers

#

alternatively it could have a boolean isOffhand() too, and we keep the -1 to indicate "it's not a normal hotbar slot"?

sullen marlin
#

Idk what else slot would mean if not those numbers

tender shard
#

if you have a chest open, then the hotbar won't be 0-8 too

#

in an inventory view, the hotbar will be 36-45 or sth

#

so that's inconsistent anyway

smoky oak
#

alright for now ill change the number in the pom to the proper 1.0.0-Snapshot and see if thatll help

tender shard
#

idk I'm not complaining, I just think it must be possible to get the "slot number" without using a deprecated method

tender shard
#

send the .jar file you're using on your server here

smoky oak
#

i mean ur welcome to take a look

#

i have no idea why it only happens sometimes

tender shard
#

any dependencies?

smoky oak
#

ah yes one

#

all this does is provide some location data

smoky oak
#

it doesnt do any calls or have any names equal to classes in the other plugin

tender shard
#

right now you can only get the bookmeta, not the itemstack

tender shard
#

IIRC you can only get it using getItem(EquipmentSlot) or using getExtraContents()

#

but I am not sure

sullen marlin
#

That doesn't sound correct but idk

tender shard
#

as said, I#m not sure. But I don't think anyone expects being able to just throw the result of getSlot() into the inventory as the docs clearly say it can be -1 for offhand

tender shard
sullen marlin
#

The docs specifying the bad behaviour doesn't make it not bad

smoky oak
#

the NPE i was realoading of

#

this aint the classnotfound

#

like i said

#

i do NOT know what causes it

#

its not consistent

tender shard
smoky oak
#

it happens in like one in ten restarts or so

tender shard
#

while keeping the -1 thing?
I really don't think that returning -1 is "wrong" in any sense

#

we could alternatively rename the method to getHotbarSlot(), that way people know it's not meant to be thrown into Inventory#getItem(...)

sullen marlin
#

Well I'd want to know for sure what the offhand slot is and then suggest that a new method should return that

#

Sounds like itemstack should also be added to the event

tender shard
#

what the offhand slot is depends on context

#

in PlayerInventory it has another number than in CraftingInventory iirc

sullen marlin
#

CraftingInventory doesn't have an offhand or hotbar

tender shard
#

but using getContents() would show the offhand

#

(i think?!)

odd lark
#

hello, I don't understand my error, it tells me this: java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener except I did everything correctly I added the dependency and the repository in my pom.xml

even if I add it in the dependencies I must add it in the plugin on the server too?

tender shard
#

you're not using the maven shade plugin

sullen marlin
#

I don't think orotocollib is shaded

#

Needs to be a depend in plugin.yml

tender shard
#

oh it's protocollib? yeah that's usually something you don't shade

odd lark
#

yes it's protocollib

tender shard
#

so did you add it as depend or softdepend in plugin.yml?

odd lark
#

yes

tender shard
#

show your latest.log

#

?paste it here

undone axleBOT
thin iris
#

oh my god it’s so preppy in here

tender shard
#

no clue what that means

#

is that some kind of nova scotia idiom I'm too european to understand

tender shard
#

you don't have ProtocolLib installed

#

if you want to use protocollib in your plugin, ofc it must be installed

odd lark
tender shard
#

No. ProtocolLib is a standalone plugin that needs to be installed

#

what are you trying to do btw? listen to incoming packets?

#

or listening to outgoing ones?

#

or just wanna send packets yourself?

odd lark
#

Basically I wanted to provide better personalization of the chat and also check that users do not receive messages from other plugins or scripts, for example checking that the player does not receive the seed from the server

tender shard
#

ok so you want to listen to outgoing packets

#

in that case, using ProtocolLib is fine. But as said, you'll have to install PLib on the server too

#

an alternative you could use is PacketEvents by retrooper, you can shade that and then people do not have to install anything else

#

(although 95% of servers got ProtocolLib installed anyway, so I wouldnt worry over having that as dependency)

odd lark
#

the server for which I am making the plugin already has protocollib installed so I take the opportunity to use it

tender shard
#

then you just gotta install it on your test-server too

#

and since your plugin NEEDS protocollib, use depend instead of softdepend in your plugin.yml

odd lark
#

thanks

quaint mantle
#

How do I get the player's UUID? Because through skullmeta there is a problem, that if I set the head with p.getplayer() then the head is shown with the player's skin, but it opens the gui to the last one to enter the server, preventing others from opening the gui. PS: It's a head that opens your profile gui to the Hub

jaunty shuttle
#

Hi guys, we are currently busy with the development of a minigame, have been here for days on a solution for a Spectator mode, which does not involve any problems, but we can not find a solution. In the normal spectator mode all players have armor stands over their heads as spectators, we somehow can't get these removed either, in versions we tried without the spectator mode of Minecraft (gamemode 3) you can't see the other players in the tablist etc.

Does anyone here possibly have a solution so that we can finally complete this project

Thank you very much 🙂

quaint mantle
tender shard
thin iris
#

show the code

tender shard
#

"marks in red" is also the worst possible decription

#

tell us the actual error message

thin iris
#

omg wait i feel so smart i’m the one helping..

tender shard
#

probably you're getting the "player" from an InventoryView and hence it's "only" a HumanEntity

quaint mantle
tender shard
thin iris
#

i think theyre making some sorr of gui

thin iris
tender shard
#

no, your turn

#

bb

thin iris
#

okay watch me ill do it all on my own

#

show us the error peppino

tender shard
#

you and me @thin iris can still battle later in #bot-commands

thin iris
#

LMFAO

quaint mantle
thin iris
#

does it have harry potter trivia

tender shard
#

yes!

#

it does

thin iris
#

and put it here

quaint mantle
thin iris
#

or dm me a photo and ill relay it here

tender shard
#

ooor just...

#

?img

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 can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

thin iris
#

oh..

#

omg i love lightshot

#

i have a desktop widget

echo basalt
#

lightshot is ass

#

but at least it makes links for you

thin iris
#

oh wow

tender shard
#

yeah it's nice but we superior mac users don't need any tools for screenshots

echo basalt
#

or just use sharex and route it through imgur

thin iris
#

i like the way i can make boxes witb red lines

tender shard
#

macOS builtin screenshot tool beats lightshot 😛

quaint mantle
thin iris
#

yeah

subtle folio
#

whats the best way to check if any player is within range of a specific entity? I feel like looping through them all would get laggy..

thin iris
#

show us the code

tender shard
#

what are you trying to do?

echo basalt
thin iris
#

getnearbyentities

#

ye

#

then filter that

echo basalt
#

it's fine to loop through them all

#

p sure that chunk#getEntities just does the same stuff

tender shard
subtle folio
#

really??

thin iris
#

period

tender shard
#

checking distance is just some extremely cheap math

#

a normal CPU has at least 2GHz

#

imagine how many simple calculations it can do

thin iris
#

it’s not like you’re spawning particles at all those locations

tender shard
subtle folio
#

haha

tender shard
#

premature optimization is a bad thing

echo basalt
#

don't forget

tender shard
#

your first goal is to make your things work

quaint mantle
# tender shard what are you trying to do?

Skullmeta, test with the skin of the player that opens a gui, if I put p.getplayer it works, but then in the server it starts the gui only for one player, i.e. the last one who enters, if I exit and return in fact it works for me and the others no

echo basalt
#

we minecraft people usually try to stay within 50ms for our operations

tender shard
echo basalt
#

that's in a single core

subtle folio
#
    x - 1/2 the size of the box along x axis
    y - 1/2 the size of the box along y axis
    z - 1/2 the size of the box along z axis
echo basalt
#

And even that is hard to do

#

What if

subtle folio
#

Does this mean I just give it 10 if I want it to be within 20 blocks?

tender shard
echo basalt
#

you need millions

#

now think about

#

if you did this in like 128 cores

#

and instead of 50ms it was 1 second

tranquil beacon
echo basalt
#

that's how many operations a server cpu can run per second :)

tender shard
#

if someone ever mocks you for using distance() instead of distanceSquared(), tell them to upgrade their 1998 CPU

quaint mantle
echo basalt
#

no bro woeisme

#

alex btw I pinged you the other day

#

I remember you toyed around with real estate

#

got any houses in dusseldorf I can stay at for 3 days shy

smoky oak
#

why are all the pink guys here german

echo basalt
#

I'm not german

#

but plane tickets are like 50€

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tender shard
echo basalt
#

I mean it's close enough

jaunty shuttle
#

will i get an answer for my question, because there were so much messages, i dont think that anyone will read it anymore 😄

tender shard
#

well you can stay at my place if you wanna sleep on the sofa lol

echo basalt
#

any others

orchid gazelle
#

hi

smoky oak
#

I've a flat in Bremen :kekw:

#

thats a bit far tho

tender shard
#

everything else is rented out

echo basalt
#

I don't think I'd feel safe

#

damn

orchid gazelle
#

how can I correctly escape the Regex "^(\w+).*?(\d+)$" as a string?

#

so I can properly compile it

tender shard
smoky oak
#

escape the regex characters

orchid gazelle
#

yes

tender shard
#
String myRegexString = "^(\\w+).*?(\\d+)$";
jaunty shuttle
#

Hi guys, we are currently busy with the development of a minigame, have been here for days on a solution for a Spectator mode, which does not involve any problems, but we can not find a solution. In the normal spectator mode all players have armor stands over their heads as spectators, we somehow can't get these removed either, in versions we tried without the spectator mode of Minecraft (gamemode 3) you can't see the other players in the tablist etc.

Does anyone here possibly have a solution so that we can finally complete this project

Thank you very much 🙂

orchid gazelle
#

didn't work /:

tender shard
#

it is correct

smoky oak
tender shard
#

I'm wrong

orchid gazelle
#

it's not matching the string that regex101.com tells me is right

smoky oak
#

oh i know that feeling

echo basalt
#

player.setInvisible

#

or something

tender shard
tender shard
#

DOTALL

#

regex101 defaults to using gm as flags

echo basalt
#

This is how I do my fake spectators

#

might change any day now

orchid gazelle
tender shard
quaint mantle
glad prawn
#

matches mean match on whole string right

orchid gazelle
#

im calling #compile() and then im calling #matcher(string).group(2)

tender shard
orchid gazelle
#

after matcher before group?

tender shard
#
String myString = "my name is mfnalex";
Pattern namePattern = Pattern.compile("my name is (?<name>.+)");
Matcher matcher = namePattern.matcher(myString);
matcher.find();
String name = matcher.group("name"); // name will be "mfnalex"
tranquil beacon
echo basalt
glad prawn
orchid gazelle
tender shard
# orchid gazelle after matcher before group?

yes, you have to remember that a matcher can have more than matches. a matcher is a bit like a mysql resultset or an iterator. you first have to tell it to "move to the first match" using find() once

orchid gazelle
echo basalt
#

$ usually means regex end

tender shard
#

$ means end of line

echo basalt
#

try escaping it

tranquil beacon
tender shard
#

not end of regex

tranquil beacon
orchid gazelle
#

uhhh

#

well

#

it matches the correct data so I guess it's fine lol

tender shard
#

so calling find() did work?

orchid gazelle
#

it's processing

#

always takes 5 mins

tender shard
#

btw just a tip, you should always used named groups

#

it makes things easier if you ever change your regex

echo basalt
orchid gazelle
#

oh ok

echo basalt
#

I have my IDE settings how I like them

#

Mostly stock

thin iris
#

@tender shard i fell asleep lmfao

echo basalt
#

It's mostly personal preference

#

I can click on it and it'll show me the full method

#

I don't care.

orchid gazelle
#

3 mins left and I can tell if it is working lmao

tranquil beacon
tender shard
smoky oak
tender shard
# orchid gazelle oh ok

here's a reason why named groups make sense. imagine now you want to add an additional property between key and value, now value would be group 3 instead of 2

orchid gazelle
#

basically

#

(and more readable)

tender shard
#

using the named groups you could easily turn this into a map that looks like this
"name" -> "mfnalex"
age -> 28
place of birth -> münster

all you'd have to do is to loop over the matcher while find() is true

orchid gazelle
#

cmon CPU, process faster

smoky oak
#

ill just leave the regex to you

orchid gazelle
#

it's only running at 5.2Ghz

#

ahh now 5.3

tender shard
smoky oak
#

bleh

#

at least yours work

tender shard
#

so yeah I can definitely do perfect regex but mine tend to be more complicated than needed lol

orchid gazelle
smoky oak
#

i dont understand why the internet says the regex works but it doesnt when i plug it into code

echo basalt
#

alex is a half-god at everything

orchid gazelle
#

welp

#

the regex did not work sadly

tender shard
smoky oak
#

eh tru

#

but i couldnt tell you what

tender shard
orchid gazelle
#
                        Matcher matcher = PATTERN.matcher(between);
                        matcher.find();
                        between = matcher.group(2);
tender shard
#

what's PATTERN

orchid gazelle
#

Adrian997 hat dir 50$ gegeben! input

#

private static final Pattern PATTERN = Pattern.compile("^(\\w+).*?(\\d+)$");

tender shard
#

ok gimme a minute to start IJ

echo basalt
#

already told you to escape the dolla

orchid gazelle
tender shard
orchid gazelle
#

I tried that, but without #find() lol

tender shard
#

name and amount of $?

orchid gazelle
#

just the $

#

name is dynamic, but idc about it

orchid gazelle
glad prawn
#

wtf

orchid gazelle
#

you need code block

#

discord formatting lmao

glad prawn
#

yeah

echo basalt
#

try it

orchid gazelle
#

yeah it's running

worldly ingot
orchid gazelle
#

I never really worked with regexes

#

idk shit about it

tender shard
#

@orchid gazelle

#
public class Test {
    private static final Pattern PATTERN = Pattern.compile("^(?<name>.+) hat dir (?<amount>\\d+)\\$ gegeben$");

    record Transaction(String initiator, String amount) { }

    private static final Transaction getTransaction(String input) {
        Matcher matcher = PATTERN.matcher(input);
        if(!matcher.matches()) {
            return null;
        }
        return new Transaction(matcher.group(1), matcher.group(2));
    }

    public static void main(String[] args) {
        String input = ("mfnalex hat dir 499$ gegeben");
        Transaction transaction = getTransaction(input);
        System.out.println(transaction);
    }

smoky oak
# orchid gazelle

fuck kinda process ur doing that processing 10k entries is taking you 5 minutes

orchid gazelle
smoky oak
#

wait is that files

orchid gazelle
#

yes

smoky oak
#

ah

tender shard
orchid gazelle
orchid gazelle
tender shard
#

also why did you put a question mark behind the .* ? * already means "zero to unlimited"

#

only reason to use a ? there is if you want it to be non-greedy

#

but you don't want that in that your case I guess

#

please give me a few examples of lines you wanna match and lines you don't wanna match

#

then I will craft you a perfectly working regex

orchid gazelle
echo basalt
#

it has .matches

glad prawn
#

He just match whole the string

tender shard
#

you need to understand how matchers work

#

they are a bit like sql resultsets

jaunty shuttle
# echo basalt player.setInvisible

We tried player.setInvisible already, and player.allowFly together with that, but the player cant fly then, do u know a solution for that ?

orchid gazelle
tender shard
#

if you only need one result, and you do matches()..., you don't need find()

dire bluff
#

hello have u got any listeners to make cactus not raking items

orchid gazelle
#

so yeah you can compare that

#

seems like

orchid gazelle
#

name can include decimals, yes

tender shard
#

name?!

#

with decimals I mean kommazahlen

orchid gazelle
#

oohhhh right

#

there are no comma numbers

tender shard
#
Pattern myPattern = Pattern.compile("(?<name>[a-zA-Z0-9]+) hat dir (?<amount>[0-9]+)\\$ gegeben!");
#

add ^ at the beginning and $ at the end if you only wanna match the "full line"

orchid gazelle
#

it's actually insane that you can do this lol

tender shard
#

then you can do group("name") and group("amount")

orchid gazelle
#

regexes just look like nonsense to me lol

#

well it seems like it's working, it's at least not erroring anymore lol

#

thanks for the help already man

tender shard
#

np

#

my above regex could have been simplified e.g. by using \d but imho it's easier to read if you actually do [0-9]

subtle folio
#

has anyone ever worked wiht the wagon-ftp plugin? If so, is it possible to use sftp with it? when I try I get this error ```[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project Tazpvp: Failed to deploy artifacts/metadata: Cannot access sftp://panel.ntdi.world:2022/plugins/ with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access sftp://panel.ntdi.world:2022/plugins/ using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol sftp: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: sftp
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

orchid gazelle
tender shard
orchid gazelle
#

like I can see it's not thaaat hard to understand, but writing?!

glad prawn
#

yes 💀

tender shard
#

I haven't found a good book about it yet

orchid gazelle
#

uhhh I think I messed something up lol

tender shard
#

I tend to do my regexes one by one

glad prawn
tender shard
#

e.g. if I wanna match "Du hast 123$ von xyz bekommen" first of all I write a regex that finds ^Du hast

#

then I add the [0-9]+ part

#

put it into a named group

#

etc etc

orchid gazelle
#

so it's step-by-step

tender shard
#

yes, I mean for easy stuff like you mentioned, yeah I can write them by heart now

subtle folio
sterile sapphire
#

How do servers do this!!???

tender shard
subtle folio
#

mfw mfw

tender shard
#

also why do you even need wagon-ftp?

subtle folio
#

to upload my artifcat to ftp server?

tender shard
#

deploy by itself can handle sftp just fine

subtle folio
#

oh

#

idk apache maven says to use that

tender shard
#

where does it say that?

orchid gazelle
tender shard
sterile sapphire
#

Uk what plug-in?

subtle folio
#

makes sense

tender shard
#

you are using SFTP which is basically SSH

orchid gazelle
subtle folio
#

mhm mhmm

sterile sapphire
#

Ik so many servers with this tho

tender shard
#

you don't need any further plugin to use SFTP/SSH

#

just update maven-deploy to 3.1.1

orchid gazelle
tender shard
#

and get rid of the wagon extension

subtle folio
#

can you link me mave-deploy

#

i cant find it

tender shard
#

<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
<type>maven-plugin</type>
</dependency>

#

that should be in <build><plugins> btw

#

not as normal dependency

subtle folio
#

yep

sterile sapphire
glad prawn
sterile sapphire
tender shard
#

feel free to ?paste your whole pom @subtle folio

subtle folio
#

kk

#

?paste

undone axleBOT
subtle folio
tender shard
#

what is running at panel.ntdi.world at port 2022?

subtle folio
#

an sftp server

opaque crystal
tender shard
subtle folio
#

i can connect just fine with filezilla

orchid gazelle
tender shard
#

?paste the full output of mvn clean deploy -X

undone axleBOT
tender shard
#

it shouldn't show any credentials btw so dont worry

opaque crystal
subtle folio
#

kk

orchid gazelle
tender shard
#

your whole project setup is messed up

#

is this your first plugin?

orchid gazelle
#

oh wait there is no JavaPlugin?

opaque crystal
opaque crystal
tender shard
opaque crystal
glad prawn
tender shard
orchid gazelle
#

maven also works on eclipse pretty well, I'd suggest using maven

tender shard
#

if you want to keep using eclipse, I cannot help you

#

but your setup is messed up anyway, the plugin.yml should not be in the sources folder

#

You would really do yourself a favor by using IntelliJ and maven

eternal oxide
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

tender shard
#

if you insist on using eclipse, ask ElgarL, IIRC he uses eclipse

orchid gazelle
#

I do too

#

there also might be an easy tutorial

#

but I sadly don't know one out of the brain rn

tender shard
#

so you gotta at least delete the .eclipse folder

orchid gazelle
#

you just gotta delete the project and make a new Maven Project

tender shard
#

yeah

#

what a hassle

eternal oxide
orchid gazelle
#

lol

tender shard
#

btw I meanwhile even suggest people to use gradle instead of maven

subtle folio
#

does maven deploy not support sftp?

orchid gazelle
#

😂

eternal oxide
#

alex you need shooting

opaque crystal
orchid gazelle
#

not u

#

I meant alex lmao

tender shard
orchid gazelle
#

oh no

#

I still hate gradle

river oracle
#

He even wrote a gradle plugin

tender shard
#

for beginners I still recommend to use maven

orchid gazelle
#

im literally the oldest young developer on this planet

tender shard
#

it's such much easier to use

#

and gradle is NOT faster than maven

orchid gazelle
#

I use all the typical old dev tools, but im literally 16

orchid gazelle
#

gradle or maven?

river oracle
#

DaFeist runs ant?

tender shard
#

maven

#

100% maven is easier to use

river oracle
#

Docs are good too

orchid gazelle
orchid gazelle
#

I don't like gradle at all

#

I don't really see the advantage of me using it

#

(I used to use it for mod development, and I had to cry multiple times because of gradle doing shit)

tender shard
#

You will only notice benefits once you wanna do sth that maven cannot do

echo basalt
#

gradle is nice when it works

orchid gazelle
#

that gave me a mental breakdown with forge

#

gradle straight up not working for seemingly no reason all the time

#

uhmm alex

#

regex not working /:

tender shard
#

Gradle always works, you guys are just always abusing the main build.gradle file for stuff that belongs into separate buildSrcs… right @slender elbow ?

orchid gazelle
#
                        Matcher matcher = PATTERN.matcher(between);
                           if(!matcher.matches()) {
                                continue;
                            }
                           System.out.println(matcher.group(2));
                        between = matcher.group(2);
``` no sysouts
#

so #matches does not return true

tender shard
#

how does your input look like?
too little info

orchid gazelle
#

it's the run before switchting to your regex

#

oh wait

#

nvm

#

im dumb

#

I am using your correct regex but forgot to change the group in the code lol

tender shard
#

also coming back to gradle: if your build.gradke(.kts) uses any allprojects or subprojects closure, you're probably doing sth wrong, unless you don't manipulate any specific tasks inside there. and even if not, most of the subprojects or allprojects things belong into settings.gradle instead

#

e.g. declaring repositories that should be available to all subprojects, that never belongs into your build.gradle but into settings.gradle

slender elbow
#

I have a very bold love-hate relationship with gradle

tender shard
#

or stuff like setting java version, no, don't do that in subprojects, do that in a java-conventions.gradle file in buildSrc

tender shard
#

it's so powerful but the docs are so shitty that it's obvious that people abuse it

glad prawn
slender elbow
#

it's like, holy shit I love it when things are so nice and it just works

tender shard
#

the fact that the mcdev-plugin for IJ creates a bullshit example project doesn't really help

slender elbow
#

but then I do one slightly wrong thing and I spend the entire afternoon on it

#

only to change one line and be like "oh, yeah that makes sense"

tender shard
#

yeah it's a whole different thing. maven uses xml / a set of instructions, declarations. gradle let's you actually code stuff

#

ofc it's more error prone

#

one thing I still miss in gradle is being able to pass var/vals to plugins

orchid gazelle
tender shard
orchid gazelle
tender shard
#

yowza

#

and maven 4 easily defeats the "lol but gradle compiles in 1 second instead of 4 seconds"

orchid gazelle
#

naaah fuck me im sooo dumb actually

#

guess what I did

#

holy fuck LMAO

tender shard
#

yeah you fucked up my regex

smoky oak
#

im not using maven cuz its better

#

im using maven cuz thats the first thing i learnt

#

so im not learning something else cuz it works

orchid gazelle
#

im using maven because I like it

orchid gazelle
#

actually, I used Gradle first

#

but I hated gradle and decided to go "learn" maven(yeah im still bad)

tender shard
#

neither maven nor gradle is better. they are both great tools. maven is like a hammer. you can easily use it to hammer a nail into the wall.

gradle is like of those swiss army knives. Sure, it also maybe somewhere has something that is supposed to act like a hammer but you need half an hour to find out where it is, and even if you find it, chances are high you're using it wrong

orchid gazelle
#

gradle is basically

#

tradeoff: you will hate your life more / you have more features

tender shard
#

gradle is made for highly complicated builds that indeed profit from the features gradle offers. maven is made for things where you just wanna say "ok I have this and that dependency and I want it shaded and pls make javadocs too"

smoky oak
#

not like thats doing me any good urgh

#

like seriously where are my classes

tender shard
#

what's your issue again?

smoky oak
#

a class that has nothing to do with static is getting ClassNotFoundException which commonly is caused by static initialization

#

sooo

#

0 leads, and its not a consistent issue

tender shard
#

okay moterius do this:

smoky oak
#

so i cant even try to debug it properly

slender elbow
#

do you have a stack trace?

tender shard
#
public class MyPlugin extends JavaPlugin {
  static {
    try {
    Class.forName("my.class.that.is.weird");
    } catch (Throwable t) { t.printStackTrace(); }
  }
}
smoky oak
#

oh thats an interesting idea

#

onLoad or in a test command?

tender shard
#

as mentioned above:

smoky oak
#

nvmind i see what u mean now

tender shard
#

in the static init block

#

unless that class is using some static getter of your main class or sth. in that case, move it into onEnable or onLoad

smoky oak
#

its not using it, some others that dont cause issues are

orchid gazelle
#

brrrr CPU is doing wrmmm wrmm

echo basalt
#

bros got a transformer

orchid gazelle
#

yeah

#

I do

tender shard
#

someone here recently asked me to do cinebench on my m2 to laugh at me how their desktop CPU is better than my laptop

smoky oak
#

theres nothing in the console

smoky oak
#

I'll keep the code and post the stacktrace if it happens again

orchid gazelle
#

:)

tender shard
slender elbow
#

not

orchid gazelle
tender shard
#

where?

orchid gazelle
#

we discussed about it for literal 2 hours

#

lol

#

wait imma find it for you

tender shard
#

sorry I snacked 2mg clonazepam that day, it's causing retro-grade amnesia lol

#

just gimme a TL;DR

#

what was the results?

smoky oak
#

nothing yet

#

imma restart my server buncha times

orchid gazelle
#

it was about 1000 -> 1650 non-overclock

tender shard
#

isnt that a desktop CPU that takes like 250 watts?

orchid gazelle
#

yes

#

if you overclock it, it can eat 300W

tender shard
#

well in that case, getting 60% more than a laptop that takes way less than 100 watts is not really a big achievement

echo basalt
#

cries in 65w chip

#

underclocked and water cooled

orchid gazelle
echo basalt
#

what else do you care about in a cpu

#

if it's ecological?

tender shard
#

power usage for example? because my macbook lasts 20 hours playing minecraft

orchid gazelle
#

idk I only care about raw performance if I am able to cool it properly

#

I am using one of the best 360mm water-coolers so yeah

smoky oak
tender shard
#

yeah obviously a water-cooled 5.4ghz intel is beating an m2 in "raw performance"

smoky oak
#

isnt m2 a folder on windows

tender shard
#

.m2 is the maven folder

orchid gazelle
tender shard
#

M2 is apple's newest system-on-a-chip

smoky oak
#

ah that damn thing

#

i dont like apple