#help-development

1 messages Β· Page 1833 of 1

tender shard
#

even if he didn't, he will probably have checked it before accepting the PR

golden turret
#

im getting a free game here

young knoll
#

Nah it’s probably before his time

mortal hare
#

im 80% sure thats due to encapsulation of the object (for example, Conversation object includes this method)

young knoll
#

Maybe back in the dinnerbone era, no idea how old the convo API is

mortal hare
#

API wouldnt really like this

tender shard
#

I like the fact that spigot has a rule that premium plugins must not be drug plugins lmao

mortal hare
#

it could create recursion bombs

young knoll
#

All drugs must be free

rancid flume
tender shard
#

quick question - someone here running macos?

tender shard
#

probably most people doing drug plugins were on some drugzz

mortal hare
#

how old is conversation api

tender shard
#

I for myself are only addicted to Spigot

#

and alcohol

tender shard
young knoll
#

Alcohol is bad for you

#

And spigot is even worse for you

mortal hare
#

tbh

tender shard
#

gradle is bad for me

mortal hare
#

programming is so addictive to me

#

that i've skipped school several times

tender shard
mortal hare
#

just to do some coding

tender shard
#

don't you have coding in school?

mortal hare
#

yea

#

scratch

#

πŸ˜‚

tender shard
#

oh

mortal hare
#

🀑

tender shard
#

yeah my first programming in school was

#

"Hamser Simulator"

#

you controlled a hamser using java

ancient plank
#

my spigot fork is gonna be named Faucet

young knoll
#

What’s a hamser

tender shard
tender shard
ancient plank
#

no

tender shard
#

this animal

#

this is a hamster

young knoll
#

Ah

#

Hamster

tender shard
#

and this is hamster simulator

tender shard
mortal hare
#

hamser

#

this is going to my head's long term memory

tender shard
#

but yeah sometimes it doesn't, then I slam the key hard enough and it works again

#

I should give my keyboard a bath and then stop smoking at the pc

#

it's the ashes that fall into it while typing what's fucking up the keys lol

#

you know what's funny?

#

there's no link at all in there to go to the spigot code

vale ember
#

why do spigot need my address to let me contribute?

tender shard
#

for the CLA

vale ember
#

WHY

tender shard
#

whats wrong with giving your address

vale ember
#

nothing, but why?

#

what's the point?

tender shard
#

All information is kept strictly confidential, and is required in case we need to contact you about your contribution(s).

#

for example

vale ember
#

:))))))

paper viper
#

mail

tender shard
#

imagine you contribute code and then somehow it turns out you stole that code

#

spigot must give your name then so they aren't in trouble

#

and address

#

there must be someone to sue πŸ˜›

vale ember
#

how would someone prove i stole their code?

tender shard
#

that's up the judge

paper viper
#

its pretty obvious just by looking

ivory sleet
#

yup I used int i = 0 in a for loop

vale ember
#

isn't that possible that i make the same functionality with similar code/

tender shard
#

if someone can prove they had identical code before you contributed to spigot, the judge might say "well I believe them" and you're rekd

ivory sleet
tender shard
#

as said, it's up the judge whom they believe

vale ember
ivory sleet
#

But the bigger the amount of stolen code is, the more obvious will it be

ancient plank
#

I helped someone with making something work then they used my code in a developer application

tender shard
#

in most countries, the judge will judge you by what they believe and not what was 100% proven right

young knoll
#

MD didn’t come to visit after my CLA

#

:c

ancient plank
#

I'd have been fine if they kept the comments that I put saying I made it to help them make their code work, and kept the comments explaining what it did, but na they passed it off as their own so I got in contact with the admin abt it keksad

tender shard
#

e.g. if someone gets shot, and the bullet gets somehow connected to your gun by investigations, and you don't have an alibi for that day, and you actually knew the dead person, and you also have burn marks on your hand, and you can't explain where they come from - that's not a 100% proof that you shot the person, but you'll get arrested for murder anyway because the judge thinks it's like 99% likely that you did it

#

at least that's how it works in germany

#

TL;DR and spigot doesn't want to be responsible if you shoot someone so they want your address lol

tender shard
#

ikr?

#

i HATE chrome

#

why can't I keep Ctr+W held down to close many tabs

#

I have to repeatedly press it

ancient plank
#

oh true

#

I honestly thought you could hold it, though I've never tried

tender shard
#

no 😦

#

okay I'm in a bad situation

#

I want to add a method to org.bukkit.entity.Player to get the total experience

#

but

#

getExp() and getTotalExperience() already exist

#

so.... how would I even call that method

vale ember
#

getTotalExp

tender shard
#

yeah but kinda clashes with getTotalExperience

vale ember
#

to confuse everyone

tender shard
#

maybe getExpIncludingLevels()? idk lmao

proud basin
#

to disable people from chatting would I need to use the AsyncPlayerChatEvent?

vale ember
#

getRealTotalExperience()

#

^ if you like php

tender shard
vale ember
#

probably

tender shard
#

but for real - I have no idea on how to call it

#

I'll make a forums post

cinder tusk
#

which file am i supposed to add to my server's plugins dir??

vale ember
#

i have question
WHY WON'T SOMEONE ADD API FOR NPCS IN SPIGOT???????????

tender shard
#

SpawnerTag-1.0-SNAPSHOT

vale ember
#

well, im kinda lazy

#

why wouldn't someone make it/

sterile token
#

You cant use lambda with object#getClass() right?

sterile token
cinder tusk
#

wdym shaded?

sterile token
#

shaded its a maven plugin that put maven dependencies/libraries inside the jar

vale ember
cinder tusk
#

so what file do i add

sterile token
vale ember
#

the one WITHOUT "original"

sterile token
cinder tusk
#

ok

sterile token
#

Who uses intellij idea?

cinder tusk
#

thats the one i add, its recognized but doesnt work 😦

cinder tusk
sterile token
tender shard
cinder tusk
tender shard
sterile token
#

Oh ok

tender shard
#

what's your question

cinder tusk
#

