#help-development

1 messages · Page 808 of 1

rough drift
#

with a couple types

alpine urchin
#

no hell no

#

or wdym

rough drift
#

i.e.

river oracle
#

that'll never get accepted we want to try to avoid a general packet API

alpine urchin
#

forget it

flint rune
#

I want to modulate this when I import uuid from every plugin

alpine urchin
#

paper has a one liner to add your handler to the netty pipeline when a channel is initialized

rough drift
#
public interface Packet {
  String getName();

  int getId();

  <T> T getNMSPacket();
}
paper viper
alpine urchin
#

whole point of an injector is to inject into a section where the player handler is ready

#

to add your handler

river oracle
#

iirc its in the readme of either CB or B

rough drift
#

It wouldn't be a general packet API, you'd still need NMS

alpine urchin
#

@rough drift unnecessary

glossy venture
#

it would be difficult to maintain yeah

alpine urchin
#

just what paper does as i described would be enough

paper viper
#

i mean the truth is that u cant do everything with api

rough drift
alpine urchin
#

look at viaversion how they use paper’s utility

#

to injection

rough drift
#

k

river oracle
alpine urchin
#

but then right below that is the injector for spigot

#

XD

#

hundred+ lines

rough drift
#

I love hangar /s

remote swallow
#

spigot doesnt add stuff for nms related stuff because its nms, if there something missing from the api make a jira ticket for a feature request and someone might do it

quaint mantle
#

Spigot cant just provide packet manipulation api tho.

alpine urchin
#

they shouldnt

flint rune
river oracle
#

you'll probably have to fork bukkit and craftbukkit at worst

alpine urchin
#

i can

river oracle
#

UUID is pretty deeply rooted

alpine urchin
#

what is his problem

#

okay

#

im lazy

#

anyway

river oracle
#

he wants to spoof UUIDs for some reason

rough drift
#

My suggestion is just to add a listener which makes it much easier to use handlers, but provides no actual packet data other than class name / packet id, it wouldn't be a packet API imho

river oracle
#

like uproot the entire UUID system for players

alpine urchin
#

just use protocollib or packetevents

paper viper
#

switch to a server side mod and use mixins or fork the server

rough drift
#

you can just change the return value from the auth API or change it when sending to players

flint rune
#

ty

rough drift
#

@alpine urchin where is this Paper API thingy

alpine urchin
rough drift
#

ah I see

quaint mantle
#

hi i need help

