#development

1 messages ยท Page 116 of 1

sterile hinge
#

but if you only want to replace substrings, you should use replace

grim oasis
#

ye i will be

#

idk why i didn't do that

#

๐Ÿคทโ€โ™‚๏ธ

flint pine
#

Is there an admin online to re-verify my plugin, Glare disabled it at my request due to it having a breaking bug and ive got round to update it and it is all sorted now? Looks like trying to pull it ingame downloads an old version which is odd, not sure if thats something you can fix aswell, but the 1.4.2 release on gh/eCloud work fine from all my testing
https://api.extendedclip.com/expansions/floodgate/

mental cypress
#

I gotchu

flint pine
#

Showing as offline i see, thanks ๐Ÿ™‚

mental cypress
#

You can always DM me. I usually am around.

#

Verified now. Should show up in the next hour or so in-game.

flint pine
#

Excellent thanks ๐Ÿ™‚ also noticed the date ingame was showing as published 1.3 18 days ago which is very wrong, not sure why that was

mental cypress
#

Not even sure how it's showing in-game to download from since it wasn't verified unless you enabled the config setting in PlaceholderAPI.

flint pine
#

I did

mental cypress
#

Was 18 days ago when I unverified it?

flint pine
#

ah maybe

mental cypress
#

Might be an internal backend bug I need to look at, but it's not game breaking at least.

flint pine
#

looks like it

mental cypress
#

Looks like it's already showing in-game but the cache will overturn and show everywhere over the next hour or so.

#

Feel free to DM me if you need anything else

ocean raptor
#

how can i send data via proxiedplayer to server?

ServerInfo#sendData sends the data via first element of ProxyServer.getInstance().getPlayers(), not the specified player
ProxiedPlayer#sendData sends the data to player's client, not to the server

#

i am just going to specify the player in the data

#

i guess there is no other way

dense drift
#

color?

#

ah

queen plank
#

Yeah, I was thinking of something like that, would like to avoid making a server for it tho. Would have preferred dc or smth else. And as for modifying the resource code, that is always something I have to worry about, can't really do much about that.

torpid raft
#

nothing jumps out at me as super dangerous about this, but that doesn't mean there are no hidden flaws

#

doing it this way also means that you would not be able to use discord account ids as the plugin key - instead consider issuing a (very long, like in the kb) base 64 encoded key to each buyer

#

this actually seems like a pretty cool project idea, so i'll steal it from myself and see if i can make a library for it

torpid raft
#

also someone just mentioned this but you can host a small server for free forever through oracle, so don't give up on your hope of having a verification server
#off-topic message

dusky harness
#

note that oracle might just terminate it in like a year ๐Ÿฅฒ

#

happened to a lot of ppl here

torpid raft
#

oh oof

#

do they terminate their 'forever free' tier? they do mention they have stuff that's free for 12 months, that would make sense to terminate after a year

dusky harness
#

ye it was the free tier

#

thats also why slimjar was down for weeks

torpid raft
#

big oof

pure crater
#

for artifact hosting i use jfrog artifactory now

#

free tier

dusky harness
queen plank
torpid raft
#

sure thing, good luck with your endeavor ๐Ÿ‘

queen plank
#

Thank you, I'll probably need it lmao

#

Making a db isn't hard, using it is (never used one in a plugin b4)

torpid raft
#

wait

#

you're not directly connecting to a database you host through your public plugin right

#

right???

dusty frost
#

DRM ๐Ÿคฎ

torpid raft
#

droopy roopy monke

dusty frost
#

I didn't really read much above, but I hope you have a really good reason for this DRM, and even if you do, that's not enough

#

all DRM does is harm people who genuinely use your service

torpid raft
#

i dont think he has anything that would qualify as such for you

#

but i think making a good drm is an interesting technical challenge

#

so ๐Ÿคทโ€โ™‚๏ธ

dusty frost
#

How?

#

I could set up a key verification service in like 5 minutes

torpid raft
#

well if you look at some of his constraints

#

he wants to avoid hosting server if possible

dusty frost
#

wait what lol

torpid raft
#

so you need to do something like what i described and rely on github or some other public point of reference

dusty frost
#

well yeah that does actually sound interesting from a cryptography and secret-keeping kind of perspective

torpid raft
#

right??

dusty frost
#

still wouldn't recommend actually implementing, especially for a minecraft plugin

torpid raft
#

yeah seems kind of pointless

#

actually i remember seeing an anticheat plugin a while ago that had some drm

#

they had their own server that used ML to decide if players on whichever servers were cheating in real time

#

since that was a subscription based thing drm sort of makes sense there

dusty frost
#

wow, that sounds overkill

#

i mean, I wouldn't consider that DRM if you're just paying to use the server

torpid raft
#

hmm thats true

#

i guess that literally is a subscription at that point

dusty frost
#

yea lol

#

doesn't matter to the person running that server if you distribute copies of their clientside plugin

echo igloo
#

Hey, I'm trying to make an setspawn and spawn commands but I'm struggling with the config part. Maybe can someone help me?

SetSpawn CMD

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(sender instanceof Player p){
            if(p.hasPermission(Config.getString("setspawn-perm"))){
                plugin.getConfig().set("Spawn.world", p.getLocation().getWorld().getName());
                plugin.getConfig().set("Spawn.x", p.getLocation().getX());
                plugin.getConfig().set("Spawn.y", p.getLocation().getY());
                plugin.getConfig().set("Spawn.z", p.getLocation().getZ());
                plugin.getConfig().set("Spawn.yaw", p.getLocation().getYaw());
                plugin.getConfig().set("Spawn.pitch", p.getLocation().getPitch());
                p.sendMessage(Colors.color(Config.getString("setspawn-msg")));
                Sounds.success(p);
            }else{
                Config.noPermission(p);
            }
        }
        return true;
    }
#

Spawn CMD

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(sender instanceof Player p){
            if(p.hasPermission(Config.getString("spawn-perm"))){
                if(!plugin.getConfig().contains("Spawn",false)){
                    p.sendMessage(Colors.color("spawnnotset-msg"));
                    Sounds.fail(p);
                }else{
                    World world = Bukkit.getWorld(Config.getString("Spawn.world"));
                    double x = Config.getDouble("Spawn.x");
                    double y = Config.getDouble("Spawn.y");
                    double z = Config.getDouble("Spawn.z");
                    Float yaw = Config.getFloat("Spawn.yaw");
                    Float pitch = Config.getFloat("Spawn.pitch");
                    Location loc = new Location(world,x,y,z,yaw,pitch);
                    System.out.println(loc);
                    p.teleport(loc);
                    p.sendMessage(Colors.color(Config.getString("spawnteleported-msg")));
                    Sounds.success(p);
                }
            }else{
                Config.noPermission(p);
            }
        }
        return true;
    }
#

It's not overwriting the config file and If you guys know a way to check if the List is empty that'll help

torpid raft
#

are you calling plugin.saveConfig();

echo igloo
#

oh

dusty frost
#

well, I wouldn't recommend using YAML for data storage like this period, this sounds like a job for JSON and serialization

#

but yeah what Ivan said ^

echo igloo
#

I don't know how to use JSON

dusky harness
#

(also spigot has a builtin Location serializer)

dusty frost
echo igloo
torpid raft
#

you also seem to be saving each player's spawn data to the same spot in the config

echo igloo
#

without writing it in a file?

dusty frost
torpid raft
#

like you dont differentiate based on player, so you end up with a shared field which is probably not what you want

dusty frost
#

He means that the Spigot API has a way to serialize locations easily