nah im just sad because my plugin doesnt work :((((

sterile token
#

I want to ask which maven dependencies i should need to create simple repo accessible from outside

paper viper
#

i think you are getting confused here

tender shard
#

however there are better ways, e.g. installing Nexus

paper viper
#

do you mean deploying your artifacts?

sterile token
#

I want to code a simply backend

tender shard
#

other stuff like jitpack exists but it sucks

paper viper
#

i use jfrog artifactory

#

the free version

#

but its crappy

sterile token
#

yeah they are too complex and have problems and many things

paper viper
#

it gets the job done tho

tender shard
#

so either

  1. Use an already existing repository
  2. Host your own. You only need a webserver, but better solutions like Nexus exist
tender shard
sterile token
#

Really thanks, but i wanna to experiment more with NodeJS, Express (and his dependencies)

tender shard
#

if you got a VPS somewhere, just install nexus via docker and host your own stuff

#

it requires about 2GB of RAM though IIRC

tender shard
#

I know, I don't like it too

#

you can of course install it without docker too

#

but for stuff like nexus that come with a TON of dependencies, it's just way more comfortable

cinder tusk
#

is there someone here that can help me with code? it isnt long (about 50 lines)

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!

sterile token
#

I only use docker with my pc servers. I have 2 servers with 64gb of ram and 16 threads so its fuck me

rough drift
#

can you catch any/all console errors within a plugin?

tender shard
sterile token
tender shard
cinder tusk
#

so ill just send the code and say waht i expect ot happen?

tender shard
#

?paste it here

undone axleBOT
rough drift
sterile token
#

I wont install it via docker because every i install something the fucked servers get disconfigured from the cluster its a yeat man

tender shard
rough drift
#

even other plugin's

tender shard
tender shard
#

and also

#

why would you want to do that

#

to get rid of error messages?

rough drift
#

I don't mean like stop from throwing, just getting th ename of exception

sterile token
tender shard
#

you already have the name of the exceptions - it's in the logs πŸ˜›

tender shard
#

at least not here :>

sterile token
#

:3

rough drift
#

yeah tho not from the logs, talking about the plugin just being able to read the exception that are thrown

cinder tusk
#

it doesnt let me send the .java file

tender shard
#

I use quora to troll people lmao

tender shard
undone axleBOT
sterile token
#

What reason.

#

Lol

#

Console its enoguht

tender shard
#

exceptions are thrown for a reason

cinder tusk
tender shard
#

you should get rid of the reason instead of just catching the exception

cinder tusk
#

didnt understand

tender shard
#

?paste

undone axleBOT
tender shard
cinder tusk
#

just a blue screen with some commands

tender shard
#

yes, paste your code there

#

sorry didnt know you never used any pasting websites before

rough drift
#

I just want to collect the exceptions (not stopping from throwing), and just send it to my own server where i can try to figure out if there are incompatibilities

sterile token
tender shard
#

paste your code then click the "save" button and send the link

cinder tusk
sterile token
tender shard
cinder tusk
sterile token
tender shard
sterile token
#

Are you having any exception/s or what?

#

Let start from there

cinder tusk
#

expected: it places a block when the world generates, every time that block is mined - it reapears with a chance to be a spawners

tender shard
#

first of all

cinder tusk
#

present: only spawns once at world gen and doesnt respawn

sterile token
#

No why you dont use the {} its break my eyes

tender shard
#

you never register your events

sterile token
tender shard
#

you must register your events in onEnable

sterile token
#

i explain him

tender shard
#

second of all - your class does not implement listener

rough drift
#

I think i found a way

tender shard
rough drift
#

yes i did

tender shard
#

because there is none

rough drift
#

let me test it

cinder tusk
#

im sorry if im bothering yall, im just trying to make a plugin for me and my friends and its my first time

tender shard
sterile token
cinder tusk
tender shard
cinder tusk
sterile token
tender shard
#

org.bukkit.event.Listener or sth like that

rough drift
tender shard
sterile token
rough drift
#

alr

cinder tusk
#

so class SpawnerTag extends JavaPlugin implements Listener?

tender shard
#

now your event listener methods should get called

sterile token
tender shard
#

yes but maybe they should learn the basics first

#

like actually getting it to work

cinder tusk
#

its only like 50 lines of code

#

not that complicated

sterile token
#

Lol

#

who clean my msg?

tender shard
#

you will probably get a message from them πŸ˜›

cinder tusk
#

ok, thanks yall

#

testing again

tender shard
#

oki

sterile token
#

ok

#

Let us knowing

ancient plank
#

y'all are doin' a mighty fine job in here yeehaw

rough drift
#

@tender shard I got it

#

i added a filter to the main log4j logger

#

everything logs to that

#

i can intercept messages

tender shard
#

yes but I thought you wanted to CATCH those exceptions

rough drift
#

oh no

#

not at all

tender shard
#

of course you can get what gets logged

rough drift
#

thats really bad

tender shard
#

I thought you wanted to CATCH the exceptions

#

like

#

try/catch

#

that's why I kept saying that's not possible and a bad idea πŸ˜„

rough drift
#

yeah i am aware, and its really a bad idea xD

tender shard
#

yeah sorry, misunderstanding πŸ˜„

rough drift
#

no problem, its alr

cinder tusk
drowsy bramble
#

            switch (this) {
                case ADMIN:
                    return ChatColor.WHITE + "[" + ChatColor.DARK_RED + ChatColor.BOLD + "Prince" + ChatColor.WHITE + "] " + ChatColor.LIGHT_PURPLE;
                case JRADMIN:
                    return ChatColor.WHITE + "[" + ChatColor.GOLD + ChatColor.BOLD + "Count" + ChatColor.WHITE + "] " + ChatColor.LIGHT_PURPLE;
                case SRMOD:
                    return ChatColor.WHITE + "[" + ChatColor.YELLOW + ChatColor.BOLD + "Viscount" + ChatColor.WHITE + "] " + ChatColor.LIGHT_PURPLE;
                case MOD:
                    return ChatColor.WHITE + "[" + ChatColor.DARK_AQUA + ChatColor.BOLD + "Seigneur" + ChatColor.WHITE + "] " + ChatColor.LIGHT_PURPLE;
                case JRMOD:
                    return ChatColor.WHITE + "[" + ChatColor.DARK_GREEN + ChatColor.BOLD + "Baron" + ChatColor.WHITE + "] " + ChatColor.LIGHT_PURPLE;
                case ETERNAL:
                    return ChatColor.WHITE + "[" + ChatColor.LIGHT_PURPLE + ChatColor.BOLD + "Eternal" + ChatColor.WHITE + "] ";
                case SAVAGE:
                    return ChatColor.WHITE + "[" + ChatColor.RED + ChatColor.BOLD + "Savage" + ChatColor.WHITE + "] ";
                case LEGEND:
                    return ChatColor.WHITE + "[" + ChatColor.AQUA + ChatColor.BOLD + "Legend" + ChatColor.WHITE + "] ";
                case ULTRA:
                    return ChatColor.WHITE + "[" + ChatColor.GREEN + ChatColor.BOLD + "Ultra" + ChatColor.WHITE + "] ";
                case DEFAULT:
                    return "";
            }
            return null;
        }
    }``` how would i make this return the rank? cause currently rank is null
cinder tusk
sterile token
cinder tusk
#

thats the updated code - now another problem. for ome reason it doesnt generate the block at the expected location

hasty prawn
cinder tusk
#

its supposed to generate at -627, 93, -1431

sterile token
sharp bough
cinder tusk
#

it generates in -626, 95, -1430

drowsy bramble
#

?paste

undone axleBOT
cinder tusk
drowsy bramble
tender shard
drowsy bramble
hasty prawn
sharp bough
drowsy bramble
#

getting the prefix rather

sharp bough
#

so thats not good

drowsy bramble
#

ik thats the problem. idk how to fix it

potent quest
#

wouldn't it be better to pass the prefix through the enum constructor and make your getPrefix() method return it instead of using a switch statement?

sharp bough
#

now i dont recommend saving the prefix in the code

cinder tusk
#

oops it generates at -625, 94, -1420

sharp bough
#

save it in the config file

cinder tusk
#

30*

sterile token
sharp bough
#

and load it in the memory

hasty prawn
sharp bough
#

but im not sure how to return the rnak

hasty prawn
#

You typed 94 instead of 93 lol

tender shard
#

switch(this) is always a very bad idea

hasty prawn
#

In the break event

hasty prawn
#

Same thing you did with the level

cinder tusk
#

missed that line thanks

hasty prawn
#

So that doesn't happen πŸ˜„

cinder tusk
#

still the same position hmmm

sterile token
#

Shahar i recommend you reading more about basic Java and the SpigotAPi

#

It ill be easier for you

hasty prawn
#

If so, you didn't upload the new plugin and restart

potent quest
# drowsy bramble how would i do that?
enum Ranks {
  ADMIN("<prefix>"),
  JRADMIN("<prefix>");

  private final String PREFIX;
  private Ranks(String prefix){
    PREFIX = prefix;
  }

  public String getPrefix(){
    return PREFIX;
  }
}
cinder tusk
#

i did

potent quest
#

code example

sterile token
ancient plank
#

junior admin adelemThonk

earnest tulip
#

this is probably a noob question but why isnt the second if statement in this working https://paste.md-5.net/ewinivipax.cs
the code is in a BukkitRunnable, the first if statement works just fine

potent quest
cinder tusk
tender shard
sterile token
#

and why a variable in cappital letter that against some "developing rules"

tender shard
#

yeah UPPERCASE is for final static fields

hasty prawn
#

Should be -627 not -625

cinder tusk
hasty prawn
#

Yeah you didn't update it then

sterile token
#

Like local variables should start with _ and not uppercase letter, etc

ancient plank
#

I love hardcoding locations

hasty prawn
cinder tusk
#

ill try again

tender shard
sterile token
#

I dont like harcoding code. But for testings its essentially

ancient plank
#

you make one typo and the whole thing is wrong

potent quest
#

only hardcode locations.

hasty prawn
tender shard
sterile token
earnest tulip
#

if someone could help me i would rly appreciate it, i cant seem to figure it out and im kind of in a time crunch

hasty prawn
tender shard
#

ah okay

hasty prawn
#

Camel Case

tender shard
#

yeah _stuff is used internally in some things

ancient plank
#

_firstNumber

#

ezzz

tender shard
#

don't use it

hasty prawn
#

Isn't that a C# thing?

sterile token
#

cuz he is a .Net developer

tender shard
#

it's a thing in many langs

hasty prawn
#

Yeah that's why, doesn't apply to Java

tender shard
#

but in java, please dont

sterile token
tender shard
#

it wont break anything though

hasty prawn
#

^

sterile token
#

It fuck my eyes that

#

Like its not confortably to see that in code

hasty prawn
mellow gulch
#

just use the coding conventions you like when you're writing code for you, and use the coding conventions your employer likes when writing code for them

tender shard
#

I think I will use uPSIDEdOWNcAMELcASE from now on for all my stuff

hasty prawn
proven river
#

How would I go about removing hearts from a player? I dont mean like dealing damage but removing an actual heart?

sterile token
#

Why you cant use getClass()#getMethods()#forEach

#

Omg

tender shard
#

removing hearts = damaging the player

sterile token
#

and i hate doing loop without lambda expression

hasty prawn
#

I think they mean like, lowering the max health

proven river
#

like

#

removing

#

max hp

tender shard
#

ah yes

proven river
#

so 20hp then 19hp

trail lintel
#

Is lombok included with spigot? If I want it I would have to embed its jar as a dependency right, which would be inefficient if other plugins are also bundling it.

tender shard
#

it does stuff at compile time

trail lintel
#

Ohhhh is that so, hell yeah πŸ˜„

proven river
trail lintel
#

so I don't need to include it as a dependency eh

hasty prawn
#

Just lower it

tender shard
#

well yes, in your pom or whatever, you need it as dependency

tender shard
#

but you can set the scope to provided so it doesnt get shaded into it

trail lintel
#

bawlin πŸ˜„

tender shard
#

probably the player isnt sneaking lol

sterile token
#

Object#getParameters() in java return all what inside method () right?

tender shard
#

it should return all the classes of the parameters

earnest tulip
#

does no one really know?

#

its driving me nuts

#

i swear i tested it so many times

hasty prawn
#

If the first if statement is executing & the second one isn't, then they aren't sneaking.

#

There isn't another option

earnest tulip
#

then how

#

like

#

let me try explaining better

#

i want them to be separate

hasty prawn
#

Oh

earnest tulip
#

the first one should not have to execute for the second one to

hasty prawn
#

Put it outside the first one then

earnest tulip
#

it is

hasty prawn
#

whatcat oh the formatting just sucks

earnest tulip
#

i want to send a pic but i cant

#

yea

tender shard
earnest tulip
#

i dont want it to be an if else

#

i want them to be separate

tender shard
#

yes, they are separate right now

earnest tulip
#

i cant find why this isnt working

tender shard
#

show the full code of that class pls

earnest tulip
#

ok

cinder tusk
#

i deleted the traget dir to regenerate it and it didnt generate a JAR... what should i do?

earnest tulip
#

im not the best java programmer

sterile token
earnest tulip
#

EVERYTHING else works

#

in there

rancid flume
#

thas a lot of ifs

cinder tusk
#

it worked last time

earnest tulip
#

ik

cinder tusk
#

ill restart intelliJ

sterile token
drowsy bramble
sterile token
#

?paste

undone axleBOT
earnest tulip
#

oof everyone vanished right when i sent the code

cinder tusk
hasty prawn
#

How do you know it's not running

tender shard
#

e.g.

earnest tulip
#

i did, i tried player.sendMessage() too including the leggings

tender shard
#
if(player.isSneaking()) {
  System.out.println("SNEAKING");
  player.getInventory().setLeggings(null);
}
hasty prawn
#

ya do that

tender shard
earnest tulip
#

nope

#

i tested it so many ways

#

ive been at it for an hour and im going crazy

tender shard
#

add a debug statement at the top where you check whether origin equals "Elytrian"

earnest tulip
#

this didnt happen anywhere else in the code

#

ok

#

it already works fine**

tender shard
earnest tulip
#

lmao

#

like i debugged it a lot but for some reason any second if statement after the PlayerInventory inv = player.getInventory(); wont work

sterile token
earnest tulip
#

hang on im trying some stuff

#

ok so i tested it and for some reason

#

if i put this in the conditional armors.contains(player.getInventory().getHelmet().getType())

#

it doesnt run any if statements after it

#

other stuff works like if i test if the player is sneaeking

drowsy bramble
sterile token
#

if its says that its wrong

#

use what its recommend

cinder tusk
sterile token
cinder tusk
#

the link

trail lintel
#

So I'm trying to set my project up with maven now, but it doesn't appear to be detecting the plugin.yml anymore. Here is what I have in my pom

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.mries</groupId>
    <artifactId>EnderBag</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>
    <repositories>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
cinder tusk
#

i pasted it

tender shard
trail lintel
#

ohhh I could use that πŸ˜„

trail lintel
#

I use vscode =]

tender shard
#

eclipse somehow always gets confused when converting an existing project to maven

#

oh okay. should work, I hope πŸ˜„

sterile token
rancid flume
#

IDEA #1 ✊

trail lintel
#

vscode power!

cinder tusk
#

it doesnt build a jar

#

for the server

tender shard
#

am I stupid or should it be "player's" instead of "players" everywhere in the javadocs???

sterile token
drowsy bramble
tender shard
drowsy bramble
#

how do i store the info in the config tho for the ranks?

sterile token
tender shard
#

getConfig().set("path.to.your.whatever",someValue);

#

Do you think this is a good explanation for my bukkit PR?

    /**
     * Gets the player's total amount of experience points, including those of previous levels.
     * <p>
     * This refers to the total amount of experience required to restore the player's current level
     * plus their progress in their current level.
     * 
     * @return Current total experience points
     */
    public long getPureExp();
sterile token
#

Use an intellij plugin

tender shard
#

??

#

what do you mean

glossy venture
#

probably takes more effort

sterile token
#

there is a plugin for that what you are doin

tender shard
#

what am I writing manually?

tender shard
sterile token
glossy venture
sterile token
tender shard
#

how would IntelliJ know what I want to write into the docs?

glossy venture
#

why would u use a plugin

tender shard
#

It can't read my mind duh

sterile token
#

There is a maven plugin that already write everything forthe method

tender shard
#

can people stop answering with "yes" or "yeah" to questions that are not yes/no questions?

sterile token
tender shard
glossy venture
#

how will it know what to write lol

tender shard
#

oh sorry @glossy venture I thought with "yeah" you wanted to answer my question on how the plugin should know what I want to describe ol

glossy venture
#

nah

#

i agreed with ur point

tender shard
#

I just added a method to Bukkit's Player interface and obviously I also added JavaDocs. @sterile token please explain on what you are talking about lol

glossy venture
#

do you also have to implement it in craftplayer?

#

or will they do that

tender shard
#

yes

#

I have to do that

glossy venture
#

ah

tender shard
#

the interface of course is just the interface πŸ™‚

glossy venture
#

so you also have to edit craftbukkit

tender shard
#

yes, Bukkit and CraftBukkit

#

it's just three lines needed though

#

just some ugly math

glossy venture
#

i thought they might accept PRs and then implement them

#

as like suggestions

tender shard
#

they do accept suggestions but creating a PR myself is probably 2 years faster XD

calm star
#

how can i check if a player is in the respawn screen? will i add them to a list when they die and remove them from it when they respawn?

sterile token
tender shard
calm star
#

ok ill see

tender shard
#

you have no idea what you're talking about

#

what should that plugin do?

#

what's wrong with the javadocs I've written?

#

How would any plugin improve that?

glossy venture
#
/**
* This is a method.
*/
#

would be the best it can write

tender shard
#

yeah lmao

#

it could maybe also create a @return This is the return value

glossy venture
#

and params

tender shard
#

yeah but it takes no params πŸ˜„

glossy venture
#

but the thing is that intellij does that for you

sterile token
tender shard
#

ikr? just enter /** and hit return

glossy venture
#

when you type /** <Enter>

tender shard
sterile token
#

There u have

#

Nmms

tender shard
#

I have what there?

glossy venture
#

nmms of course

tender shard
#

oh yeah

#

the new NMS

#

NMMS

tender shard
#

net.minecraft.meh.server

rancid flume
#

Hey can you tell me why I'm stupid

tender shard
# sterile token There u have

you DO realize, then even when generating a javadoc template, you still have to write the explanation yourself, right?

rancid flume
#

This is done with your snippet @tender shard

tender shard
#

oh wait

#

what are you doing

rancid flume
#

Its not calculating down to the Exp point value

glossy venture
#

package name for nmms: n.e.t.m.i.n.e.c.r.a.f.t.s.e.r.v.e.r

tender shard
#

send the code in a code block please

#

@rancid flume

rancid flume
#

sure

#
public static int getTotalXP(final int currentLevel, final Player p){
        return getTotalXPRequiredForLevel(currentLevel) + (getTotalXPRequiredForLevel(currentLevel) - p.getExpToLevel());
    }
calm star
glossy venture
#

how are you checking it

calm star
#

if(!p.isDead())

glossy venture
#

this cant be real

sterile token
#

I think the javadoc was only that in the picture

#

I have never realized that need a description

glossy venture
#

the Gets connections.

#

maybe it can generate that for simple methods

tender shard
# rancid flume sure

can you try this please?

public static int getTotalXP(final @NotNull Player p){
        return getTotalXPRequiredForLevel(p.getExpToLevel()) + getTotalXPRequiredForNextLevel(p.getExpToLevel()+1) * p.getExp();
    }
mellow gulch
#

they don't "need" a description, but docs aren't very useful without manual edits

tender shard
sterile token
#

I will make your tps go down

mellow gulch
glossy venture
tender shard
glossy venture
#

its a compile time annotation

tender shard
glossy venture
#

its not even stored at runtime

#

takes up 0 bytes

tender shard
#

basically EVERYTHING in bukkit is annotated with NotNull or Nullable. And that makes total sense for an API. and anyone claiming it creates performance problems should stop smoking so much crack

glossy venture
#

yeah

cinder tusk
#

?

rancid flume
tender shard
#
    public static int getXPRequiredForNextLevel(final int currentLevel) {
        if (currentLevel <= 15) return (2 * currentLevel) + 7;
        if (currentLevel <= 30) return (5 * currentLevel) - 38;
        return (9 * currentLevel) - 158;
    }
somber hull
#

How would i set up permissions on my plugin to allow plugin.amount.5 allowing the player to have 5 of some thing?

tender shard
glossy venture
#

bruh

tender shard
somber hull
#

like

#

i know about plr.hasPermission

#

but how do i check the number that they have

tender shard
tender shard
# somber hull it can be any number tho?

well you basically really need to iterate:

int max = 0;
for(int i = 10000; i > 0; i--) {
  if(player.hasPermission("your-permission." + i) {
    max = i;
    break;
  }
}
#

you want to start with the highest possible number

#

but to be honest

#

doing that is a bad idea imho

glossy venture
#

please no

#

cant u like implement a PermissionAttachment which will store all permissions?

tender shard
#

I use a groups.yml file for that, e.g. sth like this:

# You can define a custom AngelChest duration for certain groups.
# Players will need the angelchest.group.[groupname] permission.
# If a player is in no group, or the value has not been set for
# any of the player's groups, the default value will be used.
# If a player is in multiple groups, the "best" value is used,
# e.g. the highest duration, highest amount of chests and
# lowest prices.
#
# NOTE: SOME OF THOSE OPTIONS ARE ONLY AVAILABLE IN THE PREMIUM VERSION (AngelChestPlus)
# Every option here has an identical option in the config.yml. You can find information
# there whether one of the options is premium only or also available in the free version.
#
# Available options:
#   angelchest-duration: <duration in seconds> (e.g. 600, 0 = infinite chest)
#   unlock-duration: <duration in seconds> (e.g. 300, 0 = never unlock automatically)
#   max-allowed-angelchests: <number of chests> (e.g. 10)
#   price: <price for spawning the chest> (e.g. 5000 or 0.1p = 10% of player's balance)
#   price-open: <price for opening the chest> (e.g. 5000 or 0.1p = 10% of player's balance)
#   price-teleport: <price for teleporting to the chest> (e.g. 5000 or 0.1p = 10% of player's balance)
#   price-fetch: <price for fetching the chest> (e.g. 5000 or 0.1p = 10% of player's balance)
#   xp-percentage: <percentage of how much XP to keep> (e.g. 1 = 100%, 0.5 = 50%, -1 = vanilla behaviour)
#   spawn-chance: <spawn chance of an angelchest> (e.g 1.0 = 100%, 0.5 = 50%, 0.01 = 1%)
#   random-item-loss: <number of item stacks randomly lost> (e.g. 2 = 2 item stacks or 0.5p = 50% of player's item stacks)
#   invulnerability-after-tp: <amount of seconds> (e.g. 60 = one minute invulnerability after TPing to your chest, 0 = no invulnerability)
#   allow-tp-across-worlds: true|false
#   allow-fetch-across-worlds: true|false
#   max-tp-distance: <blocks> (e.g. 0 = unlimited, 200 = player can only teleport if they are within 200 blocks of the chest)
#   max-fetch-distance: <blocks> (same as max-tp-distance)
#
# Note: You MUST rename this file to groups.yml if you wish to use it.

admin:
  angelchest-duration: 1500
  unlock-duration: 0
  max-allowed-angelchests: 999
  price: 0
  price-open: 0
  price-teleport: 0
  price-fetch: 0
  xp-percentage: 1.0
  spawn-chance: 1.0
  random-item-loss: 0
  invulnerability-after-tp: 5
  allow-tp-across-worlds: true
  allow-fetch-across-worlds: true
  max-tp-distance: 0
  max-fetch-distance: 0
mod:
  angelchest-duration: 1200
  unlock-duration: 0
  max-allowed-angelchests: 10
  xp-percentage: 0.8
  spawn-chance: 1.0
donor:
  angelchest-duration: 900
  unlock-duration: 450
  max-allowed-angelchests: 7
  spawn-chance: 1.0
noob:
  angelchest-duration: 300
  unlock-duration: 150
  spawn-chance: 1.0
  random-item-loss: 1
idiot:
  angelchest-duration: 150
  spawn-chance: 1.0
  random-item-loss: 0.5p
#

so I just have to loop over angelchest.group.<groupname> which is basically only a few permissions instead of possible 10000

left swift
#

Heyo! I register my fully custom entity and it has no asstributes, it's attributes are null. I want to set default attributes for my custom entity, but idk how currently, because my currently soultion sometimes does not working. No attributes error

Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.ai.attributes.AttributeProvider.a(java.util.function.Consumer, net.minecraft.world.entity.ai.attributes.AttributeBase)" because "this.d" is null
    at net.minecraft.world.entity.ai.attributes.AttributeMapBase.e(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at java.util.HashMap.computeIfAbsent(HashMap.java:1224) ~[?:?]
    at net.minecraft.world.entity.ai.attributes.AttributeMapBase.a(SourceFile:48) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at net.minecraft.world.entity.EntityLiving.getAttributeInstance(EntityLiving.java:2333) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at net.minecraft.world.entity.EntityLiving.<init>(EntityLiving.java:292) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at net.minecraft.world.entity.EntityInsentient.<init>(EntityInsentient.java:132) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at net.minecraft.world.entity.EntityCreature.<init>(EntityCreature.java:17) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    at pl.tuso.xentitydev.entities.type.EntityDev.<init>(EntityDev.java:70) ~[?:?]
    at pl.tuso.xentitydev.entities.Snail.<init>(Snail.java:26) ~[?:?]
    at pl.tuso.xentitydev.events.DevCommand.onCommand(DevCommand.java:25) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.17.1.jar:3284a-Spigot-3892929-0ab8487]
    ... 19 more```
glossy venture
#

if you do this like every tick dont

tender shard
#

better create some kind of group system

#

like what I sent above

#

iterating over all possible permissions is a shitty way, but the only one possible if you really have to rely on your.permission.<number>

#

but as said you should not do that in the first place

#

it's fine if your max number is 50 or something, but not if it can also be 10 thousand

glossy venture
#
Player player = ... // get player
// get permission attachments
Set<PermissionAttachment> attachments = player.getEffectivePermissions();

// iterate over all attachments
for (PermissionAttachment pa : attachments) {
  // get all permissions
  Map<String, Boolean> perms = permissions.get(0).getAttachment().getPermissions();

  /* do stuff (idk what next) */
}
#

maybe something like that

#

idfk

rancid flume
little trail
#
@EventHandler
public void onPlayerLogin(AsyncPlayerPreLoginEvent event) {
    String uuid = event.getUniqueId().toString();
    logger.info(uuid);
    HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.tooty.xyz/new/" + uuid))
            .header("Authorization", auth)
            .GET()
            .build();
    this.client.sendAsync(request, BodyHandlers.ofString())
            .thenApply(HttpResponse::body)
            .thenAccept(body -> {
                event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER,
                        String.format(NOTE, ChatColor.of(Color.decode("#9966cc")),
                                ChatColor.RESET, ChatColor.BLUE, body));
            });
}```
 it doesnt seem to kick, (i get a request incoming btw)
sterile token
#

HI! is the same using:

Socket socket = new Socket("127.0.0.1", 81);
DataInputStream input = new DataInputStream(socket.getInputStream());
new TestClass(input);

and

Socket socket = new Socket("127.0.0.1", 81);
new TestClass(socket.getInputStream());
little trail
#

i mean you arent making a DataInputStream on the 2nd one

tender shard
sterile token
#

I care because i having thread locks

#

And im checking every line code of the library to get why the thread get locked

split lichen
#

Hey, maybe someone can help me out with vector rotations. Basically, I'm trying to create a helix which is placed horizontally as opposed to vertically, with the starting point being the player head

#

Helix creation isn't a problem, but I can't figure out how to "flip" it 90 degrees forward (or am I going about that wrong)

tender shard
#

I think of the discord helpers were quite good in doing math things

#

just try to ping Conclure, he has "ping for help" in their name anyway πŸ˜„

wicked lake
#

Game dev usually means math at some point :)

tender shard
wicked lake
#

Still developing for a game

tender shard
#

yeah

wicked lake
#

But yeah I avoid vectors like the plague

split lichen
#

@ivory sleet sorry for the ping, but I'd appreciate the help

wicked lake
#

Might go ahead and learn how to do them soon

split lichen
#

Oh there's a lot of it, I tried a lot of things, give me a second

tender shard
wicked lake
#

Niiice

tender shard
#

the best thing about adventure games - you don't need any drawing skills. Just pretend that it's supposed to look bad

wicked lake
#

Precisely

tender shard
#

lol my latest game

wicked lake
#

Dear god lmao

hasty prawn
#

Paint!

tender shard
#

its photoshop

#

but it also has some hand drawn levels lol

wicked lake
#

It has a certain charm to it

calm star
#

how can i break out of 2 for loops?

tender shard
#

e.g.

tender shard
#
outerloop:
for(whatever) {
  innerloop:
  for(anotherWhatever) {
    // ...
    break outerloop;
mellow gulch
#

a boolean that tells the outer loop to break at the end of the iteration

wicked lake
#

:)

tender shard
split lichen
#
                for (int l = 0; l < checkPoints; l++) {
                    for (double y = 0; y < maxHeight; y += heightIncrement ) {
                        double radius = y * radiusIncrement;
                        double x = Math.cos(Math.toRadians(360/checkPoints*l + y*25 - angle)) * radius;
                        double z = Math.sin(Math.toRadians(360/checkPoints*l + y*25 - angle)) * radius;
                        
                        Location cloned = location.clone().add(x, y, z);
                        Vector rotX = rotateAroundAxisX(cloned.getDirection().normalize(), x);
                        Vector rotZ = rotateAroundAxisZ(cloned.getDirection().normalize(), z);
                        Vector rotY = rotateAroundAxisY(cloned.getDirection().normalize(), y);
                        
                        cloned.add(rotY).add(rotX).add(rotZ);
                        
                        effects.particle(cloned, Particle.PORTAL, 150);
                    }
                }
                angle++;```
#

the math part

mellow gulch
tender shard
tender shard
mellow gulch
#

idk, i like labels

tender shard
#

I mean... some people also hate static but that's not a reason not to use it

calm star
#

oh thanks so much @tender shard never had to use this before but it seems rlly useful thanks!

mellow gulch
#

and i use goto in c++ also, but some people hate those too

#

programmers are weird

split lichen
tender shard
tender shard
mellow gulch
tender shard
#

yeah true

#

anyway I avoid goto as much as I can as it leads to spaghetti code imho

ancient plank
#

oop- dropped my pen

tender shard
#

you guys still using pens?

#

I only use pens when I'm playing anno

mellow gulch
ancient plank
#

delete ram;

tender shard
#

rm -rf --no-preserve-root /

#

I think imma go with getFullExperience for my PR

grizzled arrow
wicked lake
#

Are you using a build tool or just throwing in the jar as a library?

grizzled arrow
#

I'm using the maven repo

#
<dependency>
  <groupId>org.spigotmc</groupId>
  <artifactId>spigot-api</artifactId>
  <version>1.18-R0.1-SNAPSHOT</version>
  <scope>provided</scope>
</dependency>
sullen marlin
quaint mantle
#

how to take inventory from the player and remove all items that type is "diamond"?

Player variable:

Player p = (Player) sender

grizzled arrow
sullen marlin
quaint mantle
#

I'm seeing and I can't find

tender shard
#

I like Player#getFullExperience

wicked lake
#

Yeah one of the issues I've run into is Spigot doesn't track actual exp values

#

You can do a close fix for it by converting levels into their exp values but you can lose some exp in that transfer

tender shard
#

it's just three or four lines

wicked lake
#

Yup!

tender shard
#

I just think it might be a useful API addition

#

sometimes you just need the full XP, e.g. to let players keep only X% of their TOTAL XP on death

wicked lake
#

Definitely useful, I recently coded an "exp storage" book for my players so had to go about that issue

tender shard
#

:3

#

glad to know I'm not the only one who would like to have this lol

mellow gulch
#

i've also found a need for doing this sort of experience stuffs, one of my plugins uses xp for teleports and has it's own version of bottles o enchanting

little trail
#
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    String uuid = player.getUniqueId().toString();
    logger.info(uuid);
    HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.tooty.xyz/new/" + uuid))
            .header("Authorization", auth)
            .GET()
            .build();
    this.client.sendAsync(request, BodyHandlers.ofString())
            .thenApply(HttpResponse::body)
            .thenAccept(body -> {
                logger.info("kicking");
                player.kickPlayer(String.format(NOTE, ChatColor.of(Color.decode("#9966cc")),
                                ChatColor.RESET, ChatColor.BLUE, body));
            });
}```
 ```java
