#help-development

1 messages ยท Page 283 of 1

rotund ravine
#

?paste

undone axleBOT
remote swallow
#

you can press the view whole file

#

next to the collapse thing

rotund ravine
undone yarrow
#

I'm pretty sure that's not possible with plugins, unless you put the item on an invisible armorstand, place it correctly in the shulker box and let it move/animate/rotate

remote swallow
undone yarrow
rotund ravine
undone yarrow
#

exactly

rotund ravine
#

putting a block in a minecart and making it invisible go broom

undone yarrow
#

but that wont work with items

#

or an item frame

#

can work too

rotund ravine
#

yeah

undone yarrow
#

but then you'd have to make the item fram einvisible

quaint mantle
#

when i added plugin (in my neparth server) and restarting server after and joining the server and doing) /plugins and is saying 0:( plugins (used spigot plugin downloaded one! and is not working

rotund ravine
#

link plugihn

undone yarrow
#

@remote swallow you know why it's crashing?

rotund ravine
#

There's not really enough information

remote swallow
#

theres no stacktraces in console so ive got no clue

undone yarrow
#

hmm

#

perhaps I should look up how the damage function works

rotund ravine
#

try waiting a tick

remote swallow
#

also pass a double not an int

tardy delta
#

do me a favor and print Thread.getDefaultUncaughtExceptionHandler()

knotty meteor
#

I want to recreate something like this, you can see a glowing item floating in the shulkerbox
And how can i let the items "explode" out of the shulker and put it on the ground, and that you cant pick it up

tardy delta
#

ddg lmao

remote swallow
#

oh that, thats just spawning an item

undone yarrow
#

I cant even find the function player.damage in the documentation

tardy delta
#

didnt know id see someone who plays on there

remote swallow
rotund ravine
#

big

remote swallow
dry yacht
#

Just cancelling pickup alone would result in a thousand calls to that event, so I'd definitely set the delay, yes.

undone yarrow
#

thats 1.19.3 api

#

not 1.17.1

remote swallow
#

player#setHealth

#

its also in the 1.17 docs

undone yarrow
#

hm

knotty meteor
undone yarrow
#

Why does this shit always happen to me

knotty meteor
remote swallow
#

World#dropItem

#

the name might be an armor stand

remote swallow
#

what plugin is it

#

also are there any errors in console

quaint mantle
#

Citizens

remote swallow
#

any errors in console

quaint mantle
#

lemme check

#

no errors

remote swallow
#

any other plugins

quaint mantle
#

just one plugin i added the npc plugin but doesnt working

remote swallow
#

?paste latest.log from after a restart

undone axleBOT
quaint mantle
#

what is that link

#

?

remote swallow
#

a link to the paste site

quaint mantle
#

i open the link?

remote swallow
#

restart your server, open latest.log, press control and A, press control and c then open the link, press control and v then save it and send us the link

tardy delta
#

how to send the link

knotty meteor
remote swallow
#

you would have to tp it

quaint mantle
knotty meteor
#

But will it go in random directions then? Because it need to be like 5 items

remote swallow
remote swallow
quaint mantle
#

but the rest idk

knotty meteor
#

I will try it thank you!

remote swallow
#

do you know how to open the server files

quaint mantle
#

yea ik how to open file manager

remote swallow
#

go to the logs folder

quaint mantle
#

ok 1sec server still restarting

#

ye now i in logs folder

#

so next?

remote swallow
#

find the one called latest.log

quaint mantle
#

findded

#

what i do?

remote swallow
#

open it

knotty meteor
remote swallow
#

havent done it before but i would guess you need to get the entity of the item stack in the world

quaint mantle
remote swallow
quaint mantle
remote swallow
#

copy the contents of the latest.log file

quaint mantle
#

can i send on private dm to you screen shot of it so i doing it right?

remote swallow
#

sure

quaint mantle
#

Hey, this may sound absurd but is it possible to force players to refresh the server resource pack?

ocean hollow
#

Any ideas why this isn't working? The part marked with a cross does not work.

quaint mantle
#

i cant send here

remote swallow
#

?img

undone axleBOT
remote swallow
#

you can dm me if you want

tardy delta
#

dont compare items by ==

#

use isSimilar

tardy delta
#

and follow naming conventions

ocean hollow
quaint mantle
#

Is it possible to generate a resource pack in a plugin and then send it to the player?

mortal pulsar
#

hm

dire marsh
#

you'd have to generate all the json files, make a zip, then host it somehow

quaint mantle
#

Do I really have to host it? Dang

tardy delta
#

ye

dire marsh
#

the client needs a URL

mortal pulsar
#

ig

dire marsh
mortal pulsar
tardy delta
#

hows that free

#

they are probably stealing your textures

dire marsh
#

that doesnt make sense though

#

the textures can be accessed by anyone who downloads your resource pack

tardy delta
#

whatever nothing is free

quaint mantle
#

Can I have multiple server resource packs at the same time?

quaint mantle
#

Dang

chrome beacon
#

You can combine them

ocean hollow
#

How can I simulate block placing with an item?

#

I mean this, using paper place for example deepslate

rotund ravine
#

You might want to call the BlockPlaceEvent too to make sure that worldguard etc. will block the action.

dry yacht
#

@gleaming grove Btw, in case you're interested: I've now played with proguard to eliminate dead code, this is the configuration I've ended up with: https://paste.md-5.net/kepezehaca.xml, while using this as my proguard config: https://paste.md-5.net/unevafucun.coffeescript

The shaded jar had a size of 50K while the shrink could get it down to 36K. May not be impressive to many, but that was only one (and my smallest) lib. I'm planning on doing much more than that. Seems like a nice setup, as it doesn't take much longer than usual and I do not have to take any extra steps. "It just works".

gleaming grove
#

thanks that will be useful for me in future

vague swallow
#

What is the best way to move an entity to a Location?

#

without teleporting

#

like actually move it

undone yarrow
#

@remote swallow player.setHealth(1.0); worked, no crashes anymore. But now I'm wondering why .damage doesn't work ๐Ÿ˜•

#

Anyways, thanks for the help ๐Ÿ™‚

knotty meteor
remote swallow
#

loads of noteblock sounds

remote swallow
knotty meteor
remote swallow
#

theres a lot in that

#

that isnt just one sound

#

its a lot of noteblock sounds with different pitches and type of noteblock

knotty meteor
#

Oowh oof i think i cant recreate that

remote swallow
#

you could with a lot of trial and error

#

and a lot of time

knotty meteor
#

Yepp

vague swallow
#

@remote swallow Do you know a good way to move an entity to a specific location without teleporting the entity?

remote swallow
#

without teleporting i cant think of any good ways

buoyant viper
#

simple, remove them from the world and respawn them at the new position

vague swallow
#

is there a way to set a target for a vector?

vague swallow
buoyant viper
#

well i mean idk how else u plan on moving them

remote swallow
#

summon invisible colidable blocks and pray

buoyant viper
#

true, i was actually thinking a long path with flowing water

#

it may take a while but

tardy delta
#

david wont be happy

vague swallow
#

is there a way to set a target for a vector?

eternal oxide
#

a vector is just a direction with a length

vague swallow
#

Can I focus the vector on a location?

eternal oxide
#

you can calculate a vector between two locations

vague swallow
#

how can I do that?

eternal oxide
#

its probably better you tell us what you are trying to do

fallow violet
ocean hollow
# rotund ravine https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractE...
        Location loc = block.getLocation();
        if (block_face.equals(BlockFace.UP)) {
            loc.add(new Vector(0, 1, 0));
            if (loc.getBlock().getType().equals(Material.AIR)) {
                return loc;
            }
        }
        else if (block_face.equals(BlockFace.DOWN)) {
            loc.add(new Vector(0, -1, 0));
            if (loc.getBlock().getType().equals(Material.AIR)) {
                return loc;
            }
        }
        else if (block_face.equals(BlockFace.EAST)) {
            loc.add(new Vector(1, 0, 0));
            if (loc.getBlock().getType().equals(Material.AIR)) {
                return loc;
            }
        }
        else if(block_face.equals(BlockFace.NORTH)){
            loc.add(new Vector(0, 0, -1));
            if(loc.getBlock().getType().equals(Material.AIR)){
                return loc;
            }
        }
        else if(block_face.equals(BlockFace.WEST)){
            loc.add(new Vector(-1, 0, 0));
            if(loc.getBlock().getType().equals(Material.AIR)){
                return loc;
            }
        }
        else if(block_face.equals(BlockFace.SOUTH)){
            loc.add(new Vector(0, 0, 1));
            if(loc.getBlock().getType().equals(Material.AIR)){
                return loc;
            }
        }
    }``` I created a function that returns the Block Location. But says: "Missing return statement".
remote swallow
#

you have no else statement

#

theres a chance for none of those to be correct according to intellij

ocean hollow
#

else {return null;}?

remote swallow
fallow violet
#

just do return null on the end

#

no need for else

ocean hollow
#

Yes, that's what I did now.

buoyant viper
#

"block_face" this isnt python, get outta here with that snake_case!

remote swallow
#

oh god

#

use camel case

#

i didnt even see that lmfao

buoyant viper
#

camelCase*

remote swallow
#

takes too long to type

remote swallow
#

call multi word var names something like epicVariableName

#

for example

fallow violet
#

dont hate others for other conventions its just a way to do it if you like

remote swallow
#

?conventions

buoyant viper
#

i can and i will

remote swallow
#

its on oracle

#

so we are forced to use them

fallow violet
#

like

#

you dont have to

#

his plugin his conventions

#

your opinion

#

his opinion

buoyant viper
#

conventions may be thrown out the window when youre coding for yourself, but that doesnt mean you should throw them out the window

remote swallow
#

using them in all cases would make code better and easier to type

fallow violet
#

what if he codes easier with his conventions?

#

btw you can say it more nicely and not just "tHiS iSnT pYtHoN"

remote swallow
#

unless a keyboard has the underscore near space bar i doubt its easier to type

fallow violet
#

you dont know his keyboard layout / typing method

#

you are not them

remote swallow
#

have you never heard of opinions "i" being the important thing im my statement

buoyant viper
#

if u couldnt tell my initial statement was made with a hint of sarcasm thats on U imo

fallow violet
#

just give him a nice hint but not a rude answer you are like these big-ego-devs who thinks that they are better than everyone

tender shard
#

can't get more inconsistent than php

fallow violet
#

well tru

buoyant viper
#

i say as i write php

remote swallow
#

thats just the same as saying "fuck my life" while living

buoyant viper
#

yeah

fallow violet
buoyant viper
#

i was like wait ive used not snake case methods in it

#

checking an isset and then two seconds later im calling file_get_contents

#

good old php conventions

#

bonus mention for PHP, the fucking non-english error name for when youre missing a semicolon??!

#

at least i think thats what the errors for

#

oh nvm its for the double colon (::)

#

T_PAAMAYIM_NEKUDOTAYIM

#

like what the fuck

undone yarrow
#

For some reason, player.damage(); stops the server

buoyant viper
#

nice

remote swallow
#

because its 1.17

#

blame 1.17

undone yarrow
#

probably

#

1.17.1*

#

to be specific

remote swallow
#

same thing

undone yarrow
#

ah alright

remote swallow
#

theres a lot pre 1.18 ive seen that is just weird

river oracle
#

I'm trying to update some numbers regarding timing in a sqlite database, but for some reason they seem like they aren't updating?

However, I get that the query should have been executed via my logging statement. I'm quite confused why the numbers aren't being updated

[11:11:27] [Server thread/INFO]: Updated island: 76d60884-afd9-406c-a2c0-b9569e81ad62in database // executes properly
[11:11:27] [Server thread/INFO]: Saving NodeBlockData at location LightLocation{worldName=SuperiorWorld, x=609.0, y=112.0, z=-8.0} with Data{LastUpdate=1672420287210, TickTimeLeft=3} // shows the data should be saving
[11:11:27] [Server thread/INFO]: Updated node at LightLocation{worldName=SuperiorWorld, x=609.0, y=112.0, z=-8.0} with type IRON_ORE, time left 3, last update 1672420287210 in database // shows the database query should be occuring
    public void updateNode(final NodeBlockData data) {
        try (PreparedStatement statement = connection.prepareStatement(UPDATE_NODE)) {
            statement.setString(1, data.getType().getMaterial().toString());
            statement.setLong(2, data.getTicksLeft());
            statement.setLong(3, data.getLastUpdate());
            statement.execute();
            Bukkit.getLogger().info(() -> {
                String message = "Updated node at %s with type %s, time left %d, last update %d in database";
                return String.format(message, data.getLocation(), data.getType().getMaterial(), data.getTicksLeft(),
                        data.getLastUpdate());
            });
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

note read only has to do with the vscode extension I'm using to read the sqlite database

tardy delta
#

your view probably aint updated

river oracle
remote swallow
#

i didnt see your name, saw vscode then was about to ping you

river oracle
tardy delta
#

dunno if calling exec instead of execupdate affect the process

river oracle
#

oh shit it might

#

yea that might def be it

tardy delta
#

why tf are you logging with a supplier

river oracle
#

don't worry about it lol

#

its a temp log my friend

undone yarrow
#

Guys, whenever I try to type Material (already starting with M) my IntelliJ crashes

#

it just freezes

#

When I type M...

river oracle
#

sounds like an intellij problem can't relate as I use VSCODE

remote swallow
#

sounds like intellij doesnt have enough ram or cpu power

undone yarrow
#

I have 16gb in total

river oracle
#

as if intellij doesn't hog enough resources already

undone yarrow
#

lol

#

true

tardy delta
#

download sources

undone yarrow
#

?

#

I'll just download some extra ram

remote swallow
buoyant viper
#

have u ever tried to OPEN the Material class in intellij?

buoyant viper
#

it just fuckin dies

undone yarrow
#

oof

#

I wont try

tardy delta
#

just said download sources

remote swallow
#

i bet i could go and open

#

it

#

perfectly fine

remote swallow
#

google is too hard

undone yarrow
#

yes

tardy delta
#

double shift for every ij instruction

undone yarrow
#

wtf do you mean with sources

tardy delta
#

source code

undone yarrow
#

I can tell you to launch a nuke but you wont be able to without the instructions

#

why would I want to download source code

remote swallow
#

so you arent trying to decompile the material class everytime to get the values of it

river oracle
#

I'm so confused

tardy delta
#

just do a select again

river oracle
undone yarrow
tardy delta
#

exec a select query and see the results

remote swallow
#

when you try and get the material enum, by typing Material. intellij has to probably decompile/call for the 10k lines of code that the file is

#

which intellij cant handle

undone yarrow
#

Yeah I get that

river oracle
remote swallow
#

downloading sources would mean you dont need to do that

river oracle
#

I get the NodeBlockData object with expected values

undone yarrow
#

Sources can mean so many things

#

A source can be a link

#

sources can refer to source code and in code to which you can contribute or copy paste

#

a source can mean a place where you can get water

river oracle
#

uhm in a programming context its pretty specific

#

you are overthinking also intellij should auto download sources

remote swallow
#

Google how to download sources intellij

undone yarrow
#

k

#

So if I understand correctly, instead of having to reprocess the entire material class each time, by downloading sources it just gets stored on your pc and it remembers it which saves performance/data?

river oracle
#

I am dumb ass

#

I forgot to set where its setting the data too ๐Ÿคฆ๐Ÿฝโ€โ™‚๏ธ

#

I'm going to go die now goodbye

tardy delta
#

what

#

wdym by where the data is going to

river oracle
#

Like I just sent an Update query with literally no target

river oracle
# tardy delta wdym by where the data is going to
[11:26:31] [Server thread/INFO]: UPDATE miner_nodes
[11:26:31] [Server thread/INFO]: SET node_type = ?, time_left = ?, time_stopped = ?
[11:26:31] [Server thread/INFO]: WHERE node_location = ?;
[11:26:31] [Server thread/INFO]:  
[11:26:31] [Server thread/INFO]:  parameters=[IRON_ORE, 3, 1672421191368, null]
undone yarrow
tardy delta
#

just hit double shift and type download sources

undone yarrow
tender shard
#

just run maven manually

mvn dependency:sources dependency:resolve -Dclassifier=javadoc
undone yarrow
#

I downloaded sources and documentation and it worked for a sec

#

now it froze again ugh

undone yarrow
#

Im using jdk 19 or smth like that btw

tender shard
undone yarrow
#

I just got a popup saying this

#

IT WORKS

grand magnet
#

How do I disable the Tab Completer?

tender shard
#

the auto-complete of names is client sided, you cannot really disable that

grand magnet
#

Can you disable the command-complete?

fallow violet
#

Reset a World: is it better to copy and repaste a world or track every action (BlockPlace, BlockDestroy) and reset the actions

fallow violet
tender shard
fallow violet
#

it does

#

just return a new Arraylist

#

why is the world i copied not air map but i copied an airmap??????

undone yarrow
#

How do you use potion effects when using player.addPotionEffect()?

#

I know about Effect but thats not for potions

tender shard
fallow violet
# undone yarrow How do you use potion effects when using player.addPotionEffect()?

player.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier))
or player.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient))
or player.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles))
or player.addPotionEffect(new PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon))

undone yarrow
#

ohhh I see, thanks!

undone yarrow
#

If, say, I want to give the player nausea

fallow violet
#

nausea is PotionEffectType.CONFUSION

#

idk why

undone yarrow
final monolith
#

NMS:

How i can get a entity by the ID?
(I've already tried World#getEntityById)

final monolith
#

help me ๐Ÿ˜ฟ

#

xD

fallow violet
#

im sorry im not good in nms

quaint mantle
fallow violet
#

never used it

final monolith
quaint mantle
#

oh

final monolith
#

but appreciate your help

fallow violet
#

lmao

tardy delta
#

never use an int for a counter when ur multiplying it with 10 lol

hushed pawn
#

What is the best way to spawn something like skywars cages?

tardy delta
#

love the overflow

fallow violet
final monolith
fallow violet
hushed pawn
#

I mean cages where players appears

quaint mantle
#

I stopped programming for a year. I downloaded Eclipse now and use Spigot API, but it cannot read the code. Why?
https://prnt.sc/52tDYjaN1pfu

fallow violet
quaint mantle
#

i did

#

i'm already using intellij but i tried to use eclipse i have the same problem on both

hushed pawn
#

I mean how to past schematic/structure

#

In 1.8

fallow violet
hushed pawn
#

What api mby?

undone axleBOT
fallow violet
#

lol nice website

quaint mantle
#

Minecraft 1.8.8 is 7 years, 5 months, and 7 days old today.
(2714 days)

#

lol

#

HAHA'

#

to long

fallow violet
#

thats long time

quaint mantle
#

haha

#

yess

fallow violet
#

the time my dad went away

#

jkjk

quaint mantle
#

lol

hushed pawn
#

And most people still use it for pvp..

fallow violet
#

btw if you upload code than pls the WHOLE CODE and not just a snipped of 3 words @quaint mantle

quaint mantle
#

i soon deleting my whole email to my server hosting .-. beccuse i getting angry i cant make plugins i did right and no plugins there bruh XD

final monolith
hushed pawn
#

What i should use to spawn structures?

final monolith
chrome beacon
final monolith
#

The NMS isn't too good, but its better than the nms from 1.16.5+

final monolith
tender shard
#

you cannot just use 1_8R1 nms on anything above 1.18.3

final monolith
#

i will create every single mapping for every single version

#

until 1.19.3

final monolith
chrome beacon
#

Modern nms is quite a bit better

final monolith
quaint mantle
#

I NEED HELP TO ADD NPC PLUGIN ON NEPARTH SERVER. I cant do it i tryed and is not workinggggggg

quaint mantle
#

i installed it in the server and restarted server and i getting inside the mc server and doing /plugins and is saying 0 plugins

#

Citizens-2.0.30-b2857.jar

final monolith
#

whats the plugin

#

show us the console logs

chrome beacon
final monolith
quaint mantle
#

i use help server instead?

sonic goblet
#

Yes and post your start up logs with the question/issue

quaint mantle
#

okey

#

latest.log?

tender shard
quaint mantle
#

BUT I DONT KNOW WHAT HE MEAN WITH START UP LOGSSSS

buoyant viper
#

the file

tender shard
robust light
#

is there a way to wait in a while loop? I tried Thread.sleep() but that just crashes the server

buoyant viper
#

latest.log in logs folder

undone axleBOT
gentle yacht
#

choco u can most definitely render a map absolute to the player's screen with vanilla shaders

#

without needing the player to hold the map in their hands

fallow violet
#

lol fr

gentle yacht
#

if u have it on a wall for example

#

they were most likely wondering how to send map packets to the player manually

robust light
tender shard
dry yacht
# final monolith

Holy moly, what's that? Is that some kind of protocol-lib excerpt? Sorry if I don't recognize it immediately and the question sounds ignorant, xD.

final monolith
final monolith
# final monolith

The new version contains a lot of classes as you can see that recreates the NMS

#

as you can see

dry yacht
# final monolith Thats a old version of my NPC plugin, now its extremely better than that, but sa...

Hmm, very interesting! Because I'm thinking about how I could create true version independence without creating interfaces and a specific impl for every single version, that just hurts. I thought about some kind of json files describing the structures, then using my class/method/field predicate builder to build these descriptions and get what I need, but I'd also need to describe the invocation-order, arguments and so on and so forth. Which is why I haven't actually accomplished much so far, been procrastinating, xD.

final monolith
#

But it takes some size xD (its not 10% completed yet)

dry yacht
#

hahahaha

final monolith
#

that system gaved me brain hurts some time ago

dry yacht
#

I'd love love love to break through that tho

#

But hey, anyways, so cool that you're also working on version independence and are not just like "oh, hey, just 1.16+ for me"

final monolith
#

Complicated, but when you get it, its easy

final monolith
#

some months of hard work

dry yacht
dry yacht
robust light
dry yacht
ocean hollow
#

Is there a way to set a tag for a block?

dry yacht
final monolith
dry yacht
#

Actually yes, I very much do, lol

dry yacht
final monolith
fallow violet
#

nvm

#

you have to set a duration and an amplifier

#

duration and level

tender shard
undone yarrow
tardy delta
#

primitive generics when

tender shard
tardy delta
#

still waiting for pairs in java too

quaint mantle
#

I need help! what is command (ingame) for create an NPC. with plugin citizens

glossy venture
tender shard
quaint mantle
ocean hollow
#

How do I get an armor stand that is located at block coordinates?

glossy venture
#

getNearbyEntities ig
or if youre creating the armor stands map them by block location in a hashmap

tender shard
#

I'd use a boundingbox

    private static final Predicate<Entity> ARMORSTAND_PREDICATE = entity -> entity instanceof ArmorStand;
    public static List<ArmorStand> getArmorStandsAtBlock(Block block) {
        BoundingBox box = BoundingBox.of(block);
        return block.getWorld().getNearbyEntities(box, ARMORSTAND_PREDICATE).stream().map(entity -> (ArmorStand) entity).collect(Collectors.toList());
    }
glossy venture
#

oh yeah

#

is thag faster

tender shard
#

I haven't checked how CraftWorld#getNearbyEntities works

terse ocean
#

plugin.getConfig().getStringList("Berserkers").add(player.getName());
plugin.saveConfig();

is that supposed to add a player to the config??

ocean hollow
#

Thanks guys, I'll try it now

tender shard
untold patio
#

Hello guys

terse ocean
untold patio
#

I have a question, how can I change the messages sent by the console

tardy delta
#

what happened here

untold patio
#

For instance, console sends โ€œAn internal error occurredโ€ฆโ€ I would like to change this message for other

#

How could I do it? Ty

tardy delta
#

why

tender shard
#

that's going to add a player's name to the list you just got, without changing your config

snow compass
#

I has added all needed api and still get this error https://hastebin.com/uvekizipen.less

libraries:
  - org.reactivestreams:reactive-streams:1.0.4
  - io.projectreactor:reactor-core:3.5.1
  - io.projectreactor.netty:reactor-netty:1.1.1
  - io.netty:netty-all:4.1.86.Final
  - com.fasterxml.jackson.core:jackson-databind:2.14.1
  - com.discord4j:discord-json:1.6.13
  - com.discord4j:discord4j-core:3.2.3
terse ocean
echo basalt
#

Yeah they're both hardcoded

#

only way to change it is to intercept chat packets

untold patio
#

Oh

#

I thought there could be an event for that

#

Happens the same with messages sent by other plugins?

#

For instance, world edit, if you want to replace the โ€œYou cannot change blocks hereโ€

echo basalt
#

some plugins can hardcode it, others make it configurable

#

you can still intercept chat packets and change messages

untold patio
terse ocean
#

how do i save a players name in a stringList i cant seem to get it to work

tender shard
#

I earlier already told you that you have to change the actual config and not just the list you loaded

#

so e.g. like this

    {
        List<String> myListOfStrings = getConfig().getStringList("my-list-of-strings");
        myListOfStrings.add("some new entry");
        getConfig().set("my-list-of-strings", myListOfStrings);
        saveConfig();
    }
terse ocean
#

ok ill try that thx

rare rover
#

how would i fix this?

#

it says its connected but i disagree

#

and reloading it without reloading the server isn't it

#

i've tried both ways

#

all it is:

        client = MongoClients.create("URI");
        database = client.getDatabase("SQLTest");
        collection = database.getCollection("player_data");
        Bukkit.broadcastMessage("Connected to MongoDB!");
        Bukkit.broadcastMessage("Collection: " + collection);```
humble tulip
#

is a hashmap thread safe if im only reading not writing?

#

or should i still go with concurrenthashmap?

rare rover
#

Yeah it is

worldly ingot
#

If you want a thread-safe map, yeah, you'll want to use a ConcurrentHashMap

humble tulip
#

from multiple threads

#

but i dont write to it

worldly ingot
#

Right so it's never changed while you're reading from it?

humble tulip
#

nope

worldly ingot
#

Yeah then you're fine

humble tulip
#

great ty:)

