#help-development

1 messages Β· Page 495 of 1

fluid river
#

Ain stain

#

i had c++ exp mostly

#

but java is 10 times easier

#

in russian you say

#

Enn Shteinn

#

sad

#

sad x2

#

anyways

#

are you new to spigot?

#

well then

#

basically

quaint mantle
#

Nothing is comming, nothing for me is called .length
offlinePlayer.getLength

Player player = e.getPlayer(); OfflinePlayer offlinePlayer = e.getPlayer();

fluid river
#

.

#

send this only if !Player#hasPlayedBefore

fluid river
fluid river
#

Everything minecraft server does is receive and send packets

#

incoming packets are covered in Events or Commands

#

and then after all manipulations server sends the packets to players

#

basically after all events are processed and all commands executed

#

also bukkit provides file writing to .dat files(by impl) and .yml(by depending on SnakeYaml)

#

everything else than file writing and packets is not part of Spigot api

#

if you struggle with creating a list then it's Java-related

#

not spigot-related

eternal oxide
#

?basics

undone axleBOT
fluid river
#

now when you know all of that

#

you just open the spigot javadocs

#

and loop through all possible events

#

loop through all of their getters and see which objects they return

eternal oxide
#

javadoc search box is your best friend. Always use it

fluid river
#

and then loop through this objects and their methods

#

and so on

#

if you want something exact

#

here is a search tab for you

weak meteor
#

help

#

i cant think how to do this

#

bc is up to down

#

to weird

#

like inverted

fluid river
#

here

weak meteor
#

and i tried with a nromal for loop

#

i = 0 and stuff, same result

fluid river
#

if you want a beginner project, start with a chat manager

#

we all started from there

quaint mantle
fluid river
#

basically commands like /msg

#

text colorizing

#

message formatting

weak meteor
#

πŸ‘€

fluid river
#

spam/flood filters

#

in any primitive way

weak meteor
#

i started with a replacement of the anvil in a gui (worst way to start)

fluid river
#

and harder part is gonna be text channels

#

))

weak meteor
#

custom enchants? πŸ’€

fluid river
#

well itemstacks and invs are simple

weak meteor
#

lol

fluid river
#

if you know how to work with

#

also you would need to connect your chat manager to PAPI

#

So you can use Permission plugin prefixes

#

and stuff

weak meteor
#

no

#

Papi hook

#

is

#

SUPER easy

#

wanna see?

fluid river
#

what's your plugin about

weak meteor
#

NUKER

fluid river
#

um

weak meteor
#

I CANT DO A SCOREBOARD

#

I WANNA CRY

#

well i can just, is buggy

#

lol

fluid river
#

i just use scoreboads API lol

weak meteor
#

super

#

small

#

but the problem is

serene egret
#

hello, i have a problem, i implemented a fountain show and use a function to spawn falling blocks, this always have been worked fine but since i changed my server version the blocks wont get spawned anymore at least i dont see it but i don't get an error

weak meteor
#

little little problem

#

is the last line is the first one

fluid river
#

everybody once tried rpg plugin heh

weak meteor
#

thats

#

horrible

fluid river
serene egret
fluid river
#

that was also for my server

#

DivineRPG i called it

#

the first thing i tried to implement was custom locks on chests

#

so if you want to pick it you have to solve a maze

mossy marlin
#

it's working let's goo thx for helping me ^^

fluid river
#

basically interact with inventory slots to move a cursor to the end

#

probably lol

#

from somewhere

#

my plugin was deleted in like 2 weeks

#

from my pc

#

i didn't publish it

#

i mean i made mazes

#

but was too lazy to make their actual logic

#

so you can interact with a maze

#

?

pseudo hazel
fluid river
#

ahaha

#

bro learns now

#

can you show what you are talking about

#

or like describe better

pseudo hazel
#

πŸ₯²

fluid river
#

my brain cant understand

mossy marlin
pseudo hazel
#

oh

#

wont that remove the text for all inventories?

mossy marlin
#

it's remove for all xD

fluid river
#

i never played on hypixel

#

crying emoji

pseudo hazel
mossy marlin
#

i was ban in Hypixel because anti cheat πŸ‘Ž and i don't unban but i send all proof and he verified me xD

mossy marlin
fluid river
#

nope

#

never tried

#

guess just need to loop through spigot news

#

and learn how to make resourcepacks

eternal oxide
serene egret
#

i tried it out to spawn just a falling block with summon commnad, which worked but when i try to spawn it with my plugin it doesnt work and i dont get an error and i didn't even changed something in my code and it worked fine until i changed my server version

regal scaffold
#

Is there any way I can have priority over Multiverse stuff

#

Regarding a world

