#help-development

1 messages · Page 1250 of 1

red bolt
#

cuz like it shouldn't happen but my problem with a single world is that if someone finds a way to escape their islands they could grief the entire thing

mental trail
#

I think most skyblock plugins have perm checks on block break

red bolt
#

true

mental trail
#

seems fundamental to me at least

#

my concern was people using up their space

red bolt
#

so I would need to create a sort of hashmap for each player on what is their designated space they can use or smth?

mental trail
#

tbh, I think it's just best to use an existing one and build an addon of sorts for it

red bolt
mental trail
#

minecraft classic

#

flat block world

#

lol

wet breach
#

Just use world guard regions and dont allow them to leave the region

red bolt
mental trail
#

nah a skyblock plugin itself I was thinking

#

it handles the permissions/members/etc

red bolt
mental trail
#

I can make custom commands to modify it with an API

wet breach
#

Probably wouldnt use script but you dont need it as a dependency either since not leaving a region is built into the world guard flags

#

You just deny exiting

red bolt
#

yeah but I still need to create that region in the first place

#

so my plugin would need to do that

#

its not like protecting spawn

wet breach
#

Right, not hard to hook into it to do that

red bolt
#

ig, I dont know how to hook into it but I'l look into it

#

thx

wet breach
#

It has an api

red bolt
#

oh that's nice, I shouldn't be surprised tho 😂

mental trail
#

handles the schems for me and everything

red bolt
#

now I just need to make sure no flaw in my code grants op 🤣

red bolt
mental trail
#

ah fair

#

it hooks into oraxen

#

so I'm sure it'll be fine for my custom stuff

red bolt
#

nice

#

not sure abt itemsadder but I prefer the flexibility of a custom plugin

mental trail
#

itemsadder,slimefun,nexo,coreprotect all seem to have hooks

#

but yeah understand the custom plugin

red bolt
#

good to know tho

mental trail
#

worst case scenario I just fork it

red bolt
#

lol yeah

#

anyway heading to bed gn

mental trail
#

gn o/

dark arrow
#

there are actualy 655k ways you can wear a armour in minecraft lol

nova notch
#

are you sure about that

#

excluding turtle shell/elytra it'd be 157 trillion with all the armor trims and trim colors

#

or are you talking about one armor piece

opal carbon
#

out of curiosity why was LootTables.EMPTY removed in 1.21.2

sullen marlin
#

Ask Mojang

opal carbon
#

oh was that an internal mc change? fair enough

slim wigeon
#

Ok, I got the timers set. For single timer that is. But how can I add multiple timers to this?

https://paste.md-5.net/ijinisehay.java

If I need another HashMap or something in these lines, tell me because I don't know how far I can nest this

mellow edge
#

what timers and how you remove them depends on implementation

slim wigeon
#

That is what the timers are for

#

The reason its in a TimerManager because I might use it in other plugins

mellow edge
#

its fine as long as you know what you're doing

slim wigeon
mellow edge
#

nothing is wrong with writing your own manager, using concepts that are similar doesn't mean you are copying

slim wigeon
#

I just refuse to use their plugins even while I have a subscription going. Their devs take forever to fix issues and I don't have the time

slim wigeon
#

How can I close the gui of a player?

mellow edge
#

Wdym?

#

Custom GUI via Inventory#closeInventory

slim wigeon
dark arrow
valid burrow
#

weird question about inheritence but if i have this class

will classes that extend it also have said priority

#

and dont give me ?tas, i dont wanna try it out

pseudo hazel
#

why not

thorn isle
#

^

valid burrow
#

cause

#

id have to compile, setup multiple listeners

#

etc

#

get my server running

#

and all of that

thorn isle
#

the alternative is to go into the sources of the reflective eventhandler system and see whether it resolves inheritance or not

#

so if you'd like to do that instead...

valid burrow
#

well

#

chances were someone just happend to know

#

but ig i have no other choice

thorn isle
#

md5 might but whether he appears from the thin air now or an hour later is anyone's guess

pseudo hazel
#

i dont know the answer but if I were to assume I think it does not inherit the priority if you override the function

sullen marlin
#

I dont think listeners support inheritance

sullen marlin
#

although you've annotated an abstract method so maybe

#

if they do support inheritance then yes priority would be the same

#

tas

valid burrow
#

oki

#

ill try

#

give me a sec