ocean hollow
agile anvil
#

What is the warning on the Block#getLocation line 23?

ocean hollow
tardy delta
#

block might be null

ocean hollow
#

it cannot be null if I interact with the block during the event?

tardy delta
#

whenever youll click in the air, youll get a nullpointer exception

#

ah theres a check

#

dunno if air block counts as block too ๐Ÿ˜‚

ocean hollow
#

so what should I do?

#

I can send error message

#

forgot to attach)

fair panther
#

Im getting this error on my bungeecord server with nuvotifier

hazy parrot
agile anvil
ocean hollow
#

ok, I made it

dry yacht
#

Man, it feels so weird to just now have found out about the java.util.StringJoiner, :-:

#

Could've saved me so much manual work.

ocean hollow
#

You to me?)

dry yacht
#

Oh, no, I just said that generally, as I guess there are other people too not knowing this helpful utility.

rough drift
#

How would I display an empty player in tab list?

sterile token
rough drift
#

1.19.2

#

You're gonna say NMS, TAB or Citizens?

sterile token
#

yeah haha

rough drift
#

I already knew of those options tbh

sterile token
#

Why NMS? Api itself allow it

rough drift
#

wondered if spigot had a way

#

it allows you to add empty players?

sterile token
#

Oh not sure tho

pale hazel
#

