#help-development

1 messages · Page 1440 of 1

waxen plinth
#

?paste

queen dragonBOT
wraith rapids
#

also what's this

#

an enchant plugin

#

is it shit?

#

i need a not shit enchant plugin

sage swift
#

yes

#

i don't know i haven't used it yet

wraith rapids
#

you should make it not shit so I can use it

waxen plinth
#

RedLib makes enchantments easy to make

wraith rapids
#

i'm sure it does

waxen plinth
#

I think gecko's plugin uses it

sage swift
#

I can't even copy the text on github mobile

waxen plinth
#

lol

wraith rapids
#

by checking every item in every slot 20 times a tick

opal juniper
#

I think that he won't use it out of spite

#

exactly

wraith rapids
#

and cloning them 5 times for each check

wraith rapids
#

and then comparing them to a string in a .txt file

waxen plinth
#

I actually focus pretty heavily on performance

opal juniper
#

lmao

paper viper
#

and creating a text file

#

each time you check

wraith rapids
#

probably reloading permissions for each check too

#

just to make sure

waxen plinth
#

r/onejoke but for redlib

paper viper
#

redlib?

#

pplib

#

biglib

#

fatlib

waxen plinth
paper viper
#

suslib

clever sequoia
#

guys

waxen plinth
#

Cinnamon roll time

wraith rapids
#

anyway, i find just listening to the relevant events to be sufficient for maintaining which enchants are active on a player

waxen plinth
#

Goodbye

wraith rapids
#

like yeah, I do check each slot every few seconds

clever sequoia
#

how can i take it out the <> when i chat on my server

wraith rapids
#

but not every tick

#

that just seems excessive for what we want to achieve

waxen plinth
#

And that's fine

wraith rapids
#

it doesn't really matter that much if a player has some enchant active for 2 seconds after somehow being stripped of items by a third party plugin

waxen plinth
#

Checking it every tick is really not that heavy though

wraith rapids
#

it's still 20 times heavier than checking it every second

waxen plinth
#

Much more expensive things than that happen every tick

wraith rapids
#

depends on what you're comparing it to

sage swift
#

chunk loading B)

wraith rapids
#

for example... are you comparing it to a craftitemstack or a bukkit itemstack

waxen plinth
#

Bukkit ItemStacks are CraftItemStacks

#

Do you mean NMS items

wraith rapids
#

ItemStack is the superclass that Craftstack extends

#

Craftstack is a wrapper of the nms stack

#

the implementation of each differs

#

comparing a bukkitstack with a craftstack causes 4 itemmeta clones

#

whilst comparing a craftstack with another craftstack causes none

sage swift
#

yeah what if one is a 1.15 item and the other is a 1.16 item

waxen plinth
#

Lol

lilac dagger
#

itemstack is a concrete class

sage swift
#

craftitemstack extends itemstack

wraith rapids
#

bukkit itemstack is the superclass that craftstack extends

#

CraftItemStack wraps NMSStack and extends ItemStack

#

it's a strange design choice that is in place to let you instantiate new ItemStack even though it is an API class and should contain no implementation

opal juniper
#

GUYS, Lets calm it down

can i get some help tho

i have no clue how to send a packet with this:

PacketContainer sandPacket = this.protocolManager.createPacket(SPAWN_ENTITY);
sandPacket.getIntegers().
    write(0, 500).
    write(1, (int) EntityType.FALLING_BLOCK.getTypeId()).
    write(2, (event.getLocation().getBlockX())).
    write(3, (event.getLocation().getBlockY())).
    write(4, (event.getLocation().getBlockZ()));