torpid raft
#

lets say i have Bob and Alice

#

Bob sets his spawn

echo igloo
#

sets the spawn for everyone

torpid raft
#

you set the x,y,z,etc values in your config to that of bobs new spawn

#

wait

#

ah for some reason i was totally thinking of this as homes

#

ignore me

dusty frost
#

lmao

echo igloo
#

Yeah

#

I was wondering why you said that haha

dusty frost
#

to be fair, I kinda was too

echo igloo
#

The code is messy?

torpid raft
#

it's a little messy but also i just cant read

dusty frost
#

Moderately, and I just presumed you were looking for more

#

the method of storage matters less when it's a single location, I suppose

echo igloo
#

I don't know why it's so complicated to make an setspawn command

torpid raft
#

you could break things up a little bit to make it more readable

#

make setSpawn(...) and getSpawn() methods that interact with the yaml config so the command methods aren't clogged up

dusky harness
echo igloo
#

why it's changing my whole config?

#

when I save the config?

torpid raft
#

wdym?

echo igloo
#
#---------------------------------------------------------------------
#                                MESSAGES
#---------------------------------------------------------------------
no-permission: "&cSorry, &7You don't have the right permission to execute this command."
setspawn-msg: "&a&lSUCCESS! &7You've set the spawn successfully!"
spawnnotset-msg: "&c&lERROR! &7There is no spawn set in the server."
spawnteleported-msg: "&a&lSUCCESS! &7You've been teleported to spawn!"

join-format: "&8[&a+&8] &a%player%"
firstjoin-format: "&8[&a+&8] &a%player% Has joined for the first time!"
leave-format: "&8[&c-&8] &c%player%"

#---------------------------------------------------------------------
#                              PERMISSIONS
#---------------------------------------------------------------------
setspawn-perm: MegaWallsFFA.admin.setspawn
spawn-perm: MegaWallsFFA.spawn

#---------------------------------------------------------------------
#                              HELP MESSAGE
#---------------------------------------------------------------------

#---------------------------------------------------------------------
#                              LOCATIONS
#---------------------------------------------------------------------
Spawn:
  world:
  x:
  y:
  z:
  yaw:
  pitch:
#---------------------------------------------------------------------
#                              LOGS SETTINGS
#---------------------------------------------------------------------
joinleft-log: true # Enable/Disable Messages Logging to discord with webhook
joinleft-url: "" # The Channel Webhook URL
#

That's my original file

torpid raft
#

ah you're wondering why the comments get removed

echo igloo
#
# 
#                                SETTINGS
joinleft: true
firstjoin: true
joinleft-actionbar: true
joinleft-title: true
joinleft-hover: true
no-permission: '&cSorry, &7You don''t have the right permission to execute this command.'
setspawn-msg: '&a&lSUCCESS! &7You''ve set the spawn successfully!'
spawnnotset-msg: '&c&lERROR! &7There is no spawn set in the server.'
spawnteleported-msg: '&a&lSUCCESS! &7You''ve been teleported to spawn!'
join-format: '&8[&a+&8] &a%player%'
firstjoin-format: '&8[&a+&8] &a%player% Has joined for the first time!'
leave-format: '&8[&c-&8] &c%player%'
setspawn-perm: MegaWallsFFA.admin.setspawn
spawn-perm: MegaWallsFFA.spawn
Spawn:
  world: world
  x: -2569.0295060817352
  y: 54.5
  z: 744.5529914894588
  yaw: -89.882774
  pitch: 6.8998375
joinleft-log: true
joinleft-url: ''
#

and that's what happened

dusty frost
torpid raft
#

that's just something snakeyaml does, i don't like it either but i haven't seen any easy ways to get around it

dusky harness
echo igloo
#

dang

#

so I have to save it in json

dusky harness
#

or u can save in separate yml file

dusty frost
#

^

torpid raft
#

i saw someone do a lil trick where they saved the comments as values in the yaml file

#

so that they don't get erased

echo igloo
#

Okay

#

I'll do an separate file

#

Thanks guys

torpid raft
#

like

spawn-perm-comment: "the permission to use /spawn"
spawn-perm: "perm.perm"
dusty frost
#

hate that

torpid raft
#

it's big brain

#

real comments are definitely better but the ingenuity is to be respected

lyric gyro
#

spawn perm, or, to abbreviate, sperm

primal otter
#

haha.... ha... very good humor...........

lyric gyro
#

Yes

bright pier
#

I am currently getting an error for UnknownFormatConversionException when trying to use the setFormat method within the AsyncPlayerChatEvent. I've used a debug logger message and nothing looks out of the ordinary so I am not exactly sure why I would be receiving the error. I know about String.Format being needed, and it's what I have been following, but for some reason it is still not working.