So, exactly why are all events interfaces?

sterile token
#

If im not wrong, you can directly create tabs without 3rd party libs

rough drift
#

PlayerInteractEvent isn't iirc

rough drift
#

like the one at the top

#

you can only set header/footer

sterile token
#

Tablist is the same as tab ๐Ÿ˜‚ different ways of calling it just

rough drift
#

yes

#

but

#

you can only set the top text

#

and bottom text

#

not add fake players

sterile token
#

okay, you want to add that thing that appear the player head empty?

rough drift
#

no name no head

#

yeah

sterile token
#

You want to add entries that is called

rough drift
#

exactly

sterile token
#

Entries are the tab lines itself

#

Let me find an example

rough drift
#

no though?

sterile token
rough drift
#

searched a random image, you see those empty connections?

sterile token
#

You are messing me

rough drift
#

Yeah those

sterile token
#

Yeah?

rough drift
#

you see how there are players

#

and some data

#

yeah those are not lines

tardy delta
#

when is java going to allow default arguments like c++ does

rough drift
#

the red text is footer, golden text is header

sterile token
#

oh yes, they are fake entities

rough drift
#

yeah

sterile token
#

So what your point? Sorry bro i cant understand

rough drift
#

Wanted to know if spigot had a way

tardy delta
#

adding an npc works, probably dont even need a phsical one, just send some packets