sandPacket.getDataWatcherModifier().write(0,sandWatcher)
``` but it doesn't work, i dont know how to spawn a falling block entity
sage swift
#

don't tell me to calm down

#

I'll get banned before i calm down

opal juniper
opal juniper
wraith rapids
#

my point is that a seemingly trivial check operation can become very expensive if the itemmeta is very large and you have to clone it 2 times just so that you can compare it to another item

lilac dagger
#

wait you're right

wraith rapids
#

I had to hunt down a ton of superfluous itemmeta cloning when I unfucked slimefun cargo networks

#

shit was cloning like 3 gigabytes of itemmeta clones onto the heap every time it ran

sage swift
wraith rapids
#

call me traumatized but I know that comparing itemstacks can be explosively expensive in the worst case scenario

waxen plinth
wraith rapids
#

myes

waxen plinth
#

🙃

lilac dagger
#

it can get pretty bad but i think there's a bit of optimization going in i bet

waxen plinth
#

Love that

wraith rapids
#

and isSimilar calls it twice

waxen plinth
#

Hmm

#

And equals?

wraith rapids
#

once for getDurability and a second time for comparing the meta

waxen plinth
#

Wow

wraith rapids
#

equals forwards to isSimilar

#

but checks for amount

wraith rapids
#

because bukkit is shit

waxen plinth
#

Hmm

wraith rapids
#

it's literally a 1 line fix but nobody does it

waxen plinth
#

I have my own method for comparing items

#

I can make it cache the ItemMeta for different trait comparisons

lilac dagger
#

sure you want to prevent wrong user input but the item meta is safe from altering or is it not?

wraith rapids
#

unless it uses the underlying nms stack and you are not involving bukkit stacks in the operation, you will still be cloning itemmeta for each check

waxen plinth
#

It lets you choose which traits to compare, i.e. name, lore, amount

wraith rapids
#

the issue is that just looking at those is going to have that shulker box full of max size books cloned for every check

#

even if you cache it, you have to clone it again the next tick when you look at the slot again

waxen plinth
#

Yeah I get that much

wraith rapids
#

which can still be relatively expensive

#

which is why i'd rather have it 20 times less expensive

#

at the cost of some enchants very rarely lingering for an extra second

waxen plinth
#

It won't check a shulker box what

#

It only checks 5 slots

wraith rapids
#

you don't know that

rotund pond
#

Hello !
I will have a few questions for static methods ...
Why are they bad?
In which case can I use them? In which case not?

thank you for your time

waxen plinth
#

I do know that

wraith rapids
#

what if I want to enchant my shulker box

waxen plinth
#

??

wraith rapids
#

and wear it on my head

#

also I was talking about the item held event thing

waxen plinth
#

Oh that

wraith rapids
#

not the armor

waxen plinth
#

I mean, I've used it on a server with 100+ concurrent players and it never caused issues

#

There were other things that caused issues which I then optimized

wraith rapids
#

i'm sure those 100+ concurrent players weren't concurrently holding shulker boxes with max size books in them

waxen plinth
#

Unless it starts even showing up in timings I think it's fine

#

Hm

#

I'm pretty sure it won't compare that directly through bukkit

#

Can't say for sure

#

But I'm pretty sure BlockStateMeta is similar to ItemMeta in that it creates the BlockState when you request it rather than storing it internally

wraith rapids
#

thing is that the entire meta gets cloned when you access any part of it

#

checking the name of a shulker box will convert all of those books from nms NBTTagCompound to bukkit itemmeta

lilac dagger
#

that's on immutability programing

wraith rapids
#

it's either all or nothing

lilac dagger
#

is there a

wraith rapids
#

i'm working on a live-view itemmeta impl for myself but working with nms is cancer so it's on hold

lilac dagger
#

ItemStack#isSimilar(ItemMeta)?

wraith rapids
#

there isn't, and even if there was, it'd still clone the meta of the other itemstack

lilac dagger
#

no

wraith rapids
#

twice

lilac dagger
#

i mean

#

ItemMeta

#

as param

#

or

#

I guess

wraith rapids
#

yes, it'd still clone the itemmeta of the itemstack you're calling it on

lilac dagger
#

ItemStack#isSimilar(ItemStack)

#

would work too

wraith rapids
#

that'd clone the itemmeta twice for both of them

lilac dagger
#

as it would ignore getItemMeta

#

okay

#

that's pretty sad

wraith rapids
#

the isSimilar impl of ItemStack calls getItemMeta twice

#

it is however overridden by CraftItemStack which compares the underlying NMS ItemStack if the other itemstack is a CraftItemStack too

lilac dagger
#

you should push a fix on git for md5 to notice

wraith rapids
#

so comparing two craftstacks is significantly cheaper than comparing a craftstack and a bukkitstack

#

or a bukkitstack and another bukkitstack

lilac dagger
#

still even if it's fixed, the old versions will still have the problem

wraith rapids
#

old versions can suck my dick

wispy fossil
#

words to live by

lilac dagger
#

I have always fought the bukkit api's myself whenever I coded my plugins

wraith rapids
#

bukkit is pretty good in comparison to quite a few things but it does have its own share of problems

#

there are some areas where it's next to unusable

#

like world generation and the new data-driven stuff like loottables from datapacks

lilac dagger
#

there would be an easy fix to this problem

wraith rapids
#

biggest issue with bukkit is that it refuses to go forward and refuses to drop backwards compat

lilac dagger
#

a private, read only way of checking the meta data

wraith rapids
#

yeah, it would be super easy to fix this one

lilac dagger
#

where there is no immutability involved

wraith rapids
#

i have no clue why it is the way it is still

#

nobody seems to care about it

#

but like redempt said it really isn't a big issue for most servers with most plugins

#

so i guess nobody cares

lilac dagger
#

it might have been skipped due to the excesive comments

wraith rapids
#

for my slimefun fork i wrote a new itemstack implementation that's expressly designed to be used for repeated issimilar comparisons

#

it caches equals relations and shit

#

and caches both bukkit meta and nms meta and compares whatever is present to avoid cloning shit whenever possible

#

i'll eventually hook the live-view itemmeta impl to it and it'll be pretty nice

#

i'll call it HitlerItemStack

#

and release it as a lib on splögget

#

and watch it get taken down in .4 microseconds

lilac dagger
#

what's your fascination with hitler? 🥶

wraith rapids
#

people get annoyed by it

#

which i find amusing

wispy fossil
#

hinlor

lilac dagger
#

i am annoyed, i don't think we should promote such a guy's action

wraith rapids
#

amuse me

wispy fossil
#

who is hunker

opal juniper
#
        PacketContainer fallingBlock = protocolManager.createPacket(SPAWN_ENTITY);

        fallingBlock.getIntegers().
                write(0, 26);

        fallingBlock.getDoubles().
                write(0, player.getLocation().getX()).
                write(1, player.getLocation().getY() + 5).
                write(2, player.getLocation().getZ());

        WrappedBlockData data = WrappedBlockData.createData(Material.STONE);

        fallingBlock.getBlockData().write(0, data);

        try {
            this.protocolManager.sendServerPacket(player, fallingBlock);
        } catch (final InvocationTargetException e) {
            e.printStackTrace();
        }

Anyone know why i get this error?

https://paste.md-5.net/omariniduv.rb

wraith rapids
#

if i ever release the source code for anything i'll insert holocaust jokes into all of the comments

#

i've even bought a 200 page book just for holocaust jokes

#

it set me back 20 bucks

#

FieldAccessException: No field with type net.minecraft.server.v1_16_R3.IBlockData exists in class PacketPlayOutSpawnEntity

wispy fossil
#

but set you forward time in prison 😎

wraith rapids
#

muh free speech

opal juniper
#

wait no

wraith rapids
#

i'm not seeing it

opal juniper
#

i was looking at Data

#

which i then saw has a falling block section

wraith rapids
#

i think you need to like send an entity metadata packet or something after creating the entity

opal juniper
#

Cringe

wraith rapids
#

like i said just using serverside fallingsand would have been a ton simpler

#

well, if it fucking worked, anyway

opal juniper
#

exactamundo

lyric grove
opal juniper
#

can i ask a question about the indexing of these,

#

do i literally just count down the integers

lilac dagger
#

there is no such lib at runtime @lyric grove

opal juniper
#

for the index to write to

lilac dagger
#

at runtime

opal juniper
wraith rapids
#

there is no such lib at runtime @lyric grove

lyric grove
#

should i shade it into my plugin not using maven?

lilac dagger
#

i'll not suggest doing that

quaint mantle
#

Hello. Can someone show me how to make a scoreboard, which updates without flicker in 1.8? I've tried multiple ways, which aren't working 😦

lilac dagger
#

instead look on what spigot has

wraith rapids
#

use 1.16.5

quaint mantle
wraith rapids
#

then seek help in a 1.8 discord

quaint mantle
#

ok

wraith rapids
#

3ZNuncGJ

quaint mantle
#

send dm pls

#

ok

lyric grove
#

looks like its getting it from my jar

wraith rapids
#

can't you just use the data format bundled in the standard library

opal juniper
#

How do i get the EID of a new entity

wraith rapids
#

might need to use nms for that

#

or pick a random eid and pray

opal juniper
#

What, that it isn't in use

lilac dagger
#

instead look in the nms

opal juniper
#

I dont want to use nms tho

keen monolith
#

Hi I need help the server is saying it won't pass the event anybody know what the error is with this code:

opal juniper
#

im trying to stay away from it

queen dragonBOT
keen monolith
#

oh sry

queen dragonBOT
wraith rapids
#

lol

opal juniper
#

omg

wraith rapids
#

well the simplest way would be to spawn an actual fallingsand entity and then destroy it and cancel the destroy packet and pray it works this time

keen monolith
opal juniper
#

what is the error

keen monolith
#

Can't pass event blah blah blah

opal juniper
#

yeah that blah blah blah bit is important

keen monolith
#

It literally just says cannot pass event no more no less

opal juniper
#

ur lieing

#

there is always more

wraith rapids
#

Entity class has a private static final AtomicInteger that represents the next eid

#

you'll need to reflect into it unless there is an api way of getting its value

#

there is also a nms way of creating an entity without spawning it in a world physically, which would probably be the simplest way

keen monolith
#

there is no more

opal juniper
#

fine

#

hmm ok @wraith rapids

#

what is the nms way, i am not too well versed

opal juniper
keen monolith
#

Ahahahaha

opal juniper
wraith rapids
#

apparently choco has commented on it saying that there'a a PR open for it

#

might want to check whether that pr ever got merged

opal juniper
#

for 1.13

#

i will check

#

for some reason my acc don't work

wraith rapids
#

no stack trace no help

quaint mantle
#

no exception message no help

keen monolith
#

ah well I guess I will have to find one, hidden in the depths of some files I can't access

wraith rapids
#

try restarting the server

opal juniper
#

Wait, how do these work @wraith rapids

#

cause there is only one field

wraith rapids
#

dunno

#

here's a thread

quaint mantle
#

If I wanted something that'd allow zombies to spawn with red leather gear for 8 minutes and then after 8 minutes it were to stop after 8 minutes, what code would I need for that?

opal juniper
#

I still dk if i have managed to spawn a block

wraith rapids
#

@quaint mantle what kind of an answer are you expecting

quaint mantle
#

like

#

not the leather armour part but the timer part

wraith rapids
#

there are two ways

#

either you have a start timestamp

#

and then in your listener or whatever you compare the current time to that timestamp

#

and if it's over 8 minutes, abort

#

the other way is to use the bukkit scheduler to run a task that aborts your thing after 8 minutes

quaint mantle
#

how would i do the second option

opal juniper
#

Which one do you think it is @wraith rapids

wraith rapids
#
Bukkit.getScheduler().runTaskLater(plugin, () -> {
    //code to make your thing stop
}, delay);
#

plugin is an instance of your main class

upper vale
#

Why does e.getPlayer().getInventory().getItemInMainHand().getType() return AIR on PlayerDropItem :bruh:

wraith rapids
#

delay is the number of ticks to delay the execution by

#

get the dropped item from the event

quaint mantle
#

so "delay" is in ticks?

upper vale
#

I want to check if the dropped item was from their main hand though

wraith rapids
#

delay is in ticks yes

quaint mantle
#

ty

wraith rapids
#

i have no clue which one of those it is

#

probably the one from protocollib

#

the one in WrappedDataWatcher

quaint mantle
#

so would i make the red armour chance outside of it and then after that many ticks i put the code inside saying to not make a red armour chance and it stops it?

wraith rapids
#

uh i guess

quaint mantle
#

ah okay thank you

wraith rapids
#

you make the code in that block stop the code that's spawning them

#

as for how you do that depends on how you're spawning them

#

flip a boolean or something

opal juniper
#

this is what i have, does shit all tho

    @EventHandler
    public void oncrouch(PlayerToggleSneakEvent event){

        Player player = event.getPlayer();
        

        EntityCreator entityCreator = new EntityCreator();
        Entity fb = entityCreator.create(EntityType.FALLING_BLOCK,new Location(player.getWorld(),player.getLocation().getX(),player.getLocation().getY() + 5,player.getLocation().getZ()));

        PacketContainer fallingBlock = protocolManager.createPacket(SPAWN_ENTITY);

        fallingBlock.getIntegers().
                write(0,fb.getEntityId()).
                write(1, 26).
                write(2, 70);

        fallingBlock.getDoubles().
                write(0, player.getLocation().getX()).
                write(1, player.getLocation().getY() + 5).
                write(2, player.getLocation().getZ());
        
        

        PacketContainer meta = this.protocolManager.createPacket(PacketType.Play.Server.ENTITY_METADATA);
        meta.getIntegers().write(0, fb.getEntityId());
        WrappedDataWatcher watcher = new WrappedDataWatcher();
        WrappedDataWatcher.Serializer serializer = WrappedDataWatcher.Registry.get(Byte.class);
        watcher.setEntity(player);
        watcher.setObject(0, serializer, (byte) (0x40));
        meta.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());



        try {
            this.protocolManager.sendServerPacket(player, fallingBlock);
            this.protocolManager.sendServerPacket(player, meta);
        } catch (final InvocationTargetException e) {
            e.printStackTrace();
        }

    }
#

ik that i haven't set the correct meta objects

#

im just gonna use some nms shite for meta for now:

        net.minecraft.server.v1_16_R3.Entity nmsEntity = (net.minecraft.server.v1_16_R3.Entity) fb;
        final PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata(nmsEntity.getId(), nmsEntity.getDataWatcher(), true);
wraith rapids
#

could do that reflectively ig

cinder thistle
#

please camelCase method names

opal juniper
#

i just want this shite to work

#

ok

#

ill bear that in mimd

wraith rapids
#

generally the . on newlines is also on the new line rather than at the end of the old line

cinder thistle
#

also another unrelated note

#

(byte) (0x40) this can just be (byte) 0x40

wraith rapids
#

thing
.thing2()
.thing3()

cinder thistle
#

you don't always need the parenthesis

opal juniper
cinder thistle
#

ah

wraith rapids
#

rather than
thing.
thing2().
thing3()

opal juniper
#

yeah sure

cinder thistle
#

so we're c/p'ing

opal juniper
#

yeah

cinder thistle
#

i'll leave

opal juniper
#

i have spent all day trying to get this to work

wraith rapids
#

your previous avatar was more handsome

opal juniper
#

yeah

cinder thistle
opal juniper
#

Can i make this entity from the EntityCreator you sent me

#

@wraith rapids

#

with nms

wraith rapids
#

yeah probably

cinder thistle
#

no need to ping him he's right here

opal juniper
#

sorry

wraith rapids
#

i don't see pings anyway

#

notifications literally don't work on ripcord

opal juniper
#

shiiiiit what is this

#

oh oh oh

#

this is just this shit

#

now, how the fuck do i get the UUID and what is it anyways

wraith rapids
#

UUID is an universally unique identifier

#

each entity has one

opal juniper
#

yeah

wraith rapids
#

and it is unique

#

universally

opal juniper
#

how do i get it

wraith rapids
#

entity.getuuid or something

opal juniper
#

you right

#

didn't realise that was a thing

cinder thistle
opal juniper
#

what is the float?

wraith rapids
#

i'm not seeing a float

cinder thistle
#

should use mini's mappings tool

opal juniper
#

had that open

#

lets find it

#

there is no float?

cinder thistle
opal juniper
#

where

cinder thistle
#

right next to each other

opal juniper
#

oh, yeah

#

thats the problem

#

i don't know what they mean

#

/ where they come from

#

it isn't in the constructor?

formal ferry
#

how does one set the join message again? i forgot lol

opal juniper
#

PlayerJoinEvent -> setJoinMessage

midnight galleon
#

Yes on the PlayerJoinEvent

formal ferry
#

Well I thought that, but: Cannot resolve method 'setJoinMessage' in 'PlayerLoginEvent'

cinder thistle
#

player join

#

not login

formal ferry
#

ah

#

im blinddd

#

thanks!

opal juniper
#

SHIT

#

it didn't work

keen monolith
#

I have absolutely no clue please help

wraith rapids
#

give a stack trace

keen monolith
#

What is that

wraith rapids
#

the exception

#

at blah blah
at blah blah

keen monolith
#

NullPointerException

wraith rapids
#

the whole thing

#

the at's are the important bit

keen monolith
#

at line 3

wraith rapids
#

then something on line 3 is null and you're calling a method on it

keen monolith
#

I know I assume its e.getItem().getType(), but I have no idea on how to not make it null

wraith rapids
#

you can't make it not null

lyric grove
#

anyone know why im getting a null pointer?

wraith rapids
#

null means there is nothing

lyric grove
wraith rapids
#

the only way to make nothing not nothing is put something in it

#

but since you have nothing you can't put anything in it

#

the only thing you can do is abort

#

the player is not holding an item

#

the held item is null

#

absent

#

empty

#

devoid of value

#

check whether e.getItem() is null and if it is, return before calling any methods on it

fierce salmon
#

so i want to send operator commands when a certain command is sent

#

how would i do that?

#

like i want console to send a command

worldly ingot
cinder thistle
#

dear god

#

my brain is broken

fierce salmon
#

LMAO

hollow canopy
#

guys I tried to make a shulker backpack but it didnt work why

onyx shale
#

Isnt a shulker a backpack by itself?

eternal oxide
#

its an Inventory, yes

hollow canopy
#

I mean players will open the shulker in their inventory

onyx shale
#

Also ur sort of going into risky teritory

#

Its sensitive logic to avoid duping

hollow canopy
#

I see

#

but can you guys find my wrong in the code

wraith rapids
#

"didn't work"

#

elaborate

#

or just don't answer at all that's fine too

gaunt eagle
#

I tried to create the config in another class. But I don't understand how I can get this from here, can anybody help?^^

#

I know it looks very confusing but ignore the system.out.println's, they are just debug code

wraith rapids
#

you create a public getter that returns the yamlConfiguration and then you call it

wraith rapids
#

in this class

#

otherwise there is no way for you to get the YamlConfiguration out of this object

#

the field is private and there is no getter

#

you need to expose it somehow, f.e with a public getter

tacit drift
#

What's the best way to store a list of entities to kill them when i want? (all of them)

#

and do other things with them

wraith rapids
#

new List<Entity>

tacit drift
#

more specifically armor stands

gaunt eagle
wraith rapids
#

yeah

gaunt eagle
#

and now I need to call it on the main

#

I remembered this but I forgot. Shit. Can you tell me how to call xD?

wraith rapids
#

assign the ConfigManager you are constructing here into a field/variable

#

ConfigManager manager = new ConfigManager(this);

#

then call the method

#

manager.getYamlConfiguration()

gaunt eagle
#

thanks ^^ le me check

#

i already have code to create the file

#

🤔

#

I guess not, it's just ignored -_-

wraith rapids
#

what line threw the exception

#

file.createNewFile requires the directory to exist

#

to create plugins/yourplugin/config.yml
you need plugins/yourplugin/ to exist

#

create the directory if it doesn't exist

#

File::mkdirs

tacit drift
#

can i update a location only on a axis?

#

without making a new location

gaunt eagle
#

I created plugins/<name> and it's fixed

#

So do you have any idea why the file doesn't occur automatically?

eternal oxide
#

if your original yml file is in your jar you can simply use saveResource to get it out

#

if its the default config use saveDefaultConfig(). It will create the folder and save the config.yml from the jar into the folder

wraith rapids
#

createFile doesn't create the directory, that's just how it works

#

you'll need to use mkdir or mkdirs to create the directory first, if it doesn't exist

#

but yeah saveresource is your friend

fierce salmon
#

so i want to make it when a player sends a specific command it makes the player execute //replacenear 50 blue_stained_glass,red_stained_glass air

#

how would i do that

round finch
#

can some tell me agein why arraylist can be bad in some case?
i believe 7smile7 told me about it but i can't find message

ivory sleet
#

appending on the list at the end may be O(n) complexity and contains is also O(n)

#

get and set by index is O(1) for ArrayList

#

LinkedList has O(1) for appending elements to it iirc

#

But ArrayList is arguably the best list data structure for arbitrary stuff

#

It generally has faster iteration time than both LinkedList and CopyOnWriteArrayList

#

But also should be worth mentioning ArrayList uses System::arraycopy for resizing its array making the add operation quite fast

Edit time complexity is generally something we consider when our data structures become bigger

round finch
#

did you look on wiki?

#

pls send me source link

winged mica
#

Hello

#

it all depends on that you need to do

round finch
#

what about hashmap?

winged mica
#

if you need a list to load and have fast shearchs you usar one tipe

#

if you need a list too keep changing it all the time, other times are better

round finch
#

just looking at time complexity

winged mica
#

yep, but doing what?

round finch
#

wait what for wut situation?

#

depends on wut?

winged mica
#

I mean, what you plan to do with the list?

#

what you need to do?

ivory sleet
round finch
#

just trying to learn more

winged mica
#

k k

round finch
#

still feel noobish

ivory sleet
#

But remember time complexity just tells u the worst amount of operations sort of

winged mica
ivory sleet
#

For instance IdentityHashMap is better (faster) than HashMap although they have the exact same time complexity

sullen marlin
#

uh

winged mica
#

sometimes it is better if we doo some testing with several strutures, to find out what is more suitable

ivory sleet
#

Yeah

tacit drift
sullen marlin
#

IdentityHashMap is just a normal HashMap that uses Object.equals/hashcode rather than the subclass ones

winged mica
#

i still use hashtables

round finch
#

i would like to improve my java develop skills

#

there for i'm asking alot 🙂

ivory sleet
#

No it uses System::identityHashCode

winged mica
#

but now days there are improved strutures over that

tacit drift
#

efficient holograms with armorstands guide? 😀

round finch
#

so then to use what?

#

for wut situation?

ivory sleet
#

Depends

#

What is the data structure for?

round finch
#

go on

#

just looking for exemple

#

to take note

#

or what you can tell me about it

#

i really should learn more about data and data structure
to make better code

#

it works but it is right not sure?

ivory sleet
#

Well unless you have an example it’s hard to just pull out all the concrete information you want to know

round finch
#

sorry if i'm asking alot i'm very curious

winged mica
#

about 20 years ago, ye that long, I made a sort of winzip, using wolfmans algorithm

ivory sleet
winged mica
#

so with that project I played with vectors, linkedlists, hashtables, binary trees

#

lots of stuff

ivory sleet
#

Vector Hashtable lol

winged mica
#

and learned quite a lot from it

round finch
#

nothing propper well written

#

but i had a item sort plugin

#

there sort to another inventory instance

winged mica
#

cool

round finch
#

note: i had no real experice making that

#

it like i can visualize things in my head

#

Note: i have Autism

wraith rapids
#

great

#

i'm out

winged mica
#

it is a great stuff to learn

#

and practice more skills

round finch
winged mica
#

I am making and improving some existing pluggins

#

learned quite a lot from it too

#

just for fun, actualy

#

anyway, we should be always learning, so our brain doesnt get lasy 🙂

round finch
#

i felt like spigot course scam me for a chance to learn

#

i could have used those 100$ on something else

#

or better

wraith rapids
#

lmao

#

did you really pay 100 dollars for a spigot tutorial or some shit

round finch
#

it is not even service for it

winged mica
#

you spent money on it?

round finch
#

i didn't know back then

wraith rapids
#

i'm dying

ivory sleet
#

That’s like rip

round finch
#

he was so promising

winged mica
#

lets make it worth it 🙂

wraith rapids
#

well, as they say

round finch
#

now it just feels like a schem

wraith rapids
#

the fool is never the one asking for the sum

#

it's the one paying it

winged mica
#

it depends

round finch
#

i should have bought java books for it

wraith rapids
#

anyways i'm off for realises now before i get anal cancer

round finch
#

or paid someone to teach me

round finch
ivory sleet
#

You learn most stuff for free nowadays

round finch
#

sus

winged mica
#

forget about it, just look at the future

round finch
#

yeah you learn from the past

winged mica
#

if that is your greatest mistake, then you are ok

round finch
#

probably doe

winged mica
#

I have made greater ones along my life

ivory sleet
#

Pog

#

Hopefully you learned from it

winged mica
#

always learning

round finch
#

i spend 800$ on super learn course

ivory sleet
#

Bruh

round finch
#

more oof

ivory sleet
#

Stop it

wraith rapids
#

hhhhhhhhhhhhhh

winged mica
#

🙂

round finch
#

but that was the past

#

it same time i bought spigot course

#

so i were dumb back then

wraith rapids
#

ok i'm actually terminating ripcord this time so I don't accidentally look

ivory sleet
#

Lmao

quaint mantle
#

how do i set the time to the very start of night in a world called "10"

winged mica
#

0_o

round finch
#

hope this can help you

hollow canopy
#

guys I want to seperate something from my main and I created a new class for register the events to main but I cant use public void shulker(InventoryClickEvent e)
this is the code https://paste.md-5.net/iwitozasig.java

winged mica
#

did you register that class for the events on your main?

hollow canopy
#

yes

winged mica
#

implements Listener missing

hybrid spoke
#

what

#

is

#

this

#

method inside constructor 🤔

hollow canopy
round finch
#

World world10 = Bukkit.getWorld("10");

hollow canopy
quaint mantle
round finch
#

World10.setTime( );

hollow canopy
#

@winged mica thanks thats worked

round finch
#

if you wanna use that

hollow canopy
winged mica
#

public class ShulkerCanta { should be public class ShulkerCanta implements Listener {

#

first start

hollow canopy
#

yes I did it that way

round finch
#

wait is Class Mob constructor use for Custom mobs?thonkang maybe.. oh

winged mica
#

not having this, i think you event register shouldn't be working

winged mica
#

PluginManager.registerEvents(new ShulkerCanta(), this);

#

on your main?

hollow canopy
#

there is no problem with register

#

I forget the implements as you said

winged mica
#

so it enters in the event?

#

k k

hollow canopy
#

yes

#

but there is another error

winged mica
#

show us

hollow canopy
#

look at my code again

hybrid spoke
hollow canopy
#

But if I put it outside how can I register the event

upper vale
#

Is there a packet for the item held aniamtion?

hybrid spoke
#

as long as you keep it marked with @EventHandler

#

and let your class implement Listener

#

and register the class in your onEnable

hollow canopy
#

getServer().getPluginManager().registerEvents(new ShulkerCanta(), this);

#

like this?

#

my other class name is ShulkerCanta

#

okey I got it

winged mica
#

you puted the event inside of the construcor

#

try this

#

public class ShulkerCanta {

    @EventHandler
     public void shulker(InventoryClickEvent e) {
         if(e.getClick().equals(ClickType.LEFT)) {
             if(e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta()) {
                 ItemStack box = e.getCurrentItem();
                 if(box.getItemMeta() instanceof BlockStateMeta) {
                     BlockStateMeta blockmeta = (BlockStateMeta) box;
                     if(blockmeta.getBlockState() instanceof ShulkerBox) {
                          ShulkerBox shulker = (ShulkerBox) blockmeta.getBlockState();
                          Inventory inv = Bukkit.createInventory(null, 27);
                          inv.setContents(shulker.getInventory().getContents());
                          e.getWhoClicked().openInventory(inv);
                     }
                 }
             }
         } 
     } 

}

hybrid spoke
#

?paste

queen dragonBOT
hollow canopy
#

Okey I made it

#

thanks anyway

#

I will change my whole code

quaint mantle
#

how do i make ward play at 0, 0, 0 in a world called "10" with a radius of 1000 blocks

tacit drift
#
        while(chestsi.hasNext()) {
            Map.Entry e = (Map.Entry) chestsi.next();
            Hologram hologram = HologramsAPI.createHologram(SWXChestHolo.getInstance(), (Location) e.getKey());
            hologram.appendTextLine("This is a test.");
            SWXChestHolo.holograms.add(hologram); //line 46 SWXArenaStart
        }
#

public static List<Hologram> holograms; (in main class)

#

what did i do wrong?

quaint mantle
#

ward the disc

round finch
#

Oh.. like how to play The music ward at 0 0 0

fierce salmon
#

how do you force a player to execute a command in java?

#

i tried doing this but something tells me its wrong

maiden thicket
fierce salmon
#

@maiden thicket like this?

maiden thicket
#

and uh

#

add a logger in there like

#

Bukkit.getLogger().info("dispatched cmd");

sage swift
#

aaaaaa why is your variable capitalized

maiden thicket
fierce salmon
#

tbh idk

maiden thicket
#

when u use command.getName() to check the command being called and not separate classes

#

🥲🥲🥲🤚🏽

sage swift
#

also pretty sure there is player.dispatchCommand or whatever

#

just search command in the methods

clever sequoia
#

guys

#

how can i take it out the <> on the name of a player

#

in the chat

ivory sleet
#

AsyncPlayerChatEvent::setFormat

sage swift
#

you can do /stop

#

that'll be sure to take the brackets out

outer sorrel
#

I have a custom event thats being called asynchronously but I cant cancel it, all the other code in the event works fine

#
@EventHandler
    public void flagEvent(FlagEvent event){
        event.getPlayer().sendMessage("e"); // works
        event.setCancelled(true); //doesnt work
    }

and this is it being called, its called from an async thing

FlagEvent flagEvent = new FlagEvent(player);
        Bukkit.getPluginManager().callEvent(flagEvent);
        if(flagEvent.isCancelled()) {
            return;
        }
ivory sleet
#

thats calling it sync?

outer sorrel
#

well it doesnt cacel then still

ivory sleet
#

ur snippet is minimal

#

please give more code

outer sorrel
#

uh

#

idk how to do that without sending the whole class

ivory sleet
#

send the method maybe?

outer sorrel
#

i guess here

public void fail(Player player) {
        FlagEvent flagEvent = new FlagEvent(player);
        Bukkit.getScheduler().runTask(FlappyAnticheat.getInstance(), () -> Bukkit.getPluginManager().callEvent(flagEvent));
        if(flagEvent.isCancelled()) {
            return;
        }

and its called here

@Override
    public void onPacketPlayReceive(PacketPlayReceiveEvent e) {
    //bunch of code here
    fail(player);
}
ivory sleet
#
public void fail(Player player) {
        FlagEvent flagEvent = new FlagEvent(player);
        Bukkit.getScheduler().runTask(FlappyAnticheat.getInstance(), () -> Bukkit.getPluginManager().callEvent(flagEvent));
        if(flagEvent.isCancelled()) {
            return;
        }
#

still not entire method

outer sorrel
#

the only code after that is sending messages

ivory sleet
#

so cancelling ur event will just avoid sending messages?

outer sorrel
#

basically

ivory sleet
#

aight right now the event is called sync

#

ops

outer sorrel
#

ok, how would I get it be canceled?

maiden thicket
#

implements cancellable
if event not cancelled then call event

ivory sleet
#

send FlagEvent class

outer sorrel
#
public class FlagEvent extends Event implements Cancellable {

    private final Player player;
    private boolean isCancelled;

    public FlagEvent(Player player) {
        this.player = player;
        this.isCancelled = false;
    }

    @Override
    public boolean isCancelled() {
        return this.isCancelled;
    }

    @Override
    public void setCancelled(boolean isCancelled) {
        this.isCancelled = isCancelled;
    }

    private static final HandlerList HANDLERS = new HandlerList();

    @Override
    public HandlerList getHandlers() {
        return HANDLERS;
    }

    public static HandlerList getHandlerList() {
        return HANDLERS;
    }

    public Player getPlayer() {
        return this.player;
    }
}

upper vale
outer sorrel
#

i didnt change anything for this calss

upper vale
#

thats not going to cancel sending the messages

#

you need to send the messages within the task in order for the return to do anything

ivory sleet
#

TheDoominator that packet receiving is async right

upper vale
#

additionally async events should have super(true)

outer sorrel
upper vale
#

otherwise you'll get error

upper vale
outer sorrel
upper vale
#

?

#

send new code pls

outer sorrel
#

ill add the super thing now

upper vale
#

Yeah the super isnt really relevant rn since you're calling the even sync atm

ivory sleet
#

have smtng like this then:

public void fail(Player player) {
        FlagEvent flagEvent = new FlagEvent(player);
        Bukkit.getScheduler().runTask(FlappyAnticheat.getInstance(), () -> {
          Bukkit.getPluginManager().callEvent(flagEvent));
          if(flagEvent.isCancelled()) {
            return;
          }
          Bukkit.getScheduler().runTaskAsynchronously(FlappyAnticheat.getInstance(), () -> {
          //handle event async
        };
}
#

but yeah idk depends on what u exactly want

upper vale
#

^

outer sorrel
#

thanks

upper vale
#

if youre just sending messages, i dont really see a benefit of that being async

ivory sleet
#

that too

outer sorrel
#

the packet plugin i use makes it async

ivory sleet
#

why not continue event flow async?

outer sorrel
#

it is now

#

i think

#

idk, it works tho

ivory sleet
#

ok

#

nice

#

have a good day

outer sorrel
#

thanks for the help

ivory sleet
#

pog

quaint mantle
#

how do i make a music disc play with a radius of 1000 blocks in a certain world

sage swift
#

you uh

#

dont

#

sounds have a radius

#

but the problem with sounds is that once they start in a location, they will continue to play there

#

so even if you play a music disc for all online players at their locations, once they move or teleport far enough away they won't hear it

quaint mantle
#

Yeah

#

Well my world has a border of 100

#

and a build limit of 128 blocks

#

getWorld("10").playSound( Sound.MUSIC_DISC_WARD, 3);

#

ive figured this out but

#

it requires a location and i don't know how to save the co ords 0, 0, 0 in a location

sage swift
#

use the Location constructor

quaint mantle
#

whats the location constructor

sage swift
hollow river
#

hey what is the generally used entity to make floating text? like on a server lobby which would have a mob nametag as text without a mob (well, invisible)

ivory sleet
#

it was armor stands

#

or

#

afaik

hollow river
#

oh okay ^^ thank you!

sage swift
#

armor stands were usually the way to do it, recently the meta has become area of effect clouds

upper vale
#

weird question but uh

#

is it possible for a PlayerInteractEvent to not be cancelled properly if the server is lagging

hollow river
#

does the mob matter for performance reasons?

#

also im seeing only the nametag of the top level passenger mob, is there any way i can show nametags on all passengers? (trying to make a healthbar + name above a mob)

cold tartan
#

im getting this error but I dont use the eventdamagebyblockevent

[22:01:43 ERROR]: Could not pass event EntityDamageByBlockEvent to Tutorial v1.0
#

here is the code it has an issue with:

    @EventHandler
    public static void onDamage(EntityDamageEvent event) {
        LivingEntity entity = (LivingEntity) event.getEntity();
        if (entity.getName().equals("DefiantBurger")) {
            if (entity.getHealth() - event.getFinalDamage() < 1) {
                event.setDamage(entity.getHealth() - 1);
                entity.sendMessage("§c§l(!) §cYou almost died!");
            }
        }
    }
#

here is the error below it:

java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R3.entity.CraftItem cannot be cast to org.bukkit.entity.LivingEntity
#

but im not casting an item to a living entity as far as I know

fierce salmon
#

i want to set the itemstack amount to 3 how would i do that?

sullen marlin
#

you're literally casting it on the first line of the method

#

you need an instanceof check

#

& look at the parameters available for new ItemStack

sage swift
#

EntityDamageByBlockEvent is a subclass of EntityDamageEvent as well

#

and yeah when an item is destroyed EntityDamageEvent is called

#

you need to check that the entity is a living entity before you cast it

quaint mantle
#

Helpme please

#

Why are the jar sizes in intellij so large?

sage swift
#

since an item is not, it errors

#

the order of an enum's values() never changes, right?

compact haven
sage swift
#

probably

torn oyster
#
        file = new File(plugin.getDataFolder(), "friends.yml");
        try {
            config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        
        saveFile();```