The Error: https://paste.md-5.net/aropimaxoj.bash
The Code: https://paste.md-5.net/icokofivak.js
Debug Message: [14:59:36] [Async Chat Thread - #0/INFO]: [Stylizer] %s >> %s
Chat Format From Config: "%displayname% #14abc9>> #6b6b6b%message%"

I have tried using %1$s and %2$s as well as the generic %s but can't seem to find what is actually using the error. Any help would be appreciated as this error is annoying me

river solstice
#

hey, uh, how does one parse player skull textures?

#

where the material goes something as follows basehead-[some-uuid]

river solstice
#

more complicated than I thought

#

so basically it's pulling data from the minecraft profiles, getting the texture and applying it to the skull?

dense drift
#

yea, I guess

river solstice
#

aight, coo

#

also, thanks for the gui api

#

was looking for a decent one

#

lol

dense drift
#

๐Ÿ˜‰

torpid raft
rustic matrix
#

Does anyone have a custom enchant skript?

torpid raft
#

you should not be connecting to your private database with your public plugin since people can dig around and find your database credentials

spiral prairie
#

yeah

rustic matrix
#

?

spiral prairie
#

thats the worst thing you could possibly do

torpid raft
#

and then they can do all sorts of evil stuff

spiral prairie
#

make them use their own

torpid raft
#

not about you spexz dont worry

rustic matrix
#

ok

torpid raft
spiral prairie
#

yes

#

rest apis are easy to make

#

especially if you go with enterprise systems like Micronaut or Spring

torpid raft
#

spring is a very popular choice ^

plucky delta
#

java.lang.IllegalStateException: Asynchronous getNearbyEntities!

Me getting this error while doing this List<Entity> nearbyEntities = (List<Entity>) EntityArea.getWorld().getNearbyEntities(EntityArea, 15, 15, 15); HashMap<String, Double> rangeplayers = new HashMap<>(); for (Entity entity : nearbyEntities) { if (entity instanceof Player) { if (entity != player) { Double distance = Double.parseDouble(String.format("%.2f", player.getLocation().distance(entity.getLocation()))); rangeplayers.put(((Player) entity).getUniqueId().toString(), distance); player.sendMessage(entity.getName() + " is " + distance + " blokken van je verweg"); } } }

spiral prairie
#

it literally says it in the error

queen plank
# torpid raft define proxy

Cloudflare. I currently have my server network protected by cloudflare and imagine it won't be to bad to add a db to it

plucky delta
#

Any alternatives?

spiral prairie
plucky delta
#

Under it it will upload it

spiral prairie
#

what

plucky delta
#

well

#

under this piece of code

#

I will send a webrequest to upload the information

#

if i do that, then theres a big lagspike

#

everytime i do it

#

so i think async will fix that

pure crater
#

supply a future when you send the information

#

the entities looping can be on the main thread, but you can send the info async

#

and just supply whatever information you need to supply

dusky harness
#
// async code - ExecutorService, runTaskAsynchronously, etc
Bukkit.getScheduler().runTask(plugin, () -> {
    Collection<Entity> nearbyEntities = EntityArea.getWorld().getNearbyEntities(EntityArea, 15, 15, 15);
    // etc
});
#

or that

#

ye

#

ยฏ_(ใƒ„)_/ยฏ

pure crater
#

it schedules to the next tick iirc XD

dusky harness
#

he already has it async

#

so thats how u get it back sync

pure crater
#

yea that works too

dusky harness
torpid raft
queen plank
#

I did not think abt that

#

The shit security on mysql

torpid raft
#

i mean its not just bad security

#

more like

#

you are literally giving your plugin the password

#

since you want to connect to the db

#

that is bad

queen plank
#

Guess I'll have my server look up the entries in the database and respond, not have the plugin connect to the db directly.

torpid raft
#

thats a much more reasonable thing to do

queen plank
#

Yup yup

#

Thank you!

#

That could have gon real bad

#

lol

torpid raft
#

yes

#

very

#

in a perfect world you would make your api server standalone though

#

so that it wont go down if your server goes down

#

and so you can scale it independently

#

or wait maybe you wanted to do that from the start

queen plank
#

That seems reasonable. I may have some old server computers, from before my mc network upgrade, to handle it.

torpid raft
#

i just read server as mc server

queen plank
#

What do you mean? Confusion

torpid raft
#

i thought you meant you would have your minecraft server respond to the api calls

queen plank
#

Ohhh

#

Nononon

torpid raft
#

as in you would have a plugin host it

#

ok good

spiral prairie
#

no

queen plank
#

My server as in the computer that handles my server network

spiral prairie
#

just make a quick Rest API with lets say Micronaut

torpid raft
#

you can have your api server on the same machine as your network that part is fine

spiral prairie
#

yeah

torpid raft
#

but if you have some low powered machine you want to use instead of your beefy mc network machine that might be a better use of resources for you, but thats all up to you and not critical

plucky delta
sharp cove
#

Can someone help me?

#

I do not get what is wrong

queen plank
#

How many rows does the inventory have? Are they both of the same size?

sharp cove
#

5 rows

#

i think so?

queen plank
#

In that case, 45 is too much

#

It goes from 0 to 44

sharp cove
#

omg you're right

#

this helps me so much

#

thank you my friend

queen plank
#

Np lol

spiral prairie
#

java counting BigBrainTime

sharp cove
#

nahh

#

didn't count the rows right

queen plank
#

I've done that mistake too much making GUIs lmao

sharp cove
#

Hahahaha

loud sorrel
#

Hey I'm having an issue where I'm importing WorldGuard just fine but when I go to compile, maven says it cant access one of its classes. It's imported as a repo and depend in my pom. And suggestions?

sharp cove
#

That explains a lot

sharp cove
#

To the project *

queen plank
#

Hmm?

#

Aren't they using Maven?

loud sorrel
#

No

neat pierBOT
#
Hey son,

This is my step ladder. I never knew my real ladder.

loud sorrel
#

Nahhh gradle stinks lol

sharp cove
spiral prairie
#

/j

wheat carbon
sharp cove
#

Just add the .jar in the project

spiral prairie
#

whoops

#

a bit too offensive

loud sorrel
#

The only modules I have are the ones maven added from the pom

loud sorrel
#

yeah

loud sorrel
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โ€ข HelpChat Paste - How To Use

sharp cove
#

and that works for me

spiral prairie
#

noo

queen plank
#

It does work. But use maven

spiral prairie
#

whyy

loud sorrel
spiral prairie
#

youre evolving, just backwards

sharp cove
spiral prairie
#

no

queen plank
loud sorrel
#

Yes I just added the correct version and still nothing

#

@sharp cove I need to add it w maven

queen plank
#

No?

sharp cove
#

oh lol

#

i always do that

#

since a error that he is getting i got

loud sorrel
#

You're not supposed to have to do that

sharp cove
#

it works for me

#

then its fine (for me)

queen plank
#

It works, but you shouldn't do it.

sharp cove
#

okey

queen plank
#

I'm not really great with Maven, but it looks fine to me. I honestly have no clue

#

Can we see the entire error message?

loud sorrel
#

"cannot access com.sk89q.worldguard.WorldGuard"

queen plank
#

Or is it in the IDE

#

Oh

loud sorrel
#

unfortunately that's all i got

sharp cove
#

Wait its WorldGuard

#

I had some trouble with that too

loud sorrel
#

it's not the ide bc i can do alt-enter and import it no problem

sharp cove
#

But it was a long time ago, don't know what it was

loud sorrel
#

yeah

queen plank
loud sorrel
#

idk, i got it from their website

queen plank
#

The latest on bukkit is 7.0.6

#

What MC version?

loud sorrel
#

im using spigot

#

1.16.5

queen plank
#

Use 7.0.5 WG

#

And 7.2.8 WE

loud sorrel
#

ok ill try those

#

That worked, but now i have the same thing for luckperms lol

#

I'm not using it tho so I'll just take it out

#

tysm!

queen plank
#

Np :))

#

Also, change WE to 7.2.8

loud sorrel
#

actually

queen plank
#

I didn't notice u could first

loud sorrel
#

sorry, i have the same issue for another thing

queen plank
#

Noice

loud sorrel
#

for ultraprisoncore

#

cannot access me.lucko.helper.plugin.ExtendedJavaPlugin

#

i thought it said luckperms but nvm

queen plank
loud sorrel
#

Oh wait one sec

#

i might know the issue

queen plank
#

Wait, why are you using Java 8?

loud sorrel
#

It worked!

#

Tysm

#

I forgot I removed the depend when I was messing w my pom

queen plank
#

Ahh

pulsar ferry
queen plank
#

That might be why it does not work then?

pulsar ferry
#

It's possible

#

That version works fine for me on Gradle though

queen plank
#

Huh...

#

Think they used Java 8 tho

#

Ig u are not

pulsar ferry
#

Oh yeah lmao that is actually the reason

#

His maven is setting Java to 8

#

That version of WG only works on 16+

queen plank
#

There it is

left galleon
#

Hi guys. I seriously need your help. I don't understand how to change a player's nametag prefix/suffix.

queen plank
#

With wat? Vault? "Over the head" nametag?

left galleon
#

yes over the head nametag

queen plank
#

player#setDisplayName

left galleon
#

It doesn't work

#

I just tried

queen plank
#

Oh wait

#

Over the head

left galleon
#

yeah

queen plank
#

player#setCustomName iirc

left galleon
#

and then I have to set CustomNameVisible?

#

or it is by default

queen plank
#

No clue tbh

#

Try

#

Ig it is true by default

left galleon
#

Nop it doesn't work

queen plank
#

You set setCustomNameVisible to true?

left galleon
#

yeah

queen plank
#

Idk then

tiny goblet
#

php-cgi.exe not found: Please ensure that configured PHP Interpreter built as CGI program (--enable-fastcgi was specified)

#

Help

left galleon
obsidian jackal
#

How would i go forwards coding a plugin that "removes hunger" or gives the player infinite saturation? I'm quite new to Java and minecraft development, and i need this for my server

brittle thunder
#

Anyone faced this issue when using the jlink gradle plugin to get a jfx executable image?

Two versions of module javafx.base found in {Project_Directory}\build\jlinkbase\jlinkjars (javafx-base-16-win.jar and javafx-base-16-mac.jar)
torpid raft
obsidian jackal
torpid raft
#