serene egret
# eternal oxide You posted nothing for anyone to work with. Not even a question.
public Shooter(World world, Location sl, double xd, double yd, double zd, int stay, Material mat) {

        new BukkitRunnable() {
            int time;
            

            public void run() {
                this.time++;
                if (this.time >= stay)
                    cancel();

                MaterialData matd = new MaterialData(mat);
                FallingBlock fb = Main.getWorld().spawnFallingBlock(sl, matd);
                fb.setDropItem(false);
                fb.setHurtEntities(false);
                fb.setVelocity(new Vector(xd, yd, zd));
               fb.getWorld().spawnParticle(Particle.BLOCK_CRACK,sl, 10,xd, yd, zd,0.001, Material.BLUE_STAINED_GLASS.createBlockData());
               fb.getWorld().spawnParticle(Particle.WATER_SPLASH,sl, 10, xd, yd, zd,0.001);
            }
        }.runTaskTimer(Main.getInstance(), 0L, 1L);
    }``` hier is my code
eternal oxide
#

I see nothing imediately wrong there. You should update to use BlockData over MaterialData

serene egret
#

okay i will try it

eternal oxide
#

and add a debug sysout to make sure you code is actually being called

serene egret
#

but i cant see the blocks

eternal oxide
#

did you print it IN the run task?

serene egret
#

yes

eternal oxide
#

what block are you trying to spawn?

serene egret
#

a falling block Blue_stained_glass

eternal oxide
#

do you have an api-version in your plugin.yml?

serene egret
#

yes 1.19

eternal oxide
#

everythign sounds fine then

#

no reason it would not spawn

flint coyote
#

unless another plugin cancels the spawn

serene egret
#

bruh i know thats why im so confused cause i changed nothing at this code and it has been worked for over 2 month and when i changed to another server version it wasn't going fine anymore

serene egret
eternal oxide
#

I can only comment on what you have shown. Nothing is incorrect in it.

cinder abyss
#

Hello, things before // Bug here works but after, it doesn't. I have no errors or warnings :java public void GenNoteBlock(Block block, Instrument instrument, int octave, Note.Tone tone){ block.setType(Material.NOTE_BLOCK, false); NoteBlock nblock = (NoteBlock) block.getBlockData(); nblock.setInstrument(instrument); nblock.setNote(Note.flat(octave, tone)); PersistentDataContainer customBlockData = new CustomBlockData(block, this); // Bug here customBlockData.set(new NamespacedKey(this, "instrument"), PersistentDataType.STRING, instrument.toString()); customBlockData.set(new NamespacedKey(this, "octave"), PersistentDataType.INTEGER, octave); customBlockData.set(new NamespacedKey(this, "tone"), PersistentDataType.STRING, tone.toString()); block.setBlockData(nblock); getLogger().info(block.getX() + " " + block.getY() + " " + block.getZ()); }

flint coyote
serene egret
#

the weird thing is that it wont get spawned cause when i press f3 and b it also is not marked as existing but when i print the location, it is fine

quaint mantle
#

How do i make so when you join my server the first time your group will be set to C?

river oracle
#

what

#

elaborate What is a group? How do you assign to groups?

quaint mantle
#

With luckperms, can i make so when a new player joins the group of the player will be set to C with luckperms

quaint mantle
#

But im trying to make it in a plugin?

cinder abyss
quaint mantle
#

Okay.

cinder abyss
#

and see the luckperm doc https://luckperms.net/wiki/Home

white root
#

Does <Entity>.getLocation().getChunk.getX() and .getY() return the chunk's x and y location?
for instance, if the entity was a chunk bordering 0,0, it would return 1 for both the x and y (assuming that the entity was at coords like 10, 10)

eternal oxide
#

yes

white root
#

Cool, thanks

flint coyote
flint carbon
#

while working with mysql/hikaricp, are these necessary to have?:

    config.setMaximumPoolSize(this.maximumPoolSize);
    config.setConnectionTimeout(this.connectionTimeout);```
cinder abyss
#

I already made this

#

but after the bug here it's not printed

eternal oxide
#

none of those sets can cause an issue. they are literally just PDC set calls

flint coyote
#

Sounds odd. Are you sure? Otherwise the only option would be that /reload fucked up your server. You could try a full restart. That only ever happened once to me tho

eternal oxide
#

so add a sysout before block.setBlockData(nblock)

cinder abyss
#

because it's after bug here

cinder abyss
#

and it's after bug here

eternal oxide
#

if you can sysout before getting teh PDC but not after then you must be getting an exception thrown which is hidden

livid tundra
#

Why does List<Player>.class cause Cannot select from parameterized type?

config.getObject("played-before", List<Player>.class);
flint coyote
#

Are you even testing what we saying or just assuming it won't work? You are quite quick with answering

eternal oxide
#

wrap the PDC line in a try/catch Exception

#

sysout any exception

cinder abyss
eternal oxide
#

yes

flint coyote
livid tundra
#

then how do I get a list of players from a config?

eternal oxide
#

never store Players in a config

cinder abyss
livid tundra
eternal oxide
#

you can not create a Player object

livid tundra
#

what type are UUIDs?

#

So, I do config.getObject("played-before", List<String>.class);?

flint coyote
eternal oxide
#

why are you storing a list of players who have played before?

livid tundra
#

starter kit plugin

eternal oxide
#

doesn;t matter. Every OfflinePlayer object has a hasPlayedBefore() method

livid tundra
#

I'm trying to use getObject if I can, bcs I have a utility method that wraps around it

eternal oxide
#

all you have to do is check that onJoin and give them a kit if false

livid tundra
eternal oxide
#

makes no sense

livid tundra
#

In case they played before the plugin was installed

eternal oxide
#

ah ok

livid tundra
#

Here's the description from the yml
#Are new players ones not seen before by the server or the plugin? (server,plugin)
#For example, a player who played on the server before the plugin was installed would not have been seen before by the plugin
#Players who the plugin has seen before are stored in played_before.yml

pseudo hazel
#

well

cinder abyss
pseudo hazel
#

tbh, configuring a starting kit plugin would nt be something you do halfway into your server life

eternal oxide
pseudo hazel
#

its safe to assume you dont wantto save player data if you move over to having kits

cinder abyss
eternal oxide
#

No error but you are saying no code runs after that line

eternal oxide
#

Thats impossible

cinder abyss
eternal oxide
#

The only way it would be possible is if that line was locking the thread, but it can;t be as you are in a RunTask

pseudo hazel
#

well why would a server owner want to use your plugin

livid tundra
#

also, is here any way to use getObject with a List<String>?

#

or is getStringList the only way?

pseudo hazel
#

getStringList is the way yes

hazy parrot
#

Get it and cast to List<String>

halcyon hemlock
#

do I need AI enabled for navigation?

cinder abyss
#

so I'll check if the librairy is compatible with it

pseudo hazel
#

why

#

why not have a 1.19 server

livid tundra
flint coyote
#

at least it isn't 1.8.8 this time lol

eternal oxide
pseudo hazel
#

thats just asking for compatibility issues

halcyon hemlock
#

do I need AI enabled for navigation??

cinder abyss
hazy parrot
eternal oxide
eternal oxide
livid tundra
eternal oxide
halcyon hemlock
hazy parrot
eternal oxide
cinder abyss
eternal oxide
#

Seems so

cinder abyss
#

🀣

eternal oxide
#

can you show the actual code with all the sysouts

#

?paste

undone axleBOT
livid tundra
#

I know it's unlikely, but it's a possiblility

cinder abyss
hazy parrot
eternal oxide
#

um

halcyon hemlock
#

πŸ”₯

cinder abyss
eternal oxide
#

why are you using CustomBlockData?

halcyon hemlock
#

definitely not you not following java conventions

cinder abyss
eternal oxide
#

this block is a Noteblock so has a TileState and as such has it's own PDC

cinder abyss
livid tundra
#