compact haven
#

if so then yes it changes, every time the enum order is changed

torn oyster
#

why is that causing an error

#

filenotfoundexception

#

im using bungee

sage swift
#

the file doesnt exist

#

mindblowing stuff

compact haven
#

lmfao'

torn oyster
#

oh

#

wow

#

i am

#

not the smartest

sage swift
#

spamming the chat

quaint mantle
sage swift
#

did you shade spigot

cold tartan
#

I keep getting this when I try to send a command

#

wait ik what i did

#

nvm

#

srry

sage swift
#

returned false

cold tartan
#

nope

#

forgot to register it

#

if I wanted to save some data for when the server next starts up, would it be dumb to just set that data in persistent item data when a player logs out, then read it when the player logs back in?

upper vale
#

So I have this really weird bug where if i hold down right click with a stone hoe and then spin around in circles, a random PlayerInteractEvent containing LEFT click is sent... does anyone have any idea on whats causing this lol

cold tartan
#

that is a really weird bug

ivory glacier
#

How would I serialise an item stack?

upper vale
#

it happens on one of my production servers but not my localhost lol

ivory glacier
#

How comes ItemStack isn't Serializable?

upper vale
ivory glacier
#

Nah to Serializeable

#

My entire data structure is

sullen marlin
#

its ConfigurationSerializable