๐Ÿ‘

drowsy edge
#
@EventHandler
    public void onKill(EntityDeathEvent event) {
        Entity entity = event.getEntity();
        if (entity.getScoreboardTags().contains("pigkid")) {
            event.getDrops().add(new ItemStack(Material.BLAZE_ROD));
             event.getDrops().add(Main.lavacore());
        }
    }

I really honestly dont know why this is not working :/ its not adding the drops...
here is the mob:

Player player = (Player) sender;
                LivingEntity mob = (LivingEntity)player.getWorld().spawnEntity(player.getLocation(), EntityType.PIGLIN_BRUTE);
                PiglinBrute z = (PiglinBrute)mob;
                World world = player.getWorld();
                z.addScoreboardTag("pigkid");
                z.setMaxHealth(1000);
                z.setCustomName("ยง6General Pigkid");
                z.setHealth(1000);
                z.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 100000, 2));
                z.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100000, 2));
                z.isAdult();
#

i think his tags are getting reset but idk

torpid raft
#

z.addScoreboardTag("piglinos");
entity.getScoreboardTags().contains("pigkid")

drowsy edge
#

oh

torpid raft
#

did you want these to be the same

#

or

drowsy edge
torpid raft
#

okay

#

is there a reason you decided to work with scoreboard tags

drowsy edge
torpid raft
#

hmm

#