paper viper
#

How do i disable player collsion so that players are not colliding with each other?

What I tryed
player.setCollidable(false);

rough drift
#

yeah

paper viper
#

yes

#

isnt working

tardy delta
#

add them to a team and set no collision rule

rough drift
#

yeah

#

fixed it with teams

sterile token
rough drift
#

I know the packets, just wanted to know if spigot had an API

sterile token
#

Yeah definitly it have to be done thru packets

tardy delta
#

i guess not

rough drift
#

but tbh, I had to expect it, no tab list API lmao

sterile token
#

No i didnt tell to you use it

#

Just you to see how they do it

rough drift
#

oh no I know how

#

I just wanted to know if spigot had an api

sterile token
#

oh i dont think

rough drift
#

might just contribute an API myself tbh

sterile token
#

Yeah create a PR to spigot so then they add an api

rough drift
#

I don't know how to design it though

lavish hemlock
#

Braincells โœจ

#

Would you like to borrow some of mine

paper viper
#

no

sterile token
#

Mostly apis base on this example

public interface Tablist {

  String getHeader();
  
  String getFooter();

  Map<Integer, TabEntry> getEntries();  

}```
dry yacht
# paper viper no

Sure? Because tab-team collision rules can override collision. I have no idea what that bukkit API is supposed to be doing behind the scenes, but I guess the only way to change collision is tab teams.

paper viper
#

Ok thanks i will give it a try

dry yacht
# paper viper Ok thanks i will give it a try

If your tab uses colors on names in any way, shape or form, you have teams. If so, you need to modify those. Otherwise, create a dummy team on the scoreboard manager's default scoreboard and add all players onEnable and when they join.

rough drift
#

I guess something like this works:

var player = somewhere.getPlayer();

var tabList = player.getTabList();
tabList.freeze(); // Don't send updates
tabList.clear();

tabList.setHeader("My");
tabList.setFooter("TabList");

tabList.setHeight(9); // 9 fake players on the y
tabList.setWidth(4); // 4 fake players on the x

tabList.setEntry(0, 0, player);
tabList.setEntry(0, 0, UUID.fromString("someUUID"));
tabList.setEntry(0, 0, Bukkit.getOfflinePlayer(...));

tabList.setName(0, 0, "Some Text"); // No Skin, just text
tabList.setIcon(0, 0, "someplayericon"); // Just skin, no text
tabList.unfreeze(); // Send all queued updates, and start sending each update as soon as it is received
#

Something like that?

sterile token
#

Also add something like a delay setter so then its more configurable

rough drift
#

?

sterile token
rough drift
#

show me an example

dry yacht
rough drift
dry yacht
#

I don't appreciate these ways of handling updates at all.

dry yacht
rough drift
#

I guess I'll make update

#

it was my first choice

sterile token
rough drift
#

then my mind went to the average spigot developer

dry yacht
#

Spigot and bukkit are both a big mess, don't get inspired by that. Rather write clean and friendly APIs.

rough drift
#

watch it get denied for too clean

dry yacht
#

You don't have to work with any legacy stupidity, you can just design everything from the ground up and not limit your creativity.

rough drift
#

It's the first version

#

it's my version

sterile token
#

Spigot is not friendly

lavish hemlock
#

Bukkit is a nightmare and I'm surprised we still use it

serene sigil
#

why cant i click this??

sterile token
#

Yeah, why dont they wrote the new versions on Kotlin, they will need less lines

rough drift
dry yacht
# sterile token Agree x2

Let's write a proper open source minecraft server in a proper language which abstracts versions right above the packet layer and is friendly towards developers. Who's in? lol.

serene sigil
#

but i can this

lavish hemlock
#

When it comes to compiling Kotlin, you actually get larger, slower binaries

rough drift
#

and the code is unreadable

#

like kotlin is just unreadable

sterile token
lavish hemlock
#

And also โœจ the inclusion of the entire Kotlin standard library โœจ

rough drift
#

?stash

undone axleBOT
rough drift
#

I am doing it bois

#

It's API designing time

lavish hemlock
#

Not to mention you force all developers to use Kotlin-based APIs

sterile token
#

What are stash never understand them

rough drift
#

can't be os on gh due to DMCA

sterile token
#

oh, they dont use github?

dry yacht
sterile token
#

oh yeah what stupid questin i have done

lavish hemlock
#

Either way I don't really dislike Kotlin

rough drift
#

Scala > Java > Kotlin

sterile token
dry yacht
#

Kotlin is awesome, but it's cost is too high.

rough drift
#

Scala only has the sbt problem and it's standard lib

#

otherwise it's good

dry yacht
sterile token
rough drift
#

you can't deobf scala code

#

it just translates to java

#

so at most you get the compiler's output of scala

dry yacht
lavish hemlock
#

Does Scala use a transpiler?

rough drift
rough drift
#

it just compiles to bytecode

snow compass
rough drift
#

Scala is a jvm language

lavish hemlock
#

Kotlin does too but

#

It's just very strange bytecode

#

Since it uses a lot of dynamic invocation

sterile token
rough drift
#

nah scala doesn't

#

scala just makes clean java code *for a compiler

snow compass
sterile token
snow compass
sterile token
snow compass
#

Hastebin Send and Save Text or Code Sni...

dry yacht
sterile token
rotund ravine
#

Kotlin outdoes java in some departments where java outdoes kotlin in some departments.

rough drift
#
List(
  List(1, 2, 3),
  List(4, 5, 6)
).flatMap(...)
#

the ... is because I forgor

rotund ravine
rough drift
#

I used kotlin, java and scala

#

scala is just bae

sterile token
#

Imagine yesterday there was a kid, tryign to write a Lua api, to write spigot plugins but in LUA ๐Ÿ’€

dry yacht
#

What's the issue tho? Not really having any context to get what you mean.

rotund ravine
#

Kotlin is still a valid choice though.

dry yacht
sterile token
dry yacht
#

I mean, from a technical standpoint it's an immensely interesting language, but I just somehow cannot take it seriously. Don't know why.

sterile token
#

What properties will need a Group object? will be use for creating permissions groups

rotund ravine
#

blank finals.

rough drift
dry yacht
# rotund ravine blank finals.

That's an issue? Oh. I thought as long as it's only assigned once, like in the if- or it's matching else clause, you're fine. Like an inlined if-else in kotlin, or even a switch. Think the variable can also be a val then.

rotund ravine
rough drift
#

like normal finals

#

java variables can't be non initialized

rotund ravine
#

blank finals is a thing.

rough drift
#

no?

#

where did you see that

rotund ravine
#

google it

dry yacht
rough drift
#

@rotund ravine yeah a non initialized variable

#

not blank

#

it's unset

rotund ravine
rough drift
#

okay, whatever you call it

#

it will still error if not set

#

weird

dry yacht
#

You cannot use a blank final variable. Try to print it.

rough drift
#

probs because of a class?

dry yacht
#

IntelliJ isn't weird at all.

#

That's defined behavior.

rough drift
#

no

#

it's undefined

dry yacht
#

...

rough drift
#

x points to whatever piece of memory

dry yacht
#

You cannot access it before you assigned to it.

rotund ravine
#

Yeah that will error, but try setting it @dry yacht before printing it

rough drift
#

so it spits an error

sterile token
#

What its better for serializing/deserializing mongo document? Why / why not?
Write each property manually from/to document for saving/loading it or directly using Bson parser?

rotund ravine
#

Not sure if it only works in constructors.

dry yacht
jagged monolith
dry yacht
rotund ravine
rough drift
#

no?

rotund ravine
#

nvm it was morice

rough drift
#

I am just saying that

final String x;

if(condition) x = "a";

// x is not valid, not assigned in all paths
dry yacht
#

Blank finals allow you to to "inline" logic into variable assignments, and the compiler only allows you to access the variable if it has been assigned in all available paths.

#

It's never pointing at unknown memory...

rough drift
#
final String num = switch(a) {
  case 0 -> "zero";
  case 1 -> "one";
  default -> "don't know";
};
dry yacht
#

I know, but I don't like to compile at that version.

#

Can the compiler compile that down?

rough drift
#

I compile at 19

rough drift
dry yacht
#

Stupid compiler.

rough drift
#

not stupid compiler

#

good compiler

dry yacht
#

Big amount of people will trip up on 19 requirement.

rough drift
dry yacht
#

Why not just compile new language features down to the old runtime, what's so hard about that.

rough drift
#

so yk

dry yacht
#

Yeah, but this inlined switch can literally be accomplished using blank finals and is only syntax-sugar

sterile token
rough drift
#

I have no clue how to clone spigot EEEEEEEEEEEEEEEEEEEEEEE

dry yacht
#

Well, to add new cool features, but if these features can be depicted using old technology, why not compile them down? Like TypeScript does to JS.

#

Btw, any news on updating inventory titles? xD

sterile token
rough drift
#

I haven't used mongo in 7 months

#

I came clean of mongo

#

happiest I've been, used it for like 2 days

#

went into depression /s

dry yacht
#

They suck.

sterile token
rough drift
#

no shit

dry yacht
#

Hahahaha :,D. It's such a weird topic. I have yet to look through the decompiled minecraft client to check it's logic on PacketPlayOutOpenWindow-receival

rough drift
#

the mc client doesn't support it iirc

#

so yk

#

pattern de-structuring is better

dry yacht
#

I don't want them to limit my free will. If I wanna run an inlined switch on java 8, I should be able to. Assholes.

rough drift
#

if(object instanceof Point(int x, int y)) -- Coming next java version

sterile token
#

Also, why didnt mojang re write, their backend in a better lang?

dry yacht
#

Pattern matching? What's that?

rough drift
sterile token
dry yacht
#

Ah, just inlining instanceof.

#

Something that could be compiled down... Again.

rough drift
#

record destructuring is just extracting values out of a record

#

like

#
if(obj instanceof Point(int x, int y)) {
  System.out.println(x + y);
}

// x -- not allowed here
dry yacht
#

I literally see no appeal in records. Maybe they help the compiler to achieve some lower-level optimization, but that's about all of the advantages I see there.

rough drift
#

they are good for immutable data

paper viper
#

@dry yacht worked thank

dry yacht
#

I know, what lombok solved years ago.

rough drift
#

lombok nooooooooooooooooooooooooooo

#

weird hacky reflection

dry yacht
dry yacht
paper viper
#

collison teams

chrome beacon
#

I wanted to change lombok behaviour a bit

#

I gave up real quick

dry yacht
paper viper
#

Created teams like you sayed

dry yacht
#

Awesome! :)

#

Tell me the real world advantages of records over lombok @Getter, @Setter and @AllArgsConstructor instead of just hating on it.

rough drift
#

they are reflections

#

it's annotation processing

dry yacht
#

Am I that misinformed? Let me check for a second before I talk trash here.

rough drift
#

yeah

chrome beacon
#

Eh it's done at compile time so it's fine

rough drift
#

It's a compiler plugin

#

compiler plugins just process annotations

#

they can add some stuff iirc

sullen marlin
#

Iirc records use some mix of reflection and invokedynamic

rough drift
#

records?

sullen marlin
#

Lombok could actually be superior in that regard

ivory sleet
rough drift
#

yes

#

but

#

multi nesting records

ivory sleet
#

In what way exactly?

dry yacht
rough drift
#

compile time reflection

dry yacht
rotund ravine
#

lombok is like a poor mans kotlin

dry yacht
ivory sleet
dry yacht
ivory sleet
#

Wat

#

Thatโ€™s completely besides the point?

dry yacht
#

Classes, Methods, Fields, Constructors. Now, also have to handle records. If they convert any class to a record, my reflection matchers are screwed for the new versions.

dry yacht
#

Making a language have more features is driving it in C++ direction: a clusterfuck.

ivory sleet
#

Records are immutable transparent data carriers

#

@Getter @Setter etc generates a getter/setter at compile time

#

The point of records is โ€œto devise an object oriented construct that expresses a simple aggregation of valuesโ€

dry yacht
#

?

ivory sleet
#

Annotations are not really object oriented, and in the sense of lombok more inflexible in an OO infrastructure

rough drift
#

Finally I am doing what I always wanted to do

#

Improving spigot APIs

dry yacht
#

Just wanted to know in which context you said that, sorry, should've written more than a questionmark, xD.

ivory sleet
#

That does not mean annots and lombok are bad, but it makes sense for Java to add a proper โ€œooโ€ way and being a proponent of that

#

Myea

#

True

dry yacht
#

You just threw that in there, so I thought you did.

#

Yes, you did. You replied to "in what way exactly", which referred to "if it's anything that needs updating, it's the annotations api", which itself kinda refers to lombok.

#

Whatever...

rotund ravine
#

Print out the default message.

sterile token
#

?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.

rough drift
#
var player = somewhere.getPlayer();

var tabList = player.getTabList();
tabList.clear();

tabList.setHeader("My");
tabList.setFooter("TabList");

tabList.setHeight(9); // 9 fake players on the y
tabList.setWidth(4); // 4 fake players on the x

tabList.setEntry(0, 0, player);
tabList.setEntry(0, 0, UUID.fromString("someUUID"));
tabList.setEntry(0, 0, Bukkit.getOfflinePlayer(...));

tabList.setName(0, 0, "Some Text"); // No Skin, just text
tabList.setIcon(0, 0, "someplayericon"); // Just skin, no text
tabList.update();
```Thoughts?
#