#

java Serializable sucks

upper vale
#

cant possibly think of what could be wrong inside my plugin lol

#

It seems that spinning in circles while looking at just blocks is fine, spinning in circles while looking at just air is fine, but if you start moving your mouse really fast over blocks and air the event just comes out of nowhere

wise cape
#

Does the api have a method to determine the top Y pos based on a given x and z pos?

wise cape
upper vale
sage swift
#

is it only with a hoe? does it happen with only a plugin to broadcast interact events?

hollow river
#

Im kinda having the issue of having to make everything 100% futureproof and "perfect" as i can, it kinda prevents me from just making things and i lose motivation because i spend days or weeks on a single small thing

#

Does anyone have tips or the same issue and what's the best solution? I've managed to make things now but it'll probably happen again where i'd lose motivation because of it

sage swift
#

i've lost the drive to make anything at all before, where i just sit for days thinking about the project but not actually doing anything
i think it's totally normal, just comes and goes

#

and i think with practice it has gotten easier to know exactly what is required to make everything as needed

#

and yknow bugs do happen thats just a part of development

hollow river
#

Yeah its really annoying, i tried to minimize and focus on not doing that with my current project and so far i've been able to actually make things work, quest system, mob spawning, custom mobs, dialogue etc

#

Well its not bugs, but more of things like "i wonder how a plugin the scale of hypixel would do this" and well that's where it goes downhill and i get stuck trying to make it "professional" even though it works just fine