can you add a sysout inside the if (entity.getScoreboardTags().contains("pigkid")) { block, to see if it is being called at all

drowsy edge
#

k

neat pierBOT
sacred stirrup
#

Hello, I can't get the placeholder from the plugin DeluxeTags to work.
getting this error.
https://paste.helpch.at/sivipamuse

I use the chat plugin essentials chat.
Can someone help me?

hushed badge
#

update placeholderapi

sacred stirrup
#

thank you, my problem is resolved.

trail burrow
#

I use IntelliJ and would like to see what my plugin is doing after I run a command, since it don't seem to do what I think it should. There must be a line that it hangs up on without an error

wooden loom
trail burrow
#

none of the log messages got sent to the logs

wooden loom
#

Then it goes wrong at the start ๐Ÿ˜‚

trail burrow
#

yes many other things work fine just not the check on island levels

iron pulsar
#

Anyone know why this check might not work when breaking wheat/carrot/potato crops?: BlockBreakEvent

if (event.getBlock().getBlockData() instanceof Ageable) {
```I've used the block import as well
shell moon
#

isnt it getState() ? (just saying, didnt use that in a long time)

iron pulsar
#

doesn't work either, but I dont think that works for crops tho

shell moon
#

getBlockData should work

#

if its not returning, then probably not a Ageable

#

getState().getBlockData() instanceof Ageable? Kappaclown

iron pulsar
#

Nope, neither - and Wheat/Potatoes/Carrots are ageables tho

lyric gyro
#

make sure you're importing the right Ageable interface

#

cuz there are two, one for entities and one for block datas

#

datas think

iron pulsar
#

yep I am import org.bukkit.block.data.Ageable;

#

in the end it'll be such a stupidly simple solution over which I slammed my head against the desk soooo many times...

#

I just cant annnyyymoorreee some one please help me out of my misery xD

#

solved it, thanks tho

graceful juniper
#

Couldnt u just instanceof Crops? Havent done it in a bit

prisma briar
#

If I mount an entity using packet, does the server recognize that I'm mounting the entity or as the passenger of the entity? Like does Entity#getPassengers will be empty?

leaden sinew
prisma briar
#

Let me explain to you a little bit of what I'm trying to do, basically I want to make teleportation with passengers possible, and I heard that's possible with just NMS so I'm trying to figure it out and all this time I'm using EntityLiving#startRiding, would It make any difference If I'm using PacketPlayOutMount to mount instead using that method?

tame orbit
#

Hey so Iโ€™m going to create a plug-in that allows players to block people from entering their plot. Iโ€™m thinking of using the towny Api and flinging the players back when they enter. Iโ€™m just not sure how I should have the data stored. Should I just store the plot coords and the list of players blocked in a yml file? Do plots have an id or anything? Thanks

prisma briar
tame orbit
#

So if a player stands in their plot and does /plot block <player> how should I save the plot and the banned player to be used in the future

prisma briar
tame orbit
#

I was thinking a yml file like

plot-id:

  • player-uuid
prisma briar
#

Yeah you should store the owner's uuid, I think it's good.

#

Since a player can have multiple plots afaik.

tame orbit
#

Ok, but do you know if a towny townblock has like a unique identifier I can store or what

prisma briar
#

I don't know

tame orbit
#

Oh wait

#

It looks like thereโ€™s plot metadata

#

The wiki says I can store custom metadata in the townblock

#

I will look at that

prisma briar
#

That's very useful.

#

You can store the blocked player's uuid inside that metadata.

tame orbit
#

Yea

leaden sinew
prisma briar
leaden sinew
#

Are the passengers packets?

prisma briar
#

I'm using the EntityLiving#startRiding method to make the entity ride player.

leaden sinew
#

Oh well if you switch to packets it may work, in a plugin I recently made both the entity and setting passenger was with packets, and despawning and respawning the entity on teleport worked

prisma briar
#

Ah, very happy to hear that!

#

I've been searching this solutions for months.

leaden sinew
#

I can send the GitHub link to the plugin I made so you can see

prisma briar
#

Are you using ProtocolLib?

leaden sinew
#

Yeah

prisma briar
#

Well, I'm not. To modify the passengers, should I use reflection?

leaden sinew
#

You can just send regular packets

#

You donโ€™t really need reflection

#

You can just make a bunch of interfaces for different versions

#

And then use one depending on the server version

prisma briar
#

There is no method to set the passengers sadly, well it has but it requires PacketDataSerializer.

leaden sinew
#

Wdym?

prisma briar
#

The PacketPlayOutMount class.

leaden sinew
#

Iโ€™m pretty sure you just send the packet right?

prisma briar
#

Well, I haven't set the passengers yet, so it's just send nothing basically.

leaden sinew
#

Doesnโ€™t the constructor take the passengers? Or is that not how it works?

prisma briar
#

That's the player's entity I think.

leaden sinew
#

Oh yeah

#

One sec

#

Iโ€™m not sure why there isnโ€™t an option for passengers in the class you sent

prisma briar
#

That's the same packet I think.

leaden sinew
#

Maybe you can add fake nms passengers with the same ID to the nms player?

#

Is there any reason you donโ€™t want to use ProtocolLib?

prisma briar
#

At first I don't understand how it works, but the plugin is already working on 3 different version, so If I want to switch to ProtocolLib I need to do a lot of changes, that means consume a lot time also.

leaden sinew
#

I guess you might be able to use reflection to manually set the entity IDS in the b[] field

#

Can you not set data in the PacketDataSerializer class?

#

Could you actually send that class? Iโ€™m not on my computer right now

prisma briar
#

What class?

#

The PacketDataSerializer?

leaden sinew
#

Yeah

prisma briar
leaden sinew
#

I hate obfuscation lol

#

Reflection might be your best bet if you donโ€™t want to switch to ProtocolLib

prisma briar
#

Alright, I'll read some tutorial how to do Reflection, thanks for your help!

leaden sinew
#

No problem, good luck! If you want to see how I did it with ProtocolLib let me know.

prisma briar
leaden sinew
#

Looks good

#

The plugin I made was actually a backpack one lol

#

Looks like youโ€™re doing the same thing

prisma briar
#

Yup I just realized that xd

#

Does that makes us competitors? ๐Ÿ˜†

leaden sinew
#

Idk lol

prisma briar
#

When you try to teleport does the PlayerTeleportEvent got called?

leaden sinew
#

Yes

leaden sinew
prisma briar
#

Nevermind, It worked perfectly, thank you so much man.

#

You make me happy, really

leaden sinew
#

Youโ€™re welcome

#

It took me so long to get it to work too lol

prisma briar
#

I totally believe you xd. I've been searching for months but I got nothing.

formal locust
#

can anyone please tell me how to make player data system.
like make a method

PlayerData().addKills(player)
PlayerData().addDeaths(player)

and a database with hashmap

warm steppe
#

learn java

formal locust
atomic trail
#

What's the new thing in paper for this

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
graceful hedge
#

java tool chain 12434b1bf8604b228598a41d3936d2cd

noble grotto
#

whats a good representation of coding? Im making a drawing

noble grotto
spiral prairie
#

Symbol

#

Hard

winter nimbus
#

Hey what is best practice to save (and load) skyblock worlds if I have a big server. Since I would have multiple servers running where the person can play skyblock but he needs to have the same world on all servers

#

Lets say I have 3 servers with each 30 spots. I want if I make edits to my skyblock on server one, that server 2 would also have that same exact skyblock when I join that one

dusky harness
#

When you pick up an item from the inventory, and then PlayerInventory#clear, it doesn't remove that item... so how do I remove that item?

#

it allows players to bring items from one round to the next :/

atomic trail
#

Is it just



java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(16)
    }
}
broken elbow
#

pretty sure they give an example on their github page as well but I think that's right iirc

winged pebble
dusky harness
#

ty, ill try it out :)

#

Player#updateInventory doesn't seem to work :(

obsidian jackal
#

Is there a way to check Material of any shulker box color? or should i just check for all the colors? I want to disable opening shulkers, maybe there is another way to do it?

#

I thought about just Material.SHULKER_BOX, but that is just the default purple one right

winged pebble
obsidian jackal
#

also, is there a similar method of doing this for beds?

atomic trail
#

Getting this error when building using shadowJar

> Task :shadowJar FAILED
ex
org.gradle.api.GradleException: Could not add file 'C:\Users\45512\Desktop\JAVA\plugins\build\classes\java\main\net\valdemarf\parkourplugin\commands\Restart.class' to ZIP 'C:\Users\455
12\Desktop\JAVA\plugins\build\libs\ParkourPlugin-1.0-SNAPSHOT-all.jar'.

Never seen it before and can't find a solution on google

#

This should be correct?

atomic trail
#

Oh wait doesnt this mean invalid JDK version? Unsupported class file major version 60

dense drift
#

I think you need a newer version of shadowJar, 7.0.0 probably

atomic trail
dense drift
#

Ye

atomic trail
#

Works now, thx a lot

#

Ummm so which one is the actual useable plugin?... lol

#

I'm guessing the top one but yeah

dusky harness
#

-all

#

@atomic trail

#

bottom one

atomic trail
#

Oh, well, thanks

pulsar ferry
#

In that case it doesn't matter they are the same
If you are shading things then it'd be the -all

atomic trail
#

Or well I'm supposed to lol

pulsar ferry
#

Well, you aren't, so might wanna check that out

#

Can you send your build.gradle?

atomic trail
#

Well I am getting an error so yeah lol

pulsar ferry
#

compileOnly doesn't shade, use implementation

atomic trail
#

oh.. It just said compile in the guide so I assumed it meant compileOnly

pulsar ferry
#

compileOnly means it only needs it at compile time

atomic trail
#

Oh yeah, and since ACF isn't in the directory at runtime it has to be implemented ig

#

It doesn't really do anything as far as I'm aware

light ice
#

Is anyone here good with the Essentials API?

neat pierBOT
#
FAQ Answer:
ยป Give the helpers some details
ยป Ask suitable questions
ยป Be polite
ยป Wait

Source

light ice
#

How helpful, it was a yes or no question..

#

Is anyone here good with the Essentials API? I am trying to use KitClaimEvent to get the kit's items' names, and replace them with the same names except run PlaceholderAPI through the names

pulsar ferry
light ice
#

I mean it's just basic conversation..

#

But yes, I explained my question further

broken elbow
light ice
#

I asked the question

broken elbow
#

yes I know. I was just meme-ing. I had to

spiral prairie
#

Blitz on its meme trip

broken elbow
#

yes sir. k. let's get out of here. his question is dissapearing. Mantice might want to ask again so the question is not lost

broken elbow
light ice
#

I don't know why they insist on making their API like this or just not adding PlaceholderAPI support, I mean, I saw last night they were planning to in a github post, but that was in 2018

dense drift
#

Papi support ๐Ÿคฃ ๐Ÿคฃ ๐Ÿคฃ yeah, good joke

#

Dont you want a discord module insted? ๐Ÿฅฒ

broken elbow
#

gaby pr or shut up

dense drift
#

Essentials is bad and cmi is not os, so I gotta use it ๐Ÿ™„

light ice
#

Yeah but CMI also charges for something that's basically Essentials lol

#

Definitely don't need all those extra features

dense drift
#

cant say essentials is very good but sadly, it is the only plugin available with such functions

broken elbow
#

well not really. you could use Skript and make your own plugin. that'll also be better than essentials ||/s :))))||

dense drift
#

what about you fuck off @broken elbow

broken elbow
dense drift
#

nah

warped thorn
#

@neat pier prefid

#

prefix

dense drift
#

=

broken elbow
#

/

neat pierBOT
inner valley
#

I get this error when my plugin loads

high edge
inner valley
#

On line 46 thiss is the code:

#

New bouwCommand(this);

#

And line 16 of the bouwcommand classs this is the codee

#

Public bouwCommand(Bouwpixel plugin) {
plugin.getCommand("bouw").setExecutor(this);
}

#

But idk whats wrong

pulsar ferry
#

Did you register the command in the plugin.yml?

inner valley
#

Omfg

#

I'm so dumb

#

And stupid

#

Thanks i try it

#

I've tried it but the same error pops up

broken elbow
#

don't use plugman

#

restart

#

also no /reload either

inner valley
#

Lol

#

I've plugman deleted

#

The same error pops up

#

Commands:
bouw:

#

This is my plugin.yml commands section

#

It works

#

Thx!

atomic trail
#

Does worldguard api not have a method for checking a player is within a specific region? Can't find it in the guide.

inner valley
#

I get this error when i pickup an item

neat pierBOT
inner valley
#

Code: public void pickupEvent(PlayerPickupItemEvent e) { Player p = e.getPlayer(); if (Bouwpixel.bouwers.contains(p.getUniqueId())) { e.setCancelled(true); if (this.COOLDOWN_pickup.contains(p.getUniqueId())) return; this.COOLDOWN_pickup.add(p.getUniqueId()); Bukkit.getServer().getScheduler().runTaskLater((Plugin)Bouwpixel.get(), () -> { if (p == null) return; this.COOLDOWN_pickup.remove(p.getUniqueId()); }, 100L); p.sendMessage(Utils.chat(Bouwpixel.get().getConfig().getString("interactions.items.pickup")));

broken elbow
inner valley
#

Wait i gonna upload him

#

This is the whole error

broken elbow
inner valley
#

Thx i'm gonna check it

winter nimbus
#

Hey I am stuck with an idea. I want to make sort of a skyblock-ish minigame. However think of it more as hypixels skyblock with an RPG element. However I am stuck at the thought how I would handle the worlds. Since I am not gonna do a server per person since it wouldn't be scalable.

I was thinking something along the lines of storing worlds in a blobstore, but this would have a lot of lag when loading in. Anyone know what's the best way to tackle this issue? The best way to manage saving and loading of a players island?

#

Keep in mind multiple servers are assigned to handle the skyblocks. ^

atomic trail
#

Does someone know why slf4j's logger doesnt work with "debug" in paper 1.17.1?

Only the top line gets printed to console

            LOGGER.info("INFO LOG");
            LOGGER.debug("DEBUG LOG");
icy shadow
#

because the debug logger isnt enabled by default

#

you have to change the logging config

#

which is a horrendous experience

#

that nobody deserves to go through

atomic trail
#

Oh lol, so only info and error works?

icy shadow
#

and warn

atomic trail
#

ah nice

icy shadow
#

iirc debug will go to the .log files

atomic trail
#

I guess I wont need more than that

icy shadow
#

but not console

atomic trail
#

Oh that's pretty nice ngl

winter nimbus
spiral prairie
#

maybe you can customise it a bit

#

but id wait for the rewrite

winter nimbus
#

Will look into it, maybe it could help me out big time

wild geyser
#

Hello i need help
How do i import the class location from Spigot API
my "extends JavaPlugin" is red
I added the dependancy

atomic trail
#

"board is null"

    public void updateDefaultBoard(FastBoard board) {
        board.updateLines( //Line 82
                "",
                "Players: " + getServer().getOnlinePlayers().size(),
                "",
                "Kills: " /* + board.getPlayer().getStatistic(Statistic.PLAYER_KILLS)*/,
                ""
        );
    }

Inside runnable

scoreboardManager.updateDefaultBoard(scoreboardManager.getDefaultBoard(player)); // Line 72

onJoin event

FastBoard defaultBoard = new FastBoard(player);
defaultBoard.updateTitle(ChatColor.BLUE + "Survival");
this.defaultBoards.put(player.getUniqueId(), defaultBoard);

error: https://paste.helpch.at/varovisepi.bash

atomic trail
#

Are you using gradle or maven

wild geyser
#

Intellj

atomic trail
#

well... Which build tool are you using

#

Not IDE

wild geyser
#

idk what that means

#

i installed intellj

#

created the project

broken elbow
#

he's probably not using any. just the things offered by IJ

atomic trail
#

Ye

wild geyser
#

its just red bro

#

i added the spigot.jar as a dependancy but it wont work

#

why would i need a build tool

#

also my module sdk is openjdk-17

#

idk if thats like

#

bad

atomic trail
wild geyser
#

idk i can't even get like the most basic thing to work

#

JavaPlugin is just red

#

i followed like 4 tutorials

#

its just red

atomic trail
#

Yes, it's because spigot isn't implementing correctly, not sure how to do this without a build tool. A build tool basically handles all this.

wild geyser
#

okay

#

idk im stuck

torpid orbit
#

What method should i use to take instance of the main class?

private static Main INSTANCE;
public static Main getInstance() {
        return INSTANCE;
    }
``` This is the easiest way i think but i have heard that using static like this is bad or using it in util classes where you use static alot? Is it bad practice or does it actually affect something else, like performance? I dont use static in util classes and is that good or should i switch to using static because it doesnt affect anything or does it?
spiral prairie
#

Util classes

#

Are there to be static

#

Because they should serve utilities not bound to a class

#

And for the main, you just pass it around with dependency injections

neat pierBOT
light ice
#

Anyone know how to cancel moving an item using 1-9 keys? I've canceled moving the item in the inventory, just doesn't cancel 1-9 keys for some reason, even though pretty sure it calls on the same event

wild geyser
#

Trying to learn Java and got a basic plugin set up that just shows starting and stopping in console.
Can someone code a command that I can put in my main.java that would like make /ping command (and answers to only that players "pong!"). This way I can understand more how commands work, thanks.

wild geyser
cinder forum
#
if (!(sender instanceof Player)) {
  Bukkit.getLogger.info("cmd is for players only!!!!!!!!")
  return true;
}

Player player = (Player) sender;

player.sendMessage("lol");
#

smth like that

dense drift
#

you are so close xdd

cinder forum
wild geyser
#

dont you need to use the

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)```
thing?
warm steppe
#

How can I

warm steppe
wild geyser
#

what is going on

cinder forum
# wild geyser dont you need to use the ```java public boolean onCommand(CommandSender sender, ...

yes you do
it should look like this
I recommend to learn Java basics (just basics, you dont need to be Java pro) before making Bukkit plugins

//commands/PingCommand.java
public class PingCommand implements CommandExecutor {
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if (!(sender instanceof Player)) {
      Bukkit.getLogger.info("cmd is for players only!!!!!!!!")
      return true;
    }

    Player player = (Player) sender;

    player.sendMessage("lol");
  }
}
//MainClassName.java
public void onEnable() {
    registerCommands();
}

private void registerCommands() {
    getCommand("ping").setExecutor(new PingCommand());
}
//plugin.yml
name: ...
version: ...
main: ...

commands:
  ping:
wild geyser
#

damn

warm steppe
lyric gyro
#

using libraries and frameworks is likely not the best idea when someone is just starting to learn all of this stuff with little java experience

broken elbow
#

jesus fucking christ @cinder forum. I'll start timing out if you don't stop with this spam

cinder forum
broken elbow
queen plank
#

When using a InventoryMoveItemEvent, is it possible to get the name of the inventory without using Inventory#getViewers?

#

I want to get the name of the inventory, but what if no one is looking in the inventory at that time?

lyric gyro
#

just compare the inventory instance with .equals()

#

don't rely on titles

queen plank
#

Does not that compare contents as well?

lyric gyro
#

no

queen plank
#

Wat

lyric gyro
#

it compares the (underlying) inventory instance

queen plank
#

Though, I want to compare the title. I have custom items, and a feature which blocks the movement of item to certain inventories, with a certain name if you wish.

#

So I need the title

#

Or can I do that with .equals()?

lyric gyro
#

does this feature function based on the title?

#

e.g. rename a chest and it works

lyric gyro
#

what what

queen plank
#

Confused

#

What do you mean?

#

Me dum dum

lyric gyro
#

I asked if your feature works/depends on the title being a certain one

queen plank
#

Ohh

lyric gyro
#

Like, e.g. renaming a shulker box

queen plank
#

Yeah, ig. If the plugin users wish to block the movement of items to only chests with a certain name they should be able to

#

Is what I want

#

And this goes for movement through hoppers as well

#

A.k.a. a player might not be watching the inventory

lyric gyro
#

Right, idk if the best way but a good one then is probably to store inventories in a Set<Inventory>, and then in the event check if Set#contains

queen plank
#

Could I not use a switch, check the block type. And use Dispenser, Chest or whatever to get the name?

lyric gyro
#

The thing is that inventories themselves don't have a title really

#

Bukkit is just garbage

queen plank
#

Cool

#

Is it just the inv view that has it?

#

The title

lyric gyro
#

yeah

queen plank
#

...

queen plank
queen plank
#

I mean, uhhhh

#

Ig I have to lol

#

Btw, should not InventoryMoveItemEvent activate when a player moves an item to another inventory?

torpid orbit
spiral prairie
#

But you get it form an instance, dont you

torpid orbit
#

ye i thnk so

spiral prairie
#

So it should stay there as an instance

#

And not get "statified"

torpid orbit
#

yeah

lyric gyro
queen plank
#

But Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another.?

#

Why...

lyric gyro
#

probably things like villagers "using" the inventory

#

idk

#

bukkit's inventory api is shite

queen plank
#

Indeed lol

#

Also, how tf does this print false System.out.println(Bukkit.createInventory(null, 9, "Hi").equals(Bukkit.createInventory(null, 9, "Hi")));?

torpid raft
#

the inventory class must not be overriding the .equals method

queen plank
#

Can you use == ?

#

Since they are equal I mean

torpid raft
#

definitely not

queen plank
#

No

#

Wait

#

I'm dumb

#

That only works for primitives

torpid raft
#

not quite

#

== checks to see if they reference the same spot in memory

queen plank
#

Ik

torpid raft
#

so you can technically use it on any objects

queen plank
#

I didn't say that

#

You saw nothing

torpid raft
#

lol

queen plank
#

No proof

torpid raft
#

the default .equals() method actually just uses == itself apparently, makes sense

queen plank
#

I forgot that using Bukkit.createInventory creates a new inv instance

torpid raft
#

ye

queen plank
#

So how do I know for sure that the clicked inv is from my plugin?

#

If .equals does not work I mean

#

Do I have to use titles

#

Or like items with nbt tags or smth

torpid raft
#

great question

queen plank
#

Cuz currently I am, and it is so dumb

#

And annoying to change titles

torpid raft
#

i've never had that issue because i always end up having a map of <uuid, inventory> or whatever, so i already know the inv is mine

queen plank
#

Aahh

#

I have a GUI tho

#

So...

#

I mean, I can compare the items in the clicked inv to the real GUI inv ig

#

But that still feels to dumb

#

Why doesn't the inv class override .equals, so dumb

torpid raft
#

i've been implementing a gui lib myself for abit

#

the solution i decided on was just to check if the item has a certain label whenever the player clicks on it in an inventory

queen plank
#

Plugin or lib?

#

Yeah, that is sort of what I do

#

But I check title as well

torpid raft
#

o

lyric gyro
#

Again, using equals compares the underlying inventory instance

queen plank
#

Why does this print false then System.out.println(Bukkit.createInventory(null, 9, "Hi").equals(Bukkit.createInventory(null, 9, "Hi")));?

lyric gyro
#

it doesn't check contents or titles

queen plank
#

Ohh

torpid raft
lyric gyro
#

keyword instances

#

they are two different inventories

torpid raft
lyric gyro
#

I'm 10000% certain

torpid raft
#

when i click to view the method code it takes me to the object class's .equals

queen plank
#

So to verify an inv, with different instances, you can't use .equals. Bummer, ig titles it is

lyric gyro
#

but the implementation

#

which is not api

torpid raft
#

i see

lyric gyro
#
@Override
public boolean equals(final Object obj) {
    return obj instanceof CraftInventory && ((CraftInventory) obj).inventory.equals(this.inventory);
}
torpid raft
#

๐Ÿ˜ฎ

lyric gyro
#

is this where we get the dev builds for Deluxechat?

pure crater
#

No

light ice
#

Hello, so I'm trying to cancel the movement of a diamond pickaxe in my inventory, I don't want to be able to move it from any slot that it's originally given in, I successfully canceled the ability to click on the pickaxe, and I've canceled the ability to shift-click the pickaxe, and using the number keys to move the item in my hotbar, but, I can still move the pickaxe to my inventory if it's in my hotbar, lets say the pickaxe is in slot 1, if I click 1 on an empty spot in my inventory, the pickaxe goes there, and then it's stuck there

#

Does anyone know how I can stop that from happening as well?

light ice
#

Hmm.. I have no idea how to implement this in my current code yet, lol

dusky harness
light ice
#

Ah

dusky harness
# light ice Ah

and so InventoryClickEvent#getHotbarButton would return a number from 0-8

#

0 being the first slot in the hotbar

#

and -1 if it's not a hotbar numkey action

light ice
#

Hmm, I have like, a ton of checks for specific items right, like, in my config I have each type of pickaxe with a true or false to determine if that should be enabled, and if it's enabled, it cancels the event

#

I guess what I don't understand is if I should check for what you're saying, inside that area, like under each pickaxe, or before it, and still check for each pickaxe.. I will try before it

#

Yeah ^ I'm completely stumped

light ice
#

Okay, so I've got it to cancel for every item, but I can't figure out how to check for a specific item

#
if (e.getClick() == ClickType.NUMBER_KEY) {
  if (e.getCurrentItem().getType().equals(Material.DIAMOND_PICKAXE)) {
    e.setCancelled(true);
  }
}

For example, this does not work

#

But, obviously, if I remove that second check then it does work

#

I am currently attempting to swap the if's

#

Didn't work

#

I don't get this

#

So the opposite of that works to stop pressing numbers on the item, but not to stop moving the item to an empty spot you clicked..

#

Okay well I know what I have to do but I don't know how to do it

dusky harness
#

and if the number's slot is the diamond pickaxe, then set cancelled

loud sorrel
#

does anyone know how to fix this error: The AureliumSkills API is not loaded yet with the AureliumSkills plugin?

#

pls ping me if u have a solution bc i gtg thx ๐Ÿ™‚

loud sorrel
#

anything?

spiral prairie
loud sorrel
#

i did

#

thats why im so confused

spiral prairie
#

oh

#

hm

loud sorrel
#

its added as a depend in plugin.yml

atomic trail
#

How do I get JUST the playername in 1.17.1 paper? Instead of this crap

broken elbow
#

kek

spiral prairie
#

thats JSON

#

not crap

#

lol

#

just Player#getName

broken elbow
#

I'm assuming they actually want the display name

atomic trail
#

but .displayName() also gets that

broken elbow
#

yeah. it returns a component

spiral prairie
#

ye

atomic trail
#

Can I get the displayname based on that or just .getName() ?

spiral prairie
#

bruh

#

d;adventure Component#content

uneven lanternBOT
#
@@NotNull
Componentๆฑ‰)  compact()```
Description:

Create a new component with any redundant style elements or children removed.

Since:

4.9.0

Returns:

the optimized component

broken elbow
#

kek

spiral prairie
#

im scared

#

what is this

loud sorrel
#

anyone able to help me? ^

atomic trail
spiral prairie
#

if you want the name, yes

broken elbow
#

hmm actually

atomic trail
spiral prairie
#

the name the player has when selecting it

atomic trail
#

Should be good

dense drift
wheat carbon
#

wew

dense drift
#

only if they were separated ffs

pulsar ferry
#

Gotta love it

dense drift
#

@NotNull(@NotNull)

broken elbow
#

also wtf is going on here?

dense drift
#

It probably broke on the double @NotNull

broken elbow
#

oh

#

lmao

atomic trail
#

This still adds to the original set right? Just to be sure

                        TreeSet<PlayerTime> times = parkourPlugin.getPlayerTimes();

                        if(times.isEmpty()) {
                            times.add(newTime);
                        }
#

When creating a copy of it

brittle thunder
#

Quick typing the basic template in exams where im not allowed an IDE or copy/paste

dense drift
atomic trail
dense drift
#

if you getter returns a copy, no

atomic trail
sterile hinge
#

that does not return a copy

atomic trail
#

Yeah but this doesnt create a copy rightTreeSet<PlayerTime> times = parkourPlugin.getPlayerTimes();

#

I just wanted to avoid calling the getter all the time to get the set

dense drift
#

no, it doesn't create a copy

#

you assign the value of getPlayerTimes() to times, like a shortcut

atomic trail
#

Perfect, that's what I want to do, just had to make sure

#

Ty

night ice
#

Hey is there a way we can get the amount of xp player had before he died?

queen plank
#

Why does this not work? It only cancels "left click moving"/drag and drop

@EventHandler(priority = EventPriority.HIGHEST)
    public void onInventoryClick(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();
        Artifact a = Artifact.getArtifact(event.getCurrentItem());

        // Return if the clicked item wasn't an artifact or if players
        // may move the artifact around in the inventory
        if (a == null || a.getConfig().getBoolean("Traits.AllowInventoryMove"))
            return;

        // Cancel the event
        event.setCancelled(true);
        player.closeInventory();
    }```