[13:40:47 INFO]: [TootyAUTH] kicking
[13:40:47 FATAL]: Thread Thread-11 failed main thread check: player kick
java.lang.Throwable: null
        at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.17.1.jar:git-Paper-401]
        at org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer.kickPlayer(CraftPlayer.java:499) ~[patched_1.17.1.jar:git-Paper-401]
        at xyz.tooty.JoinListener.lambda$1(JoinListener.java:57) ~[tooty-0.1.0-a.jar:?]
        at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[?:?]
        at java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:610) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:840) ~[?:?]
        at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
        at java.lang.Thread.run(Thread.java:831) ~[?:?]```
tender shard
tender shard
wicked lake
#

The easiest way is really just to use player.giveExp() with a negative value to remove exp for me

little trail
#

L57 is the kickPlayer

#

god discord is being slow

mellow gulch
#

(private so doesn't really matter)

tender shard
#

yeah I dont know why I made it

#

in fact you're right

#

sqrt should be square ROOT

#

I probably was drunk when I made it

mellow gulch
#

lol

tender shard
#

I could also say "ugh sqrt is the german word for squared"

#

but that would not be true

wicked lake
#

But yeah gave it a +1, it's a qol change but one that would be welcome

little trail
tender shard
#

wtf is a trusted plugin?

little trail
#

I don’t know

#

It's just it seems to not be allowed to kick or something

tender shard
#

idk what you're talking about

#

Player#kickPlayer only requires a string

wicked lake
#

Ah

#

Paper

little trail
#

There's only a string there too

tender shard
#

if that does not work - you have another plugin cancelling the PlayerKickEvent

#

try without other plugins

#

btw you should ALWAYS test your plugins without having other plugins running

tall dragon
#

not always possible ^

tender shard
wicked lake
#

ooliver are you using Paper? I see some refs in that debug you posted

#

IK that Paper often has differences from the normal spigot

tender shard
#

it has, but it should be 100% compatible anyway

#

only things that might occur is the IDE saying sth's deprecated while it isn't in spigot

wicked lake
#

They're also using NMS CraftPlayer in that method

#

So all over the place

mellow gulch
#

i've had paper do very odd unexplainable things that spigot doesn't do so i stick to spigot.

tender shard
#

oh boiii my first attempt to add a PR, I'm a bit anxious lmao

#

someone please calm me down

#

tell me sth about fluffy animals

mellow gulch
#

i've had it give me incorrect blockdata during redstone events and such, just tiny little oddities that i never looked into too much

mellow gulch
#

could be because it was a dev build but idk, going to try it out again in a month or so to see if the same strange stuff happens.

tender shard
#

yeah sometimes paper has strange bugs

#

whenever I get bug reports and really have NO CLUE at all why it happens

#

I tell my users to update paper

#

somehow it always works lmao

mellow gulch
#

but when it happenned it broke one of my minigame maps because it told me solid blocks were supposed to be piston heads, and then when my method to revert the map ran it ended up replacing the solid blocks with piston heads, which in turn borked up the redstone

#

(and spigot has never done such things)

quaint mantle
#

Vault enabled and my plugin don't find it

paper viper
#

are you loading your plugin before vault is loaded?

#

did you make sure you specified it as a load after vault

quaint mantle
#

depend: [Vault]
softdepend: [Vault]
loadbefore:

  • Vault
#

'-

#

Can someone help me solve this? Please!

visual tide
#

you cant have loadbefore and depend

quaint mantle
#

How should I leave?

eternal oxide
#

also don;t depend AND softdepend, both will break shit

visual tide
#

loadbefore means your plugins gets loaded before vault
depend means vault gets loaded before your plugin

#

just depend: [Vault]

quaint mantle
#

trying

visual tide
#

cut the softdepend and loadbefore

quaint mantle
#

Server starting...

#

not working

#

wait

#

how to send a message in action bar? 1.8.8

sullen marlin
#

.spigot().sendMessage(...)

upper niche
#

is there a way to create a custom MerchantInventory, or at least open a villagers trading menu to a player? i see the getInventory() method for villagers but that just returns the items theyve picked up

quaint mantle
#

?

sullen marlin
quaint mantle
#

Maybe ChatMessageType 🀫

mighty sparrow
#

np

quaint mantle
#

I know

mighty sparrow
#

For better searching trough the documentation go in google and type: site:jd.bukkit.org [your search]

little trail
sullen marlin
#

?jd

mighty sparrow
#

look at the links above too @upper niche

quaint mantle
tender shard
little trail
#

so I don’t know the issue, that's why I came here to ask

tender shard
#

send your whole code for that again pls

#

idk if you already sent it, I was afk

quaint mantle
little trail
#
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    String uuid = player.getUniqueId().toString();
    logger.info(uuid);
    HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.tooty.xyz/new/" + uuid))
            .header("Authorization", auth)
            .GET()
            .build();
    this.client.sendAsync(request, BodyHandlers.ofString())
            .thenApply(HttpResponse::body)
            .thenAccept(body -> {
                logger.info("kicking");
                player.kickPlayer(String.format(NOTE, ChatColor.of(Color.decode("#9966cc")),
                                ChatColor.RESET, ChatColor.BLUE, body));
            });
}```
tender shard
little trail
#

