#help-development

1 messages ยท Page 1857 of 1

solid cargo
#

bro i hate the oracle javadocs formation. its so hard to read

quaint mantle
#

I have never in my life ever used the oracle javadocs

umbral bear
#

Hi, i'm trying to develop a command blocker plugin, but when i try to execute the command my console says that: java.lang.NullPointerException: Cannot invoke "org.bukkit.command.Command.getPermission()" because "command" is null

ivory sleet
#

pillow

#

what exactly is your situation?

umbral bear
#

u're talking to me?

ivory sleet
#

nope

umbral bear
#

oh, sorry

ivory sleet
#

but you need to check if the command instance has a permission

left swift
#

hmm, something is still not going to me, look, for example I run 3 the same tasks, but I would like only one to be executed, the one that was launched as the last one.

ivory sleet
#

or

#

well if command is null as well

solid cargo
#

cmd is not null.
everything runs

ivory sleet
#

I was talking to svssoliny

solid cargo
#

its just that the getter doesnt work on player chat event

#

oops

ivory sleet
#

oh its the chat event?

solid cargo
#

Async event ofc

#

only betas use depraceted

ivory sleet
#

just make your boolean field volatile

#

should be enough

umbral bear
#

with also: Command command = Bukkit.getServer().getPluginCommand(event.getMessage());

ivory sleet
#

however pillow, if you for instance toggle the boolean within the async event handler method, you might need to implement a locking mechanism

solid cargo
#

doesnt work btw

young knoll
#

Isnโ€™t that what atomic variables are for

quaint mantle
umbral bear
#

thx

ivory sleet
#

atomic delegate classes have additional features which touch really low level stuff

umbral bear
#

can i ask another thing?

quaint mantle
#

sure

solid cargo
#

wait

#

i set the getter to final, so it cant be changed, reverting

ivory sleet
#

well java if (command != null) { }
would be needed as well since Server::getPluginCommand return type is nullable iirc

solid cargo
#

nope, doesnt work

ivory sleet
#

pillow do smtng like:

umbral bear
# quaint mantle sure

i use maven as compiler and i have imported a dependency named projectlombok, but i get a warning

ivory sleet
#
class ChatListener implements Blah {
  volatile boolean state;
  final Object[] mutex = new Object[0];

  void toggle() { //invoke if you need to change state
    synchronized (mutex) {
      this.state = !this.state;
    }
  }

  boolean isOn() { //invoke if you wanna check the state
    return state;
  }