Anything to add/remove?

sterile token
rough drift
sterile token
#

What contains?

rough drift
#

It's just a demonstration of every method

rotund ravine
#

print out e.getmessage and you shall see why you have ur issue

sterile token
dry yacht
#

Since you're setting the message to the final format you'd like to have and then prepend the playername by the format string, you'll end up with two playernames.

rough drift
sterile token
#

I cannot find in the docs

dry yacht
rough drift
#

And I'll commit it to spigot

#

well PR it

sterile token
#

Oh yeah you are re writing api

rough drift
#

no

#

making new api

#

so I can play with it as much as I want

rotund ravine
#

he is writing some functions for the api

rough drift
#

yep

dry yacht
#

Is there a limit to how wide (in slots) the tab can be?

sterile token
#

Also will do something similar, but for scoreboards

rough drift
#

@sterile token you can't

#

you cannot remove ANY old api

ivory sleet
#

Anyway blvckbytes check jep 395

#

Tells why they added records

sterile token
#

Oh ok that makes sense, because if you remove old api method then when the PR is accepted, people have to modify their code

dry yacht
dry yacht
#

New code please, and make sure the new code actually ran (often times it doesn't, xD).

rough drift
#

coordinates

#

x and y

#

bounds check should be done beforehand though

rotund ravine
#

I see, newbies will get more confused than me. I had to tell someone what a grid is.

#

no?

#

Tab is a grid

rough drift
#

yeah

#

x and y coords

#

in the grid

sterile token
young nimbus
#

Hi, could someone help me with my Plugin? I try to display titles with a Scheduler, the first title shows but the others which run by the scheduler doesnt work.

rough drift
#

@quaint mantle

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

young nimbus
#

Can i just post the raw code here?

undone axleBOT
rough drift
#

random screenshot:

0, 2 here is the top-left yellow text

young nimbus
rough drift
#

because zero slots from the left, two from the top (0 indexed)

#

like a 2D array

#

what would you prefer then?

#

So like what?

rotund ravine
#

is that

#

vertical

#

or down

#

from lower right

rough drift
#

like ye

rotund ravine
#

or top left

#

Vertical or horizontal

rough drift
#

I'll add slots too I guess

dry yacht
# sterile token 1.7 3 rows, +1.8 4 rows

I really don't want to over-engineer anything, but maybe it'd be a good idea to use an enum for the tab-width, to constrain the valid range of numbers. I'd still have integers for setting slots and just performing a noop for invalid positions, but at least you cannot create an invalid-width-ed tab format (and you don't need to throw a stupid IllegalArgumentException). You could have a static #fromInt, which min-max-es internally