thorn isle
#
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface EventHandler {
#

not meta-annotated with @Inherited

#

my guess is that they don't get inherited

sullen marlin
#

I dont think the meta annotation changes the example

#

it'll depend on the reflection code

valid burrow
#

is there a way to get an events priority from the event object?

#

so i can just print it out

thorn isle
#

if the reflection logic that scans for the superclass' method declaration it will get inherited yeah

#
        Set<Method> methods;
        try {
            Class<?> listenerClazz = listener.getClass();
            methods = Sets.union(
                Set.of(listenerClazz.getMethods()),
                Set.of(listenerClazz.getDeclaredMethods())
            );
        } catch (NoClassDefFoundError e) {
            plugin.getLogger().severe("Failed to register events for " + listener.getClass() + " because " + e.getMessage() + " does not exist.");
            return ret;
        }
#

well, it doesn't recursively get the private methods of the superclasses, so if the class you're extending has a private eventhandler method, that won't be registered

valid burrow
#

okay

#

so

#

the listener doesnt even fire

#

lol

thorn isle
#

getMethods will also get inherited methods, which will have the annotation

#

but the issue is that getDeclaredMethods will get the methods specifically declared on that class, and that won't have the annotation

#

so the method will appear twice in that set union

#

how exactly that behaves, i have no clue

valid burrow
#

the issue is that it doesnt even find the listner

#

lol

thorn isle
#

presumably then the declared one takes precedence

valid burrow
#

i mean the whole argument is pointless if listeners arent inheritable anyways

#

or rather

#

overwritable

rough drift
thorn isle
#

they're overwritable in the sense that the method will be called on whichever listener object is registered; if its class overrides it, the overriding method will be called

valid burrow
#

it doesnt

#

i just tried

#

it does if i annotate it with eventhandler

thorn isle
#

no, that is different

valid burrow
#

but not if i overwrite it

thorn isle
#

the issue is that the reflective lookup sees both the un-annotated override and the annotated declaration in the superclass

rough drift
#

yes, because annotations are not inherited

#

you need to get the parent class to see the base annotations

valid burrow
thorn isle
#

and the un-annotated declaration takes precedence

thorn isle
#

annotations canbe inherited if meta-annotated with @Inherited

rough drift
#

it only sees one method, the furthest one down the chain is the one it sees

thorn isle
#

it gets them both

rough drift
thorn isle
#

or no, you're right, it will only see them both if the override is private

rough drift
#

didn't know

thorn isle
#

either way i don't think this inheritance thing is going to work

rough drift
#

wait no it doesn't work on interfaces

thorn isle
#

maybe we should meta-annotate eventhandler with inherited to make it work?

rough drift
#

@Inherited annotations won't inherit if you implement lol

valid burrow
#

i feel like i sparked something here lol

rough drift
rough drift
#

@thorn isle nvm

valid burrow
rough drift
#

As per oracle docs Note that this meta-annotation type has no effect if the annotated type is used to annotate anything other than a class. Note also that this meta-annotation only causes annotations to be inherited from superclasses; annotations on implemented interfaces have no effect.

thorn isle
#

great

rough drift
#

but again it may cause issues

valid burrow
#

found a workaround

thorn isle
#

i kind of doubt anyone would be relying on this behavior specifically but god only knows with plugin devs honestly

rough drift
thorn isle
#

speaking of boundless horrors

#

nobody still remember who did that async entity pathfinder fork?

#

i've been trying to look for it but i think i might just be hallucinating the recollection of it by this point

rough drift
#

wait no nvm

thorn isle
#

maybe, but i remember it being done by someone actually competent

rough drift
#

I stumbled upon yatopia 💀

thorn isle
#

🤡

jagged thicket
#

afaik panda spigot is the only big actively maintained 1.8 fork

#

or am i wrong 💀

thorn isle
#

i think it was for modern versions rather than 1.8

#

i want to say spottedleaf did it in tuinity but i might be confusing it for his async light shenanigans

#

eyeballing the patches it doesn't seem to be tuinity

valid burrow
thorn isle
#

maybe i misremember and it really was some hideous yatopia "async everything 25x" fork

jagged thicket
#

cmarco mentioned 🔥

thorn isle
#

no clue who or what that is

#

google search shows me coffee shops near me

jagged thicket
#

creator of bible plugin

thorn isle
#

i do remember someone using parallel streams for a bible plugin of some sort

#

i thought this folly

jagged thicket
rough drift
#

but you can async some stuff

#

(this is a jab at folia)

thorn isle
#

i think trying to make some of the internals more thread safe would probably have been less work, api breakage, and diffs to maintain, rather than doing whatever the hell they're doing with folia

#

but i haven't thought much if at all about regionized ticking so maybe they know something i don't

rough drift
#

That's my plan right now, but I have to get over my skill issue in not having energy

thorn isle
#

what'cha gonna async first

rough drift
#

right now? pretty much nothing, gotta get my API stable first

thorn isle
#

i'm looking at the ai goals and the more i look at them the madder i get

rough drift
#

later I'll probably work on entities yeah

#

they are the laggiest of the bunch

thorn isle
#

for sure

chrome beacon
thorn isle
#

and the newer entities with the new Brain ai system are even worse

#

frogs as it turns out are as expensive as villagers

rough drift
#

first improvement I'll make is regional collision and entity lookup, should be much faster than what's going on right now

rough drift
jagged thicket
chrome beacon
#

b-but the async async code

thorn isle
#

i don't recall collisions taking very much time, nearby entities lookups maaaybe

rough drift
#

I don't know if that got improved

thorn isle
#

if you mean region as in 16 blocks cubed section, yeah, that's how it still works

jagged thicket
rough drift
#

a region is 64x64 chunks

jagged thicket
#

isnt it 32

thorn isle
#

no that is nonsense

#

entity lookups are per-section

jagged thicket
#

im pretty sure it is 32*32

rough drift
#

THEY CHANGED IT YIPPIE

thorn isle
#

every chunk section (16x16x16 cube) has its own "entity slice"

chrome beacon
#

I doubt it was 64x64 chunks

thorn isle
#

yeah that would be disastrous

jagged thicket
rough drift
#

MY BAD

#

it's 32 chunks

jagged thicket
#

@rough drift can u do async loading for exensions in plugins (helix)

#

but allow synced loading if requested by specific plugins

thorn isle
#

weren't you pink

jagged thicket
#

i lost nitro

thorn isle
#

💀

jagged thicket
#

it was free for 1 month

rough drift
#

but I can probably do plugin initialization async based on dependency trees

jagged thicket
#

yeah that is what i meant

#

plugins got confused with exentions

thorn isle
#

entity pushing is also one of those things that i think could be done completely async, since it's just comparing bounding boxes and setting vectors

thorn isle
#

iirc setVelocity is already synchronized on and the bounding box is immutable

rough drift
thorn isle
#

sure but do you really care about races here?

rough drift
#

kinda

jagged thicket
#

what about core and plugins

rough drift
thorn isle
#

woe is me the chicken was pushed 0.3355 blocks instead of 0.33551 blocks

jagged thicket
#

modules and plugins still confuse a lot

thorn isle
#

yeah, aabb's are immutable, so no concern there

#

worst that'll happen in that regard is that the reference itself is stale (iirc it gets recomputed every tick, updated to be at the entity's new position) and your mobs get pushed in slightly the wrong direction because the boxes lag behind in visibility

#

from there if you want to be safe you can apply the collision velocity sync via the scheduler

#

hell you could do it with a plugin, by setting the collisions on every entity to false and then doing them yourself async and pushing them sync next tick

#