queen plank
#

Oh, I'm not that smart

proud pebble
#

you can use abstract events?

#

if your doing that i would suggest you cancel the inventorydrag event.

#

because i had an issue where if i dragged an item it wouldnt cancel it.

queen plank
#

Is it even possible?

proud pebble
#

event.getView()

#

i assume

night ice
#

sorry mb, i don't think InventoryInteractEvent works

queen plank
#

Wait no, I can't get the clicked item

queen plank
proud pebble
#

probably cause its an abstract event.

queen plank
#

And I can't get the slot?

#

Oh

night ice
queen plank
#

Frick, how do I cancel the item moving then...

proud pebble
#

with the InventoryClickEvent and InventoryDragEvent

#

when it comes to my inventories i just cancel drag event.

queen plank
#

The Shift-Click and numpad moving though?

#

That isn't covered by InventoryDragEvent, right?

proud pebble
#

you cant drag with numpad or shiftclick

#

you have to be holding the item to drag it

#

you cant drag with numpad or shiftclick

queen plank
#

Yeah, that is what I mean. So how do I cancel it?

queen plank
proud pebble
#

send some debug messages of the get result of the event to yourself and see whats different and figure out a solution from there

queen plank
#

I know that click types and inv actions are a thing. Just, shouldn't the event I made be global?

