#help-development

1 messages ยท Page 7 of 1

tall dragon
#

can also do that with ( ) ๐Ÿ˜„

charred blaze
#

wut

tender shard
#

this is a funny one

noble lantern
#

and ;;;;;;;;;;;;;;;;;;;;;;

tender shard
noble lantern
#

i wonder

#

if you can increase java code execution time by adding enough () {} and ;;

tender shard
#

it gets lost on compilation

noble lantern
#

man

flint coyote
#

Without a decent compiler you could

noble lantern
#

fuck javac

tender shard
#

yeah

#

what a jerk

flint coyote
#

it would be a NOP in assembly

tender shard
#

optimizing things and stuff >.<

flint coyote
#

NOP=no operation

tender shard
#

I also find it funny how sometimes people bother to turn their math into bitshifts, thinking that it makes it faster

tall dragon
#

?paste

undone axleBOT
noble lantern
#

oh god

#

here we go

tall dragon
noble lantern
#

big shifts are useful for ChunkSnapshots -> real worlds locs

#

bit*

charred blaze
#

join spam bots does not works on online mode servers?

tender shard
flint coyote
charred blaze
tall dragon
#

ahh

charred blaze
#

nots reach servers yah?

noble lantern
vast raven
tender shard
#

I once did this thinking its faster than doing %16 lol. but thats bs

charred blaze
noble lantern
#

...

#

im going to bed

#

gn guys

tender shard
#

at 5:20 pm?!

#

and no, timezones are not a thing

noble lantern
#

8:20am actually

tender shard
#

it's 5:20 EVERYWHERE

charred blaze
#

7:20 actually

tender shard
#

no

vast raven
tender shard
#

5:20 pm

noble lantern
#

germany

tender shard
noble lantern
#

ayy

#

i remember

charred blaze
#

close to germany

tender shard
#

aaaaayyy

vast raven
tender shard
#

high five

vast raven
flint coyote
#

normal 5
high โต

vast raven
charred blaze
vast raven
#

high five pm

#

ok no.

noble lantern
tall dragon
#

no it dont

tender shard
charred blaze
#

high three

tender shard
#

oh no

#

conclure arrived

vast raven
ivory sleet
#

Since it creates a formatter

#

And does some parsing

tender shard
#

everyone pretend to be innocent

tall dragon
ivory sleet
#

Yeah all innocent here

tender shard
flint coyote
ivory sleet
#

Oh yeah

ancient plank
#

127.0.0.1

tall dragon
tender shard
noble lantern
#

okay then

tender shard
#

oh shit

ivory sleet
#

Assuming you dont use a potato cpu

tender shard
#

I didnt mean to send this gif

noble lantern
#

that just looked weird to me lol

tall dragon
tender shard
noble lantern
#

lol it does same for me

#

stupid

tender shard
#

::1

charred blaze
flint coyote
noble lantern
#

^^^

tall dragon
#

ohhh danggg

#

such a good idea!

noble lantern
#

also store it on seprate machines

#

so your storage space on one doesnt always fill up

chrome beacon
#

Why not use ms paint

charred blaze
noble lantern
#

i did

charred blaze
#

gud

noble lantern
#

code dont work

#

helpspls

tender shard
#

I code using a midi keyboard

#

C4 is 1, F#5 is a 0

charred blaze
noble lantern
#

hit them with the piano in minecraft

#

hit them z_aCRYYY

tender shard
#

I have a piano app for my macbook's touchbar and it suuuucks

noble lantern
#

jaceks piano plugin is badass

gleaming grove
#

this is the old one plugin

flint coyote
#

help guys. I can't use my note block in minecraft to take notes. It always plays a different saving sound but I can't find my note anywhere.
Is it some plugin that breaks it?

noble lantern
#

ohhh

#

pooog

tall dragon
#

anyone know where the compile button is?

ancient plank
#

imagine pointing with => instead of ->

noble lantern
noble lantern
#

and and cache it in flat file json

#

should work then

noble lantern
#

mailmeaciggoddamnit

flint coyote
tender shard
noble lantern
#

indeed xD

tender shard
#

but intelliJ's buttons are useful

#

it lets you run tests, compile/build etc, start the debugger, bla bla

noble lantern
#

yooo

#

it has GITHUB BUTTONS

tender shard
#

yeah I think it's customizable but havent checked

noble lantern
#

thats cool asf

tender shard
#

photoshop etc let you customize the buttons, at least

noble lantern
#

now i want a mac

tender shard
#

๐Ÿ˜„

#

yeah well but you dont want a mac for minecraft

chrome beacon
#

Until is sends too much power to the SSD and kills it

noble lantern
#

do you get buttons for minecraft on it?

#

thats the only button i get

tardy delta
#

atleast im not the only one with a dirty keyboard

tender shard
noble lantern
#

my keyboard dirty too

tender shard
#

okay it was actually intelliJ in that screenshot

#

anyway, MC on a macbook is no fun

noble lantern
tender shard
noble lantern
#

ohhh

#

okay yea thattle do it

tender shard
#

but the funny thing is, mac stays 100% usable even with that fucking 260 load

noble lantern
#

dance multithreading dance

tender shard
#

I really love macOS

hardy swan
#

no way

tender shard
#

btw... bump ^

flint coyote
#

Just run your servers on macOS

rough drift
#

mac's are nice, for development

#

great question

hardy swan
#

proper type as in T?

tender shard
noble lantern
#

iirc chars have a numerical value

rough drift
#

it has something to do with something I forgot

noble lantern
#

dont they?

tender shard
flint coyote
#

because int is the code of the character

noble lantern
#

^^^

#

thats what i was trying to say

tender shard
#

it's still weird that it says "writeChars" and takes an int

#

same for byte

#

writeByte(int), that's weird

noble lantern
#

yeah that ones weird

tender shard
#

why not just writeByte(byte)

#

screenshot is from the "DataOutput" interface IIRC

hardy swan
#

I would understand if it is like writeChar(byte) or writeByte(char)

noble lantern
#