Hm

#

I want it to not allow them to join basically

tender shard
#

just a small suggestion, maybe it'll help: kick the player 1 tick later

little trail
#

how could I do that

tender shard
#

I think there's another event

#

wait

little trail
#

as it waits on my api to respond

#

Which is like 100ms or smth

quaint mantle
#

help

young knoll
#

There is

#

AsyncPlayerPreLoginEvent

tender shard
dense geyser
little trail
#

Yeah I tried using disallow there but it gave no error somehow

#

That's why I changed it to join

tender shard
#

you can do PlayerLoginEvent#disallow(...)

dense geyser
#

wdym no error?

little trail
#

the non async?

tender shard
#

the one I sent

#

it will definitely work

young knoll
#

I would recommend using the async one

#

Although it probably doesn’t matter that much

tender shard
little trail
#

It says depreciated

tender shard
#

WHAT is deprecated?

little trail
#

Importing the sync version

tender shard
#

are you on paper?

quaint mantle
#

help?

tender shard
#

in spigot it's not deprecated

tender shard
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!

little trail
#

my dependency is spigot

tender shard
tender shard
#

if it works, try to switch to the async event

quaint mantle
tender shard
#

so what exactly doesn't work?

young knoll
#

You don’t even use vault in the code you’ve shown

tender shard
#