  void onChat(event) {
    
  }
}```
umbral bear
#

saying : [WARNING] Discovered module-info.class. Shading will break its strong encapsulation. [WARNING] OrientalCommands-1.0.jar, lombok-1.18.22.jar define 1 overlapping resource: [WARNING] - META-INF/MANIFEST.MF [WARNING] maven-shade-plugin has detected that some class files are [WARNING] present in two or more JARs. When this happens, only one [WARNING] single version of the class is copied to the uber jar. [WARNING] Usually this is not harmful and you can skip these warnings, [WARNING] otherwise try to manually exclude artifacts based on [WARNING] mvn dependency:tree -Ddetail=true and the above output.

quaint mantle
umbral bear
#

me too

young knoll
#

Why do you sync on an empty array

#

Can you not sync on a primitive

#

Or use the wrapper type

quaint mantle
umbral bear
quaint mantle
umbral bear
#

ok, thx again

quaint mantle
#

np

ivory sleet
acoustic pendant
#

Hey! i'm starting with nms and i had a problem, the guy which i'm learning from made an event of when an entity dies and specified event.getEntity, i'm trying to spawn specific a pig but i can't find a way to specify to ((CraftEntity) ) that it has to be a pig, i have tried with Pig EntityPig EntityType.PIG and accessing the class where i create the custom mob, but i don't find any solution could someone help me?

hardy swan
#

Anyone knows what kind of weird reasons will Server#getWorld(String) return null even if the world of the exact name exists, and the call have been made with correct return value? Other than world name changing.

upper niche
#

is there a way to replace an entity's InventoryHolder?
so for example changing a villager's merchant inventory view to a regular chest view
I know I can get the same effect with PlayerInteractEntityEvent detection, I'm just curious

hardy swan
#

That's it?

#

lol

#

thanks

hardy swan
young knoll
#

Thatโ€™s all the comes to mind

hardy swan
#

or more like, CraftPig?

quaint mantle
#

I need to learn nms

#

where di u guys learn nms from?

quaint mantle
acoustic pendant
quaint mantle
#

its more like casting a Type

ivory sleet
acoustic pendant
#

and why a pig cant be a CraftEntity?

#

i mean, a pig is an entity

hardy swan
acoustic pendant
#

and, as i said the guy did event.getEntity

#

so would be the same

young knoll
ancient plank
#

me too

ivory sleet
#

anyways cool idr really what the adv of using an array as your lock

acoustic pendant
#

so, there isn't nothing to do with that?

ivory sleet
#

but iirc basically you just give up serialization

#

ofc a transient Object o = new Object[]
would be effectively equivalent

#

or might be the other way around

#

god

#

ugh

#

yes

#

you dont give up serialization

patent horizon
#

the first line is from one of my plugins and the second line is from my other. im not sure why (since they both use translateAltColorCodes) but everytime i put a double arrow symbol in one of my strings, it shows up in game with an A in front of it

ivory sleet
#

set your compiler encoding to utf8

umbral bear
#

@quaint mantle do you mind helping me again?

ivory sleet
#

if its from a file, read it with the utf8 charset

patent horizon
young knoll
#

Or use the escaped Unicode value in code

ivory sleet
#

do u use gradle?

patent horizon
#

yes

ivory sleet
#

AYE

hardy swan
#

EntityTypes nms

ivory sleet
#

compileJava.options.encoding 'UTF-8'

quaint mantle
patent horizon
#

lol i switched to gradle since shading with maven is too hard ๐Ÿ˜ญ

ivory sleet
#

if its groovy dsl

#

true

patent horizon
ivory sleet
#

compileJava.options.encoding = "UTF-8"
for kotlin dsl iirc

#

shove it in your build.gradle at indent level 0

#

and obv not before the mandatory blocks u got

patent horizon
#

so im guessing maven builds with utf-8 default?

ivory sleet
#

idk

#

plausible

tender shard
#

although I too have this in every pom

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

just to be sure lol

hardy swan
#

Does the default plugin.yml load field (POSTWORLD) mean after loading of one world or all worlds?

young knoll
#

All the default worlds

hardy swan
#

Ah ok

#

Thanks

#

Alright about world loading again

hardy swan
#

So if I want to create locations onEnable

#

I have searched and generally see two solutions

young knoll
#

softdepend on multiverse

hardy swan
#
  1. softdepend
#
  1. scheduler one tick
young knoll
#

There is a world load event

hardy swan
#

But that is when load start right

young knoll
#

Which you can also use

hardy swan
#

Its ok, not neat lol

lean gull
#

does anyone know how to get the blocks that were changed from the multi block change packet with protocollib?

umbral bear
#

Hi, i'm developing a command whitelist plugin, but my plugin can't get other plugin's permission, why?

#

i used Bukkit.getServer().getPluginCommand() to get the command and getPermission() to get the permission

#

also i'm using luckperms as permissions plugin

golden stirrup
#

hey

#

how to remove key from security key

tender shard
#

"security key".substr(0,8)

golden stirrup
#

i mean in game

#

like

#

if i locked a chest and i want to remove that lock

tender shard
#

I thought that's what not what you meant ๐Ÿ˜„

#

can chests be locked in vanilla?

rough basin
tender shard
#

to remove the lock, do Chest.setLock(null)

tender shard
rough basin
tame shoal
#

Tryna convert unix to timestamp! but won't wrk

#

First Login -> 14-12-53966 08:31

#

Just sais that in console

rough basin
#

maybe

tender shard
tame shoal
#

Like unix time to a datetime

frigid rock
#

hello! i was trying to make a plugin to store coordinates from a command in a config, but i dont really know which is the way to do it

#

i tried doing this

tame shoal
#

You would need to get x,y,z. Convert to string

patent horizon
#

if i grab the name of a file, will the name include the ".yml"

tame shoal
#

and then save it by using config.adddefaults(path, x)

frigid rock
#

i'm gonna try it

patent horizon
tame shoal
#

or just do x : y : z

tender shard
tame shoal
#

as a string

#

and you can later do String.split(":")[0] for x

#

String.split(":")[1] for y

#

String.split(":")[2] for z

#

if you save it as x:y:z

tender shard
#

and String.split(":")[3] for an exception ๐Ÿ™‚

tame shoal
#

xd

#

if u wanna know why it starts at 0 not 1, blame java

frigid rock
frigid rock
#

nop

tame shoal
#

And what's the pathname

tender shard
tame shoal
#

bc there could be no path

frigid rock
#

x_loc

rough basin
#

When exactly do Tasks disappear when the server is reloaded?

tender shard
tame shoal
#

then do config.addDefault("x_loc", location_x)

tender shard
tame shoal
#

add an s at the end of default

#

idk which on it is

patent horizon
chrome beacon
tame shoal
#

It's either config.addDefault("x_loc", location_x) or config.addDefaults("x_loc", location_x)

tender shard
patent horizon
#

i just want it to get rid of the .yml

#

not seperate it into two strings

tame shoal
#

but that would split the string and delete the .yml

tender shard
tame shoal
#

or just split at .

tender shard
tame shoal
#

xd

#

most ppl don't even google here

tender shard
#

yeah it's sad lol

#

it's so much faster to google then to summarize the question and send screenshots on this dc

tame shoal
#

Ik lol

frigid rock
#

addDefaults, gives me this and without the "s" (addDefault) doesnt work either

quaint mantle
rough basin
#

I still don't know what this means bruh

tender shard
#

config.addDefault(String,Object) exists

frigid rock
#

yeah ik

#

but when i try the command it doesnt store the coordinates

#

do i need to add "saveConfig()"?

tender shard
#

do you know what addDefault does?

#

imagine your config looks like this

tender shard
#
value1: test

and now you do getConfig().getString("value") it returns null

tame shoal
tender shard
#

but if you do getConfig().addDefault("value","something"); it will now return "something"

#

so what are you actually trying to do?

tame shoal
frigid rock
tender shard
#

the plural thing

frigid rock
chrome beacon
umbral bear
#

but i see that it can detect only his own permissions

tender shard
umbral bear
tender shard
#
getConfig().set("something","somevalue");
saveConfig();
frigid rock
#

oh i need to use set then

tender shard
tame shoal
#

It's permissions.yml

#

Works on paper

frigid rock
umbral bear
tame shoal
#

add your own permissions

umbral bear
#

ok

tame shoal
#

like /whitelist <playername>

tender shard
#

you can either assign the permissions that other plugins actually register, or you'll have a bad time

tame shoal
#

then it gives the player the perm

tender shard
#

but why don't you just assign those permissions instead?

tame shoal
#

and checks on join

tame shoal
umbral bear
#

nope, i think you missunderstand

tame shoal
#

So you would need an event, a cmd thing

#

and that's it

#

You would need to just give that UUID a perm

umbral bear
#

i want to check if the player executing the command has the executed command's permission even if the command is not in the command whitelist

frigid rock
#

it worked thank you so much @tender shard ^^

tender shard
umbral bear
#

and it gives NullPointerException

tender shard
#

what gives NPE?

tame shoal
#

Idk this is way too overcomplicated than it should be

umbral bear
#

you know plhide?

tender shard
#

one of those 8 line plugins that hides the /plugins list?

rough basin
#

?paste

undone axleBOT
umbral bear
tender shard
#

you should just explain please what exactly you try to do because I still don't understand it

rough basin
#

maybe but i did it to use myself

umbral bear
#

you know plhide?

tender shard
#

I asked you what you want to do, you asked me whether I know a certain plugin. So no, I still don't understand what YOU are trying to do, no

umbral bear
tender shard
#

You will by default only see commands for which you have permissions for anyway

umbral bear
#

to explain what i want to do

tender shard
#

So you want to...

Blocks tab-completions and commands, that can be configured in the config.yml
Option to allow or block listed commands
Groups that allow or disallow commands and tab-completions
Group inheritance
Group priority
Enable or disable that OPs can bypass blocked commands
OP-Protection
Can be enabled or disabled
Player can't be OP'ed who are not in the list
Non-allowed OP'ed Players who joined will be kicked and deOP'ed
Customize the /pl message
?

chrome beacon
#

Why not just use that plugin

tender shard
#

I really don't get what your actual question is

umbral bear
#

i want to block all commands that are not in a list (called command whitelist)

#

but

rough basin
#

umm just edit the plugin.jar?

umbral bear
#

if the player has the permission to execute that command (like litebans.ban)

#

it bypasses the blocking system

tender shard
#

but that makes no sense. then it won't do anything

#

players cant execute commands without the perm ission anyway

#

that's what permissions are for

chrome beacon
#

So you basically just want to replace the no permission message

umbral bear
#

of course

patent horizon
#

if i use the .contains() method on a list of strings, will it check if there's a string in the list that matches the value or if one of the strings in the list contains the value?

umbral bear
#

player can't execute staff cmds

umbral bear
#

but

tender shard
#

If you have a list "johnny" and "tom" and you do list.contains("john") -> false

umbral bear
#

staff can't execute staff commands either

chrome beacon
#

Just give staff your own permission to bypass

umbral bear
#

and if i would whitelist staff commands we will be at start point

tender shard
#

I don't get it, maybe I'm too stupid

umbral bear
tender shard
#

then just dont give trainees permissions to those commands...

sleek pond
#

I don't understand what they're trying to do in the first place

tender shard
#

me neither

#

makes no sense at all

umbral bear
sleek pond
#

No

rough basin
#

I don't know if I've misunderstood, but shouldn't I just modify the plugin.jar that includes the command and block it through sender?

sleek pond
tender shard
#

or you're the only smart one here, might also be possible, although I highly doubt that too because otherwise you wouldnt ask here

dawn phoenix
#

anyone have experience with ProtocolLib?

chrome beacon
#

Yes

tender shard
#

bruh why are you calling me in DMs now @umbral bear ?

umbral bear
tender shard
#

lol no

sleek pond
#

Lnaoooo

tender shard
#

read my sattus

#

status*

umbral bear
#

dude

sleek pond
#

Just explain what you want here

dawn phoenix
#

Expecting someone to be your personal support person is bad

umbral bear
#

i tried 4 times

dawn phoenix
#

Your problems, your responsibility, buckle down and LEARN

#

โค๏ธ

umbral bear
dawn phoenix
#

Its culturally bad to call people without asking

ivory sleet
dawn phoenix
#

yeah, more referring to the calling the dev, haha

sleek pond
umbral bear
#

a dev is not a god

sleek pond
#

You kept asking if we knew a certain plugin

umbral bear
rough basin
#

Do you want the command to be invisible to anyone other than the staff?

spiral light
#

just stop writing with ppl that dont can explain their problem good or at least understand your help ^^

sleek pond
#

Well then that's unfortunate for you

umbral bear
#

if someone could join a vocal

#

so i can explain by voice

dawn phoenix
#

no one wants to be on voice for support requests

sleek pond
#

What difference does it nake

dawn phoenix
#

thats bad news bears

#

if you cant articulate your issue over text, you should rethink hosting a server

sleek pond
#

If you can't explain here, how come you can in vc

rough basin
#

can i ask my questions now

umbral bear
ivory sleet
dawn phoenix
#

๐ŸšŽ

sleek pond
#

I don't think I will

chrome beacon
ivory sleet
#

^

#

?

sleek pond
#

Lmao

umbral bear
undone pebble
#

lmao

dawn phoenix
sleek pond
ivory sleet
#

?kick @dawn phoenix inappropriate behavior

undone axleBOT
#

Done. That felt good.

umbral bear
sleek pond
#

Lmao

rough basin
#

rip

ivory sleet
#

GalaKrond, ask away

tame shoal
#

Yo how would i send a textmessage in chat so it shows more text when i hover over it

rough basin
ivory sleet
#

(which takes a component so check out bungeecord chat api)

#

?jd-bcc

sleek pond
#

I suppose I have a question myself

#

Let's say I've got a vector (let's say players look vector)

tender shard
sleek pond
chrome beacon
#

oh vector math ๐Ÿ™‚

sleek pond
#

Mhm

tender shard
rough basin
#

i hate vector

ivory sleet
tender shard
tender shard
#

but yeah I just won't engange in this discussion any further ๐Ÿ˜„ it's the best solution

ivory sleet
#

yeah well, I didn't mean you but some other guy decided to be a dick towards this guy

tender shard
#

worst neighbour I ever had

ivory sleet
#

๐Ÿ‘€

tender shard
ivory sleet
#

when the code runs, no entities will be loaded in principle

tender shard
ivory sleet
#

so I just think the way you're trying to achieve something is poorly implemented galakrond

sleek pond
#

But that's not what I want

umbral bear
tender shard
#

explain your problem here so people can understand, then I am sure someone can help

umbral bear
#

i stopped the first time i did call you

sleek pond
# sleek pond But that's not what I want

I want to apply let's say a 45 degree force not relative to global coordinates, but to the player coordinates, so the direction the player is looking is "north"

ivory sleet
#

same

tender shard
#

oh no wait I get it

ivory sleet
#

well, regardless, what are you actually trying to do GalaKrond (not how)

tender shard
#

you want the player e.g. to be moved X blocks to their right for example

umbral bear
chrome beacon
tender shard
sleek pond
tender shard
tender shard
sleek pond
#

Yea, not a problem

umbral bear
#

but it returns null

tender shard
#

because the other plugin didnt register a permission for that command

#

so it has no permission

ivory sleet
#

svssoliny a good way to explain a problem is by first saying what the problem is, then what you tried, and concretize with an example or such

umbral bear
#

and with citizens it worked

tender shard
#

I highly doubt that spigot.yml will contain any plugin's permissions

ivory sleet
#

it will not

tender shard
#

are you talking about plugin.yml instead?

umbral bear
#

yeah sorry

#

my bad

chrome beacon
#

Probably and Citizens just registered their perms properly... some other plugin hasn't

umbral bear
#

so, what i should use

#

luckperms api?

chrome beacon
#

That won't help

sleek pond
#

Some people just check if sender.hasPermission, instead of just using the plugin.yml

tender shard
# umbral bear yeah sorry
commands:
  someCommand:
    permission: you.can.get.this.permission.via.the.api

permissions:
  someOtherPermission:
    description: You cannot get this permission from the command because it was not associated to the command
tender shard
worldly ingot
#

Why not >:((

tender shard
#

there is just no way to do that if your plugins do not properly register their commands/permissions

tender shard
umbral bear
#

and also i need the permission name

tender shard
#

you cannot

worldly ingot
#

Blasphemy

stiff palm
#

Hi, ยฟhow you doing?, is there someone who can offer me support for something in 1.8?

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tender shard
#

lol

#

scnr

worldly ingot
#

You can get those permissions though btw. plugin.getDescription().getPermissions(), it's just not super pretty

#

They're not associated with commands either, so ye

tender shard
#

it is just not possible

chrome beacon
worldly ingot
#

Mhmm

#

Like any sane plugin should

rough basin
ivory sleet
#

well any permission can be used with ::hasPermission so sadge

ivory sleet
tender shard
#

because it's just not possible

tender shard
#

yeah lol

chrome beacon
#

You could scan the bytecode for permission checks ๐Ÿง 

tender shard
#

btw there is a poop plugin on spigot. whenever you eat something, it spawns coco beans at the player's butt

rough basin
ivory sleet
#

Ah yes olivo 200 IQ

tender shard
#

like PLEASE stop doing that

ivory sleet
#

I guess you could lazily fetch permissions passed through CommandSender::hasPermission by injecting a delegate altho not just worth the trouble

tender shard
#

it hurts everyone's eyes

tender shard
ivory sleet
tender shard
#

or if the plugin only checks permission when !player.isOp()

stiff palm
#

I am trying to serialize armor content and inventory contents on config, but armor contents is not serializing so it throw npe when i try to deserialize it

ivory sleet
tender shard
#

just only serialize nonnull objects

stiff palm
rough basin
crimson marsh
#

anyone know how to fix, I've set my project sdk to java 16 and its still not working

lost matrix
# rough basin When the server is on again, I need to apply the sentryTask.runTaskTimer(Living...
  1. Write a tag into their PDC
  2. On ChunkLoadEvent -> get all Entities in that chunk and check their PDC and add them to the task if tag is present
  3. On WorldLoadEvent -> get loaded chunks and do the same
  4. onEnable -> get loaded worlds -> get laoded chunks -> do the same
  5. On ChunkUnloadEvent -> get all Entities in that chunk and check their PDC and remove them from the task if tag is present
  6. Do the same on WorldUnload
  7. Do the same on onDisable just to be sure
  8. Listen to EntitiyDeathEvent and EntityDespawnEvent for removal from the task
  9. When you spawn them for the first time also tag them and add them to the task
tender shard
crimson marsh
chrome beacon
undone axleBOT
stiff palm
#

ok

tender shard
crimson marsh
#

ah alright, thank you ๐Ÿ™‚

tender shard
#

np ๐Ÿ™‚

lost matrix
rough basin
ivory sleet
#

It's nice seeing 7smile7 occasionally tripping in here to drop some concise yet comprehensive guides to people ๐Ÿ˜›

lost matrix
#

And in gradle.build

tender shard
rough basin
#

ya

tender shard
#

how is it?

#

does it still suck?

rough basin
#

always has been

tender shard
#

shit

spiral light
#

must feel like a completly different year where he lives O.o

tender shard
#

well okay now I know what to expect! have a good night lol

rough basin
#

Thanks

chrome beacon
ivory sleet
#

or kotlin ๐Ÿ˜„

chrome beacon
#

๐Ÿ˜“

#

Is gameHandler null?

#

You sure

lost matrix
#

It is

#

But next time send the full stack trace pls as the whole trace could lead to a different cause

crimson marsh
#

Hey, i've installed java 16 and I'm still getting this issue, anyone know whats wrong?

lost matrix
#

Yeah gameHandler is null

tame shoal
#

I still don't understand this : I want to be able to display someone's IP (for ban-evading reasons)... But I want to do it discretley by using a hoverable text event. but it doesn't seem to work! I can't figure out why... but there are always errors. Can someone send a snippet of code so i can see how to do it?

chrome beacon
spiral light
#

well print it before running your Event

lost matrix
#

there is a good chance that your static singleton is not set at the point you isntanciate your listener class

crimson marsh
chrome beacon
topaz cape
#

O: pengu!

tame shoal
#

still doesn't work

stiff palm
tame shoal
#

is there a certain api i need?

#

Like a .jar file

chrome beacon
tame shoal
#

or is it inside spigot

tame shoal
#

Uh i removed code after it didn't work

lost matrix
chrome beacon
umbral bear
lost matrix
#

Nope that does literally the same thing

#

Try passing GameHandler as an argument via your SumoListener constructor.
This is then called dependency injection.

chrome beacon
stiff palm
#

oh wait

umbral bear
chrome beacon
#

No

stiff palm
#

?paste

undone axleBOT
tame shoal
#

this is what i put it

#

in

#

and it shows up as error

chrome beacon
#

Wrong import

tame shoal
tame shoal
umbral bear
dense geyser
#

Do ChatColor.RED.asBungee()

topaz cape
umbral bear
#

it's definitely impossibile?

chrome beacon
tame shoal
dense geyser
topaz cape
#

:D

chrome beacon
spiral light
#

nothing is impossible

tame shoal
lost matrix
dense geyser
#

I'm making an ingame version if tebexs store using http requests to get packages and category information from their site, problem is, their http requests take about 1-1.5ish seconds each. Would it be a better idea to load all of the category, package etc information in an object and refresh it every say 30 seconds on an async thread, or leave it as it is where the http requests to get information are sent when needed? (might be slightly out of date vs UI latency)

stiff palm
chrome beacon
little trail
#

is there a guide for making commands

small talon
#

Is there a way to blow up an end crystal without using NMS?

chrome beacon
lost matrix
umbral bear
#

@lost matrix ?

lost matrix
frigid rock
#

yo, i have another question. When i teleport a player, it gives me this message. Is there a way to disable it? or to edit it maybe

chrome beacon
lost matrix
frigid rock
#

its the plugin i programmed lol

chrome beacon
#

Then remove the message sending

frigid rock
chrome beacon
#

Then do it?

frigid rock
#

no, i didnt actually send any message

chrome beacon
#

Something is sending the message

lost matrix
frigid rock
#

oh bruh i'm dumb, actually i was sending the message on another class LoL

#

thx

tender shard
#

it's actually a requirement to join this discord

small talon
#

And if you don't meet it yet, you will soon ;)

opal juniper
#

why is choco here then

stiff palm
#

that gives emotion

opal juniper
#

he is impossibly smart

tender shard
#

someone ping conclure pls

tame shoal
vapid needle
#

How can I send a title?

spiral light
#

sending a msg ?
player.sendMessage()

tame shoal
spiral light
#

if player.sendMessage("md_5") will not work we are all lost

tame shoal
#

Just says that in chat

spiral light
#

thats a different thing ^^

tame shoal
#

no when i try to do

#

i then do

#

bc it tells me to do it

tame shoal
#

in chat

#

in game

topaz cape
#

component.create()

tame shoal
#

still error

#

does component.create send the message?

lost matrix
tame shoal
#

idk if im done

lost matrix
tame shoal
#

too big... what's the cmd for the

#

like pastebin

#

thing

topaz cape
#

wait

stiff palm
#

?paste

undone axleBOT
tame shoal
vapid needle
spiral light
#

player-sendTitle ?

topaz cape
#

@tame shoal is cmdS instance if player

#

if yes

spiral light
#

commandsender probably

tame shoal
#

uhhhhh

topaz cape
#

please use cmdS.spigot

tame shoal
#

alr

spiral light
#

but you can check if(cmdS instanceof Player)

tame shoal
#

yeah u can

tame shoal
#

cmdS.spigot shows up as error... I might be stupid lol

topaz cape
#

cmds.spigot().sendMessage(component);

spiral light
#

((Player)cmds).spigot()
probably

tame shoal
#

tf is spigot()

#

never heard of it

topaz cape
tame shoal
#

Ah works

topaz cape
tame shoal
#

and how would i reference the chatcomponent

#

it comes up as

#

that wierd string i sent earlier

#

that thing

topaz cape
#

That's the class path

#

.-.

tame shoal
#

it comes up as error

#

im dumb idk

karmic grove
#

i need plugin that will make spawners ignore light levels unless a torch is placed directly on it
or if its in direct sunlight is this even possible if so where would i even start

topaz cape
#

At least of the line itself lol

tame shoal
topaz cape
#

oh is it a component builder?

small talon
#

component.create()

topaz cape
vapid needle
spiral light
topaz cape
#

hey!
I have been making a bans system which is kinda going very well except for the fact that im confused about a part that i don't know how I'm going to do it
I'm willing to use MongoDB and it's a little confusing to me of how im gonna make it so it actually removes the ban after x amount of time for example:) would be helpful if someone could help me in this thread

vapid needle
spiral light
#

runnalbe.runTaskTimer

vapid needle
#

do I put it in the listener or no?

spiral light
#

what listener

vapid needle
#

see I have two java files one is a listener and one is just javaPlugin

spiral light
#

it depends on what you want to do with the title

#

send it every second when a player moves

#

or joins

#

or breaks a block

#

or without a special reson every time

tame shoal
karmic grove
#

make spawners work on custom light levels

tame shoal
spiral light
#

component.create() ?

vapid needle
tame shoal
spiral light
#

just in onEnalbe

tame shoal
#

it already is there

#

On enable?

#

but it's a diff. class

spiral light
# tame shoal

wtf is this ... you end the var-assaignment in the second code line

tame shoal
#

how-

#

Im noob at component builder

#

pls help me

spiral light
#

after that you add smth and then you create it ... create returns a object and does not change the ComponentbUILDER

#

well there was a tutorial exactly for this ... if you would read it before you would know it ^^

tame shoal
#

AAAh im bad at reading

vapid needle
karmic grove
#

?dosc

vapid needle
karmic grove
#

?docs

spiral light
#

yes

karmic grove
#

?jd

karmic grove
#

thats for me btw

vapid needle
spiral light
#

its ok for now

quaint mantle
vapid needle
#

Oh ok thanks

tame shoal
#

how would someone create a hoverable message. I don't understand it at all

main dew
tame shoal
#

...

vapid needle
#

Oh ok thanks

main dew
#

invisible armor stand with name

tame shoal
#

How would you display armourstand in chat

#

CmdS.sendmessage(Entity.Armourstand)?

vapid needle
main dew
chrome beacon
vapid needle
chrome beacon
#

No your plugin is disabled

main dew
tame shoal
#

Like i need to create a chat message

#

where you hover above it it shows something else

chrome beacon
tame shoal
#

And how would something in main class change an error in my other class

chrome beacon
tame shoal
chrome beacon
main dew
stone sinew
#

Any suggestions for a cleaner way of checking if a map doesn't contain all needed keys from another map?

if(!Map.entrySet().stream().filter(entry -> !secondMap.containsKey(entry.getKey())).collect(Collectors.toList()).isEmpty())
    return;
vapid needle
#

It worked but I saw that I get this error in the cmd that runs the server so should I worry about it or no?

chrome beacon
#

Always worry about errors

#

Especially if they're from your plugin

vapid needle
#

Sorry if I'm asking alot but I'm new to this so can I know what is the issue

onyx fjord
#

Why do you run 1.14

ivory sleet
#

Map::entrySet
Set::containsAll

chrome beacon
#

Something is null

vapid needle
chrome beacon
#

Maybe

vapid needle
#

Maybe because before I join the server right?

main dew
#

and replace .collect(Collectors.toList()).isEmpty())to count()
@stone sinew

chrome beacon
vapid needle
#

How can I make it just detect anyone in the server and send the title to him

chrome beacon
#

Loop Bukkit#getOnlinePlayers

stone sinew
ivory sleet
#

I mean your method isn't really ideal for different types of maps either?

#

anyways you could use anyMatch() instead of filter()count() == 0 or filter()collect()isEmpty() I believe

#

or noneMatch

stone sinew
ivory sleet
#

depending on what exactly ya need

#

what are the map types if I may ask yapperyapps?

stone sinew
#

craftIngredient.getItems() -> Map<ItemStack, Integer>
chestIngredientCounts -> Map<Material, Inetegr>

ivory sleet
#

and you wanted to check if none of the itemstacks materials are contained within the latter map

vapid needle
chrome beacon
#

You use sendTitle on the player

stone sinew
#

Yes. If the materials map doesn't contain all the the itemstack map's types then I want it to return false.

quaint mantle
vapid needle
ivory sleet
#

craftIngredient.getItems().keySet().stream().map(ItemStack::getType).map(chestIngredientCounts::get).allMatch(Objects::isNull) maybe @stone sinew

#

if u wanna make it clean (not considering performance)

chrome beacon
stone sinew
chrome beacon
#

?learnjava Here are some good links to get started

undone axleBOT
ivory sleet
#

yes but its more clear what you're doing, you asked for cleanliness

vapid needle
stone sinew
#

True. I usually prefer short code. Longer code doesn't seem as "clean" to me.

chrome beacon
quaint mantle
#

whether it be short or long

stone sinew
quaint mantle
#

mhm

stone sinew
#

Thats why

quaint mantle
#

lol

#

fair point

stone sinew
#

I don't care if others can understand it lol as long as its short and functions exactly how it should, I'm fine with it

quaint mantle
#

yeah but that gets to a point where it could be hard to understand even your own code

#

so its good to be careful

stone sinew
quaint mantle
#

rewrote it 3 times before abandoning it

stone sinew
#

My minions-revamped plugin had 4-6 iterations before it. They were never completed xD

vapid needle
quaint mantle
#

player will never be null

chrome beacon
#

Also avoid assert if you don't know what it does

vapid needle
vapid needle
tame shoal
stone sinew
tame shoal
#

in Bukkit.getPlayerExact("dvsdfsdf")

stone sinew
tame shoal
#

Uh ok...

echo granite
#

Hello, can anyone give me an actual simple explanation about api-version in plugin.yml? I read the explanation on spigot's website multiple times but it's still gibberish to me

worn tundra
#

What'd you read?

echo granite
#

@worn tundra "This will signal to the server that your plugin has been coded with a specific server version in mind, and that it should not apply any sort of backwards compatibility measures. As a result you will also need to make sure that you have programmed your code to account for reading of older configurations, data, etc... .Each server version can decide how compatibility is achieved, unknown or future versions will prevent the plugin from enabling. As of the 1.14 release, the api-version 1.13 is still allowed - however future versions may drop backwards support based on this version."

#

This is the official explanation, but practically I don't understand a word

#

what's the difference if I put 1.13 or 1.18 there?

#

It's too general

tame shoal
#

It defines the API-VERSION of the api you are using

#

you don't need it in your plugin.yml

echo granite
tame shoal
#

all you need for a functional plugin is Main, Name, Version, Commands

echo granite
#

the explanation says nothing about it

tame shoal
main dew
#

Someone will give an example of aspectj in a plugin for minecraft? (edit nms)

echo granite
#

please explain why

stone sinew
echo granite
#

okay let me tell the full story: I released a plugin that saves items in a config, and I put 1.16 in the api version. People who use 1.12 complain that it throws an exception about BLACK_STAINED_GLASS_PANE not existing - so would changing the API version to 1.13 help?

stone sinew
#

BLACK_STAINED_GLASS_PANE doesn't exist in 1.12
Its STAINED_GLASS_PANE with a durability of 15.

echo granite
#

exactly

#

Then what can I do to solve this?

quaint mantle
#

I got the perfect thing for you

echo granite
#

LOL

stone sinew
quaint mantle
#

i just make my own

#

no need for bloat

stone sinew
#

Don't need 15+ methods just to get a fucking material

echo granite
#

oh wait... I did see XMaterial a lot in the development forum

#

was it created to solve problems such as mine?

quaint mantle
#

yes

#

but its like 32kb

stone sinew
#

It makes backwards compatibility easier. Atleast with materials lol

quaint mantle
#

basically you create an enum with the different names it could be under

echo granite
quaint mantle
#

wow

echo granite
#

This is the size of my plugin ๐Ÿ™‚

#

LOL

#

thanks to ACF

spiral light
#

what is your plugin ?

stone sinew
quaint mantle
#
enum VersionedMaterial {
    BLACK_STAINED_GLASS_PANE("STAINED_GLASS_PANE");

    private final String[] alternateNames;

    VersionedMaterial(String... alternateNames) {
        this.alternateNames = alternateNames;
    }
}

@echo granite

#

then u make a method to get the material and store it

#

i have a world generator plugin i made but i dont know how to load all the worlds when the server starts can someone help me?

eternal oxide
#

You load them teh same way you generate them

#

If the world exists its loaded. If it doesn;t its created

quaint mantle
#
private Material cache;

public Material getMaterial() {
    if (cache != null) {
        return cache;
    }
    for (String name : alternateNames) {
        if ((cache = Material.matchMaterial(name)) != null) {
            return cache;
        }
    }
    return null;
}
quaint mantle
quaint mantle
#

wait

echo granite
# spiral light nice idea

Thank you, I put a lot of hours to develop it and luckily I have 450 downloads without any advertising ๐Ÿ˜›

spiral light
#

but what is a Bulletin Board ?

echo granite
#

umm I admit I had to translate that

#

This thing:

spiral light
#

pinboard ?

echo granite
#

yeah pretty much

spiral light
#

ah nice

echo granite
#

It's a board where you can post updates on stuff

#

Do you have an alternative for the word "bulletin"?

spiral light
#

hmm i would call it (Job-)News Board or smth like that

#

or Announcement Board

#

good luck with mysql support xD

echo granite
#

What does this line in pom.xml mean?

#

It's inside the shade plugin

echo granite
#

It doesn't provide an answer

frigid rock
#

guys how do i add a subpath to a path in config.yml?

#

tried searching that, but i havent thing anything

quaint mantle
stone sinew
quaint mantle
#
hello.world.yes
frigid rock
#

no i mean with java lol

#

not manually

quaint mantle
#

config.set("hello.world.yes", "no")

frigid rock
#

thats to store "no" in the yes subpath

quaint mantle
#

yes

frigid rock
#

but if the path doesnt exist?

quaint mantle
#

it doesnt matter

#

it will create it

frigid rock
#

oh. thanks!

#

didnt know that ^^

quaint mantle
#

guys how do i get my worlds to automaticlly load it

#

in

#

wait

lost matrix
#

You mean the default worlds? They always automatically load in

lyric grove
#

How would i access a class that I haven't imported using reflecton (to store in a hashmap)

eternal oxide
#

You get it by name, so long as it has been loaded by teh ClassLoader

lyric grove
#

Can i store it using Class.forName() inside of the hashmap?

#

as i cant import the class itself

waxen plinth
#

You can retrieve the class as an object and store it in the map, yes

lyric grove
#

oh ok

quaint mantle
echo granite
topaz cape
quaint mantle
#

ik

topaz cape
#

It ain't gonna be automatically loaded by your server jar

#

Unless you change the level name to that world

quaint mantle
#

I have a command (/wtp) which you use 1 argument which is the world name, so if you visit the world, and its unloaded, it loads it cause everytime someone uses wtp it does Bukkit.createWorld(new WorldCreator(arg[0]));

#

Does that load in every world?

quaint mantle
#

oh i already have a world creator

lost matrix
echo granite
#

I read it entirely

quaint mantle
topaz cape
#

Why's the O small u dummy

blazing scarab
#

Wtf are you doing pengu

lost matrix
#

Why not use a Map<Long, ChunkSnapshot> ???

blazing scarab
#

Long2ObjectMap ๐Ÿ˜€

#

Import the class

lost matrix
#

Then add it to your classpath.

dusty herald
#

wow it's 7smile7

topaz cape
#

if you need to use Object just use it instead of object lol

dusty herald
#

still believe comments are sin?

blazing scarab
#

good code should be self explanatory smh

dusty herald
#

shut up

#

):

#

ur feeding 7smile7

#

no

lost matrix
#

Yes. Ive taught some CS students about clean code a few months ago and had to read Rober C. Martins book again.
Comments are a sin

frigid rock
#

yo, its me again lol. i'm now trying to store the name (second argument of the command) and the coordinates in the config file. warps: name: x: -17.045529743215834 y: 71.0 z: -217.36350930724504 the coordinates work but the name inst showing .-.

blazing scarab
#

Add it to the classpath.

hasty prawn
#

So I should comment every single line of code? Got it 7smile. NODDERS

lost matrix
#

Meh. Sure. But then you would have to work with reflections all the time.

blazing scarab
#

Comments are made to just make funny notes

waxen plinth
#

Comments are a sin?

blazing scarab
#

And say // fuck

hasty prawn
#

LOL

blazing scarab
#

yes they are

waxen plinth
#

๐Ÿค”

hasty prawn
#

I've written // java is stupid a few times

lost matrix
#

// We have no idea what this method is doing but if we remove it everything breaks

topaz cape
#

Do you have the jar you want to use that class in?

lost matrix
#

how?

blazing scarab
#

Do you use maven or gradle

topaz cape
#

Just add a system scoped dependency

lost matrix
#

What plugin do you want to add to your classpath.
Btw how do you compile your project? Because ive
seen SO many ppl writing a pom.xml and then they still
build artifacts.

hasty prawn
#

What really lol

blazing scarab
#

Ugh

#

Fuck spigot guides

topaz cape
#

Clean package?

lost matrix
#

Yes. pom + adding jars to the project and then proceeding to ignore the pom to build artifacts

topaz cape
#

or just package

frigid rock
blazing scarab
#

clean install ๐Ÿ˜€

hasty prawn
frigid rock
#

how can i fix it?

hasty prawn
#

warps.name.x should be warps.x

#

same with y and z

topaz cape
#

Just use it instead of your current

#

Lol

frigid rock
lost matrix
lost matrix
topaz cape
#

LET'S GOOO HAPPY NEW YEAR

frigid rock
lost matrix
#

So
set("warps." + name + ".x", x)

hasty prawn
#

Yeah, that ^

frigid rock
steady herald
#
public class ringtest implements Listener {

    Plugin plugin = MythicUtilities.getPlugin();

    @EventHandler
    public void RingEffects(PlayerRespawnEvent event) {
        Player player = event.getPlayer();
        player.sendMessage("Line 18");

        new BukkitRunnable(){
            @Override
            public void run(){
                player.sendMessage("Line 23");
            }
        }.runTaskLater(plugin, 1);
        player.sendMessage("Line 26");
    }
}

^Listener Class

public class MythicUtilities extends JavaPlugin {

    private static MythicUtilities plugin;

    @Override
    public void onEnable() {
        //Commands
        ringLoader.load(this);
        getCommand("getMat").setExecutor(new getMat());
        getCommand("getRingList").setExecutor(new RingList());
        getCommand("applyLore").setExecutor(new ApplyLore());

    }


    public static MythicUtilities getPlugin() {
        return plugin;
    }

^Main Class

So im not sure as to why the getter isn't working, the console says that plugin is null when attempting to register the bukkitrunnable

lost matrix
#

The proper way would be to write a Warp class and make it ConfigurationSerializable.
Then write a WarpManager class which contains a Map<String, Warp>
This way you can save/load all your warps with a single

config.set("warps", warpManagerInstance);
sullen marlin
#

you never assign plugin to anything

lost matrix
#

or else its null on default

steady herald
#

Ok is therea reason it needs to be in the onEnable?

#

rather than just in the class

hasty prawn
#

Because otherwise you'll accidentally try to use it before it's set.

lost matrix
#

You cant initialise it statically as only the spigot classloader is allowed to instantiate JavaPlugin classes.

steady herald
#

k thx

lost matrix
#

If you want it even more early you could init it in your constructor

steady herald
#

Oh thats not a bad idea

hasty prawn
#

Why would you need it before then though

lost matrix
#

onLoad ๐Ÿ˜„

hasty prawn
#

I didn't even know that was a thing lol

blazing scarab
#

Smh just pass your plugin in the constructor like you do with any other object

paper viper
#

yeah be a normal person

#

or if you want to go extra use guice, dagger or some lib to handle it for you

lost matrix
#

@Inject

#

Interesting idea. CDI for spigot

young knoll
#

I did think of making that

#

Only for plugin instanaces

lost matrix
#

And also let listener classes be instantiated and registered automatically ๐Ÿ˜„

@EventClass
public class DeathListener implements Listener {

  private final YourPlugin plugin;

  @Inject
  public DeathListener(YourPlugin plugin) {
    this.plugin = plugin;
  }

  @EventHandler
  public void onDeath(PlayerDeathEvent event) {
    Player player = event.getPlayer();
    PlayerTracker tracker = plugin.getPlayerTracker();
    tracker.handleDeaht(player);
  }

}
paper viper
#

Yep

blazing scarab
#

๐Ÿ†˜ field depenency injection ๐Ÿ†˜

lost matrix
#

Yeah you are right

young knoll
#

How would I detect

#

Just loop all classes in the jar and look for @EventClass?

lost matrix
#

Yes just classpath scanning

blazing scarab
#

just check if a class implements Listener โ˜ ๏ธ

young knoll
#

Thatโ€™d also be an option

lost matrix
#

But there are people who dont treat Listeners as singletons

#

so annotation would be safer

young knoll
#

Fair

#

Now the question is, where would the auto register code go

visual tide
#

in your onEnable ๐Ÿ™ƒ

young knoll
#

Not really auto then :p

visual tide
#

wooosh

young knoll
#

Iโ€™ll woosh you

visual tide
#

oh dear i has been wooshed

young knoll
#

My first idea was having a custom class that extends JavaPlugin

#

But people extending that would still have to make sure they call super() in their onEnable

frigid rock
#

guys, is there a way to convert a string (GRASS_BLOCK) to a Material type?

sullen marlin
#

plenty of static methods in the Material class for you

frigid rock
#

i tried to google them on google but i didnt find anything helpful..

sullen marlin
#

use your IDE to help you

echo granite
hollow bluff
#

Material.valueOf?

frigid rock
sullen marlin
frigid rock
echo granite