why cant ppl just use Number as theyre argument types

tardy delta
#

arch linux

flint coyote
#

you can also do a for loop based on characters since they are basically numbers.
Like
for(char c = 'a'; c <= 'z'; c++) {
System.out.println(c);
}

noble lantern
#

ew c++

hardy swan
#

but char isn't int, the thing is

#

char is at most byte

tardy delta
#

((int)c)++ ๐Ÿค”

#

would c++ even work?

tardy delta
#

lmfao c++

bold solstice
#

Hey, Ive been trying for a few days to make it so if somebody dies it basically has a firework instantly detonate where they were killed, Im having trouble with the instant detonation, at first I used firework.detonate() method and it worked for sometime but then for some reason it stopped. Ive done some research and ive seen that this method is not the best and u have to delay the detonation in a few ticks so it will work, so I did that and it didn't work and now im stuck. Can anyone help me please

hardy swan
tardy delta
#

im a little bit late today

#

๐Ÿ˜ข

noble lantern
#

@tender shard theres a few like this

hardy swan
#

but here they say getNumericValue

supple elk
#

I have this error message

hardy swan
#

it is implied the return type is Number

supple elk
#

trying to serialise/desirialize this object

noble lantern
#

:))

supple elk
#

it gets stored like this

#

but says that the class cannot be found

hardy swan
#

for a moment I thought yaml has become a programming language

noble lantern
noble lantern
#

that classpath should be bukkits iirc

#

unless i didnt read your question entirely

supple elk
#

I'm guessing it's something to do with the registration?

#

I thought that static{} was ran the first time a class is referenced

tender shard
tender shard
#

well

#

it runs when the class is loaded

noble lantern
#

i wouldnt use records for this imo

supple elk
#

mk

grizzled oasis
#

hi a question is possible to make some people show a tag that other will not see and if yes how?

noble lantern
#

depends

flint coyote
#

You can do that with scoreboards and scoreboardteams probably

noble lantern
#

^

Theres also ways to have names show on hover, or the way without scoreboards which is packets

grizzled oasis
fiery prairie
#

Yo what can i use for gradients in the newer versions to work? Chatcolor.translatelaternateshit doesnt work

supple elk
#

Ok I'll try this, though it shouldn't make a dif

flint coyote
grizzled oasis
bold solstice
#

Hey, Ive been trying for a few days to make it so if somebody dies it basically has a firework instantly detonate where they were killed, Im having trouble with the instant detonation, at first I used firework.detonate() method and it worked for sometime but then for some reason it stopped. Ive done some research and ive seen that this method is not the best and u have to delay the detonation in a few ticks so it will work, so I did that and it didn't work and now im stuck. Can anyone help me please

supple elk
tardy delta
#

show code

bold solstice
#

?paste

undone axleBOT
supple elk
#

it's cause of the static {}

supple elk
#

I registered it outside of that and it now works

flint coyote
# grizzled oasis nah i don't care about them how i can do that? if you can link me javadocs or so...

This should give you a push into the right direction https://www.spigotmc.org/threads/hide-nametags-with-teams-and-scoreboards.170719/
also there's more posts like that aswell

tardy delta
#

people dont see to know that return is a thing

lone ore
supple elk
#

This doesn't seem to be working, anyone know why?

#

do L and R also need to implement ConfigurationSerializable?

tender shard
#

oh you already fixed it, mb

supple elk
#

kk

rough drift
#

you can just do L extends ConfigurationSerializable

#

same for R

#

SerializablePair<L extends ConfigurationSerializable, R extends ConfigurationSerializable> implements ConfigurationSerializable

tardy delta
#

pain

rough drift
#

and suffering

flint coyote
#

only the one at the players location + 3 in each direction

tender shard
#

I love generics

tardy delta
#

generics in rust even better

#

lemme show

rough drift
#

If a number is taken from configuration, is it parsed as a double regardless?

rough drift
tardy delta
#

Arc<Mutex<mpsc::Receiver<Box<dyn FnOnce() + Send + 'static>>>>

#

i made a Message type to make it shorter lmfao Arc<Mutex<mpsc::Receiver<Message>>>

tender shard
#

wtf lol

tender shard
tardy delta
#

bruh how am i playing ij i dont even have it enabled

lone ore
#

but dosent

tender shard
#

what does it do instead?

lone ore
#

nothing

tender shard
#

does your listener run at all?

#

did you register it?

lone ore
#

yes

tender shard
#

add a debug message inside every if statement

lone ore
#

wait let me check

tender shard
#

sth like this

public class PlayerEvents implements Listener {