yeah

#

that's why I wanted to see an error msg πŸ˜„

quaint mantle
# tender shard so what exactly doesn't work?

[22:17:22 INFO]: [KVender] Loading KVender v1.0-SNAPSHOT
[22:17:22 INFO]: [Vault] Enabling Vault v1.7.3-b131
[22:17:22 INFO]: [Vault] [Permission] SuperPermissions loaded as backup permission system.
[22:17:22 INFO]: [Vault] Enabled Version 1.7.3-b131
[22:17:22 INFO]: [KVender] Enabling KVender v1.0-SNAPSHOT
[22:17:22 INFO]: Vault nΓ£o encontrado.
[22:17:22 INFO]: [KVender] Disabling KVender v1.0-SNAPSHOT
[22:17:22 INFO]: Server permissions file permissions.yml is empty, ignoring it
[22:17:22 INFO]: CONSOLE: Reload complete.
[22:17:22 INFO]: [Vault] Checking for Updates ...
[22:17:22 INFO]: [Vault] No new version available

#

Vault nΓ£o encontrado. => Vault not finded

tender shard
#

did you sent the wrong class?

young knoll
#

So show the code that causes that message

quaint mantle
tender shard
#

tbh that looks fine to me

quaint mantle
#

what is tbh

tender shard
#