solemn shoal
#

dont futureproof

#

just make it work

#

i subconciously branch off my classes

#

(in this example JavaSource and JenkinsSource both extend Source so i can cast without issues)

hollow river
#

Can always futureproof later ;)

#

Oh nice!

solemn shoal
#

yeah like, idk how i do it

#

i need something? ill make a class for it

#

then like, 10 minutes later ill be like "tf am i doing lmao, oh well might aswell finish it"

hollow river
#

Yeah writing too much code is a curse

solemn shoal
#

i mean

#

yeah

hollow river
#

I just need to get on with it, make it happen and move on to the next thing

solemn shoal
#

take a look at the classes in there

#

it really is a curse but it works well

#

like, all of the events i use are separate classes

#

following a ~set structure

hollow river
#

I still have this issue with quests, and dialogues where i want full customization (like idk, when you kill 3 zombies your sword gets dropped, then an xp orb comes flying at you idk, just any customization) which j do by creating a class for every quest i make, so im not loading quests in but end up having a cluttered package with quest classes

solemn shoal
#

ah yeah

#

thats fun

#

maybe you should have an enum or something with goal types

#

idk

#

lambdas and callbacks lol

sage swift
#

at some point i wonder, "which part of this has to be hardcoded, and which part can be in a config?"

hollow river
#