    @EventHandler
    public static void onRightClick(PlayerInteractEvent event) {
        System.out.println("Test1");
        if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                System.out.println("Test2");
                if (event.getItem() !=null) {
                    System.out.println("Test3");
                    if (event.getItem().getItemMeta().equals(PlayerHandler.gh.getItemMeta())) {
.......
#

so you can see which if statement fails

dusk flicker
#

alex has an article on everything

flint coyote
#

arrow anti-pattern. I always named it using guard clauses

lone ore
tender shard
tender shard
lone ore
#

what should i do to register it

new PlayerEvents();

right? (very new to spigot started today)

tender shard
#

?events

#

?event

supple elk
tender shard
#

?eventapi

undone axleBOT
tender shard
supple elk
#

does it store doubles as floats or smmin?

tender shard
#

no, why?

#

what's the problem?

lone ore
#

yes i did it

tender shard
#

do the "debugging" stuff I suggested above

#

like, add a message before and after every "if(...)"

#

then you can see where your code stops

supple elk
#

it's saying a double cannot be cast to a float

#

meaning it's read it as a double

fiery prairie
#

How can I make e.setFormat from asyncplayerchatevent work with hex colors?

#

e.setFormat(Utils.color(getConfig().getString("chat-format")).replace("%player%", p.getDisplayName()).replace("%message%", msg));

supple elk
#

that's what it looks like

tardy delta
#

vm broken aaa

#

completely frozen

#

i can only hard shutdown

bold solstice
#

Hey, Ive been trying for a few days to make it so if somebody dies it basically has a firework instantly detonate where they were killed, Im having trouble with the instant detonation, at first I used firework.detonate() method and it worked for sometime but then for some reason it stopped. Ive done some research and ive seen that this method is not the best and u have to delay the detonation in a few ticks so it will work, so I did that and it didn't work and now im stuck. Can anyone help me please

tender shard
supple elk
lone ore
#

bec Test 1 didnt even run

tender shard
#

what's GameMap line 62?

#

and what's Position line 26?

supple elk
flint coyote
supple elk
#

GameMap shouldn't be influencing anything

supple elk
supple elk
tender shard
supple elk
#

lol ok

tender shard
#
float myFloat = (float) ((double) map.get("mydouble"));
tardy delta
#

org.json/simple moment

lone ore
#
getServer().getPluginManager().registerEvents(new PlayerEvents(), this);
``` will work right?
tardy delta
#

float f = ((Number)json.get("smth")).floatValue();

tender shard
supple elk
#

will test ig

tender shard
tardy delta
#

ye was talking bout json simple

supple elk
#

ty

supple elk
tardy delta
#

override toString kek

supple elk
#

though I have another problem

#

so it's the same object

#

when I load the metadata I store it into 2 lists, spawns and checkpoints

lone ore
#

Omg tysm to whoever helped me it worked

supple elk
#

those are the same lists which are saved when I write meta data

river oracle
#

What would be the performance impact of registering a listener while the server is already running versus doing it on startup and adding multiple if checks to every event to see if it can proceed

tender shard
supple elk
#

however, when I save the lists are now empty even though they loaded in the data correctly. So somewhere in between loading and saving the lists are cleared

#

I can't see anything in the uses though

flint coyote
supple elk
#

Here are the uses

#

it never gets cleared in any of these uses so I don't understand what's happening

tender shard
#

print out the list in your serialize() method, see if they actually contain data

flint coyote
vernal minnow
#

hello gyus, can i reload the bungeecord config with a bungeecord plugin? if yes how do i do it?

supple elk
#

when I load the data I print the new contents of the list

#

and likewise when I save

#

that's what that screenshot is

#

you can see it obtains objects in it when it's loaded

#

but nothing when it's saved

quaint mantle
#

well I tried what u said

#

lets just say it was hell

tender shard
#

show your "Position" serialize() and deserialize() methods again pls

quaint mantle
#

if I do spigot-api nms gone
and if I do spigot then EntityTypes.ENDER_DRAGON goes

supple elk
#

it happens on the SerializablePair<> too

tender shard
#

you need spigot for NMS

supple elk
quaint mantle
tender shard
#

tbh @supple elk the ConfigurationSerializable thing is very weird. I always just write my own serialize and deserialize methods that do not use the builtin serialization. I normally do it like this (one sec, I'll send some code)

supple elk
supple elk
#

same thing happened

#

and I made it secure this time

#

it clones the arrays

#

and uses an add function now

#

so I don't think it's external..

brave sparrow
#

Is that the entire class?

supple elk
#

no

tender shard
supple elk
#

I have a hunch

#

I'm just testing

#

wefoiwejfoipewjifoje woifjewoi w

#

ok it's not fixed

#

this is weird af

tender shard
#

anyway I usually just do sth like this

my-custom-object:
  something: asd

and then I have method like this

public static MyObject deserialize(ConfigurationSection section) {
  ...

and then I use it like this

MyObject thing = MyObject.deserialize(config.getConfigurationSection("my-custom-object"));
supple elk
#

right

#

here's the latest anyway

tender shard
#

it's a bit dirtier but at least it always works

supple elk
#

same thing happens

#

same object

#

so how does the list empty????

#

it can't be external

#

and I don't see anything internal

brave sparrow
#

Youโ€™re not multithreading this right?

supple elk
#

no

#

at least I don't think so

#

unless there's some weird multithreading going on with the saving/loading

brave sparrow
#

Have you tried testing this without reloading

supple elk
#

This clones an array right?

brave sparrow
#

It does

supple elk
supple elk
supple elk
#

for some reason every time I launch the server for the first time I get the same error

#

which fixes after reloaded

#

This ^

brave sparrow
#

That seems like an important error we shouldnโ€™t be overlooking

supple elk
#

yeah

#

It doesn't tell me anything though

brave sparrow
#

Whatโ€™s minecrell

supple elk
#

Or at least I can't discern anything from it

supple elk
brave sparrow
#

Ok letโ€™s ignore that one for now since it seems unrelated

#

Letโ€™s look at the error from your plugin

eternal oxide
#

What is JetCore.java:33 ?

brave sparrow
#

Whatโ€™s on JetCore line 33

supple elk
#

ahhh

#

the world isn't loaded

eternal oxide
#

NO worlds are loaded when Static

supple elk
#

is the world loaded when onEnable() is called?

eternal oxide
#

yes

supple elk
#

ok will put it in there then

brave sparrow
#

Depends on if you tell your plugin to load before or after world load

#

But generally yes

winged anvil
#

?paste

undone axleBOT
supple elk
#

I just realised I didn't need to do that stuff anyway

#

that wouldn't have affected my other issue though I wouldn't have thought

#

will test again now

#

but maybe it's the reloading which is the issue

brave sparrow
#

Iโ€™m thinking itโ€™s the reloading yeah

supple elk
#

not the reloading

tender shard
brave sparrow
#

Already beat you to it @tender shard

tender shard
#

if you set "load" to "STARTUP", then non., if you set it to "POST-WORLD" (default), then nyes

supple elk
#

onEnable(), values are loaded. It's a fresh launch

#

I then save, the values have gone from the list

#

I don't see how this happens

brave sparrow
#

Now that Iโ€™ve seen your static abuse

#

Can you paste all your code

supple elk
#

๐Ÿ˜ข

brave sparrow
#

I have a suspicion

supple elk
#

I swear that's the only bit :<

tender shard
#

static abuse where

supple elk
#

the spawn thing

tender shard
#

wanna see too

brave sparrow
#

You missed it

brave sparrow
supple elk
#

it was a bit of static abuse

#

ok so which code do you need to see?

tender shard
#

well

#

it's the spawn location

#

there always only ever is one spawn

brave sparrow
#

Letโ€™s see your command class @supple elk

supple elk
#

for which command?

tender shard
#

so I wouldnt consider this static abuse. but yeah, getting a world in the class init, ofc that cannot work

brave sparrow
supple elk
#

ok

winged anvil
#

im trying to create a custom serializer with GSON, some reason I keep getting the InaccessibleObjectException error even when I've registered the adapter. https://paste.md-5.net/obeyaneduv.java

supple elk
#

it's a little big...

#

oh wait sorry

#

wrong bit

tender shard
viral temple
#

is AsyncPlayerPreLoginEvent good for doing some player related checks with a database? will it also ensure the player is online or i have to go sync with main thread again? // posted in wrong section, oops...

supple elk
#

Here

brave sparrow
#

Oh also I wanna do a magic trick @supple elk so after you send me that put a logger in the constructor of your BoatMap class

tender shard
#

lol sorry

brave sparrow
tender shard
viral temple
tender shard
#

but the UUID could be fake in that phase, I believe

#

not sure though

brave sparrow
viral temple
#

but I'm doing something with the player after checking a database

brave sparrow
#

Also where in the class you sent me does the save get triggered

viral temple
#

i could get the player later

tender shard
#

I would just use the normal join event

brave sparrow
#

Naw

#

@viral temple if you only need the UUID that event should be fine iirc

supple elk
#

ah..

#

I think I might now know what's happening?

viral temple
tender shard
brave sparrow
supple elk
#

I'm exactly sure in which the order of stuff is created

brave sparrow
#

iirc the event is after authentication but before join

tender shard
#

ah ok

brave sparrow
supple elk
#

ok

brave sparrow
#

Wait

#

Now I know the issue too

tender shard
#

yeah anyway, my tip is always:

  1. Do stuff
  2. If it works, nice
  3. If it causes problems, fix it then. Don't worry too much BEFORE you encounter problems
    Otherwise you spend more time thinking about stuff than actually doinng stuff
#

I always just start to code sth and then fix problems as soon as they get reported lol

supple elk
#

I trigged a save

brave sparrow
#

Ok yep Iโ€™m right

supple elk
#

I think the issue is that it reads the values, tries to save to fields which don't exist yet

brave sparrow
#

Your issue is that youโ€™re assigning spawn and checkpoint to empty lists

somber hull
#

I have a spawner plugin where i need to calculate the drops of a spawner based off of a entity NBT tag wich just saves the spawners entitytype as a string. What would be the best way to calculate drops? Make a class for each one, and load those classes into a map with the key being their name as a string on startup?

old cloud
#

Why do custom channel names (plugin messaging) need to contain a colon?

somber hull
brave sparrow
#

Which happens after theyโ€™ve been assigned by the deserialize function

supple elk
#

when?

tender shard
supple elk
#

SHIT

brave sparrow
#

private List<Blah> bla = new ArrayList<>();

supple elk
#

I JUST SAWWWWWWWW

#

AHHHHH*

brave sparrow
#

That happens after

supple elk
#

yeah I see it now

#

man I'm dense

somber hull
tender shard
viral temple
#

hmm, how worse could it be to get a serial id from a database for each player joining directly in the main thread ๐Ÿค”

tender shard
#

very bad

supple elk
#

Ty so much @brave sparrow + @tender shard

tender shard
#

use Futures for stuff like this

brave sparrow
#

No worries

tender shard
brave sparrow
supple elk
#

testing

#

yes

#

๐Ÿ‘

#

it is fixed

brave sparrow
#

Excellent

tender shard
#

ford prefect

somber hull
#

Not inthe world

#

And calculate drops from there

supple elk
#

such a dumb mistake

somber hull
#

To reduce lag

tender shard
brave sparrow
tender shard
#

dumb mistakes are the worst to fix

brave sparrow
#

I wouldnโ€™t even call that a dumb mistake

#

You have to know a decent bit about execution order to realize what the issue was with your code

somber hull
supple elk
#

I ran into this same mistake ealier kinda

#

I was trying to call spawn.addAll()

#

and was confused cause I initialised spawns to a new list

#

in the constructor

#

but of course the readMetaData() is called form the super constructor

tender shard
brave sparrow
#

Yup

supple elk
#

so before the lists were initialised

#

so I made it create a new list on readMetaData()

#

which then overwrites, which works

#

but then forgot to remove the initialisation of the lists in the constructor lmao

#

which is what caused that mess

#

so I feel like I should have seen that

viral temple
#

Is the Player object thread safe enough for checking isOnline() method?

supple elk
#

oh well

somber hull
tender shard
supple elk
#

I'm pretty pleased with what I've made overall though. Storing and reading minimaps and metadata for them from files

daring lark
#
    public void onEntityDamage(EntityDamageEvent e) {
        LivingEntity monster = null;
        if(e.getEntity() instanceof LivingEntity) {
            monster = (LivingEntity) e.getEntity();
        }
        if(monster == null) {
            return;
        }
        if(monster.getCustomName() == null) {
            return;
        }
        if(!rpgMonstersManager.isRpgMonster(monster)) {
            return;
        }
        RpgMonster rpgMonster = rpgMonstersManager.getRpgMonster(monster.getUniqueId().toString());
        rpgMonster.setHp((int) (rpgMonster.getHp() - e.getFinalDamage()));
        rpgMonster.updateDisplayedHp((rpgMonster.getHp()), monster);
        Bukkit.getServer().getConsoleSender().sendMessage(String.valueOf(rpgMonster.getHp()));

    }``` did anyone knows why when i'm calling that event hp displayed updates late
daring lark
viral temple
brave sparrow
#

Look safe to you?

tender shard
daring lark
# daring lark ```@EventHandler public void onEntityDamage(EntityDamageEvent e) { L...
    public void updateDisplayedHp(int hp, LivingEntity monster) {
        String name = ChatColor.GREEN + "[" + ChatColor.YELLOW + level + ChatColor.GREEN + "]" + ChatColor.WHITE + " Zombie "
                + ChatColor.GREEN + (int) monster.getHealth() + ChatColor.YELLOW + "/" + ChatColor.GREEN + maxHp;
        monster.setCustomNameVisible(false);
        monster.setCustomName(name);
        monster.setCustomNameVisible(true);
    }``` update method
tender shard
tender shard
somber hull
brave sparrow
tender shard
somber hull
#

No

brave sparrow
somber hull
#

What ill do

#

Is ill do what another plugin i saw did

#

They had a foilder with every mobs loottable in a file

tender shard
somber hull
#

But i wont do it like that, ill do it in classes

tender shard
#

e.g. LootTables.ZOMBIE

somber hull
#

And then have a config option to chanmge them

somber hull
tender shard
#

thats spigot

#

its api

somber hull
#

Oh

#

ok

tender shard
#

LootTables.valueOf(myEntity.getEntityType().name())

#

not sure if there is a table for EVERY mob type, so you might wanna try/catch this

somber hull
#

Alr

tender shard
#

and then you can get a random drop from the table like this (1 sec ill send a link)

viral temple
brave sparrow
somber hull
#

The only issue is that i would need to generate a bunch of loot depending on how long the spawner has been in the inventory

tender shard
somber hull
#

Would i have to run populateloot a bunch of times?

tender shard
#

tbh, no idea

#

I think that "populateLoot" returns exactly one "list of items"

#

e.g. kill one zombie = populateLoot

#

kill another one = populateLoot again

#

so for 10 zombies, you gotta call it 10 times

somber hull
#

Yea

#

hmmm

tender shard
#

btw Hyper huh

#

why is your discord name different from your spigot name

#

arent you verified

raw sky
#
[24.07 13:10:56] [Server] [ERROR] Could not load 'plugins/SwornGuns.jar' in folder 'plugins'
[24.07 13:10:56] [Server] org.bukkit.plugin.InvalidPluginExceptionjava.lang.UnsupportedClassVersionError: net/dmulloy2/swornguns/SwornGuns has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
``` anyone know how I fix this
brave sparrow
raw sky
#

I havve changed so many values relating to JDK idk how it still builds

tender shard
raw sky
tender shard
raw sky
#

yep

tender shard
#

ok 1 sec

brave sparrow
#

Are you compiling swornguns?

tender shard
raw sky
#

ok lets see

brave sparrow
#

Ok so that is the one youโ€™re compiling, good

tender shard
#

looks like my blog is popular among russian bots lmao

raw sky
#

hmm thats weird lemme get some ss

#

that should work right?

#

yet its still the same error sadly

tender shard
#

how are you compiling? @raw sky

raw sky
#

Maven -> LifeCycle -> Install

tender shard
#

hm weird

#

do "clean", then "install" again

waxen plinth
#

Is it possible to parse a JSON string to a List<Object> with Jackson?

tender shard
#

do you need a List<Object> or a List<MyCustomObject> ?

waxen plinth
#

List<Object>

#

I'm trying to get as barebones as possible

#

I'm benchmarking Jackson against my own parser

tender shard
#

oh ok

#

well if you want a generic List<Object>, then I'm not exactly sure lol

waxen plinth
#

Damn

tender shard
#

that's a quite unusual question ๐Ÿ˜„

#

most people want to get a list of some specific class

waxen plinth
#

Well yeah, for benchmarking I don't care about its conversions or anything

#

I just want to compare its raw speed

raw sky
#

Rebuilding project does come up with some errors, but I think that works?

tender shard
#

what about sth like this? Haven't tested though

ObjectMapper mapper = new ObjectMapper();
List<Object> stuff = mapper.readValue(someJson, mapper.getTypeFactory().constructCollectionType(List.class, Object.class));
raw sky
#

Ill try and fix them, I believe java 11 is the closest I can get to my server version

tender shard
#

whats your sever version anyway, btw?

#

all spigot versions either require java 8, 16+ or 17+

quaint mantle
#

is there a way to set the world in a BlockVector3?

raw sky
quaint mantle
#

im guessing i need too

tender shard
tender shard
raw sky
#

is there a limit?

#

since I had java 17 and had the error

tender shard
#

what was the error?

raw sky
#

org.bukkit.plugin.InvalidPluginExceptionjava.lang.UnsupportedClassVersionError: net/dmulloy2/swornguns/SwornGuns has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

somber hull
#

If i want to get the material value of a string

#

How do i chekc if the material does not exist

#

Like say sopmeoen types in Dir instead of Dirt

#

How would i add a check fro that

#

Would valueOf return null?

#

would valueOf return null?

#

it snot sending wtf

tender shard
somber hull
#

would valueOf

#

valueOf

#

you cant send valueOf

#

wtf

raw sky
tender shard
#

version 61 = you compiled using java 18

#

send your whole pom.xml pls @raw sky

#

?paste

undone axleBOT
noble forge
#

I throws an error

#

check javadoc

tender shard
#

valueOf throws IllegalArgsExc

noble forge
raw sky
#

but I can still send it

tender shard
#

yeah pls just ?paste your pom

somber hull
# noble forge no

Should i catch the NPE in this case? And tell the player that they inputted it wrong?

noble forge
#

yes

raw sky
tender shard
#

check out my Enums class

noble forge
#

just do a try catch and in the catch do your error handling

tender shard
#

1 sec

somber hull
#

Alright

tender shard
steel swan
#

so i m using teams to setup a prefix for each players, but how can i make it so that "Prรฉfix" is on top of the players name. Like there is the "Prefix" and bellow it the player's name
heres the part of the code :

Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();



                    org.bukkit.scoreboard.Team team = scoreboard.getTeam(sender.getName());

                    team.setPrefix("Prefix \n "); 
                    team.addEntry(sender.getName()); 
tender shard
tender shard
noble forge
#

the quality of this code though is pretty great

tender shard
#

thanks lol

#

IIRC part of that stuff is "crow-coded" by people in this channel

noble forge
#

for loop > forEach

tender shard
#

I'm not using any foreach in that class, do I?

noble forge
#

no, exactly

tender shard
#

I havent checked this code since months

noble forge
#

thats one of the reasons your code quality is quite high imo

tender shard
#

forEach does have some useful cases but not if you just wanna loop over a collection lmao

noble forge
#

exactly

raw sky
noble forge
#

people abuse it too much

tender shard
#

forEach = if you use a stream already anyway
everythingElse -> normal for loop

noble forge
#

true

tender shard
#

if the code uses java 17 features, ofc you cannot compile it for java 8

raw sky
#

Ok ty!

tender shard
#

btw doesnt 1.16 support java 17 anyway?

raw sky
#

server is running java 11, I might be able to get java 17

#

tried to run it with paper and it just crashed

steel swan
#

anyone has a way to put smth on top of the players name?

tender shard
#

there is no other way

#

I suggest to use AreaEffectClouds

#

instead of armor stands

steel swan
#

why that?

tender shard
#

it's better for client FPS

#

armor stands cause huge FPS drops if you use many of them

#

area effect clouds dont

desert frigate
#

what are the pickup statuses?

tender shard
#

there is one downside though - the effect clouds only get rendered up to 48 blocks

desert frigate
little panther
river oracle
#

I'm getting compilation issues for some reason anyone have any idea what this Means

java.lang.Error: Unresolved compilation problems: 
    The type net.minecraft.world.entity.Entity cannot be resolved. It is indirectly referenced from required .class files
    The type net.minecraft.world.phys.AxisAlignedBB cannot be resolved. It is indirectly referenced from required .class files
quaint mantle
#

why isn't this working? No errors but its not setting the blocks

#
        Json json = getPminejson();
        double jsonx = json.getDouble("pmines." + name + ".loc1.x");
        double jsony = json.getDouble("pmines." + name + ".loc1.y");
        double jsonz = json.getDouble("pmines." + name + ".loc1.z");
        Bukkit.broadcastMessage(jsonx + " // " + jsony + " // " + jsonz);

        double jsonx2 = json.getDouble("pmines." + name + ".loc2.x");
        double jsony2 = json.getDouble("pmines." + name + ".loc2.y");
        double jsonz2 = json.getDouble("pmines." + name + ".loc2.z");
        Bukkit.broadcastMessage(jsonx2 + " // " + jsony2 + " // " + jsonz2);
        BlockVector3 blockVector31 = BlockVector3.at(jsonx, jsony, jsonz);
        BlockVector3 blockVector32 = BlockVector3.at(jsonx2, jsony2, jsonz2);



        World world = BukkitAdapter.adapt(Bukkit.getWorld("pmines"));
        try (EditSession editSession = WorldEdit.getInstance().newEditSession(world)) {
            RandomPattern randomPattern = new RandomPattern();
            Pattern pattern = BukkitAdapter.adapt(Material.STONE.createBlockData());
            Pattern pattern1 = BukkitAdapter.adapt(Material.SEA_LANTERN.createBlockData());
            randomPattern.add(pattern, 99.5);
            randomPattern.add(pattern1, 0.5);
            Region region = new CuboidRegion(world, blockVector31, blockVector32);
            editSession.setBlocks(region, randomPattern);
            editSession.flushQueue();
        }```
tardy delta
#

is that gson?

quaint mantle
#

that works ^ but it doesn't set blocks

tardy delta
#

i guess that means yes

quaint mantle
#

it works nvm

#

i messed up the vectors

#

:/

subtle folio
#

๐Ÿ‘

quaint mantle
#

okay now this isn't working for some reason

#
                Location pasteloc = new Location(Bukkit.getWorld("pmines"), (500 * pminejson.getInt("pminecounter")), 50, 100);
                owner.teleport(pasteloc);

                firstloc = pasteloc.add(21, 2, -20);
                secondloc = pasteloc.add(121, 46, -120);
                
                pminejson.setDefault(location + "loc1.x", firstloc.getX());
                pminejson.setDefault(location + "loc1.y", firstloc.getY());
                pminejson.setDefault(location + "loc1.z", firstloc.getZ());

                pminejson.setDefault(location + "loc2.x", secondloc.getX());
                pminejson.setDefault(location + "loc2.y", secondloc.getY());
                pminejson.setDefault(location + "loc2.z", secondloc.getZ());```
#

but they are both the same

gleaming grove
#

plugin.getDescription().getPermissions() does getPersmissions method is used by permissions management plugins?

#

i mean should I fill this array with the permissions that my plugin use?

eternal oxide
#

yes

#

if you use more permissions that just commands

gleaming grove
#

is there some legal way to doing that or i need to use refrections, sice setPermissions not exists

eternal oxide
#

in your plugin.yml

#

there is a permissions entry

gleaming grove
#

ok then reflections

eternal oxide
#

no

#

reflection is almost never the answer

gleaming grove
#

it is if plugin has version checker like -> use reflection if verions is 1.16

somber sequoia
#

Why isn't this coloring the action bar message?

player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("Action bar message", ChatColor.RED.asBungee()));

stiff zinc
#

Hey I'm having a problem testing my plugin.. I am making it compatible for 1.8 - 1.19 but I ran into an error when testing with 1.8.8
Basically it looks like guava library is not loading correctly, because I get this error.

java.lang.NoSuchMethodError: 'void com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, java.lang.Object)
But it makes no sense why this method would throw because when I decompile the spigot-1.8.8.jar I can see that the method indeed exists...

quaint mantle
#

bro why isn't this adding to the location?

#
                firstloc = pasteloc.add(21, 2, -20);
                secondloc = pasteloc.add(121, 46, -120);```
steel swan
#

someone knows how to change player display name? (using packets maybe?)

stiff zinc
#

I also used

       for (Method method : Preconditions.class.getDeclaredMethods()) {
            getOutput().info(method.getName());
            getOutput().info(Arrays.toString(method.getParameterTypes()));
        }```
And as a result I indeed got the method that is throwing this error
gleaming grove
stiff zinc
#

It does use it

#

It worked with other projects

#

No idea why it doesn't work with this one

gleaming grove
#

so try to open your server file spigot.jar with win rar

stiff zinc
#

Yes

#

I already did it

gleaming grove
#

and make sure the namespace truly exists

#

oh

stiff zinc
#

I wouldn't come here otherwise

#

The class itself exists and the method itself

#

So it's not like spigot is using an outdated version or something

#

Of course I could probably shade guava into my plugin but I don't want to make my jar bigger than needed

#

You can double check for yourself on get bukkit

raw sky
#

might sound like a stupid question but if a project compiles to java 1.8 it cannot use an api made with java 17 right?

#

I Just need to make sure

#

because who ever made this plugin needed to make it in java 17

gleaming grove
#

in the file there is method public static void checkArgument(boolean expression, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs)

#

but you are trying to find java.lang.NoSuchMethodError: 'void com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, java.lang.Object)

gleaming grove
#

i guess maybe this is the case

charred blaze
stiff zinc
#

Because when you compile a project using that method

#

It automatically converts it to an array

#

Like this

steel swan
#
org.bukkit.scoreboard.ScoreboardManager sm = Bukkit.getScoreboardManager();
                Scoreboard s = sm.getNewScoreboard();
                Objective h = s.registerNewObjective("showhealth", Criterias.HEALTH);
                h.setDisplaySlot(DisplaySlot.BELOW_NAME);
                h.setDisplayName(ChatColor.DARK_RED + "โค");

so i have this , how to attribute it to a player?

stiff zinc
#

Like I said it works with 1.17 and below

gleaming grove
#

maybe try to put array as last argument worth to try

stiff zinc
#

It's redundant tho

subtle folio
#

how do i copy the resource folder config.yml into my plugins?

gleaming grove
#

;/

subtle folio
#

itโ€™s a method in player iirc

stiff zinc
steel swan
#

oh

subtle folio
#

lol

bold solstice
#

Hey, Ive been trying for a few days to make it so if somebody dies it basically has a firework instantly detonate where they were killed, Im having trouble with the instant detonation, at first I used firework.detonate() method and it worked for sometime but then for some reason it stopped. Ive done some research and ive seen that this method is not the best and u have to delay the detonation in a few ticks so it will work, so I did that and it didn't work and now im stuck. Can anyone help me please
https://paste.md-5.net/egocatujam.cs

sterile token
bold solstice
#

exploding a firework

subtle folio
#

isnโ€™t there a particle effect and sound you could play ?

bold solstice
#

idk

#

perhaps

tranquil viper
#

Is there a way to nullify an item based on its enchants

#

Like if it has sharpness 255 I can set itโ€™s damage to 0

vocal cloud
#

Check if it has an enchantment above the max level if it does nullify it?

steel swan
#

ok so, i m using this to like show health bellow players health.

Objective h = scoreboardd.registerNewObjective("showhealth",Criterias.HEALTH);
                    h.setDisplaySlot(DisplaySlot.BELOW_NAME);
                    h.setDisplayName(ChatColor.DARK_RED + "โค");

                    player1.setScoreboard(scoreboardd);
#

but how can i display smth else without any number

quaint mantle
#

anyone know why these locations are the same?

                Location pasteloc = new Location(Bukkit.getWorld("pmines"), (500 * pminejson.getInt("pminecounter")), 50, 100);
                owner.teleport(pasteloc);

                firstloc = pasteloc.add(21, 2, -20);
                secondloc = pasteloc.add(121, 46, -120);
                
                pminejson.setDefault(location + "loc1.x", firstloc.getX());
                pminejson.setDefault(location + "loc1.y", firstloc.getY());
                pminejson.setDefault(location + "loc1.z", firstloc.getZ());

                pminejson.setDefault(location + "loc2.x", secondloc.getX());
                pminejson.setDefault(location + "loc2.y", secondloc.getY());
                pminejson.setDefault(location + "loc2.z", secondloc.getZ());```
sterile token
eternal oxide
#

your code makes firstloc = secondLoc = modified pasteLoc

#

clone pasteLoc before altering it

#

= pasteLoc.clone().add(...

steel swan
#

i have a code that displays health under players name (using scoreboard).
Anyone please knows how to make it so that only certain players see that scoreboard?

supple elk
#

Is this the sound of a tool breaking?

twilit roost
#

How can I reenable old sword blocking?

quaint mantle
crisp steeple
twilit roost
#

i saw some plugins use 1.8.9 pvp
including that blocking
but thx

little panther
#

do anyone know how to teleport someone a specific amount of block in the direction they are looking?

tender shard
gleaming grove
#

I think this is a bug, this method give paths to C:\server\update but it should gives to C:\server\plugins\update

little panther
gleaming grove
#

I doing this right now

noble lantern
#

players dont accept velocity

noble lantern
#

to make server player move

#

without it, its gonna be aids

#

its a lot of work to get players to move

tender shard
noble lantern
#

OH

#

"teleport'

tender shard
noble lantern
#

thought he said walk

noble lantern
#

to the other side of my bed

tender shard
#

to canaddad

#

canadad

little panther
#

and i meant teleport, not walk, sorry for being unclear

tender shard
sterile token
#

I having an issue with mongo, for some reason is not loading correctly each document from the database into the cache

tender shard
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

little panther
sterile token
#

๐Ÿ˜‚

tender shard
#

well if it's "not not" working, everything's fine I guess ๐Ÿ˜›

tender shard
last swift
#

How can I make this method multithreaded? The main thing Iโ€™m concerned about is reading the file which causes the server to freeze (itโ€™s a bit large, around 100kb). The MultiBlockStructure utilizes RedLib which converts the string in the file to an object to paste, but that doesnโ€™t really cause any issues. Itโ€™s the reading file part that causes lag and TPS drops.

https://sourceb.in/VKhgNueAW1

ocean lion
#

Trying to make a lifesteal plugin. When you die you lose 1 permanent heart. If you kill someone you gain a permanent heart. What events is best to listen to? DeathEvent but I dont know

little panther
# tender shard so what exactly doesnt work?

a few things, but mostly the part that the teleport just teleports me to the same block, instead of adding the distance. I also have a few other problems, it doesnt add the cooldown and on row 53, the right_click_air doesnt work

little panther
tender shard
#

print out the calculated result, then check if its correct

tender shard
tender shard
#

lifesteal plugins are pretty easy to code

little panther
#

and the multiply int is set to 30

noble lantern
#

sohard

little panther
#

adding 10 shouldnt really do the same thing, or do you mean just for testing?

sterile token
#

Mongo data not loading back when servers get restarted

solid cargo
#

am too lazy to upload to server... would this work? the char part

sterile token
solid cargo
#

decides what operation there should be

#

subtraction, addition

tender shard
#

Me when i see people who just say โ€žits not workingโ€œ

ocean lion
#

How would I remove / give player permanent hearts?

solid cargo
#

PlayerCommandPreProcessEvent is your friend

#

or something like that it was called

vale ember
#

^ how does that relate to question?

solid cargo
#

give me more context then?

ocean lion
#

Wow thanks!

solid cargo
#

nononononono

#

ok anyways

#

nothing happened

sterile token
sterile token
#

what?

#

What did i do?

solid cargo
#

ok everyone forget this confusion

#

i was confused

#

confusion is a common thing of our lives

sterile token
#

I dont understand what happening

solid cargo
#

just move on

sterile token
#

Can someone explain to me

#

Yeah he was doing the noice when you f**

#

๐Ÿ˜‚

#

That was a really out of context

#

So out of context that i forget what do i need to fix now

tender shard
#

I'm good lol, thanks

tender shard
steel swan
#

how to make only certain players see a certain scoreboard? (the BELLOW_HEAD) type.

#

in 1.8.9

#

like i wanna make it so that only selected players see players health

steel swan
#

i know

#

but wich one, and how to use it

chrome beacon
#

Eh you're on an 7-8 year old version not going to look that up

steel swan
#

i know its possible

chrome beacon
#

Well yeah

tender shard
tender shard
steel swan
#

like Player A has no life and cant see any, Player B has can see life of players (except player A) and player C has life but cant see it

ocean lion
#

public static String getPermanentHealth(Player player) {

    return String.valueOf(player.getAttribute(Attribute.GENERIC_MAX_HEALTH));
}

I have this but it just returns "CraftBukkit.AttributeInstance bla bla"

quaint mantle
#

How would I make worldedit only count the blocks in a region and only replace the blocks in a region?

tender shard
#

and ask there

quaint mantle
#

Okay

solid cargo
#

does a player removing an armor stand in creative trigger EntityDeathEvent?

midnight patrol
#

how to disable attack cooldown?

chrome beacon
#

Increase the attack speed attribute

hard socket
#

is there a way i can get like a list of paths in my file?

quaint mantle
#

then you can loop through them

#
@NotNull
    public static ConfigurationSection[] getConfigurationSections(@NotNull ConfigurationSection section) {
        return section.getKeys(false).stream()
            .filter(section::isConfigurationSection)
            .map(section::getConfigurationSection)
            .toArray(ConfigurationSection[]::new);
    }
hard socket
#

oh thx

glossy venture
#

you can use true for deep to get all paths in the file, not just the children of the root level

eternal oxide
#

try .toBytes() on the returned message

#

if the message is a String it does

young knoll
#

It probably is sending them the last color

#

But you have no text after it, so itโ€™ll just be blank

green flower
#

Does spigot provide a means for customizing an ItemStack's NBT data? I'm attempting to spawn an elytra item with a random ammount of durability, though I'm not sure how I'd change said durability

desert frigate
#
player.addPotionEffect(PotionEffectType.NIGHT_VISION);``` is there anything wrong with this code? it keeps giving an error
eternal night
#

on it you can define damage

green flower
#

Thank you so much ๐Ÿ™

young knoll
#

Which also has the duration and amplifier

desert frigate
paper viper
#

No but you can set it to be a super long value

#

And continuous give the effect after some time in a task

proven ocean
#

Can someone help me with MySQL?
I have a problem where the resultSet is empty but if I execute the statement by hand I get a result?
"false" = resultSet.next()

brittle veldt
#

What event is called when an explosion causes a block to break

dusk flicker
proven ocean
#
// Build sql command
            StringBuilder sqlBuilder = new StringBuilder();
            sqlBuilder.append("SELECT ").append(String.join(", ", primaryKeys)).append(" ");
            sqlBuilder.append("FROM `").append(database).append("`.`").append(table).append("` ");
            sqlBuilder.append("WHERE ");
            for (int n = 0; n < primaryKeys.length; n++) {
                sqlBuilder.append(primaryKeys[n]).append(" = ").append(values[n]);
                if (n < primaryKeys.length - 1) {
                    sqlBuilder.append(" AND ");
                }
            }

            // Prepare statement and execute query
            PreparedStatement statement = connection.prepareStatement(sqlBuilder.toString());
            ResultSet resultSet = statement.executeQuery();

            System.out.println(">" + sqlBuilder.toString() + "<");
            System.out.println(resultSet.next());

            statement.closeOnCompletion();
proven ocean
wet breach
#

why are you using stringbuilder for this o.O

#

also don't think your loop works like you think it does either

proven ocean
#

the error occurs because I insert smth to the database instead of updating the values. But I have to check if there is anything with the primary key already inside (which returns false). And that's my problem. The primary key is in the database and I get the error when I insert data with the same key but it doesn't tell me that it's inside

#

my problem causes the error. The error ain't the problem

wet breach
#

you should learn to catch SQLException then

#

which is what gets thrown

proven ocean
wet breach
#

sure, but your code is not

#

which is what I said

#

how you are doing it in code, is not the typical way in how queries are formed or executed

#

and your loop is probably breaking it too