to be honest

#

but wait

#

do you actually have any economy plugin?

#

it seems like you check for an economy plugin and not just for vault

quaint mantle
#

πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚

#

I don't upload the plugin

#

πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚ πŸ˜‚

tender shard
#

?

#

Map<String,Object>

quaint mantle
tender shard
#

no idea what you're trying to tell me with those emojis, but

#

your check whether an ECONOMY plugin is installed

#

and you probably don't have any

quaint mantle
tender shard
#

then you say "Vault is not installed" in your language

#

although vault is installed

#

you just don't have any economy plugin

little trail
#

Very confusing

quaint mantle
tender shard
#

yeah, print a proper message when vault is installed but economy isnt

little trail
#

ok cool, the sync player login event raises no errors and does nothing

tender shard
#
    private boolean setupEconomy() {
        if (!getServer().getPluginManager().getPlugin("Vault").isEnabled()) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false; // <------------ This is where your code returns false
        }
        econ = rsp.getProvider();
        return econ != null;
    }
little trail
#

I'll send 2 sec

tender shard
#

send your whole listener please, I'll test it myself @little trail

#

Did you forget to register your events or didnt add @EventHandler annotation?

#

check both

little trail
#

It says "kicking"

tender shard
#

oh ok

#

then send your code

quaint mantle
#