#
private Villager survivalNPC;
    @Override
    public void onEnable() {
        instance = this;
        getServer().getPluginManager().registerEvents(new joinEvent(), this);
        getServer().getPluginManager().registerEvents(new npcClick(), this);
        getServer().getPluginManager().registerEvents(new compassClick(), this);
        this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        getServer().getPluginManager().registerEvents(new spawnProt(), this);

        Location survivalnpclocation = new Location(Bukkit.getWorld("spawn"), 17.466, 5, 8.646);

        if (survivalNPC == null || survivalNPC.isDead()) {
            survivalNPC = (Villager) Objects.requireNonNull(Bukkit.getWorld("spawn")).spawnEntity(survivalnpclocation, EntityType.VILLAGER);
            survivalNPC.setAI(false);
            survivalNPC.setCollidable(false);
            survivalNPC.setCustomName(ChatColor.GREEN + "Survival");
            survivalNPC.setCustomNameVisible(true);
            survivalNPC.setRotation(survivalNPC.getLocation().getYaw() + 90, 0);

        }
        else{
            return;
        }
    }```
#

after restarting the server, even though the npc is already spawned, it spawns a new one

chrome beacon
#

yeah ofc it will

#

You need to check if it already exsists

#

oh and use the spawn method that takes a consumer

quaint mantle
remote swallow
#

no you dont

quaint mantle
#

If survivalNPC == null

remote swallow
#

if its null you spawn it

#

you dont ever find if its there

quaint mantle
#

So how can I fix it?

remote swallow
#

by restarting that value becomes null so its going to spawn again, you need to save something relating to it eg a uuid and a location to check before you spawn it

quaint mantle
#

What?

remote swallow
#

you need to save the villagers uuid

#

then check to see if the entity with that uuid exists at the location before spawning it

quaint mantle
#

how?

remote swallow
#

to start with use to start use your config.yml

quaint mantle
#

Ok

remote swallow
#

then change it to be a custom file once you know how to use the api

quaint mantle
#

Ok

#

But how to check if the uuid exist?

remote swallow
#

you will also need to check the chunk its in is loaded

quaint mantle
remote swallow
#

if the chunk isnt loaded nope

quaint mantle
#

Ok but can I use run task later?

#

Or I must do this

#

?

eternal oxide
#

your question makes no sense

quaint mantle
remote swallow
#

yes, if its not loaded you have to load it

quaint mantle
#

Ok, but how

#

@echo basaltAre you continuing to work on skyblock core or nah?

echo basalt
#

I've got a full-time job, the skyblock core is a passion project

#

I accept donations and work on it when I feel like it

quaint mantle
#

Ok

#

Do you have a TODO list or somewhere that says what still needs to be done?

graceful temple
#

I also accept donations btw

echo basalt
#

Last thing I was working on was uh

#

itemstack system

#

Then I was going to do a menu system

#

I also want to do a library loader

#

Because I have like 10 different libs I partially depend on

#

And I don't want to shade 40mb worth of libs

quaint mantle
echo basalt
#

Yep

quaint mantle
#

yk what, I just did smth like that

echo basalt
#

After the library loader, probably uhh

#

Module system?

quaint mantle
#

Not sure if that is the same thing

#

where AbstractionFrameworkItemStack just has delgated methods from itemstack

remote swallow
#

AHHHHHHHH

rotund ravine
#

Totally


    private val boneMealItemStack by lazy {
        @Suppress("DEPRECATION")
        when (ReflectionSupplier.getLegacy().new) {
            true -> ReflectionSupplier
                .CRAFT_ITEM_STACK_METHOD_ACCESS
                .invoke(
                    null,
                    ReflectionSupplier.CRAFT_ITEM_STACK_AS_NMS_COPY,
                    ItemStack(Material.BONE_MEAL)
                )
            else -> ReflectionSupplier
                .CRAFT_ITEM_STACK_METHOD_ACCESS
                .invoke(
                    null,
                    ReflectionSupplier.CRAFT_ITEM_STACK_AS_NMS_COPY,
                    ItemStack(Material.getMaterial("INK_SACK")!!, 1, 15)
                )
        }
    }

paper viper
#

Bro what 💀

quaint mantle
quaint mantle
#

How can I made a plugin compatible with version 1.8 to latest

rotund ravine
#

Hatred

#

Usually by just using only the spigot api from 1.8

proud badge
#

Do I need to toString this or is the variable already the normal username?

quaint mantle
#

and write abstraction furthermore

paper viper
proud badge
#

because

paper viper
#

if you are using the api, it should be mostly fine?

#

maybe some changes

quaint mantle
#

api's change

#

like return types for example

undone axleBOT
quaint mantle
#

I think Bukkit.getOnlinePlayers() returned different types from 1.8 to 1.12

proud badge
#

true

#

ah its getNam

#

e

#

Also is the getFirstPlayed and lastPlayed reliable or should I save their data when they join/leave instead?

rotund ravine
#

It is reliable somewhat if they have played

grim hound
#

is there any good api for nicknames?

hazy parrot
#

What do you expect to send and what to receive?

grim hound
proud badge
#

What kind of statistics are they talking about?

remote swallow
#

the statistics in the escape menu

proud badge
#

Oh cool I thought those were only clientside

grim hound
#

is this

#

called

remote swallow
#

echo shard

grim hound
#

in the Material class it's called the same?

remote swallow
#

should be

grim hound
#

and you know any good nickname APIs?

#

or do I just change the String name in GameProfile?

remote swallow
#

cant say i know of any nickname apis, so probably custom

twin venture
#

Hi jedis frezee my server when stsartup

#

what is wrong?

slate tinsel
#

How do I get a player from a "String" that has never joined the server before, therefore I want to run whitelist true on the player

echo basalt
# twin venture

subscribe is a blocking method and should be ran in another (Daemon) thread

slate tinsel
#

Should I use offline player?

echo basalt
#

Sure

subtle folio
#

You can, though I think usernames on offline player's are deprecated

slate tinsel
subtle folio
chrome beacon
subtle folio
#

But if you already have their username, cant you whitelist them wihtout needing the player object?

chrome beacon
#

Just get the offline player

slate tinsel
#

Cannot invoke "org.bukkit.OfflinePlayer.setWhitelisted(boolean)" because "target" is null

chrome beacon
#

Looks like your offline player is null

#

Not the uuid

slate tinsel
#

and then notch becomes target which then becomes null

chrome beacon
#

Send your code

#

?paste

undone axleBOT
slate tinsel
#

I think I found the error

twin venture
#

hi , uhh is this wrong?

#

its not getting executed

#

its not working in the JedisPupSub , how i can fix it?

slate tinsel
remote swallow
#

if you want to whitelist offline players too sure, but that will query mojang servers if theplayer hasnt joined before

river oracle
#

spooky!

remote swallow
#

hi miles

subtle folio
#

miles when kilometer shows up

river oracle
#

Miles >>>

grim hound
#

bruh

alpine otter
#

hello! i'm trying to create a plugin that uses javalin as an api. on local machine it works fine but on pterodactyl (docker) it says sh class org.eclipse.jetty.websocket.server.JettyWebSocketServletFactory can not implement org.eclipse.jetty.websocket.api.WebSocketPolicy, because it is not an interface (org.eclipse.jetty.websocket.api.WebSocketPolicy is in unnamed module of loader cpw.mod

quiet ice
#

why in the world do you have something from cpw running on a bukkit server - whatever.

quiet ice
#

Although imo this is an noticeably strange hack, though I guess this is related to service lookup stuff

alpine otter
quiet ice
#

What you have here seems more like something else using a different version of jetty already and the classloader seems to prefer that

#

The only hack that comes to mind is to start your javalin instance in an isolated classloader instance, but that is a lot of trouble

#

I'd ask the pterodactyl people for guidance, they probably will know why and how your server uses jetty and how to best work around this issue

alpine otter
quiet ice
#

jetty is a dependency of javalin

alpine otter
quiet ice
#

You could try shading it and relocating, that may work - however for such a complicated project that may cause issues. But that is the option that was so obvious I almost forgot it

subtle folio
#

so you mean the current “stable version”

quiet ice
#

Likely by configuring the logger accordingly?

remote swallow
#

the only really mainted version is latest so pretty much just newest mc version, the latest rev is updated after a few weeks or months when its stable

quiet ice
#

You cannot call that maintained at all

remote swallow
#

they arent maintained, they get like very critical security updates

#

if you just want the versions theres a jenkins url to format

quiet ice
#

Uh great question - you probably need to register your own config to Log4J, but how to do it via code at runtime? - no clue

remote swallow
#

format it and remove them then

#

not that i know of

sullen marlin
#

Because the later version is compatible with 1.8.4

#

So why would you want 1.8.4

river oracle
#

you wouldn't get it though

sullen marlin
#

You're right I don't

heavy swan
#

Hi!

sullen marlin
#

That's the only real list

lost matrix
#

Like maven? 🙂

river oracle
#

look at how buildtools grabs the version list

#

?stash

lost matrix
#

Maven would be something "similar" to a rest api and is capable of listing every accessible api version.

undone axleBOT
proud badge
#

Is it possible for me to modify a ban reason without having to unban and reban the player?

river oracle
#

LEMME check

#

?jd-s

undone axleBOT
river oracle
#

@proud badge ^

proud badge
#

Ok thanks

#

how exactly could I convert string to void?

twilit roost
#

I have some modules
COMMON, API, VELOCITY, SPIGOT

Common contains all of my configs
I changed something in it
but when e.g. the velocity gets shaded, it doesn't change
but the individual common jar does change

any ideas why?

lost matrix
glossy venture
#

what are you trying to do/expecting from this code

proud badge
glossy venture
#

do you want the old reason or smth?

#

you already have the reason in the reason variable so just reuse that

proud badge
#

no I want to change the ban reason to the reason which is variable "reason" which is a String

#

yes but its saying it requires a void not a string

glossy venture
#

well

#

the method returns nothing

proud badge
#

or am i missing something

lost matrix
glossy venture
#

so String banReason = setReason() wont work

twilit roost
proud badge
#

ohhh

#

wait yeah

#

ok so like this

glossy venture
#

yes

proud badge
#

I just copy pasted the code from another command and didnt realise

twilit roost
lost matrix
proud badge
#

is that bad?

lost matrix
#

Deprecated means that there is a better alternative. (Aside from Bukkit.getPlayer(String) i think)

proud badge
#

Ok thanks, I'll try to find the better alternatives

upper hazel
#

I heard that you can change the sound of breaking a block through packages, but I don’t understand which package is responsible for sending the sound of breaking to protocolLib

#

i was try find like "SOUND", "BREAK" but not find

#

inventory open

#

InventoryOpenEvent

#

inventory.getLocation

#

oh

#

this not exists in 1.8?

#

Well, maybe then get the chest block that the player is looking at?

#

when open it

#

idk obaut it but the code will work immediately after opening

#

I don't see any other options but in any case, you can get the nearest chests from where the player is looking if the ping does not turn the player too much

#

and check opened inventory name with chests inventory name

#

just get chest from radius regarding location were player stand or look

scenic onyx
#

how i can adjust?

upper hazel
#

what?

scenic onyx
scenic onyx
upper hazel
#

you want animated scoreboard showing online players?

#

or this not your scoreboard?

scenic onyx
scenic onyx
brittle geyser
#

u need to remove line

#

before u add score

scenic onyx
brittle geyser
#

for (String entry : scoreboard.getEntries()) {
scoreboard.resetScores(entry);
}

brittle geyser
#

to clear whole scoreboard

scenic onyx
#

i try

upper hazel
#

scoreboard it's so a hassle

brittle geyser
upper hazel
#

too many methods to simply animate texts or make it beautiful

#

this is how to constantly write data from the config to a class

brittle geyser
#

scoreboard is simple

upper hazel
#

not difficult but tedious

zenith gate
#

?paste

undone axleBOT
pseudo hazel
#

yeah cuz most people use it for things it wasnt designed to do

#

which is fine but just a bit of a pain

zenith gate
chrome beacon
#

Don't use system path dependencies

zenith gate
#

it's just for testing purposes, because i don't even know if it'll work just yet, and I don't want to keep adding versions.

#

even when I do it from a repository it still cant "find the class" IntelliJ knows it's there

chrome beacon
#

Just do it the proper way and install it to your local maven repo

torn shuttle
#

the heck

#

minecraft is doing drugs

#

you know I am not having a good time when I have 3 different intellij projects open to fix 1 bug

slender elbow
#

delightful

clever musk
#

Is this normal?

rotund ravine
#

Yeah

dry hazel
#

dealing with plain objects is probably not going to be ergonomic on either side of the interface

storm crystal
#

tf is ergonomic

subtle folio
#

bad posture

storm crystal
#

then how do I generalize that I want an object in here

#

since im gonna have different object for each stored data

torn shuttle
#

this is so weird

#

the hit box gets represented correctly from a visual standpoint but it seems to be 2x beyond what it shold be

dry hazel
#

ideally you'd genericize the interface, but that won't work if you want to pass in different types

storm crystal
#

I want to pass same types

#

objects

#

as in

#

instances of class

#

like this

torn shuttle
#

well ok mojang

dry hazel
#

then you can add a generic on the interface and use it instead of Object

torn shuttle
#

I guess hitboxes expect to be halved

storm crystal
storm crystal
#

my classes wont have the same amount of parameters

dry hazel
#

hm?

storm crystal
#

uh wait

#

do I just do it like that?

#

and like

#

T would stand for what kind of object it is?

dry hazel
#

also for the return types, but yes

#

yes

storm crystal
#

okay okay

#

so generics are used for generalizing things based on parameters that you provide?

dry hazel
#

yea

#

your implementation of that interface will implement DataManagementInterface<PlayerStatsDAO> for example and you can reference it as such

storm crystal
#

okay

#

may I ask

#

what would happen if I left it as Object?

dry hazel
#

you'd have to cast it to get the desired type

storm crystal
#

ah

#

so like (PlayerStatsDAO)

#

?

dry hazel
#

yea

storm crystal
#

okay that is very useful

dry hazel
#

the generic ends up doing the same thing under the hood, but it is nicer with it

weak meteor
#

my cooldown isnt working and idk why

#

i have this bug since thursday

#

and i have made everything

#

originally CooldownLoader was accessed with a @Getter and @Setter

#

i made it static

#

so its more simple to understand

#

i dont know what else to do

torn shuttle
#

intellij only knows how to blaze it up

grand flint
#

bro donated to be a donor

#

i wanna be a donor

#

?donate

#

:*

weak meteor
#

wow

kind hatch
#

Do you get the ability to change your nickname if you donate?

grand flint
#

?donor

kind hatch
#

Hold up

grand flint
#

i think u do

#

if u boost

hazy parrot
grand flint
#

L imagine

kind hatch
grand flint
#

thats what i asked

hazy parrot
kind hatch
torn shuttle
#

I'm a l33t h4x0r with connections to the spigot deepstate

kind hatch
#

I want in. :3

kind hatch
weak meteor
#

lemme explain

#

CooldownManager represents 1 cooldown right?

#

<UUID, Duration> i think

#

and CooldownLoader

#

is

#

<Kit, CooldownManager>

#

each kit has a cooldown manager

#

oh fuck now i know what it is

#

UUID doesnt exist on map cause i never enter it

#

no i didnt say anything

weak meteor
#

cooldown loader just enters values in Cooldown for each Kit

#

how should i implement it in your opinion?

#

cause in my mind it works

noble adder
#

hello im trying to add a lore in my item ItemMeta meta = this.skull.getItemMeta();

int amount = 1;

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender instanceof Player) {
this.meta.setDisplayName("§6Golden Heads");

  lore = meta.getLore();
  System.out.println(lore);   
  lore.add(args[0]);
  meta.setLore(lore);
rotund ravine
#

?learnjava

undone axleBOT
weak meteor
#

?paste

undone axleBOT
kind hatch
noble adder
weak meteor
#

and CooldownLoader actually is named CooldownManager

#

i was thinking that

noble adder
#

but i get error it ask me to initialize i don't understand

weak meteor
#

but i still doesnt know how to solve the error

weak meteor
quaint mantle
weak meteor
#

?learnjava

undone axleBOT
noble adder
weak meteor
#

there are some java tutorials

#

see for arrays and lists

#

and iteration

noble adder
#

you can't tell me quick fix friend :-:

kind hatch
# weak meteor i was thinking that

Yea. The way I handle cooldowns is to just have a cooldown class that holds the bare minimum information. Usually just UUID and 2 long variables for start and end. Then my manager class holds everything related to what I need to keep track of.

Your case may be a bit different from mine since you have multiple cases of cooldowns that seem to happen simultaneously.

torn shuttle
weak meteor
weak meteor
#

i was thinking on using millis and stuff but i really didnt understand

#

i did it with Instant and Duration with a forum on spigot

#

it does work the CooldownManager class

#

but in this time, where i need not specific cases, since kits can be created by the user

#

its difficult to implement

kind hatch
#

Is it just a cooldown for receiving each kit? Where each kit has its own cooldown?

kind hatch
#

I think I tried messing around with a system like that before. Wasn't the cleanest implementation, but it did work.
It was basically a Map<UUID, Set<Cooldown>> where Cooldown had a string attached to it so the player could have multiple cooldowns tied to them for different actions. Could probably be applied in your case since there are multiple unique cooldowns.

weak meteor
#

but how would i identify Cooldown?

#

by the kit?

#

like i add a Cooldown Member

#

private Kit kit;

#

thats set on the Constructor?

kind hatch
#

Pretty much. In my case, the string was the piece that would tie everything together. Your kit name, or even the Kit object itself could be used to identify which kit the player recieved.

weak meteor
#

okay

#

ill try to change it

#

thanks

kind hatch
#

String is more generic though. If you use the Kit object, it'll reduce the flexibility of your cooldown system a little bit, but that's your call.

torn shuttle
weak meteor
#

specially

#

for kits cooldowns

#

like KitCooldown or smth like that

weak meteor
#

never searched abt it

torn shuttle
#

persists through restarts and reloads

weak meteor
#

oh okay

kind hatch
torn shuttle
#

MC hitboxes are so janky man

#

honestly it's tempting to just make my own

#

guess I might do that later

molten hearth
#

is it normal that i cant cast a noteblock's blockdata to NoteBlock

torn shuttle
#

are you casting it to the right noteblock

molten hearth
#
if (block.getType() == Material.NOTE_BLOCK) {
    NoteBlock noteBlock = (NoteBlock) block.getBlockData().clone(); // wadafuc
}```
torn shuttle
#