proud pebble
#

there might be cases where your check doesnt actually function

queen plank
#

Obviously

proud pebble
#

im going to guess that a is returning null when you do certain things

#

which will be why it doesnt work for those specific cases where you say it doesnt work.

queen plank
#

Ig, I'll do some debugging. Thanks

#

Ok, so everything seems to work fine. As long as you are not in creative?

#

In those cases, the item will dupe. The item will stay in its original slot, and still make a copy in the new slot?

plain nova
#

hi, why is this not working? "%player_has_permission_permission.test%" (JavaScript PAPI)

proud pebble
#

im not entirely sure.

proud pebble
#

cause asking why it doesnt work doesnt exxactly help

#

also javascript placeholders have a specific string before your placeholder name

#

i think yours would be %javascript_player_has_permission_permission.test%

atomic trail
#

For MongoDB what exactly is the databasename?
Would it be the project name? Or "Cluster0" or what?
Referring to this

plain nova
plain nova
dense drift
#

BukkitPlayer.hasPermission("permission.test")

brittle thunder
atomic trail
dense drift
#

Unable to make field private final long java.time.Duration.seconds accessible: module java.base does not "opens java.time" to unnamed module @223f3642

atomic trail
#

That's what I'm tying to create at least, but is it even possible to have a custom typeadapter for an immutable class?
Since I need something like this

            if ("name".equals(fieldname)) {
                //move to next token
                token = in.peek();
                playerTime.setName(in.nextString());
            }