working :)

tender shard
quaint mantle
little trail
#

yes it's sending

#

Also the api has auth so I don’t know if you could get it working

tender shard
little trail
#

I'll try without the api first actually

quaint mantle
#

How can I send a message in action bar api in spigot 1.8.8? I need a simple code with the message "abc", whoever can send it, thanks.

little trail
#

As the async event but sync http

#

As it may be inside that completable future it somehow can’t access it to disallow

tender shard
tall dragon
#

no you dont

tall dragon
#

this will work?

quaint mantle
young knoll
#

I don’t think that was in 1.8

tall dragon
#

ah

quaint mantle
tall dragon
#

then you indeed need a packet

tender shard
#

not in 1.8

quaint mantle
tender shard
#

1.8 is so old, ancient and outdated, that it doesn't have that method

little trail
#

yess it works without the api

tender shard
little trail
#

I'll use it sync tomorrow

#

(Async event, sync http request)

tender shard
#

@little trail I just tested it

#

kicking players / disallowing them works totally fine

quaint mantle
#

which ?

tender shard
#

anyway what are you http things for? @little trail

tender shard
quaint mantle
#

wait, google translate crazy

little trail
quaint mantle
#

what packets?

tender shard
#

oh okay

tender shard
#

ah okay you edited the message again πŸ˜„