with probably an exception made for players, don't want to desync those even with slight races

#

but then again entity-entity collisions are generally not that expensive unless you have 1000 minecarts or chickens in a single block

#

so even if it is low-hanging fruit it isn't particularly worthwhile

rough drift
#

I guess

#

I don't really know what to work on first

#

so I guess I'll just work on my API lol

scarlet gate
#

Is it possible to load and enable a datapack from a plugin's resources?

young knoll
#

Depends on what the datapack does

#

Most of them can’t be enabled at runtime

thorn isle
#

you could always dump it from the jar into the datapack dir on enable, and then shutdown the server with a "pls restart" message if the datapack isn't loaded yet - so it will be loaded next restart

#

i think paper plugins might be able to load them at runtime since they load while the registries are open

flat lark
#

I created a new project for hibernate and I still get the error.

My Config: https://paste.md-5.net/uyicapohin.xml

org.hibernate.internal.util.config.ConfigurationException: Unable to perform unmarshalling at line number 0 and column 0 in FILE C:\Users\isuki\Desktop\server\plugins\NewTest\hibernate.cfg.xml. Message: null
sly topaz
#

wait, is that the same error

#

last time it was about configuration not being found at all due to missing deps

sly topaz
# flat lark Still is

now it seems like it is about mangled format in your config tho, can you send the whole stack trace?

flat lark
#

Yeah gimmie one sec

sly topaz
#

ah no it is still the same thing, I'll be damned

flat lark
#

Thing is it has the depends.

sly topaz
#

yeah, it sounds like a classloading issue at this point

flat lark
#

I was able to use this awhile back but that was like a year ago.

#

But Idk what todo to fix it.

thorn isle
#

simplicity is virtue

flat lark
slender elbow
#

are you passing your plugin's classloader to hibernate?

flat lark
#

.

flat lark
slender elbow
#

i've never used hibernate but you are meant to pass it your plugin ClassLoader somewhere so it can locate resources in your jar

flat lark
#

Not from what I know

#

I've used it in the past without passing my class but I am not sure as it dosent say it's having issues with that

sly topaz
#
    @Override
    public void onEnable() {
        saveResource(HIBERNATE_CONFIG_FILE_NAME, false);
        var originalClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());

        try {
            sessionFactory = new Configuration()
                    .configure(new File(instance().getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
                    .buildSessionFactory();
            getLogger().info("Hibernate SessionFactory initialized successfully.");
        } catch (Exception e) {
            getLogger().severe("Failed to initialize Hibernate: " + e.getMessage());
            e.printStackTrace();
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassLoader);
        }
    }

    @Override
    public void onDisable() {
        if (sessionFactory != null)
            sessionFactory.close();
    }

