#help-archived

1 messages ยท Page 53 of 1

peak marten
#

Or what you can also do, you can store an instance of your class somewhere in a database. ๐Ÿคฃ

hoary parcel
#

Well, the ctor makes sure there is only one instance

#

So it doesn't matter at all

sturdy oar
#

yeah it just disables the plugin

radiant pollen
#

tf

#

that's not what he's saying?

peak marten
#

The only thing with singleton is that you need to make sure, to call your getInstance method on load already to avoid potential thread issues

vale slate
#

I made a pseudo singleton out of my main class

radiant pollen
#

avoid potential thread issues?

#

huh?

peak marten
#

Yes,

vale slate
#

If you have multiple threads singletons can get very pissed off

peak marten
#

exactly

radiant pollen
#

it's java

peak marten
#

As the instance might not yet exist

radiant pollen
#

multithreading is undefined behavior

chrome edge
peak marten
#

Therefore, you need to make sure to call the get method before any other method will call it

vale slate
#

I learned it the hard way

uneven cradle
#

I'm confused as to how to create an instance of your plugin so you can use it for things like BukkitRunnable.

vale slate
#

the instance is created on load

peak marten
#

your instance of your plugin is basically the class extending JavaPlugin

radiant pollen
#

You can pass around this

#

from the class extending java plugin

vale slate
#

do not confuse classes and instances^^

chrome edge
#

You can save your class as a static content and get like ClassName.plugin

peak marten
#

NO ^^

chrome edge
#

It's basic and not confusing for you.

vale slate
#

this behavior is discouraged

peak marten
#

It's static abuse

#

You should use the ctor to send the instance of your main class to other classes

fleet burrow
chrome edge
#

Why is it important to save as an instance not static?

peak marten
#

why would you do that?

#

and yes

vale slate
#

you should not assign values to static variables in non static methods

chrome edge
#

May you want to explain me why it is bad?

hoary parcel
#

Why is that bad?

chrome edge
#

'cause I get all class?

#

I do not understand

vale slate
#

It's not threadsafe

hoary parcel
#

There is really nothing bad with creating a Singleton like that

chrome edge
#

I do not think so

hoary parcel
#

Well, bukkit API will only calls the method on one thread anyways?

radiant pollen
#

Yeah, what's wrong with a static reference to the plugin?

vale slate
#

nothing

chrome edge
#

...

peak marten
#

...

hoary parcel
#

And well, you would do it in onload

vale slate
#

it's just the way it is set

peak marten
#

It's simply not , how it is done. I would use dependency injection. Several reasons for that, but from a solution design perspective, it's more clean

#

And regarding the thread safety, it is thread safe, but from a performance perspective, that could lead to issues

#

Got a meeting now

#

see you guys later ๐Ÿ™‚

chrome edge
#

There's no performance issue about it

vale slate
#

you would hold all instances while assigning

#

(if they are assigned to different threads)

hoary parcel
#

I like how he didn't name one proper point

#

Hur dur PERFORMANCE!

radiant pollen
#

Yeah, I still don't get it.

hoary parcel
#

"not how it's done" elitism right there

#

So now we talking about Singleton vs DI?

#

I thought we talking about that one sample impl of Singleton vs other impls, lol

radiant pollen
#

We were talking about a static reference to JavaPlugin...? The blackone1991 does it.

peak marten
#

Yes, anyhow, it's simple

radiant pollen
#

I can't follow this conversation.

hoary parcel
#

Neither can I tbh

peak marten
#

If the singleton of the main class is thread safe and runs everything n order, calling it form a different thread, might result in a latency on your thread

#

Anyhow, I really got a meeting now

#

There are specific use cases for DI and Singleton

vale slate
#
public class Main extends JavaPlugin implements YourPlugin{
    private static YourPlugin instance;
    
    @Override
    public void onLoad(){
       setInstance(this); 
    }