dense drift
#

what even is that

atomic trail
#

Trying to create the read function in the TypeAdapter

dense drift
#

I see

#

I think you can add adapters for other stuff and it will do the rest

dense drift
#

for instance, if you have a Location in your class and create an adapter for it (since the world can't be serialized by default), GSON will then be able to serialize your class without an adapter for it

atomic trail
#

Gotta go eat, I'll be back right after

atomic trail
dense drift
#

Well, comparable objects are nothing more than objects with a compareTo method. GSON (de)serialize only fields, so that wont be a problem.

#

But ye, the problem looks like is Duration.

atomic trail
dense drift
#

Thats for org.joda.time.Duration

atomic trail
#

oh wait I see what you mean

dense drift
#

You have a java.time.Duration object

atomic trail
#

yeah, gotta create a custom adapter I guess ://

dense drift
#

Is not so hard, is basically a class that you use to tell Gson how you want to serialize or deserialize an object

atomic trail
#

Pretty sure my serializing method works, just not the deserializing method

#

Not sure how to make it since my class is immutable, and, well, I got told it should stay immutable

dense drift
#

There's an example of deserialization,

atomic trail
dense drift
#

I'm not sure about that, they probably have a similar output

atomic trail
#

Wait... I might've found an even easier solution, instead of storing the actual duration, couldn't I just store a long that contains duration.toSeconds() ? Not sure if it would work with the TreeSet or not though

#

I might not be able to convert that to millis so nah. I'll just try and create a deserializer

lyric gyro
#

Noooo don't use the Json(De)Serializer

atomic trail
#
1) You can't. JsonSerializer and JsonDeserializer are the old converter way. New applications should use TypeAdapter, which has a superset of funcionality.

2) Assuming you mean JavaFX's ObjectProperty<T> and you want to extract T's class.

You can access the Type inside TypeToken easily with TypeToken#getType().

I will give the example with List<String> which is the same idea but easily testable.
#

Just found this, so TypeAdapter it is ig

lyric gyro
#

yeah the JsonSerializer/Deserializer is essentially deprecated

atomic trail
#

I've managed to create the serialization I think

lyric gyro
#

you think?

atomic trail
# lyric gyro you think?

Well, can't test without the deserializer really

    @Override
    public void write(JsonWriter out, PlayerTime value) throws IOException {
        out.beginObject();
        out.name("name");
        out.value(value.getUsername());
        out.name("time");
        out.value(value.getDuration().toSeconds() + "." + value.getDuration().toMillis() + "s");
        out.endObject();
    }
#

Not sure if it's wrong

dense drift
#

or add two properties, seconds and ms

lyric gyro
#

eeh toMillis doesn't give you the milliseconds "part" of the duration

dense drift
#

^

lyric gyro
#

it gives you the whole duration as millis

#

and you shouldn't store it to be "human readable"

#

you should store it as easily to work as data

#

i.e. just store toMillis, no "1.23s" or "123ms" etc

atomic trail
#

?

lyric gyro
#

yeah looks about right

atomic trail
#

Or does the out.name have to match the variable name?

lyric gyro
#

nah

atomic trail
#

Good good, so for the reader, I need to pass in the constructor for the PlayerTime object somehow, how can I do that within the adapter?

lyric gyro
#

first read, then construct

atomic trail
# lyric gyro first read, then construct

Huh? So I'm trying to follow a guide where they've done something like this

            if("time".equals(fieldname)) {
                //move to next token
                token = in.peek();
                playerTime.setSmth(in.nextInt());
            }

But my object is immutable so what can I do?

lyric gyro
#

first read all of the data

#

then call the constructor

atomic trail
#

Not sure how it works

lyric gyro
#

from the.. reader?

#
int veryImportantValue = 0;
//blah blah whatever
if (something) {
  veryImportantValue = reader.nextInt();
}
// ...

.. new VeryImportantObject(veryImportantValue);
atomic trail
#

Since I'm adding 2 values to the constructor

lyric gyro
#

why would that make it mutable

#

first read all the necessary data

#

put them into local variables

#

then once you're done with the reader, call the constructor, return the instance

lyric gyro