I'll copy the link and take a nice look tomorrow since im in bed rn and trying to read that on phone is eh

solemn shoal
#

eh it was just an example of my class structure

hollow river
#

Yeah i was thinking of initializing the quests with like quest1.class or using an enum etc, but that's for later

#

Ohh alright

solemn shoal
#

im not saying its good, but it well, just works

hollow river
#

Well it looked good from what i've seen

solemn shoal
#

my onenable is a mess tho

hollow river
#

My code has structure but looks messy because i make the quests and mobs, dialogues too in separate classes (all extending from a parent of course though)

solemn shoal
#

well having differnt quest classes is fine

#

as long as all the data related to them is stored within

hollow river
#

Meh just stuff the big blocks into separate methods and call them like registerEvents(); that's what im doing

solemn shoal
#

fair

hollow river
#

Has to be done at some point, so might as well make it look nice since you cant avoid it

solemn shoal
#

ignore the mess that is that onCommand at the bottom

#

moving those into classes is still on my todo list 😅

hollow river
#

Tsk tsk unforgiveable

#

But hey your code looks good from what i see ^^ good job!

solemn shoal
#

i think its a huge rats nest

#

the main class is probably the best class in the entire project

hollow river
#

Yeah same here

solemn shoal
#

imagine all of this on a task timer