    public static YourPlugin getInstance(){
        synchronized(Main.class){
        if(instance == null{
          throw new IllegalStateException("Not initialized!");
        }
        return instance;
        }
    }
    private static synchronized void setInstance(YourPlugin instance){
     Main.instance = instance;
    }            
}
#

is what would cause performance issues

sturdy oar
#

you didn't close the if

vale slate
#

I did

#

I think

sturdy oar
keen compass
#

nothing wrong with getting the plugin instance using a static, and there is no difference in performance considering your plugins instance isn't going to go away so as long as the plugin is enabled lol

#

which ever way you decide to use is fine. However, if you are creating an api or designing your plugin so others can use it in their projects, might be better to go with DI

hardy island
#

it says is outdated mi version

radiant pollen
#

@hardy island That is literally your first message in the server...

#

wtf are we supposed to do with that?

#

what says what?

hardy island
#

idk

radiant pollen
#

I'm so confused.

keen compass
#

so update it

#

run buildtools and then update your server ๐Ÿ˜‰

frigid ember
#

Yeah, if it says outdated, chances are, it's outdated? ๐Ÿค”

vale slate
#

It is about the synchronization problem it will hold all threads while running Frost

sturdy oar
#

it's not outdated he just a time traveler

frigid ember
#

it's forward-dated? D:

sturdy oar
#

what would actually happen if i were to manually modify with a version that doesn't exist?

#

like 1.17 , would it say outdated or throw errors?

keen compass
#

what synchronization problem? Are you trying to run the plugin multiple threads or what?

frigid ember
#

Not too sure tbh

keen compass
#

You can get the plugin instance from multiple threads just fine

#

and have it not hang up any of them

hoary parcel
#

"If the singleton of the main class is thread safe and runs everything n order, calling it form a different thread, might result in a latency on your thread"

Nobody said anything about syncronising the getter

#

Which doesn't make much sense anyways since it's a read op

radiant pollen
#

Just do Bukkit.getPlugin("plugin name") every single time and then cast it.

#

am i right?

vale slate
#

don't

keen compass
#

have no idea, apparently the people I know here we all have our own in house anti-cheats XD

frigid ember
#

AAC always was pretty good, not used it in a while though

vale slate
#

What kind of anticheat would you advise with minimum load and false alarms? AAC?
An insanely expensive custom coded plugin
||Just kidding||

chrome edge
#

@radiant pollen Just use static method that I mention it. There's only difference that is static method is more simple.

radiant pollen
#

i was joking

#

no one do what i said

keen compass
#

I am not sure what you would touch them with? A stick?

frigid ember
#

That touches them? O_o

#

Bit concerning that, wrong website

vale slate
#

o_O

alpine musk
#

kick ๐Ÿ˜„

vale slate
#

So like reaching out of the monitor...?

frigid ember
#

tbh I'd touch @keen compass if he was cheating, not gonna lie ๐Ÿ˜

chrome edge
#

You may make anti cheat. I believe you, you can do it Envel

alpine musk
#

or ban

keen compass
#

by technicality I have been cheating

chrome edge
#

just check if player is move

#

and ban

vale slate
#

^

#

good idea

chrome edge
#

it is how minecraft 1.8 community works

keen compass
#

good luck with 1.8

#

its finally a dying breed

frigid ember
#

I was banned from irc, what should I do?

keen compass
#

just fyi, the protocol has flaws in 1.8

chrome edge
#

It's dying but there are a lot of player who wants to play 1.8.x pvp in servers

uneven cradle
#

Can't you get plugins for that now?

radiant pollen
#

1.8 PVP is trash

hoary parcel
#

Read the rules to learn out how to Appeal bans

chrome edge
#

so I don't believe it will complately die

keen compass
#

I would say there is more players on 1.15 then there are on 1.8

frigid ember
#

1.8 is trash, change my mind

hoary parcel
#

A lot more

frigid ember
#

where rules??

keen compass
#

?rules

worldly heathBOT
frigid ember
#

Is there anything that can't be unlocked?

hoary parcel
#

Imagine complaining about being banned and not even knowing the rules ๐Ÿ˜‚

chrome edge
#

Yeah there are a lot of player in 1.15 but PvP no... This is minecraft.

keen compass
#

there is plenty of 1.15 pvp servers

radiant pollen
#

^

chrome edge
#

Hey stop there! Clicking is my skill I cannot play 1.15

hoary parcel
#

Then learn it

vale slate
#

autoclicker is my skill

keen compass
#

lol

frigid ember
#

b-b-b-but all my y-years... ji-ji-jitter clicking? D:

chrome edge
#

I'd like to make 1.16 hub server but I don't believe there will be PvP community -_-

keen compass
#

I don't play pvp on mc anyways

frigid ember
#

md_5 << who??

sturdy oar
#

do some of you know a Java logic simplifier AI or something

#

I have thise 12 lines of code that I'm not finding a way to make shorter

frigid ember
#

As in who is md_5?

#

He's our lord and saviour

heady jolt
#

myD_5inches

frigid ember
#

um..

keen compass
#

@chrome edge I am not entirely sure where you derive your information from that makes you conclude that no one will pvp on 1.16 or that 1.8 is more popular then 1.15

frigid ember
#

There is a mistake in passing the word.

#

How can I get in touch with him?

sturdy oar
#

wut

heady jolt
#

send him an email

radiant pollen
#

Most people play on 'latest' and there are no PVP changes between 1.16 and 1.15?

heady jolt
#

there is support email for spigot

chrome edge
#

@keen compass from the servers...

radiant pollen
#

The only change is netherite which is easy to disable

#

although most players like "op" stuff

#

there's so many plugins that make stronger gear so why is 1.16 a big deal?

chrome edge
#

Let me explain you basically, are there any 1.15 PvP server that has more than 100 player?

keen compass
#

yes

chrome edge
#

A lot of 1.15 server has a lot of player but it is splitted

frigid ember
#

There's a fair few

chrome edge
#

like 1000 server with 10 players

frigid ember
#

Just search any server list for pvp and most of the top ones will probably be 1.15

keen compass
sturdy oar
#

you can have more than 100 players in a 1.15.2 server

keen compass
#

1.15 controls 55% of the servers

#

1.8 is only at 13%

frigid ember
#

Everyone is kind, thank you.

heady jolt
#

It's depend, if the server host a Faction server with 1.15, they can still count as PVP server

keen compass
#

162,375 recorded for that statistic

radiant pollen
#

You have your logic backwards dude. All of the big servers are big because they've been around since 1.8 not because they use 1.8. They have their entire infrastructure built with 1.8 and why pay devs to update everything when they've been around so long and have the playerbase already?

heady jolt
#

1.8 also easier to host ๐Ÿ˜›

radiant pollen
#

They're big because they're old and they're on 1.8 because it's expensive to update a massive server like that.

sturdy oar
#

there's no reason to use 1.8

#

it's stupid

radiant pollen
#

@heady jolt no it isnt?

#

It's much harder

keen compass
#

@heady jolt I have had no problems hosting 1.15

#

or any version for that matter

radiant pollen
#

There's so many exploits and game-breaking bugs in 1.8.

keen compass
#

1.8 has UUID spoofing

sturdy oar
#

and don't say 'hypixel uses 1.8' because they enough money to rewrite minecraft and patch any exploit

heady jolt
#

1.15.2 is cool. I'm currently host one without any problem, but for me it needs a lot more tweak than 1.8 ~ 1.12.2

sturdy oar
#

people just use that as argument usually

keen compass
#

there is also one other flaw in the protocol as well that was pretty major but can't think of it right now

#

just as bad as UUID spoofing. Maybe it was session hijacking

vale slate
heady jolt
#

yeah about UUID spoofing. We should avoid 1.8

radiant pollen
#

@vale slate no one is asking questions

chrome edge
#

I really like higher versions of course but when I look at the community they really love 1.8. You're right about 1.15 has more player but I'm trying to say 1.15 servers are separated.

vale slate
#

Anyways, mind the topic please

keen compass
#

I suppose we could just move to #general

frigid ember
#

Imagine like no one needing help

keen compass
#

Anyways, so the new CoD seems to be pretty cool

heady jolt
#

๐Ÿ›Œ

keen compass
#

I like how they decided to handle cheaters for that game though

hardy island
keen compass
#

run buildtools

hardy island
#

i go but idk how to update it

keen compass
#

how did you get spigot before?

hardy island
#

in getbukkit

vale slate
#

๐Ÿคฌ

sturdy oar
#

ew

#

that website is like bruh

keen compass
#

?bt

worldly heathBOT
hardy island
#

๐Ÿ˜ฆ sorry i just follow a video dont hate me

keen compass
#

follow the instructions for build tools

#

get buildtools, then run buildtools as the wiki describes, and then it will pop out a freshly updated spigot.jar for you at the end

vale slate
#

๐Ÿ˜ฆ sorry i just follow a video dont hate me
@hardy island would you mind telling me which video, I'd like to destroy it

keen compass
#

I think we should have competitions again

#

that was kind of fun to participate in way back when

cold wharf
#

Did someone tag me?

vale slate
#

I don't think we can help you with that

versed forge
#

is it possible to disable fly for a whole server ?

vale slate
#

explain

versed forge
#

so im trying to make aplugin for my server where when i do a comd like /disablefly it would turn everyones fly that on my server off

marble narwhal
sturdy oar
#
Bukkit.getOnlinePlayers().forEach(p -> p.setFlying(false));

this maybe?

gleaming vessel
#

Help Mee

hoary parcel
#

Not using method references, pff

sturdy oar
#

how can you use method reference for a thing that needs an argument

#

maybe im dumb, i don't usually use method reference

hoary parcel
#

Magic

#

๐Ÿ˜‚

marble narwhal
#

It's possible, it just makes absolutely no sense to do so in this case however.

hoary parcel
#
  • walks off before ppl realize he is dum *
marble narwhal
#
private void myEpicMethod() {
    Bukkit.getOnlinePlayers().forEach(this::setFlyDisabled);
}
    
private void setFlyDisabled(Player player) {
    player.setFlying(false);
}```
sturdy oar
#

bro...

#

just more code than actually passing false

gleaming vessel
hoary parcel
#

Skin restorer? You running an offline server?

gleaming vessel
#

Noo

#

Online

hoary parcel
#

Why would you use that plugin then?

gleaming vessel
#

Sorry sorry , yes cracked Server

sturdy oar
#

๐Ÿ˜‚

gleaming vessel
#

I am a turkish sorry bad english .. :)

vale slate
#

cracked players? I'm out of here

gleaming vessel
#

:(

hoary parcel
#

Yeah, hf

#

Nobody likes helping ppl that break the rules

vale slate
#

^

#

the rules -> the law

#

people are living form the earns of their games, so pay them if you want to use their software

sturdy oar
#

cracked players? I'm out of here
@vale slate me as well

hoary parcel
#

Well, it's also part of the cug that you don't give ppl access to the server which have not brought the game

sturdy oar
#

how funny is accepting the EULA then running offline mode servers

gleaming vessel
#

There are situations that you do not know ..

silk gate
#

law doesn't care about your situation

static nexus
frigid ember
#

ten on first collum

#

tan in the second

#

but at the bottom left

#

now at the top

#

yet in the far collum

#

axe in the third row

#

read in the second row

#

all 7 words

tiny dagger
#

just usually :p

frigid ember
#

Also that but i was going for 7

#

Hey where could I receive some help regarding my problem?
I bought LeaderHeads plugin the money went through but I dont have it in my purchased resources, it usually is instant!

tiny dagger
#

probabily the payment is on hold for 24 hrs

frigid ember
#

Why would they be though! its the first time i've encountered this!

tiny dagger
#

it's very rare

#

but it happened to a buyer of mine too

vale slate
#

you should wait for some time, if it is not there in 24h you should contact the seller

frigid ember
#

Alrighty all I got is time in this quarantine haha!
thanks for the help guys!

vale slate
#

You're welcome

frigid ember
#

By the way i've been looking to start messing around with Java
if I may ask there is a lot of of Youtube channels that makes java tutorials
which one would you recommend? ๐Ÿ˜› thanks in advance!

vale slate
#

especially for Spigot or general?

#

@frigid ember

frigid ember
#

Well I'm mostly interested in making plugins for my server but I guess I cant start directly with that without knowing the basics right?

vale slate
#

you can do that, but I won't recommend it, because most of the spigot tutorials give a shi* on coding conventions

#

and no, you don't have to watch it all together

#

in one session

frigid ember
#

haha yeah makes sense too much information all at once
I would forget everything the next day!

#

I really appreciate your time man thanks ๐Ÿ™‚

vale slate
#

nP

frigid ember
#

Last question i swear :P
would decompiling free source simple plugins help at understanding the basics at all? or would it make me more confused?

vale slate
#

it would most likely confuse you

marble narwhal
#

I would indeed not use decompiling to learn the basics, there is also the chance that the plugin you decompile is written poorly.

vale slate
#

and decompilers not always do their job that good

cunning umbra
#

so me and my friends want to play on a minecraft server but we all lag is there a way to fix that

frigid ember
#

Ah I see haha well if you fail you will never learn right?
I appreciate the information guys! if you got any more tips I'd be really happy to hear em!

humble hollow
#

Are you speaking of your own server or another server?

cunning umbra
#

@humble hollow own

humble hollow
#

send a timings report using /timings on and then get the link using /timings paste

cunning umbra
#

where

humble hollow
#

in your server, run those 2 commands

cunning umbra
#

k

#

its unknown command. Do i download something

humble hollow
#

are you using the vanilla jar?

cunning umbra
#

no Im using forge. sorry if im being dumb this is like my first time in minecraft

vale slate
#

then switch to the forge forum

humble hollow
#

^

#

this server is for support for spigot related issues

cunning umbra
#

k

#

ty

humble hollow
#

you can get better support from the forge forums as most of us probably never ran a forge server before

vale slate
#

I'm on that forum too

#

xD

frigid ember
#

Is the paper spigot team different than this?

vale slate
#

You dare use this word in here

frigid ember
#

oh no

hoary parcel
#

Yes, the paper team is different

#

Use papers discord for help

#

It's linked on their website

humble hollow
marble narwhal
#

What if we said Taco

frigid ember
#

is it a banned word around here?

#

xD

hoary parcel
#

They said paper spigot, that's worse

#

Nah it's not banned

vale slate
#

it's a meme

marble narwhal
#

It's not, people are just acting weird the moment you say it ๐Ÿคทโ€โ™€๏ธ

#

I saw that

#

xD

hoary parcel
#

You saw nothing

#

๐Ÿ˜‚

marble narwhal
#

๐Ÿ‘€

frigid ember
#

PAPER SPIGOT IS BETTER
grabs pop corn

marble narwhal
#

Laughs in TacoSpigot

frigid ember
#

md_5 will thanos clap me

#

what the heck is even that thom xD

marble narwhal
#

You have not heard of Taco Spigot?

frigid ember
#

Not really xD

vale slate
#

it was popular at some time

marble narwhal
#

Taco Spigot is a fork based of PaperMC

hoary parcel
#

Ffs

#

Stop calling it paper spigot

#

It's paper or papermc

#

Never paper spigot

sturdy oar
#

rock

hoary parcel
#

Taco is ded, as is 1.8

sturdy oar
#

everything <1.15 is dead

marble narwhal
#

Oof

hoary parcel
#

Modern paper forks include origami, purpur and tuinity

frigid ember
#

Who wants to join my craft bukkit 1.7.2 faction server

hoary parcel
#

As well as my very own ToiletPaper ๐Ÿ˜‚

sturdy oar
#

are u joking

humble hollow
hoary parcel
#

No

#

Dyescapes paper fork is called toilet paper ๐Ÿ˜‚

humble hollow
#

haha

compact smelt
#

help

vale slate
#

it is very expansive

#

i suppose

humble hollow
#

u gotta be kidding @hoary parcel

marble narwhal
#

What's up @compact smelt

vale slate
#

and now I finally know where all the toilet paper went

sturdy oar
#

I have my own Paper fork but It basically only add 2 events and a graph for TPS

#

so its kinda useless

hoary parcel
#

I would show the output of /version but am not at my PC

humble hollow
#

?ask @compact smelt

worldly heathBOT
#

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.

jaunty night
#

Does anyone have any good guides on creating custom entities for 1.15 or versions close to it?

#

Most of the guides I found are out of date

vale slate
#

ohm, I only found one for 1.13 and changed it around a bit now it works for 1.14

#

1.15 I haven't touched yet

jaunty night
#

Pretty sure 1.14 is pretty close to 1.15

#

Can you hmu with that link?

vale slate
#

should I send you the 1.13 version or the new one I made?

jaunty night
#

It will be helpful to send both

#

So I can see the original source and the edited version

#

so it will make it much easier to convert it to 1.15

sturdy oar
#

Define custom entity tho

vale slate
#

the 1.13 version won't help you much I think, they changed this stuff completely

jaunty night
#

Ah

#

Then send me the 1.14 one*

vale slate
#

one thing

#

these are just the methods you should use to do this things

#

you can paste them to your plugin anywhere

uneven cradle
#

Could someone explain how to use the constructer to get a new instance of your plugin?

vale slate
#

you need to save it in onLoad to a static variable in your main class

tiny dagger
#

public classname() {
this is a constructor with no parameters
}

jaunty night
#

ehh

tiny dagger
#

can be called as new classname();

jaunty night
#

MFM I would avoid using a static instance in main class

#

that can lead to static abuse

#

I'm pretty sure there's a JavaPlugin# function you can use

silk gate
#

i mean your main class would be a valid use case for a singleton

#

but just use dependency injection

vale slate
#

this is what I meant

#

@jaunty night

jaunty night
#

What I normally do is this

#

hang on lemme grab a code snippet

vale slate
#

I discussed this topic to death earlier this day, I don't like to do it again

dusty topaz
#

you don't want to do that every time

jaunty night
#

That's what I normally do

vale slate
#

This is discouraged

jaunty night
#

hang on

#

Fuck

#

wrong copy paste

vale slate
#

oh and to the Entity topic

dusty topaz
#
    public static <T extends JavaPlugin> T getPlugin(Class<T> clazz) {
        Validate.notNull(clazz, "Null class cannot have a plugin");
        if (!JavaPlugin.class.isAssignableFrom(clazz)) {
            throw new IllegalArgumentException(clazz + " does not extend " + JavaPlugin.class);
        } else {
            ClassLoader cl = clazz.getClassLoader();
            if (!(cl instanceof PluginClassLoader)) {
                throw new IllegalArgumentException(clazz + " is not initialized by " + PluginClassLoader.class);
            } else {
                JavaPlugin plugin = ((PluginClassLoader)cl).plugin;
                if (plugin == null) {
                    throw new IllegalStateException("Cannot get plugin for " + clazz + " from a static initializer");
                } else {
                    return (JavaPlugin)clazz.cast(plugin);
                }
            }
        }
    }
#

a lot slower than

#

return instance;

jaunty night
#

yeah it was wrong copy paste from a guide I made

#

I made something like this is discourgaed

#

and I copied that code without thinking

#

and I meant to copy paste the one that said "this is a better way"

vale slate
#

@jaunty night

#

all imports are NMS in Entity

jaunty night
#

Is NMSEntity a class within NMS or is it a class that is made by you

#

or is it just a placeholder

vale slate
#

It is any non abstract entity in the nms package

jaunty night
#

Ah so it's a placeholder

#

so you just replace it with like a Zombie

#

that's in the NMS package

vale slate
#

yes, my bad should have made that more clear

uneven cradle
#

Excuse my ignorance but is this converstaion about my problem or someone else's?

jaunty night
#

This convo is about custom entities

vale slate
#

about Atom's problem

jaunty night
#

For your problem I tend to use different things depending on what I'm trying to do.

vale slate
#

It was the instance thing

jaunty night
#

Yeah ik

jaunty night
#

Pretty sure he's talking about constructors here cheif

vale slate
#

I think he/she wants to get a instance of his plugin

jaunty night
#

Let's ask, @uneven cradle Do you want to get a general instance of your plugin, or how to use an instance within a constructor?

uneven cradle
#

I want to be able to use it with a BukkitRunnable, so I think the first one?

#

Which is not in the Main class BTW

vale slate
#

could you send us the class extending JavaPlugin you have

uneven cradle
#

Yes, hang on

#
import org.bukkit.plugin.java.JavaPlugin;

public final class HealBackport extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}```
#

Currently I'm not actually doing anything there because I don't know what should be done.

paper compass
#

How do I give the player a reward daily?

vale slate
#

with a runnable

jaunty night
#

Ehh

vale slate
#

||just kidding||

jaunty night
#

Depends if the server will run 24/7

#

oh

#

lol

vale slate
#

use a database, and write the dates to it

jaunty night
#

then use something to check on that database

frigid ember
#

^ they login, check the last date they received the reward, if it was the day before then give them it again ezpz

vale slate
#
import org.bukkit.plugin.java.JavaPlugin;

public final class HealBackport extends JavaPlugin {
        