wait, what error does Unchecked assignment: 'java.util.List' to 'java.util.List<java.util.UUID>' throw?

cinder abyss
eternal oxide
#

just apply to container

cinder abyss
#

I'm really excited

eternal oxide
#

you don;t needs a CustomBlockData

cinder abyss
#

If it works it's really cool

halcyon hemlock
#

how do i make entity not look at things

cinder abyss
halcyon hemlock
#

right now it is bugging out because i try to force it to look at a block but it looks are random thing

cinder abyss
#

this.

#

is.

#

working.

#

@eternal oxide

eternal oxide
#

Nice

cinder abyss
eternal oxide
#

Thanks but no Thanks. Just boost Spigot if you want

cinder abyss
#

joking aside, thank you really much !

eternal oxide
#

what issue are you having?

#

I can't make anything out in the Gif as I don't see what it's supposed to do

#

4 sides of what?

#

ok

#

I thought entities thrown into a portal maintained their velocity?

#

Have you debugged to make sure it's not early exiting on your Box overlapping?

#

Just because they spawned doesn't mean you didn't early exit, it just means the entity (falling block) was left alone and continued with it's original velocity

regal scaffold
#

How to make a void generator in 19.3

#

Without using deprecated

#

What's the replacement for generateChunkData

eternal oxide
#

with the code you have (it looks like) one block gets sent through the portal and should produce 5 at the destination.

#

4 if it has no velocity

#

correct

#

so its falling through on the overlap

weak meteor
#

can someone help me?

#

I just changed smth in pom.xml for using FastBoard

eternal oxide
#

Also test the block.getType() when it fails

#

just debug so we see which is causing it to fail

#

so it's never checking the box collision

#

seems an odd test as it shoudl never be the portal block

#

pretty sure that should be != AIR not testing for absence of a portal

#

this whoile math seems odd

#

πŸ™‚

hexed falcon
#

i would use a playerinteractentity event to detect if i had fed a specific mob right?

eternal oxide
#

!block.getBoundingBox().overlaps(boundingBox) is testing the modified locations BB to make sure it doesn't overlap teh current entity (shrunk) BB

#

yeah, I don;t even see what that test is for at all

#

eaither of them

#

yep, they seem pointless

golden turret
#

I have a GitHub package and I am using it in a project of mine. That project has a GitHub action for building using the Gradle action. As the project uses the GitHub package, Gradle raises a 401 error when building the project. How can I fix that?

eternal oxide
#

ok so the check is to prevent it forming before it's teleported

golden turret
#

how do I set them?

#

this is my gradle.yml file

eternal oxide
#

You said the sand appeared on your duper

#

thats the other side of the portal?

#

not where it falls

#

I see nothing πŸ˜›

regal scaffold
eternal oxide
#

yep add the check back then

regal scaffold
#

Just loading thousands and thousands of chunks

eternal oxide
#

portal

#

I don;t get why this code even has spawnFallingBlock

#

it already has a falling block entity

#

ok thi is where it's making your sand just appear one block in each direction and fall if (velocity.getX() == 0.0D && velocity.getZ() == 0.0D) {

#

that spawned block has no velocity, other than Y axis

#

it's just being moved to each of the 4 directions

#

probably

#

yep, give it a go

#

just use the last spawn

#

no velocity on them?

weak meteor
#

someone help me doing a single scoreboard

#