this is how I tested it and it seems to work for me (well, it doesn't load for me as I don't have sqlite database setup but that's beside the point)

flat lark
#

with what depends are you using

sly topaz
flat lark
#

Also what is the import on instance(0

sly topaz
#

ignore the spigot-remapping stuff, I tried it in a plugin I was working on

sly topaz
flat lark
#

telling me to import a class lol

sly topaz
#

just change it to this

flat lark
sly topaz
#

though it worked just fine for me, I just did a test

flat lark
#

a sqlite db?

sly topaz
#

yes

sly topaz
#

shouldn't need to do that considering setting the context classloader to the one of your plugin's should also make it load the jdbc driver when Hibernate bootstraps, but I guess it isn't happening in this scenario?

flat lark
#

for hibernate?

sly topaz
#

only added the mappings for my test entities

flat lark
#

Do I need the jspecify depend?

sly topaz
#

no, that's just nullability annotations

#

it'd be better if you could post your project in github at this point so I can try and change it myself

#

because there's no way I got it to work with my jank approach and you can't lol

flat lark
#

https://paste.md-5.net/amoxujogex.md

So here is the error now after adding class.forname but since I haven't completed my modals yet I think thats where its giving me issues at. Although, Idk how yours dose it without the class.forName could it be your shading your using as your using diffrient stuff than I am in pom.xml

sly topaz
#

I am also using a newer version of the maven shade plugin but I doubt that's the issue

sly topaz
flat lark
#
        try {
            Class.forName("org.sqlite.JDBC");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        this.getConfig().options().copyDefaults(true);
        saveConfig();

        saveResource(HIBERNATE_CONFIG_FILE_NAME, false);
        var originalClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());


        try {
            sessionFactory = new Configuration()
                    .configure(new File(this.getDataFolder().getAbsolutePath() + "/" + HIBERNATE_CONFIG_FILE_NAME))
                    .buildSessionFactory();
            getLogger().info("Hibernate SessionFactory initialized successfully.");
        } catch (Exception e) {
            getLogger().severe("Failed to initialize Hibernate: " + e.getMessage());
            e.printStackTrace();
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassLoader);
        }
``` my class now
hazy parrot
#

You don't need Class.forName

#

Unless you are like on java 6

rotund ravine
#

Maybe he is

chrome beacon
#

I've seen some people have that issue on 1.8

#

So it's required 🤷‍♂️

blazing ocean
#

1.8 😭

quaint mantle
#

Oh yeah

#

It's a java 8 thing

#

I can confirm 👍

flat lark
sly topaz
flat lark
#

it runs of my computer

sly topaz
#

how do you run it

flat lark
flat lark
sly topaz
#

the version you're using doesn't just change with your minecraft version, IntelliJ might use a different one from the one in your path

#

though that shouldn't be an issue honestly, I am using java 21 too

flat lark
#

When I was setting up the server it requires java 21

#

So I though java 21 for the plugin as well

sly topaz
#

yeah, that's fine

flat lark
#

Did they get rid of Material class in 1.21 for spigot?

flat lark
fair rock
flat lark
#

I use Intellji

#

Its update to date and I just restarted and still had that problem hmm

fair rock
#

Maven / Gradle dependency alright? Bcs Spigot didnt get rid of anything. So a user problem c:

blazing ocean
#

update intellij

#

and make sure you're using java 21

#

i'm guessing you just ran the in-ide update checker

flat lark
blazing ocean
#

well, what version are you on

slender elbow
#

install JetBrains Toolbox, update intellij from there; the in-IDE updater is terribly broken for some obscene reason

chrome beacon
#

It works

#

You just need to do like one update at a time with it

#

So multiple updates may be required in a row if you do it that way

blazing ocean
#

can't wait to install an autoclicker just to update

#

I should probably update mine too, still on ultimate 2024.3

umbral ridge
flat lark
blazing ocean
#

and now check when java 21 released

#

IJ only supports it on 2024.xx+ iirc

blazing ocean
smoky skiff
#

Why players cant enter to nether even nether is enabled

#

Incase if they inter they cant come back

#

Why can i have a solution

tranquil pecan
#

because you need it

smoky skiff
#

Wt?

tranquil pecan
#

You are you spigot?

smoky skiff
#

Used it

slender elbow
#

i love this conversation

tranquil pecan
flat lark
#

I have a feeling it was a problem with my IDE lmao

sly topaz
flat lark
earnest girder
#

Are YAMLs a good way to store player stats and data for non-small servers?

flat lark
sly topaz
flat lark
sly topaz
#

well, that's weird

#

it shouldn't work without setting the context classloader

#

unless your server is also running java 8

flat lark
#

its not.

#

it has to have java 21

sly topaz
#

and you'd be running hibernate 5.x as hibernate 6.x depends on the newer jakarta APIs

#

well, glad it worked in the end

flat lark
#

I hate using default mysql. Hence why I am using an ORM

umbral ridge
#

whats wrong with default sql

sly topaz
#

eh, HQL is convenient

#

just depends on what you're used to

flat lark
#

I used ORM in typescript as well so I more well verse what they do compare to sql

flat lark
sly topaz
#

in the plugin development space people tend to avoid ORMs since it's just too much for what ends up being rather simple pieces of software

flat lark
#

Too much typing.

#

Yeah, I get that.

#

If your doing a small plugin and storing small data use yml. But if your doing a bunch of data small or large use a db.

sly topaz
#

it also doesn't help that you end up having to relocate your dependencies, and that is always fun when things stop working as they should because of that lol

earnest girder
flat lark
sly topaz
#

at 30 players I'd start using a database honestly

#

doesn't have to be anything fancy, sqlite would do

thorn isle
#

The best way to use orm is to not use orm

#

Keep it simple, stupid

flat lark
flat lark
sly topaz
#

if you are going to go for a server-shared database though I would recommend something else other than sqlite, postgres is usually a fine choice but mysql among others is also just as fine

thorn isle
#

I've used pex with thousands of players in a yaml "database", was fine even if very dumb

slender elbow
#

i love jooq

#

i'm going to marry jooq one day

sly topaz
#

I don't think I've ever heard of anyone actually liking jooq, just tolerating it lol

slender elbow
#

interesting config

earnest girder
#

whats the easiest pastebin site to use?

#

!paste

slender elbow
#

?paste

undone axleBOT
earnest girder
#

The data are 20 ints, 1 long, 1 String, 1 String List, 1 OfflinePlayer, for each player

#

50 players max, saving data to file every 30 seconds 🤷‍♂️

#

and I only read the data when players join

#

its saved to an instance of a memory class while they're on the server

worldly ingot
red bolt
#

does the input packet also tell you when the player stops pressing the key or when they stop holding it?

#

I found this on the packet

#

it wont load the page

blazing ocean
#

?protocokl

#

?protocol

undone axleBOT
red bolt
#

ooo thx

#

so does this only get sent when the player first presses the key or gets sent as long as it is held?

thorn isle
#

It gets sent when the inputs change

#

1 means it's being pressed, 0 means it's not being pressed

red bolt
#

oh perf

thorn isle
#

To determine whether a button was released or pushed you have to compare to the previous packet and see if a 1 turned to 0 or a 0 to 1

red bolt
#

so it wont be 0 right after its pressed only once its unpressed on client side correct?

thorn isle
#

I'm fairly certain this is how the event works as well

red bolt
#

thx

thorn isle
#

1 means down 0 means up

red bolt
#

cool thx

#

yeah playerinputevent didn't do that

red bolt
slender elbow
#

you were linked to a working website 20 minutes ago

red bolt
#

yes but it shows hex codes

slender elbow
#

it shows exactly the same what wiki.vg used to

#

those are bit masks

#

why not just use the API event?

red bolt
#

that's what it used to show

slender elbow
#

that's a whole separate packet

#

different packets will show different fields as they are encoded differently

red bolt
#

OH 🤦

#

thx 😅

slender elbow
#

the protocol page in the Minecraft wiki is a direct migration of what was wiki.vg, as it shut down

red bolt
#

cool thx (plus it looks better 😎 )

#

do you know if I properly did this? (I didn't want to do it right in the main file)

slender elbow
#

uh idk what the whitelist thing is about but you can make the listener its own class, yeah

red bolt
#

is this how I do it tho? id I properly implement it?

#

the whitelist thing was automatically imported 🤷‍♀️

umbral ridge
#

that is interesting

#

CAVE AIR?

#

how is cave air determined where it is?

#

if i build a cave myself, will empty space in the cave become CAVE_AIR?

#

or is CAVE AIR under a specific y

red bolt
#

oooh you know what remember how in mc live they said blocks have location based sounds it may have to do with that

#

what ver are you using

umbral ridge
#

latest

orchid furnace
#

i think its to do with what sounds there are and iirc bats and stuff are more common to spawn in cave air

#

could be wrong tho

umbral ridge
#

oh

red bolt
#

yeah like what they announced in mc live

orchid furnace
#

didnt watch it icl lmao

red bolt
#

fair enough

orchid furnace
#

ive seen a couple clips about the ghasters or something but i never watch them

red bolt
#

yeah they look fun, I'm not a fan of the locator bar but atleast you can disable it on the srv

worldly ingot
#

Cave air is mostly for world generation

mellow edge
orchid furnace
#

ohhh

worldly ingot
#

Yeah, beat me to it. You should use isAir() for air checks

wet breach
#

also it is found in some structures too

red bolt
slender elbow
#

why aren't you just using the PlayerInputEvent?

red bolt
#

because it only returns the first keypress

red bolt
slender elbow
#

the event is called for that as well

red bolt
#

nope

#

I tried it

#

I only got "w" when I first pressed the key and when I held it I only got it once

slender elbow
#

you are only printing when you press it...

#

when you stop pressing, the corresponding key will be false

#

so it won't print

red bolt
#

but it is always false?

slender elbow
#

it is true when you start pressing

red bolt
#

how do I tell if it was let go or was just already false

slender elbow
#

it is false when you stop pressing

#

either the precious input is provided in the event, or you can get it from the Player itself

#

I don't remember which

#

previous*

eternal oxide
#

just remember the last state

red bolt
#

how?

slender elbow
#

it's in the Player object

#

getInput

eternal oxide
#

boolean forward = false;

red bolt
eternal oxide
#

per player

red bolt
#

oh like a tag

slender elbow
#

just get it from the Player..

red bolt
#

how

#

the player has smth for that?

slender elbow
#

Plater#getInput()

sly topaz
#

Player#getCurrentInput

red bolt
#

ah

slender elbow
#

if (event.player.input.isForward() != event.inout.isForward) {
// forward input changed, the event's state is the new one
}

red bolt
#

what is e.inout?

slender elbow
#

a typo

sly topaz
#

what are you trying to do with this anyway

red bolt
#

oh

sly topaz
#

they meant to type input

slender elbow
#

it's pseudocode I'm typing on my phone

red bolt
#

I guessed

red bolt
#

we need a discord overlay for IDEs xD

sly topaz
#

you probably can get the overlay if you add it as a game

orchid furnace
#

^^

sly topaz
#

though I think that's just for voice channels? Idk, I never use that

red bolt
#

normally there is like a small version of discord overlaying the app

#

think steam overlay

#

but discord

sly topaz
#

I don't use steam so I wouldn't know

#

someone probably did it though

red bolt
#

prob

worldly ingot
#

You can add your IDE to the list of recognized games on Discord

#

It should overlay then

eternal oxide
#

don't be poor and get a second monitor

polar forge
#

I get this error if i try to teleport to a map that doesnt exists (it isnt stored in the config file)

urban cloak
#

doesnt that make sense tho?

smoky anchor
#

What do you expect to happen ?

#

(Also, Paper)

polar forge
smoky anchor
umbral ridge
#

use WorldLoader class

polar forge
umbral ridge
#

or something like that

polar forge
#

as stated into the link ive semnt\

eternal oxide
#

You tried to get something from your config without checking if the result was null before trying to use it

polar forge
#

so do i neeed to check if mapname is null or map?

umbral ridge
#

both

#

how do you save map names in the config?

polar forge
#

setmapcommand

brittle geyser
#

How to use obfuscated spigot jar in my project?

#

compileOnly("org.spigotmc:spigot:1.20.6-R0.1-SNAPSHOT-remapped-obf")

drowsy helm
#

you want obfuscateD?

brittle geyser
#

ye

blazing ocean
#

and why

#

I cannot think of a valid reason for that

polar forge
#
                        player.teleport(map);
                        sender.sendMessage(ChatColor.GREEN + "You Have Been Teleported To " + mapname);
                        return true;
                    }```
#

like this ElderL?

brittle geyser
#

i cant read this

blazing ocean
#

elder 😭

drowsy helm
polar forge
#

Rad what

blazing ocean
#

his name is elgar

polar forge
#

ElgarL

#

opsie

blazing ocean
#

and elder 😭

#

he's probably the oldest on this discord

brittle geyser
blazing ocean
#

it is

drowsy helm
#

Do you understand what obfuscation is?

brittle geyser
#

no

drowsy helm
#

you want moj mappings if you want to be able to read it

blazing ocean
brittle geyser
#

then how i can get moj mappings

blazing ocean
#

?nms

young knoll
#

Pfft

#

Back in my day we didn’t have mappings!

blazing ocean
#

back in my day we didn't have minecraft

brittle geyser
#

aaaaaa

#

thanks

drowsy helm
#

good ol' try every letter til it works

red bolt
#

is it efficient to use reflection to change the players gm directly without triggering the gamemode change event?

import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import java.lang.reflect.Field;

public void setGamemodeSilentlyReflection(Player player, GameMode gameMode) {
    try {
        Field gamemodeField = player.getClass().getDeclaredField("gamemode");
        gamemodeField.setAccessible(true);
        gamemodeField.set(player, gameMode);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
brittle geyser
#

i forgot the : one

drowsy helm
#

there is no good reason to do that

#

and will most likely cause bugs

red bolt
#

so how would I do it without triggering the event

blazing ocean
#

again, no good reason to do that

drowsy helm
#

this sounds like an xy problem

#

?xy

undone axleBOT
red bolt
#

hmm possibly 😅

drowsy helm
#

Whats the core thing you are trying to achieve?

#

why cant the event be invoked

brittle geyser
#

It works, but i dont have this classes

drowsy helm
#

moj mappings use different names

#

It is the new standard, so best moving over

brittle geyser
red bolt
# drowsy helm Whats the core thing you are trying to achieve?

because I'm trying to make a custom gm plugin and my custom gamemode needs to be in spectator mode but I also have an event checking for gm change and stores that as the players current gm. there are other ways of going abt it I just thought this could easily work

brittle geyser
#

ahh i get it

red bolt
#

does the player need to be in spectator to get them to spectate an entity?

drowsy helm
drowsy helm
#

Attempted to spectate an entity while not in spectator either throws an error or just does nothing (cant remember which)

red bolt
red bolt
thorn isle
#

what's the issue with setting their gamemode to spectator again

polar forge
#

can anyone assist me?

red bolt
polar forge
#

hey vcs2

thorn isle
#

ignore the event if you caused it

red bolt
#

yeah but I need to somehow tell the event to ignore it...

thorn isle
#

when you change a player's gamemode, set a boolean field to true

#

then in your listener check if it's true

#

if it is, ignore the event and set it to false

red bolt
#

that could work

thorn isle
#

that's the standard way of doing this (with synchronous, non-recursive events), and even bukkit does it for certain things

red bolt
#

alr

thorn isle
#

that said rather than listening to gamemode changes, you maybe want to implement your own /gamemode command instead

red bolt
#

actually I could also just change the order (put them in spectator then put them into my custom gamemode, the order would override it)

red bolt
thorn isle
#

why are you listening to gamemode changes?

red bolt
#

to store the players curent gm

thorn isle
#

player.getGameMode

red bolt
#

that only works for the default gms

thorn isle
#

so you want to track whether the player is in your custom game mode?

red bolt
#

no just "ignore" the default gamemode manager and use a custom one

#

prob inefficient now that I think abt it

thorn isle
#

what's wrong with the default gamemode manager

red bolt
#

you cant add custom gamemodes

thorn isle
#

the way i see it there are the default game modes and then there's the custom state where the player is in your custom game mode

red bolt
#

actually

#

that

thorn isle
#

and the way to do this would be to have your own /mygamemode command that sets you into that state

red bolt
#

makes sense

thorn isle
#

and you would completely ignore gamemode change events

#

and if the player is in an unexpected vanilla gamemode, you set them to what they're supposed to be in

red bolt
red bolt
thorn isle
#

the player can only change out of the gm with /mygamemode

red bolt
#

how do I block it?

#

the other ways I mean

#

essentials /gm, default /gamemode etc.

thorn isle
#

you probably have some sort of a tick loop for your custom gamemode, right

red bolt
#

currently no but that's the plan yes

thorn isle
#

check the vanilla game mode there and if it differs from what you expect, set it to what it should be

red bolt
#

oh yes

#

and thats clean, nice!

#

would this work for the tick loop?

new BukkitRunnable(){
    @Override
    public void run(){
        /* Your code here, will be called every tick.*/
    }
}.runTaskTimer(/*your main class*/, 0L, 1L);
thorn isle
#

yes although i would probably have the logic in a named method on a proper class and have that be called from the scheduler

red bolt
#

true

thorn isle
#
class MyGameModeManager {

    public void tickPlayers() { ... }

}

Bukkit.getScheduler().runTaskTimer(this, gamemodeManager::tickPlayers, 1, 1);
red bolt
#

ah yes

thorn isle
#

will show up much cleaner in spark/timings

red bolt
#

it will 😂

thorn isle
#

and generally putting anything large in an anonymous class is ass

red bolt
#

yes for sure

thorn isle
#

was the bug where causing a tree to grow with applyBonemeal wouldn't fire a StructureGrowEvent fixed

viscid maple
#

How do I check if a player has a premium account?

thorn isle
#

oh hey nice

#

i have the jira link in a source code comment

#

good job 2 year ago me

#

Resolution: Unresolved

#

jesus fucking christ

red bolt
#

xD

thorn isle
#

or no, what

#

it's showing some completely different issue opened 5 hours ago

#

is the link invalid?

dapper night
#

public class EntityMountEvent

Is this right one for entering boats?

umbral ridge
#

yes

#

boat is an entity

thorn isle
#

searching requires me to log in and the pagination only goes to 6939 🤡

#

i don't have an account

sly topaz
#

What are you looking for

#

I’ll look

thorn isle
#

something something saplings, bone meal, structuregrowevent

brittle geyser
#

How can i spawn my custom entity that extends LivingEntity? (NMS)

public class Test extends LivingEntity {
    public Test(Location location) {
        super(EntityType.ZOMBIE, ((CraftWorld) location.getWorld()).getHandle());
    }
    // some logic
}
            Player player = event.getPlayer();
            Location location = player.getLocation();
            ServerLevel level = ((CraftWorld) player.getWorld()).getHandle();
            level.addFreshEntity(new Test(location));
brittle geyser
#

how to register own entity type

sly topaz
thorn isle
#

oh so the fucking url changed

#

mrngh

#

fixed

#

nice

sly topaz
#

I don't know why, but when I use the url with just the issue id, it redirects to SPIGOT-8028

thorn isle
#

uncanny

brittle geyser
polar forge
#

vcs2 could u help me c:

thorn isle
#

what was your problem again

sly topaz
polar forge
#

tptopmapPlugin

thorn isle
#

what now

sly topaz
#

I am asking because dealing with "custom" entities is a pain in the ass, unless you want to make custom goals or something, I don't recommend it

polar forge
#

^ TpToCommand

#

so when i do /setmap <map> it says it got created

#

but when i do /tptomap <map> i get this error

thorn isle
#

?paste

undone axleBOT
thorn isle
#

paste the entire stack trace and the exception name

#

and let's see your /setmap command class

polar forge
#

stack trace?

#

sure

sly topaz
thorn isle
#

it has information about the error

#

but you have cut off half of it in the screenshot

polar forge
sly topaz
#

it says the issue here

polar forge
#

^ SetMapCommand

thorn isle
#

TeleportCommand.java:30

polar forge
sly topaz
young knoll
#

That path doesn’t exist in your config

#

Or does exist but isn’t a section

sly topaz
#

the setmap command uses a completely different key for the map name so it's likely that it just doesn't exist

polar forge
#

maps exists

thorn isle
# polar forge

it seems to "exist" in the default config but i'm not sure if this is valid yaml

#

pretty sure you can't follow a key with no value

polar forge
brittle geyser
#

Caused by: java.lang.IllegalStateException: This registry can't create intrusive holders

thorn isle
#

yes, that is invalid yaml

#

an empty section would be

maps: {}
#

a section with one child would be

maps:
 mykey: myvalue
sly topaz
#

you also can just do String.join(" ", args) instead of using a StringBuilder btw

polar forge
#

so to what should i change it

thorn isle
#

this is terrible

polar forge
#

what

sly topaz
polar forge
#

should i just add the {}?

thorn isle
#

that will fix one of your errors but it won't make anything work

young knoll
#

Not with that attitude

thorn isle
#

because right now you are putting your beer in the fridge and then looking for it under the sofa

young knoll
#

You must achieve a state where your code works out of shear fear

polar forge
#

Guys im tryingto understand but its difficult

thorn isle
#

okay so you have this line in your set command

#
plugin.getConfig().set("creator." + sender.getName() + ".mapname", x.toString().trim());
#

let's run through this

#

what will this concatenated string evaluate to?

remote swallow
#

calling it they dont save it

thorn isle
#

suppose the sender is named bob and the arguments are my place

polar forge
#

ok

sly topaz
#

the setmap command uses the key creator.<player-name>.mapname and the tptomap command expects something akin to this:

mapname: x, y, z, world
maps:
  mapname1: ???
  mapname2: ???
#

is there a reason you have the player's name in the setmap command? Is it necessary for the maps to be per-player?

#

if not, I'd scrap that and just have a map name to location key in the yaml

thorn isle
#

i think the fundamental issue here is he has no idea what a config is or how it works

sly topaz
#

I am probably speaking chinese to the dude right now lol

polar forge
#

it isnt necessary no

#

ive made another plugin where i store it

#

i know what a config is

thorn isle
#

what are you trying to do again? warps?

polar forge
#

no

#

well it has the same logic behind it

thorn isle
#

like someone uses a command to store a location and then people can use a command to teleport to that location

polar forge
#

u just gave me a beautiful idea

#

a genius idea

#

bruh

#

why didnt i jsut do it before

#

i already made a warp plugin

sly topaz
#

inb4 they're just gonna use warps

polar forge
#

just copy paste

sly topaz
#

lol

sly topaz
polar forge
#

yes but then it becomes a warp

#

i want to make a difference between them

#

stored appartely

#

vsc2, why arent u a discord helper yet?

sly topaz
#

these are commands I would just ask chatgpt to generate tbh

polar forge
#

vsc2 for helper <33333

sly topaz
#

helper isn't a role for people who help here, ironically

polar forge
#

i know

#

its like a mod

sly topaz
#

yeah, kind of like minecraft roles work

polar forge
#

Javier also for helper <3333

#

:3333

young knoll
#

Our job is to kick bots

polar forge
#

Am i a bot?

young knoll
#

Well you haven’t posted any steam scams or 18+ NSFW discord links yet

#

So… maybe

#

👀

polar forge
#

Youre telling me this as if your account is being protected by Pope Franciscus

#

You can also be hacked

#

and become a bot

young knoll
#

I’m not sure the pope is particularly good at cybersecurity

sly topaz
#

I mean, people trust the guy with blessings, may as well trust them with the computer

thorn isle
#

he doesn't need to be good at anything

#

the pope is infallible

#

whatever he says becomes true

sullen marlin
#

does anything the anti pope says become false

rough drift
#

hm

polar forge
#

I know its paper

#

but its caused by a plugin

#

So i copy pasted the warp plugin but TpToMapPlugin is red in the /plugins list

#

what is this causing?

eternal oxide
#

can't tell with half an error

polar forge
#

I cant scroll up

#

its screen -r

eternal oxide
#

?paste

undone axleBOT
polar forge
#

what\

eternal oxide
#

you have used paste before

polar forge
#

yes

#

but this wont get u the missing part of code

young knoll
#

It’s in the logs

quaint mantle
upbeat silo
#

If I share my GitHub link, can you check the relevant parts of my code? I have a piece of code that sometimes works correctly and sometimes doesn't. When I tested it, it worked fine, but when I uploaded the plugin to the main Minecraft server, it sometimes behaves incorrectly

#

I'm new to Minecraft plugin development and java

polar forge
young knoll
#

latest.log

remote swallow
#

paying for terminal and unable to zoom out kekw

sullen marlin
polar forge
#

I said i know its paper

#

but its caused by a spigot plugin

#

its not paper the problem

#

its the plugin

shadow night
#

Reproduce it on spigot

#

Then we can help

sullen marlin
#

?whereami

polar forge
#

I have literally the same plugin in the server

#

and it works perfectly

remote swallow
#

i love the fact coll is still blue in that video

polar forge
#

i have a warp and a tptoplugin

#

tptoplugin doesnt work

remote swallow
#

go and read the rest of the error

polar forge
#

i dont know where

#

i dont have a latest.log file

drowsy helm
#

It will leave a file

remote swallow
#

you will in the logs folder

polar forge
#

i dont

remote swallow
#

your server has never ran then

polar forge
#

and its the server

young knoll
#

Papers new performance feature: No logging

polar forge
#

Nop it doesnt exist

#

Latest.log

drowsy helm
#

Where are you looking

#

What directory

polar forge
#

logs in minecraft directory

#

and ive searched in my whole pc

drowsy helm
#

Wot

polar forge
#

it literally doesnt exist

drowsy helm
#

It’s on the server

grim hound
#

can you change the text size of a text display?

drowsy helm
#

Not minecraft dir

thorn isle
#

you can change the scale of the text display

polar forge
#

I did it

#

Heres the error

thorn isle
#

that's half of the error again

#

you are missing the caused by: block

polar forge
#

no thats the whol

#

eit doesnt exist the caused by

thorn isle
#

or no nevermind

#

Cannot execute command 'tptomap' in plugin TeleportToPlugin v2.0 - plugin is disabled

#

says it on the tin

#

look at your logs; your plugin ran into an error when loading

young knoll
#

Which likely means it failed to load

polar forge
#

maybe bc of the main class

#

its literally perfect i dont understand why

young knoll
#

Then read the logs

polar forge
#

it doesnr give me info

remote swallow
#

scroll up

#

right at the top

polar forge
#

cannot execute command

#

no shit i know

remote swallow
#

keep scrolling up

#

its at the server start

polar forge
#

wdym

remote swallow
#

your plugin failed to start

#

go and find the error that caused it

polar forge
#

i know it failed to start

remote swallow
#

go and find the error

#

its near the top of the latest.log file

polar forge
#

where would the error be

thorn isle
#

at the start

#

ctrl-f

#

or like read through it

polar forge
#

Epic i know, i knew it even without looking at the error code

#

just by looking at /plugins

remote swallow
#

so go and find the error

polar forge
#

where would usually be the error

remote swallow
#

it has an error that causes it to not load, find it and you resolve it and make the plugin start

remote swallow
#

inside of the latest.log file near the very top

#

where plugins load

thorn isle
#

scroll all the way to the top of the logs

#

then read it one line at a time

remote swallow
#

inside of your server, inside of the logs folder

polar forge
#

you guys dont understand

thorn isle
#

continue reading it until you find the error

polar forge
#

guys forget the error log

thorn isle
#

there is no error log

#

there is latest.log

polar forge
#

Forget it

thorn isle
#

and the error is in the latest.log

polar forge
#

i dont care what the log says bc it isnt helpful at all

#

i know it doesnt get loaded

thorn isle
#

it is because it tells you why the plugin failed to enable

remote swallow
#

The startup error which causes this error WILL be helpful

polar forge
#

no need to log to say to me

thorn isle
#

we are NOT talking about the error you already sent

#

there is ANOTHER error

polar forge
#

I MEAN, where would the error be IN MY CODE

#

Main class?

thorn isle
#

DEPENDS ON THE ERROR

remote swallow
#

we do not fucking know you have not given us the error

thorn isle
#

so find it and LETS SEE IT

remote swallow
#

listen to what we are saying or go and fix it on your own

polar forge
#

u guys are fixed with the log

#

im saying dont look at the lohg

eternal oxide
#

No one can tell you unless you FIND the ERROR in your LOG as it will TELL US what caused the plugin to fail

polar forge
#

what does the log tell u about my code

#

lets see

remote swallow
#

nothing

polar forge
#

if u guys indeerstand it

#

see?

#

is it helpful the nfor u?

eternal oxide
#

ok, it was sun spots

remote swallow
#

you gave us an error whcih literally says "plugin is disabled" which means your plugin failed to start, this means near the top of your log there is SECOND error telling you why the plugin failed to start

thorn isle
#

you haven't sent us the error

remote swallow
#

there is 2 errors, you gave the later one which means nothing to us

polar forge
#

which error should i send

#

there isnt any error in my code

thorn isle
#

you absolute clown

remote swallow
#

its in the log file

eternal oxide
#

error in LOG

thorn isle
#

okay

#

lets do this

remote swallow
#

honestly cannot be fucked with this anymor

thorn isle
#

send your entire latest.log

polar forge
#

i dont understand

thorn isle
#

can you manage that?

#

copy the whole thing

polar forge
#

there is also chat

eternal oxide
#

I'm sure you are trolling now

polar forge
#

ElgarL im not

remote swallow
#

@young knoll please help

smoky anchor
#

Then send the whole log

thorn isle
#

send your latest.log

polar forge
#

i dont get what u are guys sayin

eternal oxide
#

yes you do

polar forge
#

i dont

sonic goblet
#

💀 y’all are crashing out

eternal oxide
#

find the server latest.log, find the first error in there which mentions your plugin

remote swallow
#

on your server where your server.jar is, you have a logs folder, inside of that folder is a file called latest.log put that on a https://paste.md-5.net

eternal oxide
#

simples

slender elbow
#

y'all still going with this lmao

polar forge
#

there isnt any cause by line if u guys mean this

remote swallow
#

okay im done

polar forge
#

as i mentioned before

remote swallow
#

back to the block list

eternal oxide
#

we want the FULL error

slender elbow
#

send the entire log file

polar forge
#

that is the full error

slender elbow
#

just drag and drop the file

thorn isle
#

send the entire log file

#

we are not talking about "caused by"

#

there is a separate exception message further up in your logs

slender elbow
#

it's been 50 minutes lmao

thorn isle
#

since you can't seem to find it, send the entire log and someone will try finding it for you

#

do you need help finding your log file?

remote swallow
#

if they cant even find a log file idk if they should be developing plugins

polar forge
smoky anchor
#

no fucking way
you managed to send the log

eternal oxide
#

missing command in plugin.yml

remote swallow
#

woah whats that on line 112

eternal oxide
#

throwing an error in onEnable causing your plugin to not load

polar forge
#

u guys dont believe me

thorn isle
#
[21:42:41] [Server thread/ERROR]: Error occurred while enabling TeleportToPlugin v2.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.egitto.teleporttoplugin.TeleportToPlugin.getCommand(String)" is null
    at TeleportToPlugin-2.0.jar/me.egitto.teleporttoplugin.commands.DelMapCommand.<init>(DelMapCommand.java:15) ~[TeleportToPlugin-2.0.jar:?]
    at TeleportToPlugin-2.0.jar/me.egitto.teleporttoplugin.TeleportToPlugin.onEnable(TeleportToPlugin.java:16) ~[TeleportToPlugin-2.0.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:280) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:657) ~[paper-1.21.4.jar:1.21.4-207-1a7288a]
    ...
#

see how there is another error?

remote swallow
#

holy shit there was a startup error that is crazy

#

who wouldve guessed

thorn isle
#

and let's see what it says @polar forge

#

Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.egitto.teleporttoplugin.TeleportToPlugin.getCommand(String)" is null

#

return value of getCommand is null

#

on line 15 of DelMapCommand.java

#

the error tells you exactly what the issue is and where it is

remote swallow
#

(usually means your command isnt in plugin.yml)

polar forge
#

it is in my plugin

#

u guys thought i was trolling

thorn isle
#

we were asking you to send this error

#

now since we know what the error is and which files are related, let's see the DelMapCommand class

#

and your plugin.yml

polar forge
#

delmap