    private static HealBackport instance;    


    @Overrride
    public void onLoad(){
      setInstance(this);
    }

    @Override
    public void onEnable() {
        // Plugin startup logic

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    public static HealBackport getInstance(){
        synchronized(HealBackport.class){
        if(instance == null{
          throw new IllegalStateException("Not initialized!");
        }
        return instance;
        }
    }

    private static synchronized void setInstance(Healbackport instance){
     HealBackport.instance = instance;
    } 
}
#

@uneven cradle

jaunty night
#

Quick quesiton, why is the setInstance synchronized?

marble narwhal
#

Why would you synchronize it though.

#

Yeah

uneven cradle
#

Which main do I import?

vale slate
#

oops typing error

jaunty night
#

You'd just use HealBackport.getInstance() @uneven cradle

#

unless I'm misunderstanding

vale slate
#

Why would you synchronize it though.
@marble narwhal yeah, not necessary on second thought

#

@uneven cradle if you want an explanation what this thing does in detail, feel free to ask

#

I'll be back in ~5 mins

uneven cradle
#

What does instance refer to here?

jaunty night
#

Instance is a static reference to your plugin

marble narwhal
#

It refers to the variable private static HealBackport instance;

#

Yeah

jaunty night
#

I tend to not do it this way

#

but it's fine if you do

marble narwhal
#

What are you using if I may ask? ๐Ÿ˜›

#

JavaPlugin#getPlugin?

jaunty night
#

nope

#

depends on what I'm doing

#

If I'm doing something small scale I tend to just use static

#

If I'm developing some form of API I usually just create an interface, put my API methods their, create a class that implements that and use that.

#

If I'm developing something that's really large scale

marsh hawk
#

Stupid question but anyone know how to differentiate a click in the top and bottom inventory. I'm not exactly sure what the index bounds are for each one lol

jaunty night
#

I'm pretty sure there's an enum in InventoryClickEvent

#

or in InventoryView

#

but I'm not sure

#

I need to check

#

AH

#

So there's a method

#

InventoryClickEvent#getClickedInventory()

#

and that returns an Inventory

marsh hawk
#

Oh crap so they're not considered one inventory?

#

beautiful thanks man

marble narwhal
marsh hawk
#

Thats more for contents though. Unless i want to iterate through each item

jaunty night
#

InventoryView also has a getType

#

hang on

#

You can use InventoryClickEvent#getClickedInventory() to get an instance of inventory

#

and then check if Inventory#getType is equal too InventoryType.PLAYER

#

if it is then it's the bottom one

#

if it is not then it's the top one

#

I'm unsure weather this will work

#

but I have pretty strong feeling that it will

marsh hawk
#

just ended up doing e.getInventory().equals(e.getView().getBottomInventory(). Not sure if it works yet but i don't see a reason why not

chrome edge
#

Or you can just check clicked inventory name.

marble narwhal
#

Don't check on the inventory name, what if you change the name, or what if a different plugin has the same inventory name?

marsh hawk
#

That's very incosistent

chrome edge
#

Man he just coding his plugin...

jaunty night
#

doesn't change that it's bad design

marble narwhal
#

There are really simple ways to check this without using the inventory name.

#

Which were also listed

chrome edge
#

I'm checking inventory name that is simple way to do. I also change inventory name with packets.

#

A lot of player using it without any issue and that is faster. Also you can change inventory name without closing.

jaunty night
#

you can also just directly check if one inventory equals another

chrome edge
#

Yeah you can check top and bottom with click event. I meant to say as I understood from your picture, you're making trade GUI. I though you'd like to change inventory name without closing and saving trading player's uuid as a gui name

marsh hawk
chrome edge
#

xD

marble narwhal
#

Why are you adding a switch with all materials in the first place ๐Ÿ˜‚

chrome edge
#

Omg

#

really why

jaunty night
#

hang on

chrome edge
#

Hhaa

jaunty night
#

why would you do that

marsh hawk
#

Eclipse gives the option to auto import all enum thingos

jaunty night
#

just use a default

marsh hawk
#

and i pressed it

jaunty night
#

oh lmao

chrome edge
#

So the question is WHY

#

oh

#

it was a mistake

#

haha

#

good luck to your eclpise

jaunty night
#

eclipse moment eclipse moment

marsh hawk
#

managed to survive

chrome edge
#

why there is a method that call the all materials as switch cases -_-

#

You may want to switch another IDE which is intellij

marsh hawk
#

im too used to eclipse

#

can't change

#

tried to move to IJ but i can't it's too new and pretty

chrome edge
#

I used to like you but after using intellij I feel more comfort

#

Oh okay

marble narwhal
#

I know people who said that, and eventually switched xD

vale slate
#

Eclipse for the win

ebon lantern
#

No, IntelliJ is the best ๐Ÿ˜‰

chrome edge
#

I love Eclipse. It was my first IDE for Java but it is bad...

marsh hawk
#

I use notepad++

chrome edge
#

oh that is good choice!

jaunty night
#

move this to #general bois

marble narwhal
#

Was just about to say lol

marsh hawk
#

mb lol

vale slate
#

Now they are all silent

boreal tiger
#

I love Eclipse. It was my first IDE for Java but it is bad...
@chrome edge eclipse is not bad lol

jaunty night
#

It's not bad, there's just better options.

vale slate
#

that's a matter of opinion

nova mural
#

if intellij had eclipses project viewer iโ€™d be so happy

vale slate
#

I use Eclipse with SonarLint and AllClassDecompiler

chrome edge
#

I used to use command block instead of eclipse. It was better

vale slate
#

I use MS editor

next perch
#

Hi guys, can anyone help me in loading a plugin?

vale slate
#

uhm, could you be a little more specific, please?

next perch
#

yeah sure

#

I downloaded a plugin and put it into the plugin folder. However when I start the server it says that it couldn't load the plugin

vale slate
#

can you send the log file please?

next perch
#

You mean the entire message on console?

#

Can I post it here?

vale slate
#

?paste

worldly heathBOT
next perch
#

I should have sent it

vale slate
#

you need to save it and then post the link from your browser

next perch
vale slate
#

you need to add a plugin called HolographicDisplays to your plugin folder

next perch
#

So do I have to find it on internet

#

On spigot mc

vale slate
next perch
#

Thank you so much

#

Is there a way to undestand what the console says or should I have learnt java language?

#

just asking

vale slate
#

Oh in this case you can understand without java knowledge

#

one second please

next perch
#

Oh come on, another error occurred...๐Ÿ˜ฉ

vale slate
#

that one was very clear xD

next perch
#

Yeah but I dont have practice with this kinds of things

vale slate
#

Sry, I have a weakness for ascii art

subtle blade
#

It highlights exactly what you want to look for

#

That way you can direct it to the required author and tell them where the error occurs ๐Ÿ™‚

vale slate
#

this time we only have a simple problem

next perch
#

Do i have to change server version?

vale slate
#

what is the name of the jar in your server folder?

next perch
#

The name of the server?

#

spigot-1.14.4.jar

#

I feel like a complete idiot, sorry for wasting your time

vale slate
#

ok, please send the latest.log in the logs folder

frigid ember
#

Where did you get the spigot jar? And does murder mystery say on its page that it supports 1.14?

vale slate
#

it does, but I found the problem, he/she has the wrong murder mystery version

frigid ember
#

Ah

next perch
#

The plugin should support all the version from 1.12.2 to 1.15.2

#

I took the serverfile from spigot mc

#

I can give you the latest.log if you want

vale slate
#

please

next perch
#

do i use the link you gave me before?

vale slate
#

oh damn you can't send files in here, send it via DM to me or verify your account

subtle blade
#

?paste is fine for log files

worldly heathBOT
next perch
subtle blade
#

Surely that's not the whole log file

vale slate
#

^

next perch
#

ops sorry

subtle blade
#

Also, I find messages like that super annoying lol

#

This server is running CraftBukkit version git-Bukkit-3e3818b (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)

#

You're on CB, not Spigot ๐Ÿ˜›

next perch
#

Ok i'll find the server file

frigid ember
#

?bt

worldly heathBOT
frigid ember
#

Use buildtools

next perch
#

Thanks guys I dont't want to anny you anymore

#

annoy

subtle blade
#

It's fine ๐Ÿ™‚ We're here to answer questions

vale slate
#

^

pure pasture
#

Hi guys who can you cancel a specific runTaskLater Task?

uneven cradle
#

Has player.getMaxHealth() been deprecated?

subtle blade
#

Yes. Use attributes instead

#

Trixone, you should have a BukkitTask on which you can call cancel()

hoary parcel
#

as the deprecation note says...

uneven cradle
#

How can I compare player.getMaxHealth to GENERIC_HEALTH_ATTRIBUTE

subtle blade
#

You shouldn't use getMaxHealth() at all.

#

LivingEntity has a #getAttribute() method

uneven cradle
#

OK

pure pasture
#

I want to cancel it once something happens

subtle blade
#

It's actually Attributable that has that method, lol. All living entities should have it

pure pasture
#

From another method you know?

subtle blade
#

you should have a BukkitTask on which you can call cancel()

#

runTaskLater() should return it

pure pasture
#

I just understand what you said lol

#

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

trail dust
#

Hi guys, trying to get WorldGuard API to work still and its just throwing back null errors. I'm trying to work with regions so I just want it to send back a list of the regions in the world

#

RegionManager regions = container.get(world);

#

This time of code is getting an error as it throws back a null since it can't find the world

obtuse rose
#

Would Material.LEGACY_XXX_YYY work if I compile it with 1.15 API and run it on 1.12 server?
edit: I know there are some bytecode editing stuff going on on the server but I don't really understand how it's work

tranquil rampart
#

Hi, ppls.
How can i do if an user login/sigin tp to world named "lobby" and after login/singin to hub

obtuse rose
#

@tranquil rampart authme?

tranquil rampart
#

no

subtle blade
#

Would Material.LEGACY_XXX_YYY work if I compile it with 1.15 API and run it on 1.12 server?
No

obtuse rose
#

@tranquil rampart what do you mean by login/sign-in then, do you have some sort of /login command?

#

@subtle blade thanks ๐Ÿ˜„

tranquil rampart
#

wdym

obtuse rose
#

what do you mean by

#

login/sigin

tranquil rampart
#

/login and /register

obtuse rose
#

what plugin are you using for that?

tranquil rampart
#

LoginSecurity

hoary parcel
#

why do you need that?

#

pls dont tell me you run a cracked server

#

in 2020

obtuse rose
#

@hoary parcel there's no other explaination for that though .-.

subtle blade
#

It's a good thing we don't support offline servers ๐Ÿ˜„

vale slate
#

It is the only legal way

frigid ember
#

Lo

uneven cradle
#

How can I compare getHealth() to GENERIC_MAX_HEALTH?

hoary parcel
#

just get the value of that attribute with the attribute api

uneven cradle
#

Is that Attribute.getValueOf("GENERIC_MAX_HEALTH")

subtle blade
#

There are constants.

#

Attribute.GENERIC_MAX_HEALTH

uneven cradle
#

So like > Attribute.GENERIC_MAX_HEALTH

boreal tiger
#

@uneven cradle Entity#getAttribute

uneven cradle
#

But that returns an Attribute object.

#

I need a double.

boreal tiger
#

Attribute#getValue

#

look at the javadocs

uneven cradle
#

What I currently have is player.getHealth() < player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()

#

Is that right?

subtle blade
#

Yep. Looks good to me

pure pasture
#

Guys how do remove a section from a config file

#

?

subtle blade
#

Set it to null

pure pasture
#

Doesn't work I already tried that

#

main.yamlConfigurationinvite.set(p.getName(), null);

subtle blade
#

Did you save the config? because that's most definitely how you do it ;P

pure pasture
#

Like this right?

frigid ember
#

If you set a value in the config as null it will remove it

pure pasture
#

I tried

#

main.yamlConfigurationinvite.set(p.getName(), null);
@pure pasture

frigid ember
#

Did you do what Choco said?

pure pasture
#

Isn't that right?

frigid ember
#

did you save it?

pure pasture
#

Wait

#

I'm apparently a dumb ass

#

lol

#

I did not

subtle blade
#

Yea, gotta save your changes after you make 'em ;P

frigid ember
#

๐Ÿค 

golden chasm
#

I'm having some really bad tps issues and im not sure whats causing it. any advice?

subtle blade
#

Spigot_Latest_1.15.2.jar:git-Spigot-2040c4c-a1a705e
That looks to me like a not-BuildTools-generated Spigot build

#

Though we'll need a timings report. Can't do much based on just a log

golden chasm
#

Ok, how can I find a timings report?

#

sorry, first time messing with plugins and stuff

subtle blade
#

You can run /timings start, let your server run for a bit. 15 - 30 minutes or whatever. Longer if you'd like. Then /timings paste to generate a report

#

Run that when you're having some server issues

golden chasm
#

thank you

#

ill check back in 15-30 then

subtle blade
#

It will send you a link in chat that you can then send here, we'll be able to diagnose a bit further from there ๐Ÿ™‚

golden chasm
#

thank you so much, one day ill know this stuff on my own xD

subtle blade
#

Can only learn by first not knowing

golden chasm
#

should i just leave timings on?

subtle blade
#

Yea the only standout issue in that timings report is world saving

golden chasm
#

hm I wonder whats causing the lag then, i have around 16 consistent tps with 6 players and 16 gb

subtle blade
#

With how little plugins you have and the relatively low player count, I would lower that RAM down to 4GB. Maybe 6 if you're still having issues. You shouldn't need much more than that.

golden chasm
#

It's not my personal ram, its the ram for the server itself

subtle blade
#

That may help a little to declutter any unnecessary garbage sitting around collecting dust, though to address world saving, best option is to reduce server view distance

golden chasm
#

through a hosting service

#

ok Ill look into the view distance. thank you

subtle blade
#

Definitely recommend lowering your plan then ๐Ÿ™‚ Save yourself a bit of money because 16GB is overkill and will likely lower performance over time

#

Java's GC is super lazy and won't clean up any memory unless it has to

golden chasm
#

really? I never knew that having too much would slow it down as well

subtle blade
#

I'd say you would do just fine on 4 - 6 GB

golden chasm
#

ok. thank you a ton for the help. Hopefully these things fix the tps issues im having

subtle blade
#

View distance should help a bit. Lower it by a few notches and see if that helps ๐Ÿ™‚

sage flame
#

What should I use as a restart script? Right now I just use the start script for it, idk if there's a better way of doing it

subtle blade
#

Start script is just fine

#

Doesn't need to be super fancy

sage flame
#

๐Ÿ‘

keen compass
#

@sage flame can create a service script

#

only thing I can think of that is better

sage flame
#

thanks

keen compass
#

I have a service script and the handy thing with it is that when I reboot my dedi

#

my servers startup automatically

#

I also don't need to switch users to restart/stop/start either

sage flame
#

Ah okay, I don't think that's really necessary for my needs

#

I mainly do trouble shooting/bug testing and play with friends on my server

keen compass
#

well, you said you didn't know a better way. Just merely informing you what that better way is XD

sage flame
#

That's true

golden chasm
#

seems to be much better so far Choco, the view distance and I installed clearlag, the two seem to have fixed the problem together

subtle blade
#

We typically advise against clearlagg because it causes more issues than it solves, but if you're noticing an improvement it should be fine

#

You have few plugins and players, I can't imagine it will be that big of a deal

golden chasm
#

Ok, I will keep that in mind. If tps starts going down thats where I'll look first. Thanks a ton for all of your help!

subtle blade
#

oki Pleasure. Best of luck

kind berry
#

so I have been trying to find a way to code a player tracker like the one Dream did for the man hunt, but I don't know how to edit the compass values, can anyone help?

pulsar badger
#

So I have an old server I used to run in 1.12.2 and have not updated it since but wish to update it to the latest version of Spigot again. Is it best to update through major versions and update all plugins and get it working on 1.13, then 1.14, etc. Or should I just jump straight to latest and fix bugs? I'm a very experienced server owner and error chasing is not new to me, I'm more so concerned about corrupting 5+ years of player data.

Thanks in advance.

frigid ember
#

Hi there

#

it seems if holographic displays are getting deleted

#

but no one is deleting them ;P

radiant pollen
#

@pulsar badger You might as well just update to latest. I would back-up your worlds and plugin folder though. The only issue with updating to new versions with old worlds is you have to explore new chunks to see any of the world changes.

pulsar badger
#

So long story short, the gamemode I run is an economy survival that has a "Town" world where people live, have property and store their items, then there's a "Wild" world that get's wiped/reset upon game updates.

#

So the new chunk loading is not needed.

#

I'm more so just wondering if anyone knows of any obvious issues with skipping major version?

#

versions

#

But thanks @radiant pollen

burnt raptor
#

How do i use the bukkit task scheduler?

pulsar badger
#

Also is there a simple way to just download spigot ๐Ÿ˜‚ Buildtools seems to just break.

radiant pollen
#

@pulsar badger No, there isn't. That's why I said just update to latest. Just make sure you do a backup of everything first.

#

No, you have to use BuildTools.

pulsar badger
#

BuildTools on Windows?

radiant pollen
#

@burnt raptor Bukkit.getScheduler().runTask()

burnt raptor
#

thx

red zenith
#

@pulsar badger are you having issues with using BuildTools on Windows?

radiant pollen
#

@pulsar badger I would just try updating to latest first and if it doesn't work out go through the major versions. I can't see why it would mess up, but it's so much faster than going through the major versions you might as well try it.

pulsar badger
#

I just want to download the spigot jars ๐Ÿคฆโ€โ™‚๏ธ why does it have to involve installing git bash

burnt raptor
#

You have to download git bash

#

Its not that hard

red zenith
#

Because of Legalities?

radiant pollen
#

Because spigot can't distribute the jars like that.

#

It's illegal

pulsar badger
#

What happened to that simple gui program? Is it still updated

#

Yes but I just want to run 1 installer

burnt raptor
#

you have to download the buildtools and run it from the git bash....

pulsar badger
#

I tried that and the installation failed and git died

red zenith
#

I can run it from the cmd prompt

burnt raptor
#

How can i run a piece of code after a certain amount of time?

sturdy oar
#

Bukkit schedulers?

radiant pollen
#

@burnt raptor I told you that already. Look up

burnt raptor
#

But i can't set a delay

radiant pollen
#

You should go through the documentation for the Bukkit scheduler

sturdy oar
#

yes you can

#

just remember that it's in ticks and not seconds

subtle blade
#

What happened to that simple gui program? Is it still updated
Donโ€™t think itโ€™s still up to date. Iโ€™ve considered making my own a few times

vernal spruce
#

anyone know where i can snatch the namespacedkey list for minecraft?

#

mostly the enchantment keys

cold wharf
#

Hey what is the event for crop trampling?

sturdy oar
#

What do you think of this tick converter enum?

#
public enum TicksConverter {
    SECONDS(20),
    MINUTES(20*60),
    HOURS(20*60*60),
    DAYS(20*60*60*24),
    WEEKS(20*60*60*24*7),
    YEARS(20*60*60*365);
    
    private final int conversion;

    TicksConverter(final int conversion) {
        this.conversion = conversion;
    }

    public long convert(final long value, final TicksConverter unit) {
        return value*unit.conversion;
    }
}
proper rune
#

Nice!

radiant pollen
#

@cold wharf EntityInteractEvent

#

Check if block is soil, farmland, whatever it's called these days.

cold wharf
#

farmland

regal siren
#

@sturdy oar instead of calculating it in the parameter, why not put the answer in it, its faster

cold wharf
#

Thank you zaxarner I will try it

sage flame
#

so I have been trying to find a way to code a player tracker like the one Dream did for the man hunt, but I don't know how to edit the compass values, can anyone help?
@kind berry you can use the setCompassTarget method

sturdy oar
#

define faster because i don't get it

#

I don't think that there's a huge difference between writing 20*60*60 or 72_000

regal siren
#

the compiler has to calculate for example everytime what 20*60 is, but if you put the answer of that in it, its quicker, not that you will find a bigger difference

kind berry
#

ok thx @sage flame

frigid ember
#

Can someone help me?
If i have:

    public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)  {
        if(event.getMessage().equals("/plugins") && !event.getPlayer().isOp()) {
            event.setCancelled(true);
        }
    }
}```
And someone does /PLUGINS (In capital letters) then it still works!
#

it should just be "plugins" without the /

sturdy oar
#

why are you using PlayerCommandPreprocess tho

frigid ember
#

You might want to also add pl and ?

cold wharf
#

add ignorecase

frigid ember
#

^

regal siren
#

Or just use startswith

inland meteor
#

.equalsIgnoreCase

regal siren
#

you can also do /pl

frigid ember
#

Alright, thanks guys!

#

Yes, i need to add more, this was only a test

sturdy oar
#

yeah you either use equalsIgnoreCase() or getMessage().toLowerCase()

regal siren
#

or startsWith

#

:kappa:

burnt raptor
#

How can i run a piece of code after a certain amount of ticks inside of a public void

sturdy oar
#

we already answered

#

read Bukkit Scheduler documentation

regal siren
#

No

burnt raptor
#

i siad inside public void

radiant pollen
#

@burnt raptor Did you look at the documentation at all?

regal siren
#

Dont use a bukkit scheduler

#

its trash

cold wharf
#

wdym?

regal siren
#

use Executors

sturdy oar
#

??? wtf

cold wharf
#

@burnt raptor do you mean tick cooldown?

regal siren
#

Bukkit schedulers are a no go lol, use Executors

#

they are also easier to do

#

less messy

burnt raptor
#

Is there a documentation for them

regal siren
#

Google it

radiant pollen
#

Don't executors create new threads? @regal siren Never messed with them before.

cold wharf
#

I don't think so

sturdy oar
#

I used executors

#

only newCachedThreadPool a few times when working with CompletableFutures

regal siren
#

If a task is submitted for execution and the thread is currently busy executing another task, then the new task will wait in a queue until the thread is free to execute it.

sturdy oar
#

I think like Bukkit scheduler is much easier for beginners

sage flame
#

I agree

#

Was very simple to learn

sturdy oar
#

I know of course that Executor has more potential but they'll end up just copying stuff

radiant pollen
#

I mean the BukkitScheduler surely uses the ExecutorService.

#

It's just the BukkitScheduler is probably easier and it's also synced with the server tick, right?

sturdy oar
#

it's also very useful when stuff can't be done async

cold wharf
#

What is BukkitScheduler?

#

๐Ÿ˜ฎ

sage flame
#

allows you to schedule tasks to be done

sturdy oar
#

the documentation is pretty well done as well

cold wharf
#

Oh

#

Like do something in every 15 minutes?

flat aspen
#

I'd any day prefer Bukkit scheduler over executors

#

the interface is very convenient (aside from requiring a plugin instance), maintains a threadpool internally already and allows for running sync tasks

subtle blade
#

I mean the BukkitScheduler surely uses the ExecutorService.
It does

#

private final Executor executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %d").build());

sturdy oar
#

oh so it's c a c h e d

subtle blade
#

Yes. As any sensible executor should be lol

sturdy oar
#

I still need to properly understand those things

pulsar badger
#

Oof

#

So updating all plugins and spigot to latest, then booting results in my worlds just regenerating ๐Ÿ‘

#

Despite my server having 0 errors with plugins in 1.12.2

#

Guess I'll go for the slow option updating through the versions ๐Ÿ˜‰

sage flame
#

check that the world file has the same name as in the server.properties

frigid ember
#

Not all world files can work universally, that's probably why it regenerated the new world

runic wadi
#

the bukkit async executor feels so unresponsive, i just make my own async executor

#

something is wrong with it

tiny dagger
#

Executots.newsinglethreaded() :p

runic wadi
#

well it has a thread pool so no

#

but it's still like delayed or something

tiny dagger
#

for my mysql requests it's perfect

vale slate
#

I use standard Java threads for that, these Bukkit runnables annoyed me too many times

runic wadi
#

...

#

bukkit runnables use threads

vale slate
#

ik, I just was too annoyed by the framework, so I used my own threads for async tasks

#

the sync ones are pretty useful

runic wadi
#

the only thing I use the scheduler for is putting a task on the main thread

#

i'm under the assumption the async scheduler aligns with ticks or something

#

not certain

#

but it's bad

vale slate
#

if I'm in NMS classes of my plugins I just implement ITickable and register to the scheduler

runic wadi
#

well who cares if an async task is performed without the ticks

#

the only part that matters is the last bit where you merge into the main thread if you have to

vale slate
#

I only use the tick stuff if I want to be sync

runic wadi
#

so just write the code normally lol

vale slate
#

not if I want it to be executed every tick

runic wadi
#

oh yeah then the bukkit scheduler is fine

vale slate
#

in NMS i prefer the tickable option

runic wadi
#

does it matter

vale slate
#

ITickable is more clean

#

I don't use it in normal plugins because of the version dependence

#

It's a matter of taste

frigid ember
#

Hello,

I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 48.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java

I am using ProtocolLib to handle packets.

Thank you!

vale slate
#

the first really nice asked question today! Congratulations

green oasis
#

whats the ip and version of the server?

vale slate
dusty topaz
fading shoal
#

Hello,
I have an issue where when I purchased a script I was double charged to my paypal and it sent 2 payments of 2.99

vernal spruce
#

talk to the author

tiny dagger
#

^

vale slate
#

Hello,

I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 48.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java

I am using ProtocolLib to handle packets.

Thank you!
@frigid ember there is nothing in line 48

vernal spruce
#

why not handle packets yourself,like the real man Kapp

frigid ember
#

My bad, line 40

vale slate
#

oof, I had this problem too, but I don't know how I solved it

neat orbit
#

Hey, I have a player in my server who changed their username but it is still the same account. They are treated as they are a brand new player in the server, how do I make it so that players who change their username still get to keep their /homes and /balance and everything?

sturdy oar
#

your server is offline mode?

vale slate
#

some plugin developers still haven't learned

neat orbit
#

@sturdy oar Yes.

sturdy oar
#

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

neat orbit
#

then what

vale slate
#

reeeeeeeeeeeeeeeeeeeee ghost ping

#

then what
@neat orbit We don't support cracked servers on here for legal and moral causes

#

@neat orbit with the exception of BungeeCord users of course

sage flint
#

Hey can i ask sth bout my databank?

vale slate
#

sure

#

*database

sage flint
#

20:50:40 [SEVERE] Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=127.0.0.1)(port=3306)(type=master) : Socket fail to connect to host:127.0.0.1, port:3306. Connection refused (Connection refused)

Why could it be? I made the user ranks, the rigths were given and the panel is done
What could it be?
Sorry im new in that ๐Ÿ˜„

vale slate
#

the host couldn't be found

sage flint
#

Hmm, I know but how could i fix that?

vale slate
#

is the host on the same server?

sage flint
#

moment

#

yes

atomic steeple
#

I dont get that

#

what is wrong there

#

its the latest build of the version

vale slate
#

yes
@sage flint have you used localhost as adress in the mysql config then?

bleak osprey
#

where is it?

sage flint
#

he is the guy who owns the server

#

lul

vale slate
#

depends on your plugin, normally in the plugin's config

frigid ember
#

Hello, still looking for a solution to this.

I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 40.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java

I am using ProtocolLib to handle packets.

Thank you!

bleak osprey
#

its setted up in the plugin config

#

user got privileges on database

vale slate
#

uhm, the plugin can't find the database

bleak osprey
#

its LP

vale slate
#

so there must be a error in the config

bleak osprey
vale slate
#

or you have a error in your firewall

bleak osprey
#

look

sage flint
#

what could we dou about it?

bleak osprey
#

or you have a error in your firewall
@vale slate how could i check?

vale slate
#

LP = LuckPerms?

bleak osprey
#

yes

vale slate
#

one moment please

sage flint
#

Ok ^^

tranquil rampart
west lynx
#

[22:03:55] [Spigot Watchdog Thread/INFO]: Startup script './start.sh' does not exist! Stopping server.
[22:03:55] [Thread-4/INFO]: Stopping server

#

I dont know how to make a forum on the Spigot website please help

tranquil rampart
#

@west lynx how can i setup it?

west lynx
#

Is this Hosted on your computer?

tranquil rampart
#

Yes

vale slate
#

Ok ^^
@sage flint may I see you LuckPerms config (please blur out the password)

west lynx
tranquil rampart
#

k

#

@west lynx lul doesen't help

#

with first step xD

sage flint
#

wait

pastel condor
#

I created this gui, and I want to make it so when people click "add a friend" it then allows AyncChatEvent to be active, to then check what friend the player said in chat. Though I don't want it always active wasting resrouces, how can I do this?

vale slate
#

that's not s problem with the start sh it's a stackof problem @tranquil rampart

tranquil rampart
#

k, and how can i solve it

bleak osprey
dusty topaz
#

@vale slate having the event always be active isn't intensive

#

having it register / unregister is intensive

vale slate
#

????

pastel condor
#

me?

dusty topaz
#

oops

#

wrong tag yeah

#

:p

vale slate
#

np

dusty topaz
#

pfps both blue

#

sorry :D

pastel condor
#

How can I make sure it doesn't fire when a player types another player's name?

dusty topaz
#

just have a collection of uuids listening for

pastel condor
#

I have that

#

but how would I know which world to add the friend to?

dusty topaz
#

not sure exactly what youre doing

#

but you could use a map i suppose

#

Map<UUID, UUID>

pastel condor
#

hmm

sage flint
vale slate
#

I was interested in the storage method

sage flint
#

Maria DB

vale slate
#

so you use MariaDB on your server too?

sage flint
#

Yea

vale slate
#

and change address to localhost:3306

sage flint
#

Ok

dusty topaz
#

makes no difference :p

vale slate
#

MariaDB is a very high rated bit**

sage flint
#

Hmm? I am actually confused rn lol sry

vale slate
#

MariaDB has the problem of very undefined errors

#

let me try it, one moment

sage flint
#

Ahhh

#

Ok

pastel condor
#

okay so I fixed one bug, but I am still left with the issue: how can I only add the player as a friend if they clicked the "add friend" button instead of just typing their name in chat?

dusty topaz
#

in a gui?

#

or in a text component

pastel condor
#

GUI

dusty topaz
#

then just make it run the same code

pastel condor
#

so I have my if (event.getRawSlot() == 35) { player.sendMessage("please type the player you want to add in chat"); //add friend }

dusty topaz
#

run the same code you run in chat

pastel condor
#

wdym?

#

but how would I check that they just clicked slot 35?

#

I would somehow have to send that data over?