hollow river
#

Im constantly switching ways of doing things in my head like sending a class reference or just making a new instance already, stuff like that

#

Well one question i actually have

solemn shoal
#

more task tiemrs

hollow river
#

So i just made it so that i can create spawn points for mobs, where every x seconds it'd act like a spawner

solemn shoal
#

yeah?

#

sounds like my warps system

hollow river
#

But idk if i should add a new async repeated schedule thing for every "mob spawner" or if i should have one timer which just calls every "mob spawner"

solemn shoal
#

hm

#

good question

#

i'd say look into how vanilla does it

#

wait

#

youre saying async

#

hmmm

hollow river
#

I also want some spawners to spawn only every 60 seconds, some 10 seconds etc but i might have a solution for that

#

Yeah yeah

untold kernel
#

@solemn shoal
I find you literally everywhere

#

🤣

hollow river
#

So ending up with 70+++ might be a bad idea in the long run

solemn shoal
#

you'd have to ask around because i think thats a matter of opinion

#

and implementation

#

ah yeah @untold kernel

#

ofcourse

#

this is my main hub for plugin dev questions lol

untold kernel
#

Lol

#

I just read javadocs

#

xD

solemn shoal
#

i used to

untold kernel
#

I have mastered the art of doing that

solemn shoal
#