check if it's the expected import

molten hearth
#

uh

#

well

#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.NoteBlock (org.bukkit.craftbukkit.v1_20_R1.block.data.CraftBlockData and org.bukkit.block.data.type.NoteBlock are in unnamed module of loader java.net.URLClassLoader @5c29bfd)```
river oracle
#

Wouldn't it be BlockState?

torn shuttle
#

powerable extends blockdata

#

but not craftblockdata maybe?

#

why is that craftblockdata and not blockdata?

molten hearth
#

outstanding question

#

my imports are just java import org.bukkit.block.Block; import org.bukkit.block.data.type.NoteBlock;

#

but yeah NoteBlock extends Powerable extends BlockData

#

so its a bit odd i cant cast a noteblock to a noteblock

torn shuttle
#

it's been a while since I've messed with block data

#

and I really should release this lol, I just finished working on the last bug

#

she's a beaut

#

got everything basically working

worldly ingot
#

Probably won't throw an exception if you don't clone it (which you don't even need to do, mind you)

torn shuttle
#

I actually went and checked and the clone should be retuning BlockData but yeah that would also be my guess

worldly ingot
#

Well, yeah, it's returning BlockData. It's not returning anything more specific

#

Unsure if the native clone() actually handles child classes correctly

#

My guess is that it doesn't

torn shuttle
#

really wish java would improve the ability to clone classes

#

I don't want to do all that nerd shit that is required to implement it, just let me tag it and go

kind hatch
# weak meteor look

Those methods are usually what you'd find in your manager class. I was referring to a system where you have a generic Cooldown class and any other forms of cooldown like your KitCooldown would basically extend Cooldown and have that extra piece of information needed to distinguish itself from the generic cooldown.

What you have there is basically a manager class.

weak meteor
#

oh

#

hmm

#

lemme see

weak meteor
#

and now ig i modify CooldownLoader first to CooldownManager

#

and then

#

make a general CooldownManager

#

and then KitCooldownManager extends CooldownManager?

#

and implement the same kit stuff

#

or idk

kind hatch
#

Ideally you'd only have one CooldownManager that well... manages all the cooldowns for the plugins. Your different types of cooldowns that you create are there to help you distinguish between what type they are. The manager will do all of the adding, removing, and comparing.

weak meteor
#

okay

#

thanks

weak meteor
#

i just had an idea

#

maybe doesnt matter

#

but

#

what if i make

#

a Cooldown<T> class

#

and use it for everycooldown i need

#

idk

#

its just an idea

#

that ill look further into in the future lol

minor junco
#

What would T stand for if I may ask (didn't read the entire conversation)?

#

The target object that is cooled down?

weak meteor
#

like you could use

#

Cooldown<String>

#

Cooldown<Integer>

#

and stuff

#

its a way to make a class compatible with all datatypes, or i'll describe it that way

#

a good example

#

is all data structures

#

List<V>, HashMap<K, V>

#

etc.

#

just a placeholder, to say that way

#

but i guess, yes, the target object

#

now thinking it better, making it generic is useless

storm crystal
#

Oracle explains naming convention of T, V, K etc.

spiral imp
#
public class LaserPointer implements Listener {

    private int length = 20;
    @EventHandler
    private void onInteractEvent(PlayerInteractEvent e) {
        if (!(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
            return;
        }
        if (e.getItem() == null) {
            return;
        }
        if(!(e.getItem().getType() == Material.NETHER_STAR)) {
            return;
        }
        Player p = e.getPlayer();
        Location pLocation = p.getLocation();
        Location pLocationEye = pLocation.add(0,1.5,0);
        Vector pDirection = pLocation.getDirection();


        for (int i = 1; i < length; i++) {
            Vector particleSpawn = pDirection.multiply(i);
            Location forwLocation = pLocationEye.add(particleSpawn);

            pLocation.getWorld().spawnParticle(Particle.REDSTONE, forwLocation, 30, new Particle.DustOptions(Color.RED,5));


        }
    }
}```
for some reason, instead of incrementally increasing the distance between the particles, it instead just does 3 in a strange pattern, 2 close and then 1 somewhat far away, please excuse any math issues since im a beginner when it comes to even vector math
minor junco
minor junco
minor junco
#

So by executing operations on them you mutate (ie modify) their state

#

Use .clone instead or alternatively try and use more primitives and avoid object allocation (but that's not really needed, just being premature optimization)

spiral imp
#

okay, thank you :)

minor junco
molten hearth
#

hmm so im using protocollib and PacketType.Play.Client.ARM_ANIMATION, and im trying to prevent right clicking a block from being displayed but left clicking still being displayed, what would b the best way to implement this

#

the packet data is kinda useless for this

torn shuttle
#

damn how did I even manage that

#

well

#

shit

river oracle
torn shuttle
#

meh

#

off to github it goes

river oracle
#

ahhh me thoughts it was premium

torn shuttle
#

I have no premium plugins

river oracle
#

really I thought you did

molten hearth
#

just to get ignored 😔

grand flint
#

L

river oracle
#

not sure how I managed to get my particle drawing correct which USES my bounding box only for the entire bounding box to be off by 1

#

I'm so confused

grand flint
#

let them know ur using the player interact event as well

molten hearth
#

nuh uh

torn shuttle
grand flint
#

ye u cant just get it from the packet

molten hearth
#

yea but i cant get it from the event bc the packet fires before the event

grand flint
#

did i ask

river oracle
grand flint
#

well there is no way u can do it

river oracle
#

time to keep printing debugs ig

grand flint
torn shuttle
#

animations are now fully working

molten hearth
#

wait maybe i got it

#

let me cook

echo basalt
#

you're probably passing ints instead of doubles

#

or you're using block centers

#

.toBlockCuboid might fix it

river oracle
river oracle
echo basalt
#

well

#

you should pass doubles

#

and your max should be like +0.999 on all axis

river oracle
#

weirdly enough though its just misaligned by 1 block

#

I'm not sure why

river oracle
cinder karma
#

PlayerChangedWorldEvent is fired after the player has already changed worlds...is there a way to execute code before they actually change worlds?

river oracle
#

@echo basalt stupid mistake on my end

#

I'm not getting BlockX of the location I'm checking

#

I'm pretty sure its that

#

wait nvm guh My brain is dying

#

@echo basalt ik what i fucked up I accidently changed volume to a double FML

echo basalt
river oracle
#

I literally just alt+f4d intellij

cursive kite
#

If I am making an McMMO equivalent plugin is it better to use MySQL or MongoDB for storage

molten hearth
#

alright on another note how does one color note particles

eternal oxide
#

If you are just using SQL then MySQL, if you are going to use the features of Mongo properly, then Mongo

#

It all depends on your experience

#

Postgre is also a good choice

#

but anything other than MySQL you are going to have to include drivers.

grand flint
#

minor patch

cinder karma
torn shuttle
#

yo @vagrant stratus can you clarify a point for me?

#

it's against spigot rules to compensate people for positive reviews (obviously) and iirc it's also against the rules asking people to just go post positive reviews on a plugin but just asking people to rate a plugin in general is not against the rules, correct?

#

I think that's how it went

cinder karma
grand flint
#

what do u need this for?

grand flint
#

pretty sure every dev does it lmso

#

but kinda unprofessional icl

rotund ravine
#

It is

rotund ravine
#

Oh he asked more than what it said in the reply thing

quiet ice
ebon topaz
#

Hi, so i want to disable specific aspects of the /tp command like tping players around but keep tping entitys around, how should i go about that

quaint mantle
#

How this is happening?

vocal cloud
#

What code is causing it? Because if you're trying to cast a Double to an int it will not work

quaint mantle
vocal cloud
#

Oh my

vocal cloud
#

idk what kls.java.cast does but I'm assuming it's casting a value to the wrong type

dry hazel
#

yeah that's not gonna work

serene cape
#

Hello! im new to spigot, how can i give the player an item

#

or is there something like runCommand()

serene cape
#

hmmk

#

what is an ItemStack?

#

i want to give the player a paper item with a custom model data

eternal night
#

You'd pass Material.PAPER for paper for example

serene cape
#

yeah i figured that out

#

but how would i add a custom model data to its nbt

#

like paper{CustomModelData:1} ingame

eternal night
#

You'd grab the item meta via getItemMeta

#

Item meta basically holds the "nbt" tag

#

Notably, getItemMeta always yields you a copy, so after editing it in any way you gotta call ItemStack#setItemMeta for it to apply to the item sraxk

serene cape
#
ItemStack kuromiHat = new ItemStack(Material.PAPER);
        kuromiHat.setItemMeta(kuromiHat.getItemMeta().setCustomModelData(1));
#

like this?

eternal night
#

Store the meta in a variable

#

setCustomModelData doesn't return the meta back

#

It has a void return type

quaint mantle
#

is there a example for 1.20.2 player packets?

#

for sending fake players

serene cape
#

so like that

eternal night
#

Yea just

#

Follow java naming conventions XD

#

But beyond that, if item is a material

#

And customModelData is an int

#

You should be good

serene cape
serene cape
#

e

#

OMG FINALLY AFTER 1 HOUR OF DEBUGGING

#

i succesfully stopped the plugin crashing when the user provides an invalid syntax

serene cape
#

How can i add tab completion to my commands?

inner mulch
#

Create a String ArrayList and return it

#

If you create a seperate class for the completer you need to register it to ifs corresponding command

lost matrix
upper hazel
#

If i will use method parallelStream from list this will be work?

#

for bukkit api

hazy parrot
#

I mean it's part of jdk, I assume it does work

#

Question is if you need your stream to be parallel

upper hazel
#

or this not will work?

#

?paste

undone axleBOT
upper hazel
sullen marlin
#

No that shouldn't be parallel

upper hazel
#

why

#

becuse this bukkit ?

sullen marlin
#

because when populate returns the chunk should be populated

lost matrix
upper hazel
#

wdym

#

becuse its need?

lost matrix
#

Did only skim this. Is it alex's custom blocks thing?

upper hazel
#

idk maybe

lost matrix
#

Nah doesnt look like it

upper hazel
#

i not can get biom from this chunk yea?

lost matrix
#

Btw this line i useless if (customBlocks.isEmpty()) return;

quaint mantle
upper hazel
#

yea thf

upper hazel
lost matrix
#

If you call a bulk operation on an empty collection, nothing happens anyways.
So the code runs the same, even without this line.

quaint mantle
#

mb

#

i meant for another topic

lost matrix
#

All good

#

Oh

lost matrix
quaint mantle
#

i will write to general

#

bcs not for development

#

i need idea for minecraft server project

#

i will write give me sec

upper hazel
#

i can get biome from this chunk when generate it or this useless?

#

Only use the BlockState returned by LimitedRegion, never use methods from a World to modify the chunk.

#

This mean i really not can get biome?

#

becuse this not generated ?

#

i in 1,16,5

lost matrix
#

Population should be called after the chunk is already generated (Including its biome)

upper hazel
#

oh

#

so not all warning in bukkit doc true?

lost matrix
upper hazel
#

"Only use the BlockState returned by LimitedRegion, never use methods from a World to modify the chunk."

quaint mantle
lost matrix
upper hazel
#

and when replace block too

#

because they are the only ones

#

Kind of contradictory don’t you think?

lost matrix
upper hazel
#

i have fileds like : World, Chunk, Random

#

this all

lost matrix
#

What version are you on?

upper hazel
#

1.16.5

lost matrix
#

I mean... if you use old versions, then you shouldnt be perplexed why the latest javadocs might not apply to you.
This just doesnt make sense.

upper hazel
lost matrix
rotund ravine
#

Help chat has some old ones hosted

upper hazel
#

i found It seems these restrictions for some reason do not apply to my version

rotund ravine
#

?

inner mulch
#

How do i call methods everytime my plugin ist being reloaded

lost matrix
molten hearth
#

now that i think about it, there is no sane way to automate building using actions if I rely on NMS right

#

someone made a resource for it

#

whoa

drowsy ivy
#

How would i go about making custom advancements?

serene cape
#

if i leave the permission value blank on my command will everyone be able to use it?

eternal oxide
#

if it has no permission everyone can use it

serene cape
#

great!

inner mulch
eternal oxide
#

lots of testing

inner mulch
#

?

eternal oxide
#

You have to be very careful with reload as not all objects/instances are cleared from the class loader

#

in certain instances static singletons will remain

inner mulch
#

I alr know my plugin Breaks on relaod 😕

#

Thats why i need to fix it

eternal oxide
#

then see what breaks and fix it 🙂

inner mulch
#

I know whar breaks only way to fix it is doing somwthing on reload

lost matrix
inner mulch
#

okay

lost matrix
#

But if you really want to support reloading, then you need to design your whole plugin around
a clean teardown and startup, independent of your onEnable and onDisable.

eternal oxide
#

Also, no matter how careful you are plugins like PlugMan will break shit all over the place

serene cape
#

how can i add nbt data to an ItemStack so it has the invisible tag for an item frame?

mental frigate
#

hello, i have more general java question, so i have this code reading file:

public static String readFile(String path) {
        File file = new File(path);
        StringBuilder code = new StringBuilder();
        String line;

        try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
            line = reader.readLine();
            do {
                code.append(line);
                if((line = reader.readLine()) != null) code.append("\n");
            } while (line != null);
        } catch (IOException e) {
            e.printStackTrace();
        }

        return code.toString();
    }```
and it seems that it doesnt recognize tabulators, can anyone help?
lost matrix
mental frigate
#

will it recognize tabulators?

lost matrix
#

I dont see why no

river oracle
#

It should even reading it from a BufferedReader

river oracle
#

I always did Files#newBufferedReader. Granted how often do you read a file and not parse something

mental frigate
mental frigate
lost matrix
mental frigate
slender elbow
#

it seems to work fine

jshell> Path p = Path.of("hello.txt")
jshell> Files.writeString(p, "hello\tworld")
jshell> String str = Files.readString(p)
jshell> str.indexOf('\t')
$4 ==> 5
mental frigate
#

hmm

#

but what if you open this file in notepad and manually add tabulator

slender elbow
#

yes

river oracle
slender elbow
#

a tab is a tab no matter where it is written from

#

you may have your text editor configured so tabs are written as spaces :^)

mental frigate
#

oh

slender elbow
#

(notepad is not one of those kinds of text editors, it's as raw as it gets)

mental frigate
#

i havent thought about it

mental frigate
slender elbow
#

by default i don't know

#

you'd need to check in the settings or just don't use intellij for that file

mental frigate
#

yes it is, just checked it in notepad

#

thanks for help

proud badge
worldly ingot
#

I mean, neither snippet you sent there actually increments the ban count at all

proud badge
#

Ok I fixed it

#

By moving the int banAmount after the banPlayer method

#

and pardon methods

river oracle
#

Oh my this is why we need components so much ChatColor everywhere my poor soul

worldly ingot
#

1.20.3, first thing on my todo list

river oracle
#

Yay!! By 1.20.1 you think?

worldly ingot
#

.21 you mean? That's the hope, but you never really know

river oracle
#

Yeah lol

#

Hey Choco how tf do InventoryHolders work

worldly ingot
#

I want to say there's a method patched into the NMS Container interface to get an InventoryHolder instance

#

Or something to that effect

#

Yeah, IInventory

remote swallow
river oracle
#

Guh that's gonna be a lot of work to fix

#

It's in my InventoryBuilder class

remote swallow
#

get to work

river oracle
#

Me wonders why InventoryHolder works with createInventory in the first place

remote swallow
#

are you an inventory holder

river oracle
#

Because createInventory is not connected to world but InventoryHolder is much wacky

river oracle
serene cape
#

hello again, how can i do this item_frame{Entity_Tag:{Invisible:1b} using spigot and doing addItem?

worldly ingot
river oracle
#

Well regardless just remembered I'd need it for legacy compatibility 🥲

cosmic spear
#

How i can protect my plugins if i can't use my custom license system?

#

Because one got leaked and i can't know who is

river oracle
#

Make it open source and don't chase after sales you won't be making anyways

shadow night
#

Sounds like a good option to me

cosmic spear
#

What response it is

#

bro

worldly ingot
#

What a lot of people fail to realize is that you can have any license you'd like, but if you can't enforce it, that license means nothing :p

#

So if you want to have a custom license, you'd best have a lawyer ready to enforce it for you

#

Oh, sorry, license "system"

#

It won't work lol

#

I, like many others, can decompile your plugin and just remove the license check

cosmic spear
#

Yes but 90% of people don't do this

worldly ingot
#

Right but what about the 10%?

#

That can then distribute it on another platform?

river oracle
#

@cosmic spear I'm a big fan of wanting to learn asm If you find a great license system lmk I wanna have some fun

cosmic spear
#

So its impossible protect our plugins

eternal oxide
#

Even if you found out who leaked it, what are you going to do?

worldly ingot
#

Pretty much, yeah

#

It's a game of cat and mouse

rotund ravine
#

Usually just limiting support is the easiest way

worldly ingot
#

^

#

If you have some way of determining whether or not a build is redistributed via unofficial means, then yeah, just say "Sorry, can't support you until you buy it"

cosmic spear
#

okok

remote swallow
#

Do like most premium plugins and have it open source on git but paid on spigot and you pay for support

shadow night
worldly ingot
slender elbow
worldly ingot
#

i gotchu

shadow night
#

Lol

slender elbow
#

thanks babe

remote swallow
shadow night
#

I just give people stuff for free

#

Because yes

quaint mantle
#

he wants to test it out

#

can i c ur current lciensing system?

#

the one u cant use?

rotund ravine
#

Lol

alpine otter
#
java.lang.NoSuchMethodError: 'void org.eclipse.jetty.servlet.ServletHolder.<init>(javax.servlet.Servlet)'
        at io.javalin.jetty.JettyServer.start(JettyServer.kt:57) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:174) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:148) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.Main.onEnable(Main.java:39) ~[LiquidREST-0.1-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:273) ~[forge:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[forge:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:502) ~[forge:7e29f765-296df566-9fb885e8]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:414) ~[forge:7e29f765-296df566-9fb885e8]
        at net.minecraft.server.MinecraftServer.func_240787_a_(MinecraftServer.java:427) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:347) ~[?:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:227) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:768) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:267) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[15:54:17 INFO]: [LiquidREST] Disabling LiquidREST v0.1.```
does someone may know what does trigger this error, it works perfectly fine on local machine.
icy beacon
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

alpine otter
slender elbow
#

hybrid 💀

alpine otter
chrome beacon
#

?main

river oracle
#

It works well 🤷‍♂️

alpine otter
cosmic spear
#

Where i need to report my leaked plugins?

lost matrix
cosmic spear
#

on an external webiste

river oracle
#

Uhm you get a lawyer and sue in a court of law I do so believe

lost matrix
river oracle
#

Send them a dmca take down request and follow up with legal forums of they do not respond

#

First you'd ofcourse have to consult a lawyer to make sure you can sue and have taken the steps to affiliate a license with your plugin

cosmic spear
cosmic spear
#

lol

#

💀

river oracle
#

Talk to a local lawyer about this

#

This isn't the place for legal advice imho

lost matrix
river oracle
#

@cosmic spear I will warn you though it's not worth the time or money

#

Much bigger companies struggle to do what your attempting to do and have much bigger pockets for legal action

grim hound
#

How do I fix this?

eternal oxide
#

Being in Italy (EU) you'd have to prove monetary loss.

#

The best you could achieve is to get teh site to take the resource down

#

You can issue a DMCA yourself, but seek legal advice

lost matrix
valid burrow
#

is it normaal that if you put an armorstand on an entity it doesnt move anymore?

lost matrix
lost matrix
#

As in: The language fails to clarify why "it" refers to

young knoll
#

Presumably the not armor stand

#

Armor stands don't move much to begin with

lost matrix
#

If they are mounted on something, they sure should move

#

He could mean that the mountee still moves without the armorstand

valid burrow
#

well no

#

armorstand on entity

#

entity no move

#

entity stupid

lost matrix
#

Ah. Should still move, right?

valid burrow
#

but i already found the error already so its alright

valid burrow
#

i placed them the wrong way around

lost matrix
valid burrow
#

whats the event for a guardian shooting his laser

lost matrix
#

Hm. My first guess would be an animation or effect event

#

I dont see anything useful

valid burrow
#

i mainly mean the whole action

#

like

#

if its possible to cancel his whole attack before the laser even apears

#

thats what im trying to do

#

wasnt sure if they were seperate eventy

#

just trying to make the guardian stop attacking with his laser

young knoll
#

It's an attack

#

So it just fires the EntityDamageByEntity

valid burrow
#

but like

lost matrix
#

Myeah but cancelling it wont stop the laser from appearing, right?
Only the damage

valid burrow
#

the damage comes after the laser

#

EntityTargetEntity?

ashen quest
#

ay guys, how do i check if a player tries to double jump

like u know when they try to use an elytra so they jump and then jump again?

#

im tryna setGliding for them at that moment to true

lost matrix
ashen quest
#

thank you

prime sentinel
#

how do you get citizens 2\

#

how do you get citizens 2

glad prawn
#

?

young knoll
#

You buy it

#

Or you go to their jenkins

valid burrow
prime sentinel
#

Okay thx

alpine otter
#

why plugins throws an error on a machine and works on another one

#

makes no sense

subtle folio
#

Verisoning errors?

#

What if one server runs 1.8.8 spigot and another 1.20.2!

alpine otter
alpine otter
subtle folio
#

send the errors

umbral ridge
#

hey how do you check if material exists without try catch

#

do I really have to use it

#

is it still efficient to use Material.values() then?

#

and .contains() method on it

alpine otter
# subtle folio send the errors
[17:15:08 ERROR]: Error occurred while enabling LiquidREST v0.1.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void org.eclipse.jetty.servlet.ServletHolder.<init>(javax.servlet.Servlet)'
        at io.javalin.jetty.JettyServer.start(JettyServer.kt:57) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:174) ~[LiquidREST-0.1-all.jar:?]
        at io.javalin.Javalin.start(Javalin.java:148) ~[LiquidREST-0.1-all.jar:?]
        at wtf.justmammtlol.plugins.LiquidREST.LiquidREST.onEnable(LiquidREST.java:36) ~[LiquidREST-0.1-all.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:273) ~[forge:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:335) ~[forge:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[forge:?]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:502) ~[forge:7e29f765-296df566-9fb885e8]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:414) ~[forge:7e29f765-296df566-9fb885e8]
        at net.minecraft.server.MinecraftServer.func_240787_a_(MinecraftServer.java:427) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240800_l__(MinecraftServer.java:347) ~[?:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:227) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:768) ~[?:?]
        at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:267) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[17:15:08 INFO]: [LiquidREST] Disabling LiquidREST v0.1.0```