#

Sorry I don't know the packets for 1.8

#

Maybe someone else here knows stuff about that 8 year old MC version you are still using

tall dragon
#

im pretty sure i have a method

#

1 second

quaint mantle
tender shard
#

I just want to add: using 1.8 is stupid and you should not use 1.8 πŸ˜›

#

it's like still being on Windows XP

little trail
#

Is it for pvp or something

tall dragon
# quaint mantle Ok '-'

try this

    public static void sendActionbar(Player player, String message) {
    }
        if (player == null || message == null) return;
        String nmsVersion = Bukkit.getServer().getClass().getPackage().getName();
        nmsVersion = nmsVersion.substring(nmsVersion.lastIndexOf(".") + 1);

        try {
            Class<?> craftPlayerClass = Class.forName("org.bukkit.craftbukkit." + nmsVersion + ".entity.CraftPlayer");
            Object craftPlayer = craftPlayerClass.cast(player);

            Class<?> ppoc = Class.forName("net.minecraft.server." + nmsVersion + ".PacketPlayOutChat");
            Class<?> packet = Class.forName("net.minecraft.server." + nmsVersion + ".Packet");
            Object packetPlayOutChat;
            Class<?> chat = Class.forName("net.minecraft.server." + nmsVersion + (nmsVersion.equalsIgnoreCase("v1_8_R1") ? ".ChatSerializer" : ".ChatComponentText"));
            Class<?> chatBaseComponent = Class.forName("net.minecraft.server." + nmsVersion + ".IChatBaseComponent");

            Method method = null;
            if (nmsVersion.equalsIgnoreCase("v1_8_R1")) method = chat.getDeclaredMethod("a", String.class);

            String colorMsg = ChatColor.translateAlternateColorCodes('&', message);
            Object object = nmsVersion.equalsIgnoreCase("v1_8_R1") ? chatBaseComponent.cast(method.invoke(chat, "{'text': '" + colorMsg + "'}")) : chat.getConstructor(new Class[]{String.class}).newInstance(colorMsg);
            packetPlayOutChat = ppoc.getConstructor(new Class[]{chatBaseComponent, Byte.TYPE}).newInstance(object, (byte) 2);

            Method handle = craftPlayerClass.getDeclaredMethod("getHandle");
            Object iCraftPlayer = handle.invoke(craftPlayer);
            Field playerConnectionField = iCraftPlayer.getClass().getDeclaredField("playerConnection");
            Object playerConnection = playerConnectionField.get(iCraftPlayer);
            Method sendPacket = playerConnection.getClass().getDeclaredMethod("sendPacket", packet);
            sendPacket.invoke(playerConnection, packetPlayOutChat);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

tender shard
little trail
#

As you have an economy thing, I don't think it's centred around pvp so you should probably update

quaint mantle
tall dragon
#

probably yea

#

i used this like 4 years back

#

he can figure that out

tender shard
little trail
#

Yeah it's very lightweight

tender shard
#

good luck then πŸ™‚ But if you're only supporting 1.8 I would NOT use reflection

earnest tulip
#

yo so i want to store some ItemStacks on a player's PersistentDataContainer, but i dont think u can do that, idk if anyone here has any idea how to work around that

fervent gate
#

?paste

undone axleBOT
kind hatch
#

Anyone here work with maven multi modules? I'm having some issues getting it to work properly for me.
More specifically, I have this as my dependencies

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

    <dependency>
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot</artifactId>
      <version>1.17-R0.1-SNAPSHOT</version>
      <classifier>remapped-mojang</classifier>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>me.nothixal.hugs</groupId>
      <artifactId>core</artifactId>
      <version>${project.parent.version}</version>
    </dependency>
</dependencies>

Yet, in my class, all references to net.minecraft or org.bukkit.craftbukkit are not found.
Also, for clarification, I have already run BuildTools for 1.17.

tall dragon
tender shard
earnest tulip
#

oh fr

tender shard
tender shard
tall dragon
#

yea thats fair

tender shard
earnest tulip
#

@tender shard thanks G

tender shard
#

np

fervent gate
tender shard
#

you never told the itemstack to use the updated meta

#

add item.setItemMeta(meta) AT THE END. you are doing it before your last line

#

basically move line 40 to the bottom

fervent gate
#

right

#

Thanks

tender shard
#

np πŸ™‚

somber hull
#

Like can you elaborate

tender shard
#

yes

#

create a groups.yml file. Like what I already sent. Then, loop over all the keys of that config file and check whether the player has permission for "your.plugin.group.<groupname>"

#

if yes, get the value from that config

#

if you need further help open a thread pls and ping me there