i dont even need javadocs anymore lol

hollow river
#

Can't read experience off of javadocs ;)

untold kernel
#

So I no longer need ask xD

solemn shoal
#

ah

untold kernel
solemn shoal
#

i dont need the javadocs anymore

untold kernel
#

Yeah fair enough

#

I had problems with the async repeated thingy

solemn shoal
#

because most thigns are autosuggested in intellij anyways

untold kernel
#

Really bad performance

solemn shoal
#

trying to modify world async?

untold kernel
untold kernel
#

And put it in mysql

#

Somehow lagged the server

#

;/

solemn shoal
#

tf

#

thats weird

#

i think the issue lies in mysql

untold kernel
#

One time I was so brain effed that I was performing 5 database things on main thread

cinder thistle
untold kernel
#

On playerjoinevent

hollow river
#

Yeah so i think i'll have an async repeated task which runs every 5 seconds which will be the min amount for a spawner to activate, and then maybe i can add a counter for each spawner which only gets triggered at every 20 seconds (every 4 calls if the async takes 5 seconds)

solemn shoal
#

checking the balance itself is fine, i do that multiple times per tick for every player

#

well

#

you'd need it to be a multiple of 5 seconds then

untold kernel
#

I am gonna make my own thread manager soon

#

For my plugins

#

xD

solemn shoal
hollow river
#

Yeah i think 5 is a good number

cinder thistle
#

specifically I'd like to point out that you're using what looks like a util class to get core things

solemn shoal
#

that was an example of bad code

cinder thistle
#

alright alright

hollow river
#

Nice flexibility without too heavy of a load

cinder thistle
#

I can agree there

#

imagine being unverified

solemn shoal
#

uh yes im using a util class to get core thigns

untold kernel
#

Tbh in the end

#

Everyone's code looks like that

hollow river
#

Dont bulli me :(

untold kernel
#

😂

sage swift
#

at the start, not the end

#

what the heck

untold kernel
#

Well for me I start out with let's make this clean

sage swift
#

mine doesnt look like that anymore

solemn shoal
#

util class in question

untold kernel
#

20 minutes later I challenge a friend I can make the whole plugin in a single class

#

🙃

sage swift
#

single line

#

did you see that video

untold kernel
#

No?

#

Lel

solemn shoal
#

single line isnt hard

#

ctrl+shift+r
first line: \n
second line:
alt+a

sage swift
#

kek

hollow river
#

I got a degree in web dev, im a full stack who kinda learns quickly so now i also make plugins. But one thing i always wanted to try was to make a big ass website just on one line of code

solemn shoal
#

@sage swift

sage swift
#

find and replace all new lines with zero-width spaces

#

boom

solemn shoal
#

yes

#

well actually no

#

why would you use zero-width spaces

#

i think the compiler would get angry about that

#

just replace it with nothing

sage swift
#

dont you need something to replace with

cinder thistle
#

1 class 50 lines is fun

sage swift
#

guess not

solemn shoal
#

no you dont

cinder thistle
#

that is the ugliest util class I've ever seen

solemn shoal
#

lol

#

dafuq

cinder thistle
#

there was a bukkit thread for it once

solemn shoal
#

ngl @cinder thistle

cinder thistle
solemn shoal
#

my util class is epic

cinder thistle
#

not really

cinder thistle
sage swift
#
        System.err.println("[BananaBonus] "+"iConomy not installed!");
        }```
#
                        cs.sendMessage("Invalid player");
                    }```
cinder thistle
#

Yeesh

cinder thistle
sage swift
#

My first plugin for minecraft 1.9. in 2011

#

beta

cinder thistle
#

I assume netbeans

torn oyster
#

how do i get a playerconnection

sage swift
#

EntityPlayer.playerConnection

torn oyster
#

oh

#

alright

#

well

sage swift
#

wacky stuff

torn oyster
#

uhh another thing

#

i found this code on the internet somewhere

#

lmao

#

but

#
        ScoreboardTeam team = new ScoreboardTeam(((CraftScoreboard) Bukkit.getScoreboardManager().getMainScoreboard()).getHandle(), p.getName());
    
        team.setNameTagVisibility(ScoreboardTeamBase.EnumNameTagVisibility.NEVER);
    
        ArrayList<String> playerToAdd = new ArrayList<>();
    
        playerToAdd.add(p.getName()); //Add the fake player so this player will not have a nametag
    
        connection.sendPacket(new PacketPlayOutScoreboardTeam(team, 1));
        connection.sendPacket(new PacketPlayOutScoreboardTeam(team, 0));
        connection.sendPacket(new PacketPlayOutScoreboardTeam(team, playerToAdd, 3));```
#

it aint working