umbral ridge
#

ty

remote swallow
#

Use the method that returns null if not found

subtle folio
#

what javav verison are you running/

alpine otter
#

seems to be the ideal for 1.16.5

lost matrix
subtle folio
chrome beacon
#

1.16.5 will work on Java 8

alpine otter
#

idk, i read something that says java 8 is better for <1.17

lost matrix
#

Its [52, 60] compatible. So 8 to 16. I would def go with the highest LTS version. Especially for running the server
to reap the jvm improvements.

alpine otter
#

should i use java 11 or 16?

alpine otter
alpine otter
# lost matrix Did you relocate already?
shadowJar {
    relocate 'io.javalin:javalin:4.6.8', 'shadow.io.javalin'
    relocate 'org.slf4j:slf4j-simple:2.0.7', 'shadow.org.slf4j'
    relocate 'com.fasterxml.jackson.core:jackson-databind:2.13.2', 'shadow.com.fasterxml.jackson.core'
    relocate 'org.eclipse.jetty:jetty-servlet:9.4.48.v20220622', 'shadow.org.eclipse.jetty.servlet'
    relocate 'io.javalin.jetty:jetty-server:9.4.48.v20220622', 'shadow.io.javalin.jetty'
}```
lost matrix
lost matrix
hushed spindle
#

how fast is World#getNearbyEntities()? like would it be acceptable to do that every tick to figure out the closest entity to a projectile?

alpine otter
hushed spindle
#

i figured lol

lost matrix
hushed spindle
#

the other approach would be to have that "closest entity" be determined on shooting based on which entity is closest to the shooter's line of sight

worldly ingot
#

It's honestly not horrible. Mostly just numerical comparisons

hushed spindle
#

no every-tick nonsense

worldly ingot
#

If the chunks are loaded it's fine

#

Entities are already in memory anyway

rotund ravine
#

I am sure you don’t need every tick though

worldly ingot
#

No probably not

lost matrix
hushed spindle
#

wanting to make a homing projectile property which i would like to be workable with fast and slow projectiles

worldly ingot
#

I just recently did repeating getNearbyEntities() lookups with a bounding box and I only do it once every 5 ticks

#

That's still 4 times/second which is relatively quick

#

Keep in mind that hoppers probably do this a lot more KEKW

hushed spindle
#

4 times a second is quick but for very fast projectiles it probably isnt enough but ill figure something out

lost matrix
#

Ideally you would dynamically change the polling rate, depending on your projectiles velocity, to reduce overlapping volumes getting scanned too much

ashen quest
#
@EventHandler
    public void onJumpTwice(PlayerToggleFlightEvent event) {
        Player player = event.getPlayer();
        if(players.contains(player)) {
            player.setGliding(false);
            players.remove(player);
            return;
        }
        player.setGliding(true);
        players.add(player);
        System.out.println(players);
    }

    @EventHandler
    public void onGlideCancel(EntityToggleGlideEvent event) {
        if(players.contains((Player) event.getEntity())) event.setCancelled(true);
    }

event call not happen do what now

hushed spindle
#

listener registered?

lost matrix
ashen quest
#

im just testing so didnt create a new class

ashen quest
hushed spindle
#

yeah but did you register it

#

you still gotta register your listeners even if they are the main class

ashen quest
#

ahhhhhhhhhh

hushed spindle
#

Player#setAllowFlight()

ashen quest
#

thank you

hushed spindle
#

that will allow the player to fly though

hushed spindle
#

what are you wanting to do

#

double jump stuff or something?

ashen quest
#

letting player glide without elytra

#

im programming after a year excuse my rustyness

umbral ridge
#

hey

ashen quest
#

hello

umbral ridge
#

does getOfflinePlayer() work both for online and offline players?

quaint mantle
#

Yeah

umbral ridge
#

ok ty

quaint mantle
#

You can pass player as offline player also

umbral ridge
#

But if I only know the name, specified as a command argument, then how can I get the UUID? I see that getOfflinePlayer(String name) is deprecated

#

I can do this differently but I was just thinking if there is a simpler way

quaint mantle
#

Its deprecated because of security issues

chrome beacon
#

I wouldn't call it security issues

quaint mantle
chrome beacon
#

getOfflinePlayer will already do that for you

#

if you only have the player name it's fine to use it

umbral ridge
#

ok nice

chrome beacon
#

It's just a warning telling users to not store the username as a player identifier

#

Deprecated.
Persistent storage of users should be by UUID as names are no longer unique past a single session.

quaint mantle
#

What if offline player does not even joined the server?

valid burrow
#

how can i prevent that message being sent

chrome beacon