rotund ravine
#

did you print e.getmessage?

rough drift
#
setSlot(9, player);

setSlot(0, 2, player);
#

both is good?

rotund ravine
#

Now, why not used a Vector2D

rough drift
#

fair point

dry yacht
#

A vector? D:

rotund ravine
#

Alright connophy

sterile token
rotund ravine
#

@quaint mantle the message

#

should not contain the displayname

rough drift
#

I guess the second one is better just for one reason: iteration

I know it sounds counter productive, but you can do

for(int x = 0; i < tabList.getWidth(); x++) {
  for(int y = 0; i < tabList.getHeight(); y++) {

  }
}
rough drift
#

ofc not

#

what if more is added

sterile token
#

What?

#

๐Ÿค”

young nimbus
#

Can someone tell me what i did wrong?

rotund ravine
#

It is that part.

rough drift
#

huh?

rotund ravine
#

You should change the format if you wish to display the displayname differently @quaint mantle

#

%s: %s

rough drift
#

A ton of times it is useful

#

makes it easier to reason about stuff

dry yacht
#

Because you don't tend to store a grid-layout as a list.

pale hazel
#

So, I am a little new to API Documentation and reading other peoples code. When I created a inventory how am I supposed to know that inventory needs ItemMeta which is the data the represents the Items?