i cant :(

#

ive tried now with 3 apis and a scoreboard that i made

#

and anything works

#

idk why

eternal oxide
#

You do get 5 blocks each block you send in though?

#

yep, they wouldn't be as it would be air

#

ah one sec, you are offsetting before you check teh location

#

Take the add off the end Location loc = event.getBlock().getLocation().add(direction);

#

each block shoudl be spawned 0.25 offset but that is causing you to test 1 offset

#

you add the actual offset in the spawn code

#

nothing spawns?

#

if you manually send one only one spawns the other side?

undone axleBOT
eternal oxide
#

when you send a single through what errors?

orchid trout
#

if you stop nesting if statements i will πŸ‘°β€β™‚οΈ

eternal oxide
#

yeah I still have no idea why that test is even there

#

the fix for nesting is java if ((event.getTo() != Material.AIR) || !(event.getEntity() instanceof FallingBlock falling)) return;

orchid trout
#

good

eternal oxide
#

remove the end portal test, just so we can see if the offsets work

#

lol

tardy delta
#

πŸ€”

eternal oxide
#

I may have to open my IDE

regal scaffold
#

How can I prevent chunks from being unloaded in 19.# +

young knoll
#

Add a chunk ticket

regal scaffold
#

How do these work

young knoll
#

Exactly how it says

regal scaffold
#

Really? That's it?

#

Just chunk.addPluginChunkTicket(plugin);

young knoll
#

Mhm

regal scaffold
#

And until when does this block unloading

#

restart?

young knoll
#

Yes

#

Or until you remove it

eternal oxide
#

its been so long I can;t even remember how to spawn an end portal

regal scaffold
#

Pretty cool

#

Thanks!

eternal oxide
#

doh end is disabled on my test server πŸ˜›

#

odd. I filled out an end portal fram and no portal

#

oh

#

nope

#

what command?

young knoll
#

Yeah the facing part is weird

eternal oxide
#

I have never used that, ever

young knoll
#

/setblock ~ ~ ~ end_portal

#

Well, maybe ~ ~-2 ~ if you don’t want to suddenly be in the end

eternal oxide
#

I just got the end setup so I can test πŸ˜›

#

I did see some wierd triggering of it while I was building and it threw obsidian blocks

regal scaffold
#

How can I make sure

#

My plugin loads before everything else

young knoll
#

Every other plugin?

regal scaffold
#

Yes

young knoll
#

Uhhh

#

Hm

regal scaffold
#

My plugin loads worlds

#

And I need to be able to load the worlds before other plugins

young knoll
#

Yeah it’ll mostly be on them to handle that tbh

regal scaffold
#

Some of them load it themselves

echo basalt
#

plugin.yml

young knoll
#

Although yours should be load startup so that’ll put it before most plugins

regal scaffold
#

Startup doesn't allow me to interact

#

With other worlds besides default

echo basalt
#

you can play with files

regal scaffold
#

What you mean

tender shard
#

i don't think you can load worlds in STARTUP

regal scaffold
#

You can't

#

Besides default

#

So how can I make sure my plugin has control of the world management before others attempt to load them

echo basalt
#

Problem I'm having

#

how can I make sure worlds are deleted onDisable hmm

regal scaffold
#

autoSave(false)

echo basalt
#

I'm probably just gonna write a bunch of worldids to a file and delete those ids on startup

regal scaffold
#

Any ideas? @tender shard

eternal oxide
#

delete them in onLoad not onEnable. It runs before worlds are loaded

#

just check Bukkit.getWorlds().isEmpty() first so you don;t trigger on a reload

echo basalt
#

true but if this works onDisable then I'll be happy

young knoll
#

When do we get onEnable(boolean reload)

echo basalt
#

haha compatibility go boom

ivory sleet
#

onEnable(EnableContext context) πŸ™‚

regal scaffold
#

So any ideas on mine?

young knoll
#

not a compatibly problem if you just have 2 methods

echo basalt
#

you could make a tempfile that stores disable epocj

#

and on enable, if the epoch offset is less than 2 secs

#

magic

young knoll
#

Lol

regal scaffold
#

There's loadBefore in plugin.yml

young knoll
#

List the name of every plugin in there

#

:D

regal scaffold
#

Yup

#

Works

#

lol

#

It's just a few, the ones that need world loaded before

grand flint
#

Can I disable the F3 menu with mods?

#

Yes, I know, does forge have a discord server? thank you

young knoll
#

You can reduce what is shown on it with a gamerule

#

But that’s all you can do server side

grand flint
#

What's that?

weak meteor
#

if i have this task in my constructor:

#

how can i get a UUID

#

from the plauer

grand flint
#

What does that do?

young knoll
#

It hides stuff like coordinates

weak meteor
#

nvm

eternal oxide
#

@last temple I can't get it to do anythign close to yours

quiet ice
#

However it only HIDES them

eternal oxide
#

I just get a snad block formed in the nether

#

the end*

grand flint
#

What about the piechart?

quiet ice
#

They are still sent to the client

quiet ice
#

Alt + F3

eager jacinth
#

Hello! Does anyone know why when I edit the name in WrappedGameProfile (PLAYER_INFO), it doesn't change in the tab? Perhaps I need to edit a different packet?

echo basalt
#

mans using a 4080 on 1080p

eternal oxide
#

This event is for when the block lands not for portaling

quiet ice
#

The fps/bar chart was shift + f3 iirc

echo basalt
#

still

#

I wanna get a 4k monitor for coding

grand flint
#

So wait no pie chart right?

echo basalt
#

but I usually always code on my main monitor which is also my gaming monitor

#

so 2k 144hz for now

quiet ice
#

Pie chart is entirely clientside

#

There is no reason to disable it anyways

eternal oxide
#

I don;t get how you are getting dropped blocks in the end

#

Its a falling block so it forms when it lands

grand flint
quiet ice
#

Since it just shows the client's mspt per section

quiet ice
echo basalt
#

damn 2k 144hz is like 250 bucks but if I want 4k I gotta pay 1k$

quiet ice
#

For the pie chart to be usable for tracking down bases something must produce severe amounts of clientside lag

grand flint
#

No I meant, if there are mob spawners near the person

eternal oxide
#

it does form instantly but it always quits because of that crazy portal test

#

not end portal

quiet ice
grand flint
#

Most smps suffer from this issue

quiet ice
#

Are you sure you don't mean the more usable debug info (e.g. entity count in view)?

young knoll
#

Smps?

#

I can see factions but any normal smp should have protection plugins

quiet ice
grand flint
#

You know you can specific the pie chart to show certain things

grand flint
quiet ice
#

It only shows render times basically

#

I don't know what arcane magic you are pulling off there unless for some ungodly reason mob spawners have their dedicated category (highly doubt so given that that should be serverside only)

young knoll
#

I mean who cares if you find a hidden base if it’s protected

severe folio
#

^

grand flint
quiet ice
grand flint
#

To make something to disable piechart

sullen marlin
#

They can just use a cheat client anyway?

remote swallow
#

im being exposed

quiet ice
grand flint
young knoll
#

But cheating is against the rules

grand flint
#

No it's a custom client

young knoll
#

Everyone knows people can’t break the rules

grand flint
#

Excatly

quiet ice
grand flint
#

Server checks what mods you join with

quiet ice
#

But if you have a custom client you can just patch out the pie chars anyways

grand flint
#

Yes, that's why I asked with mods at first

young knoll
#

It’s easy to bypass a mod check

orchid trout
#

skids hate this man

grand flint
quiet ice
young knoll
#

Just make the mod lie about its name

eternal oxide
#

still workign on it

grand flint
#

No the mods have custom code that sends info to the server

sullen marlin
#

?whereami

quiet ice
#

They probably are just using plain fabric or plain forge which is just πŸ’€

quiet ice
grand flint
#

Yes, but why would they know that it sends it?

quiet ice
#

Recaf my beloved

#

And then copy + paste

grand flint
#

What's recaf?

orchid trout
#

how do i power trip

quiet ice
grand flint
#

Oh so they can get the code in the jar file?

quiet ice
#

Yep

white root
grand flint
#

Yes but can't I detect that there are more mods then there should be?

#

Or less?

#

Or if the files just don't match?

quiet ice
#

Just remove that logic

#

via Recaf

quiet ice
#

You are being too paranoid

grand flint
#

Well I'm not trying to work on a client for ages just for some dude to insert his hacks in it

orchid trout
#

threadmil problem

#

treadmil

grand flint
#

I don't care if a master hacker manages to get thru them all

#

I don't think a 8 year old kid that installed random hacks is gonna pass it

orchid trout
#

treadmill

young knoll
#

We need a layer 0 anti cheat for minecraft

grand flint
#

I just want basic protection

young knoll
rough ibex
#

Snapshot 23w18a: added denuvo

severe folio
#

i'd rather drink bleach

quiet ice
orchid trout
#

how would that even woirk

grand flint
#

What are just basic stuff I can add to stop kids from inserting hacks easily?

#

File checking good enough?

wary topaz
#
    public void onPluginMessageReceived(String channel,Player player,byte[] message) {
        if (! channel.equals("BungeeCord")) {
            return;
        }
        ByteArrayDataInput in = ByteStreams.newDataInput(message);
        String subchannel = in.readUTF();
        if (subchannel.equals("PlayerCount")) {
            ServerSelector a = new ServerSelector();
            a.PlayerServerCount = in.readInt();
        }
    }```

First one to say ?learnjava is a meanie

But really, i dont undestand message channels
sullen marlin
quiet ice
young knoll
#

I don’t see the point of forcing players to use a custom client just to play your server

wary topaz
#

public Integer PlayerServerCount = - 1;

sullen marlin
weak meteor
#

I guess this isnt ok...

wary topaz
#

I dont know why the PlayerServerCount isnt being set

quiet ice
wary topaz
rough ibex
#

i don't think so

sullen marlin
#

toArray() returns object[]

weak meteor
#

isnt castable to String[] ?

sullen marlin
wary topaz
#

Noerror.

#

choosemetaarray.add(ChatColor.RED + "There is a total of " + PlayerServerCount + "players online!");

#

ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("PlayerCount");
out.writeUTF("survival");

#

if you want I can send full code

sullen marlin
wary topaz
#

yes i know, i dont need the server nameinput though

sullen marlin
#

Your code doesn't read server name for starters

#

You still need to read it

wary topaz
#

oh really?

young knoll
#

Yes

wary topaz
#

String ignore = in.readUTF();

young knoll
#

Reading something advances the pointer forward

wary topaz
#

do you think thats all?

young knoll
#

You don’t even need to assign it to a variable

sullen marlin
#

If message received is being called, then probably

wary topaz
#

oh true

#

alr ill test it out ;D

sullen marlin
weak meteor
wary topaz
#

same problom

#

ill send full code

#

public ItemStack storage(String s) {
is where the item is

#

line 114

sullen marlin
#

You make a new serverselector variable and then do nothing with it

wary topaz
#

where?

#

ServerSelector a = new ServerSelector();
a.PlayerServerCount = in.readInt();

#

?

sullen marlin
#

Yes, it's never put on an itemstack

wary topaz
#

Line 117, Server selector GUI

sullen marlin
#

Plugin messages are asynchronous so putting them back into the server is difficult

#

That's a different instance because you used new

wary topaz
#

public Integer PlayerServerCount = - 1;

sullen marlin
#

Best approach is probably to request player count every 30 seconds in a scheduled task, store the count in a field, then use that for the gui

wary topaz
#

ah

#

Where will this scheduledtask be located?

#

and how will it recieve the information

sullen marlin
#

onEnable it will send request to bungee (if a player is online)

weak meteor
#

BRO FINALLY MY SCOREBOARD WORKED

sullen marlin
#

The existing receive method can then update field when it gets response

wary topaz
#

and just to verify, if (subchannel.equals("PlayerCount")) {
is right?

#

Line 40 of main

sullen marlin
#

Think so

wary topaz
#

alr ill be back when I finish

weak meteor
#

Err, when i update my scoreboard, like, disapears and appears in like, 2s and stuff, why?

#

no 2s like instantly

#

lemme record

weak meteor
#

?paste

undone axleBOT
eternal oxide
#

@last temple This seems odd. In your gif you are getting dropped sand blocks not falling blocks

weak meteor
eternal oxide
#

how? that doesn;t happen unless they fall on torches

sullen marlin
#

They're not running spigot

eternal oxide
#

oh they are not?

floral drum
#

hi md_5 bestie

eternal oxide
#

well it shoudl be easy to simulate but not replicate

wary topaz
#

as you can see the List is in red, indicating the variable is not registering the value

weak meteor
#

maybe bc im accessing the config constantly...

wary topaz
#

^

wary topaz
#

also I thought .getStringList returns String[]?

weak meteor
#

what

weak meteor
wary topaz
#

o

severe folio
weak meteor
#

But isnt it bc im accessing in the runnable?

#

lemme try

#

Nah it wasnt that

#

@wary topaz, what do u suggest

#

i do not understand what u said

#

didnt*

white root
#

I want to get a list of entities that are either in the same chunk or one of the 8 neighboring chunks to an entity.
Would it be faster to create a BoundingBox that contains all of those chunks, then use world#getNearbyEntities(boundingBox)
Or (assuming I already have a list of chunks) iterate over the chunks and call myList.addAll(chunk.getEntities()) for each chunk
Obviously I could benchmark it, but I'm hoping that someone might know, as I don't have a benchmark setup for this atm 😳

wary topaz
sullen marlin
wary topaz
#
 public ServerSelector(Plugin plugin) {
        this.plugin = plugin;
        Objects.requireNonNull(plugin.getServer().getPluginCommand("serverselector")).setExecutor(this);

    }```<ServerSelector

    ```public Integer survivalPlayerCount = - 1; 
    new ServerSelector(this);```< Main
eternal oxide
#

entity portal exit is Spigot

#

why would you?

sullen marlin
#

Who's to say

young knoll
#

Probably, paper gives you an error for everything

sullen marlin
#

?whereami

eternal oxide
#

I don;t write anything that doesn;t run on Spigot

weak meteor
#

but i love spigot

young knoll
#

Paper does some good things

#

And some less good things

weak meteor
#

coll

#

wanna

#

help me out?

#

:(

weak meteor
#

IDK HOW TO

severe folio
weak meteor
#

WEIRDO ANIMATIONS

young knoll
#

It deprecated every single string method for components

#

Which can be a pain

sullen marlin
#

Are you creating a new scoreboard each time?

weak meteor
#

wanna see the 2 other methods?

sullen marlin
#

Yeah the update ones

weak meteor
#

?paste

undone axleBOT
weak meteor
sullen marlin
#

Idk what fastboard is

#

So I blame that

weak meteor
#

i got the code

#

well i gotta think its the api fault

#

idk

quaint mantle
#

What DI lib do you guys prefer for spigot plugins?

Koin, Guice, spring, or otjher?

tender shard
#

none

#

I just pass the instance myself

#

I never understood guice etc, it seems to just create new instances. using it properly seems more complicated to me then just not using it

echo basalt
#

just make a constructor

river oracle
weak meteor
#

that weird recharge animation

weak meteor
river oracle
#

where are you creating your boards at

#

are you caching them correctly as in the docs of FastBoard

tender shard
river oracle
remote swallow
#

the array list has stuff added but never used anywhere

tender shard
#

oh I am stupid

#

getDefault != computeIfAbsent

young knoll
#

Sometimes the ide is smart :p

tender shard
#

ok but this really makes no sense

#

I am checking if it's assignable, how is that an unchecked cast

ivory sleet
#

generics

#

raw types is a solution

#

or just //noinspection unchecked

mortal hare
#
    for (float *itPtr = &data[0], *endPtr = itPtr+1000; itPtr != endPtr; itPtr += 4) {
        asm(
            "mov rax, %[itPtr] \n"
            "movaps xmm0, [rax] \n"
            "mulps xmm0, xmm0 \n"
            "movaps [rax], xmm0 \n"
            :
            : [itPtr] "rm" (itPtr)
            : "rax", "xmm0"
        );
    }
#

oh yeah

#

SIMD operations

#

4 multiplication instructions at one cycle atomically without any multithreading

#

For those who dont know what are SIMD instructions, they're basically instructions that lets you execute the same operation for multiple data at the same time

#

in my case

#

I've managed to crunch 1000 iterations into 250

tender shard
#

I did check it with isAssignableFrom πŸ₯²

young knoll
#

Generics are mean

tender shard
ivory sleet
#

its the (Class<Type>) castable

#

cuz type erasure

weak meteor
#

How to get the type of death?

#

Like in PlayerDeathEvent how do i differentiate between a player and water lets say

tender shard
# ivory sleet its the (Class<Type>) castable

I am calling SomeClassObject.isAssignableFrom(AnotherClass), and only cast SomeClassObject to AnotherClass if it's true, so it can never happen that this causes a ClassCastException

#

btw can I always reuse the same Gson instance, or do I always (or sometimes?) create a new instance?

#

the javadocs unfortunately don't tell me anything about it

remote swallow
#

you can reuse or create a new one

tender shard
#

thx

#

then I'll declare it as field in PlayerDataAPI interface

ivory sleet
#

alex yes but

#

reflection is runtime

#

static analyzer doesnt care

#

nor does compiler

tender shard
#

yeah that is the issue, javac should be able to see that I called "isAssignableFrom"

#

I mean, it also realizes when you do instanceof on normal object

#

then why can it not realize that I called isAssignebleFrom on the class i'm gonna cast

ivory sleet
#

instanceof doesnt work on higher ordered types

#

and isAssignable still doesnt prevent type erasure

tender shard
#

but my GlobalEvent class isn't generic

ivory sleet
#

but Class<? extends GlobalEvent>

#

and thats the type u use

tender shard
#

but java knows that it must work, otherwise it'd complain

ivory sleet
#

String and GlobalEvent are entirely different

#

as said and it does not matter how you look at it

#

its an unchecked cast, because it cannot be checked accurately in regards to the higher ordered types due to type erasure

mortal hare
#

Type erasure exists in java

#

unfortunately

ivory sleet
#

and yes u have reifiable and non reifiable types

#

but thats also decided during runtime

#

new Consumer<Map<String,Object>>(){public void accept(Map<String,Object> o){}} would create a new type

#

where Map<String,Object> is stored during runtime

round finch
#

COPIUM
anyone who has some code for
generating 3d Pentagon with rotationZ and rotationY
i can't do math

#

i will probably quit and just try later sadge

rough ibex
#

what the fuck was I thinking when I wrote this

sullen marlin
#

cant you just use the parametric equation for a regular polygon and change the initial value of theta?

sullen marlin
#

then you can have any polygon you like

round finch
#

i'm a freaking math noob

#

i know with 2 equation

#

you just ad another Dimension

round finch
#

i did it with a circle and a cube but now the real challenge is here

#

?paste

undone axleBOT
round finch
#

i'm definitely not ready to become a 3d graphic developer that is for sure

sullen marlin
#

wdym by 3d pentagon

#

pentagonal prism?

round finch
sullen marlin
#

so a dodecahedron

round finch
#

wait is that called a Pentagon Ball?

round finch
#

that is probably why chat gpt couldn't do it

#

i said it wrong

tender shard
sullen marlin
round finch
#

thank you md_5 math genius

ivory sleet
#

like

        void x(Object o) {
            List<String> s = (List<String>) o;
        }

this is an unchecked cast, or rather "uncheckable"

whereas

        void x(Object o) {
            String s = String o;
        }

is checkable

#

specifically String in the higher ordered type is uncheckable due to type erasure

#

however

#

like if u were to do List<?> s = (List<?>) o or List s = (List) o then IJ wouldnt complain

#

first one due to that the generic type can be anything, so no "uncheckability", second one is due to that there is no generic type, aka a raw type

#

(and then again, no "uncheckability")

tender shard
ivory sleet
#

no

#

wekll

#

well

tender shard
#

but why does it work then

ivory sleet
#

rather

#

isAssignableFrom checks it, but not in the way you think

#

like

#

alex

#

its a normal java method

tender shard
#

ofc I cannot check whether List<String> is instanceof List<Integer>, that I know. But I have a class OBJECT

ivory sleet
#

its not a special semantic like instanceof

tender shard
#

I meant to say CLASS object

#

wrong emphasis lol

ivory sleet
#

jetbrains ide could have considered isAssignableFrom to be a special case scenario

analog snow
#

How can I send players to other Bungeecord servers?

ivory sleet
#

where they would regard it as a special semantic

tender shard
ivory sleet
#

but they didnt

tender shard
ivory sleet
#

think that was an issue brought up even

tender shard
ivory sleet
#

since we have some special stuff like from annotations, reflective lookups etc

ivory sleet
tender shard
#

I have tried to do IJ plugins a few times πŸ˜„

#

but their docs are so shitty

#

it's hard to believe

ivory sleet
#

oh ye fr

#

i just look at other plugins sources most of the times

tender shard
#

sometimes I wonder, how do people manage to create IJ plugins in the first place

#

I mean, where did they get the required info from?

#

because I seem to be too stupid to find it

ivory sleet
#

u're not alone :.)

mortal hare
#

literally no proper docs for that, except for some github projects showing how to setup the barebones without actuallly explaining a lot

#

like wtf is .m4 macro language

#

I've found an article deep in the web from 20 years ago that clarified that a little bit but still

ivory sleet
#

sounds abysmal and ludicrous

mortal hare
#

if not this

#

i would've struggled more

tender shard
#

maven uses it for archetypes but there's like, only one website that has ANY information about it

analog snow
river oracle
#

?paste

undone axleBOT
river oracle
river oracle
#

I'm looking to clean up the processor code I feel like I'm missing maybe some improvements that could be done especially dealing with the nested object

tender shard
river oracle
# wary topaz Same here
  1. If you are repeating the same code over and over again you are doing something wrong. It can be reduced
#
            case "gsgp" -> {
                choose = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);
                choosemeta = choose.getItemMeta();
                if (choosemeta != null) {
                    choosemeta.setDisplayName(" ");
                }
                choose.setItemMeta(choosemeta);
            }
            case "psgp" -> {
                choose = new ItemStack(Material.PURPLE_STAINED_GLASS_PANE);
                choosemeta = choose.getItemMeta();
                if (choosemeta != null) {
                    choosemeta.setDisplayName(" ");
                }
                choose.setItemMeta(choosemeta);
            }
            case "bsgp" -> {
                choose = new ItemStack(Material.BLACK_STAINED_GLASS_PANE);
                choosemeta = choose.getItemMeta();
                if (choosemeta != null) {

                    choosemeta.setDisplayName(" ");
                }
                choose.setItemMeta(choosemeta);
            }
``` the only difference between these 3 switches is a material
#

extract all of that code into a method

analog snow
river oracle
#

next don't hard code all of your text its better to put it into configs

tender shard
wary topaz
river oracle
#
        ServerSelectorInventory.setItem(0,storage("gsgp"));
        ServerSelectorInventory.setItem(1,storage("bsgp"));
        ServerSelectorInventory.setItem(2,storage("gsgp"));
        ServerSelectorInventory.setItem(3,storage("bsgp"));
        ServerSelectorInventory.setItem(4,storage("gsgp"));
        ServerSelectorInventory.setItem(5,storage("bsgp"));
        ServerSelectorInventory.setItem(6,storage("gsgp"));
        ServerSelectorInventory.setItem(7,storage("bsgp"));
        ServerSelectorInventory.setItem(8,storage("gsgp"));
        ServerSelectorInventory.setItem(9,storage("bsgp"));
        ServerSelectorInventory.setItem(10,storage("gsgp"));
        ServerSelectorInventory.setItem(11,storage("psgp"));
        ServerSelectorInventory.setItem(12,storage("gsgp"));
        ServerSelectorInventory.setItem(13,storage("psgp"));
        ServerSelectorInventory.setItem(14,storage("gsgp"));
        ServerSelectorInventory.setItem(15,storage("psgp"));
        ServerSelectorInventory.setItem(16,storage("gsgp"));
        ServerSelectorInventory.setItem(17,storage("bsgp"));
        ServerSelectorInventory.setItem(18,storage("gsgp"));
        ServerSelectorInventory.setItem(19,storage("psgp"));
        ServerSelectorInventory.setItem(20,storage("survival"));
        ServerSelectorInventory.setItem(21,storage("psgp"));

        ServerSelectorInventory.setItem(23,storage("psgp"));

        ServerSelectorInventory.setItem(25,storage("psgp"));
        ServerSelectorInventory.setItem(26,storage("gsgp"));
        ServerSelectorInventory.setItem(27,storage("bsgp"));
        ServerSelectorInventory.setItem(28,storage("gsgp"));
        ServerSelectorInventory.setItem(29,storage("psgp"));
        ServerSelectorInventory.setItem(30,storage("gsgp"));
        ServerSelectorInventory.setItem(31,storage("psgp"));
        ServerSelectorInventory.setItem(32,storage("gsgp"));
        ServerSelectorInventory.setItem(33,storage("psgp"));
        ServerSelectorInventory.setItem(34,storage("gsgp"));
        ServerSelectorInventory.setItem(35,storage("bsgp"));
        ServerSelectorInventory.setItem(36,storage("gsgp"));
        ServerSelectorInventory.setItem(37,storage("bsgp"));
        ServerSelectorInventory.setItem(38,storage("gsgp"));
        ServerSelectorInventory.setItem(39,storage("bsgp"));
        ServerSelectorInventory.setItem(40,storage("gsgp"));
        ServerSelectorInventory.setItem(41,storage("bsgp"));
        ServerSelectorInventory.setItem(42,storage("gsgp"));
        ServerSelectorInventory.setItem(43,storage("bsgp"));
        ServerSelectorInventory.setItem(44,storage("gsgp"));
``` if you are doing something like this instead of a loop you need to look at configs as well
wary topaz
#

mk

river oracle
#

you could even stick to internal JSON files

#

and not expose it to the end user

wary topaz
#

I'm not quite, the responsible kind when it comes to json files

#

could I have an example? Not a spoon

river oracle
#

your ide should have json syntax highlighting and linting

#

if it doesn't there might be a plugin

wary topaz
#

It does.

#

Intellij

river oracle
#
{
  "key": "value",
  "another-key": "another-value"
}
``` json just looks like this
wary topaz
#

Alright thank you!

river oracle
#

for an inventory you could make a json like this

{
  "title": "&4Inventory Title",
  "background": {
     "name": " ",
     "material": "RED_STAINED_GLASS_PANE"
   },
}
``` and so on
#

honstly since you are are newer it'd be easier just to use yaml

#

since its already built into spigot very easy to use

wary topaz
#

I'm already used to yamls. tyvm

#

ill use that

tender shard
river oracle
#

generally that's how it works
Its got a nesting structure due to the emphasis on using NoSQL

#

JSON structure basically which makes nesting objects not that uncommon especially in a data object like a Player or Entity

tender shard
#

ah so it's like gson but for mysql I guess

#

nosql*

wary topaz
#

way too long

#

mb

river oracle
wary topaz
tender shard
wary topaz
#

serverSelector.survivalPlayerCount = in.readInt();

tender shard
wary topaz
#
    public Inventory ServerSelectorInventory = Bukkit.createInventory(null,45,ChatColor.YELLOW + String.valueOf(ChatColor.BOLD) + "Available servers!");
    public Integer survivalPlayerCount = - 1;
    Plugin plugin;```
tender shard
#

why do you readUTF() in that part?

river oracle
tender shard
wary topaz
#

I thought about that too, but md_5 said to keep it

tender shard
#

the first readUTF(), where you check whether it's "survival", is fine. but the next one is useless and reads the int. now when you wanna read the actual count, you're already at the end

wary topaz
#

o

tender shard
wary topaz
#

alr ill try the new code

tender shard
#

calling "readWhatever()" without saving it, is in 99% of cases wrong

pseudo hazel
#

what event is being fired when a player hits an interaction hitbox?

tender shard
#

wdym with "hit"? left-clicking / melee attacking it?

pseudo hazel
#

yeah

#

as thats how you interact with those

tender shard
#

PlayerInteract(At)EntityEvent

pseudo hazel
#

it says thats only for right clicks

tender shard
#

oh my bad, you are right

#

lemme check

#

what's the name of that entity class again?

#

InteractionDisplay or sth?

pseudo hazel
#

Interaction

#

the displays are separate

tender shard
#

ah yeah

pseudo hazel
#

but you can beatifully combine them into a interactable scene I have deduced

tender shard
#

hmmm try the PlayerInteractEntity nonetheless pls

wary topaz
tender shard
#

otherwise, try EntityDamageEvent

#

@pseudo hazel

wary topaz
#

ill send myfull main class

pseudo hazel
#

yeah that was my second option aswell since you can configure it to make a hit sound and what not

sullen marlin
#

almost ther

tender shard
# wary topaz

what are you trying to do btw? get the number of players online on the whole bungee?

sullen marlin
#

you just need to stop making a new server selector each time

wary topaz
#

on the survival server

sullen marlin
#

store it as a field

wary topaz
#

wdym each time?

pseudo hazel
#

oh md do you know which event is fired when hitting an interaction?

sullen marlin
#

line 55, with new

tender shard
#

@sullen marlin do you know which event is called when someone left-clicks an "Interaction" entity?

sullen marlin
#

idk, presumably an interact event

wary topaz
#

PlayerInteractEvent?

tender shard
wary topaz
#

alr illtry it

tender shard
#

so I doubt it's that

wary topaz
#

it is,

tender shard
#

how? where?

wary topaz
#

if (event.getItem == null)

compact haven
#

:?

#

that's jsut the item in their hand

#

also event.getPlayer().getItemInMainHand()

wary topaz
#

oh wait you mean entity

tender shard
#

well

#

Items are lol

#

but getItem() is not an item, but an itemstack

wary topaz
#

itemStack(getItem)

#

or wait its the opposite

tender shard
#

no clue what you on about. I thought you wanted to detect which "Interaction" entity a player left-clicked, right?

#

PlayerInteractEvent will NOT work for that, it doesn't have any method that returns an entity (besides the player itself)

pseudo hazel
#

anyways ill test it out later since I dont have 1.19.4 set up atm but I am fairly certain the entityDamageEvent might be the one

#

but I was hoping someone in here might have just known

tender shard
wary topaz
#

@EventHandler
public void test (EntityDamageEvent event) {

}
#

youregood

pseudo hazel
#

where I dont care about that

compact haven
#

the fuck you mean where they clicked it

pseudo hazel
#

you can only check if they interacted with it

wary topaz
#

its still -1

tender shard
#

well if you don't care about where, then go for "EntityDamageByEntityEvent", check if damager is instanceof Player, and getEntity is instanceof Interaction

#

that should definitely work

pseudo hazel
#

yes

#

exactly

tender shard
pseudo hazel
#

I thought maybe there would be a separate event for it that I didnt know about

#

thanks for your help btw

wary topaz
tender shard
#

what the heck is this

wary topaz
#

public ServerSelector(Plugin plugin) {
this.plugin = plugin;
Objects.requireNonNull(plugin.getServer().getPluginCommand("serverselector")).setExecutor(this);

}
#

its a way to get the plugin

pseudo hazel
#

these 1.19.4 additions will really reshape public servers, especially minigame servers, when all the libraries have caught up ofc

sullen marlin
#

implying people will stop supporting 1.8

wary topaz
#

NOO

pseudo hazel
#

lmao

wary topaz
#

me love 1.8

pseudo hazel
#

well that too, but I have given up that cause

#

im just saying there are about a 100 hologram libraries or smth that can benefit greatly from the new additions xD

#

but if it aint broke, dont fix it

#

so 🀷

wary topaz
tender shard
tender shard
wary topaz
#

I sent you the updated code

wary topaz
tender shard
#

Gimme a few minutes, laptop battery just died

wary topaz
#

mk

tender shard
#

Its gotta charge a few minutes before it boots again

tender shard
#

I wonder what thatβ€˜s supposed to do

#

You just create objects and then throw them away?

#

Why

wary topaz
#

I dont lol

#

check serverselector class

compact haven
#

@tender shard the constructor for those objects register themsevles as commands

tender shard
#

Damn that is nasty

compact haven
#

its bad design

wary topaz
#

it saves the plugin variable

tender shard
#

Yes, very bad

wary topaz
#

which is very useful

tender shard
#

Its useless

#

Its bad design

wary topaz
#

well that aint the problom lol

tender shard
#

That is true

#

But as said, i gotta wait a few minutes

compact haven
#

what you're doing is terrible

wary topaz
#

how else am I gonna get the pluginvariable

tender shard
compact haven
#

learn Java πŸ€•

wary topaz
#

Look ifit works for me it works for me

tender shard
#

okay so I'm back

compact haven
#
public void onEnable() {
  getCommand("blah").setExecutor(new MyCommand(this));
}
public class MyCommand {
  private final MyPlugin plugin;
  public MyCommand(MyPlugin plugin) {
    this.plugin = plugin;
  }
}
#

there, that's how it's typically done

compact haven
#

you still have the plugin variable, and the executor is still set by the plugin (good practice when not using a library)

wary topaz
#

?di

undone axleBOT
compact haven
#

yes, its literally di

wary topaz
#

Idont need it

compact haven
#

u dont need what

wary topaz
#

the dependency injecter

tender shard
#

why do you refuse to do things properly

compact haven
#

bro you literally use DI in your ugly code

wary topaz
#

I dont need it in the way you do it

compact haven
#

you're just moving one line

#

jesus fuck

tender shard
#

a command should not register itself, that's not its responsibility

compact haven
#

then move the command into the main class too

#

because apparently we dont care where code goes, as long as it works

tender shard
#

a command should execute commands. a plugin should register those commands

#

that's the idea