rotund ravine
#

the first %s gets put to the displayname and the second is set to the message. @quaint mantle

If you set the message to name: message, the format %s: %s. Will get set to name: name: message

rotund ravine
sterile token
#

Just dont fuck and use Flexbox!! - Its a meme sorry i have to say it. Dont blame me please

dry yacht
#

Because? You have to do math to translate between pos and slot, while 99% of users are going to use a grid in their local state?

rough drift
#

I feel like grid is better, and if you want slot you can just int slot = x + y * width;

rotund ravine
#

show me your changed code.

rough drift
#

so slot 8 is easier than 0, 2

#

wait no

#

yeah

#

slot 8

#

it is

#

I know

#

nope

rotund ravine
#

That's not how you should put it.

pale hazel
#

Okay, so when I create an Itemstack it requires ItemMeta for the item data of the ItemStack. How am I supposed to know that? Maybe I am still wording it wrong.

rotund ravine
#

The format is already that.

#

@quaint mantle Print out message and format before you do anything to see what they are for yourself.

dry yacht
#

Because nobody thinks of an inventory (in day2day use) as a grid, except for when you want to create animations. But who would modify the tab like this to only have standard players? You'd either store per-column or a full grid. Otherwise, you have to think about the current width all the time.

rough drift
#

slot 2 is

rotund ravine
#

no why

rough drift
#

because otherwise it's (y, x)

rotund ravine
#

he want it to go vertically @rough drift

rough drift
#

bruh wtf

quaint mantle
#

How do ya'll make this tab like that?

rotund ravine
rough drift
dry yacht
rough drift
#

also @quaint mantle

dry yacht
#

If you only modify the max slots, setSlot is not going to be interesting to you at all.

rough drift
#

Map rendering uses (x,y)