#help-development

1 messages ยท Page 1677 of 1

eternal oxide
#

why + 80?

proud basin
#

move it to the left

eternal oxide
#

it shoudl be centered without the +

paper viper
#
  • 80 is not relative
proud basin
#

I don't exactly want the center

#

should of be more specific

tepid thicket
#

The client is fine, it still have FPS and can move. The server doesn't respond while the many particles are spawned.

eternal oxide
#

ok, but don;t use + 80, use a calculation from scaledWidth

eternal oxide
tepid thicket
#

The action isn't showing up in the timings, and it says after on I would have 20 TPS.

proud basin
#

so would sr.getScaledWidth() - (this.width / 2), sr.getScaledHeight() - (this.height / 2) get the exact center?

tepid thicket
#

So I assume some internal component is overloaded? But which one?

eternal oxide
#

you are refusing the let the server do anything else

#

These are particles, spawn them async

#

It "should" work

tepid thicket
#

But it's not the server thread which is doing the work. So what is actually going on?

#

You know what I mean here?

eternal oxide
#

no

proud basin
eternal oxide
#

How are you spawning them?

eternal oxide
proud basin
#

oh ok

#

so I shouldn't do addition

eternal oxide
#

so if you want it to alwasy be in the correct relative position, no matter the client size you use + (clientWidth/10)

proud basin
#

but what if you don't want it centered?

eternal oxide
#

It measn if the client is 800 you will add 80, if its 1500 you would be adding 150

#

you are adding an offset of center

proud basin
#

I'm lost

eternal oxide
#

without any + you shoudl be drawing it in the exact center

tepid thicket
#

The server was freezed here for 3 seconds. But timings show a load of 6% only and 20 TPS.

eternal oxide
tepid thicket
#

While the system cpu rises by 10%. So something must happen internally.

proud basin
#

so should I always divide by 10?

#

then add whatever I need

eternal oxide
#

you never add nor subtract hard coded numbers

tepid thicket
#
player.spawnParticle(Particle.VILLAGER_HAPPY, vec1.getX(), vec1.getY(), vec1.getZ(), 5);
eternal oxide
#

you calculate teh value you need

tepid thicket
#

I use this line.

proud basin
#

so I shouldn't do this.width / 10 + 150

eternal oxide
#

no, +150 is hard coded

#

it will not scale with the client size

paper viper
#

Do everything in proportion to the screen width/height

#

everything should have some relativeness to the size

proud basin
#

yeah I'm sorry I'm still confused

eternal oxide
tepid thicket
#

Yes. But the server is still freezing. Thats the question actually.

proud basin
#

so then I wouldn't want to use this.width

#

and just ScaledRes

formal dome
#

what kind of sql url do i need to pass into DriverManager.getConnection()

eternal oxide
#

what is this.width?

paper viper
#

the thing you are trying to display would fly off the screen

#

because its + 150

#

you have to make sure that it accounts for those cases too

#

so you cant use + CONSTANT

#

or - CONSTANT

#

in other words, the location has to be dynamic

proud basin
#

so always divide or multiply?

paper viper
#

Always divide, multiply or whatever

eternal oxide
#

You calculate it based upon the client width

proud basin
#

so never do addition or subtraction

eternal oxide
#

as I said, + (clientWidth/10), would add your 80 if the width was 800, and 150 if it was 1500

#

You can add and subtract, but not CONSTANTS

#

you have to calculate the offset

proud basin
#

so how is 150 a constant?

eternal oxide
#

150 is alwasy 150

#

150 is never 20

#

so 150 is unchanging. Its a CONSTANT value

proud basin
#

so I would have to do something like + (clientWidth/10 * 2),

eternal oxide
#

why *2?

proud basin
#

idk

#

I'm just trying to understand

paper viper
#

have you coded a website?

#

just wondering

#

or anything web related

proud basin
#

ya

paper viper
#

..

#

you should know this

#

you know when building responsive sites

#

you have to make everything relative

eternal oxide
paper viper
#

lol

proud basin
#

I've only done it like twice

eternal oxide
#

it doesn;t really matter how you calculate it. You showed you wanted it 80 off-center, so I showed you if the width was 800 then dividing by 10 gave you the offset you wanted

proud basin
#

just to mess around

eternal oxide
#

is simply calculating the location based upon the client width so, if the width changes the offset moves too.

#

Example, you see in your code how it calculates the centre by dividing by 2?

proud basin
#

yea

eternal oxide
#

it doesn;t say teh center is 400, 300

#

400,300 is using constants

#

it calculates the center

proud basin
#

huh

#

so dividing by 2 is a constant?

eternal oxide
#

no

paper viper
#

maybe we should show him a swing example

eternal oxide
#

dividing by 2 is calculating the center

#

hard coding the centre to be 400,300 is setting CONSTANTs

proud basin
#

so if I did sr.getScaledWidth() - (this.width / 2 + 30) 30 is a constant

paper viper
#

Yes

#
  • 30 is a constant
eternal oxide
#

No, + 30!!!

proud basin
#

ok

eternal oxide
#

oh yes, you asked

#

I thought you were offering that as how to do it ๐Ÿ™‚

formal dome
#

can i repaste a question

proud basin
#

so if I wanted a + 30 do I divide by 3?

paper viper
#

Examples:
width/2 + 30 -> not good
width/5 + width/2 -> good
width/3 + 60 -> not good
width/5 - width/7 -> good

paper viper
#

you have to think relative here

#

dont think absolute

formal dome
#

what kind of sql url do i need to pass into DriverManager.getConnection()
No suitable driver found for mysql://localhost:3306/logReader

proud basin
#

so you are saying sr.getScaledWidth() - (this.width / 2 + this.width / 5) is fine?

eternal oxide
#

no

#

-5 is a constant

proud basin
#

it's a division now?

eternal oxide
#

it is now ๐Ÿ™‚

#

yes that would be fine, theres no hard numbers in there

proud basin
#

so if my screen res was

#

1920 x 1080

quaint mantle
#

Help?

paper viper
quaint mantle
proud basin
#

it would be 1920 - windowSize / 2 + windowSize / 5

eternal oxide
#

yes

proud basin
#

what if I needed it like 1 pixel up?

eternal oxide
#

you don;t move by pixels

#

well you can

#

but it will be different for every resolution

tepid thicket
#

Okay actually the particles are lagging my connection. Not the server.
Are there any limits a single connection can process?

proud basin
#

hm ok

#

wait

#

let me draw something

eternal oxide
eternal oxide
proud basin
#

for this

rugged topaz
#
        if (e.getWhoClicked().getInventory().getItem(e.getHotbarButton()) != null && e.getWhoClicked().getInventory().getItem(e.getHotbarButton()).hasItemMeta() && e.getWhoClicked().getInventory().getItem(e.getHotbarButton()).getItemMeta().hasDisplayName() && e.getWhoClicked().getInventory().getItem(e.getHotbarButton()).getItemMeta().getDisplayName().contains("Bonemerang") && e.getWhoClicked().getInventory().getItem(e.getHotbarButton()).getType().equals(Material.GHAST_TEAR)) {
            e.setCancelled(true);
        }

messy line, but why does this

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at net.minecraft.server.v1_8_R3.PlayerInventory.getItem(PlayerInventory.java:433) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventory.getItem(CraftInventory.java:47) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        at dev.karar.alc.gui.GUIManager.onInventoryClick(GUIManager.java:94) ~[?:?]
paper viper
#

what

#

the fuck

quaint mantle
eternal oxide
#

I'm not even going to look through that god line of code.

quaint mantle
eternal oxide
proud basin
#

If I did 1920 - (580 / 2)

eternal oxide
rugged topaz
#

well shit how the fuck do i clean up that line of code if i need a null check for every method

proud basin
#

no?

eternal oxide
proud basin
#

so then I don't use ScaledRes

paper viper
#

im sorry but its a mess like everything

#

use variables at least to store values

rugged topaz
#

alr

paper viper
#

?dry

eternal oxide
paper viper
#

damn it

proud basin
#

well actually

#

1920 would be my x

eternal oxide
#

The only thing your drawing program cares about is teh size of the paper

proud basin
#

so say the window is full screen

#

so 1920 x1080

#

and I did this.width / 2

#

what does the 960 do?

eternal oxide
#

As far as your drawign code, the paper is its whole world. It doesn;t matter where it is on the screen

proud basin
#

is that the position?

eternal oxide
#

960 would be the center

#

but

#

don't think of it as 960

#

ignore its value, only think that its the centre

#

its teh width / 2

proud basin
#

right

eternal oxide
#

0 is left, width is right, centre is width / 2

proud basin
#

so lets say I had this window the arrow is where I want something drawn in the center

eternal oxide
#

so any other positions you want on that paper you calculate. Values have no meaning here.

proud basin
#

I would want to multiply too?

paper viper
#

Depends

proud basin
#

so I can achieve that?

paper viper
#

multiplying is fine, but what are you multiplying?

proud basin
#

width?

eternal oxide
#

Well, if you want to draw that box, you would need the box width and height.

proud basin
#

right

eternal oxide
#

so you want it in the centre, you need to start drawing the box left of centre by half of the box width.

dire marsh
#

are you having fun with drawing images on mc client?

eternal oxide
#

then you get half of the box on each side of centre

proud basin
#

so

#

0

#

as the first width

eternal oxide
#

first?

#

0 is no width

proud basin
#

you said it was left?

eternal oxide
#

teh value zero is left of the page

proud basin
#

yeah

eternal oxide
#

forget numbers... the values you need to wipe from your mind.

proud basin
#

isn't that want I want or?

paper viper
#

Here, another way to think of it is:

Suppose you are working with absolute right. So you have a 1920 x 1080 moniter and you want to place a dot at (224, 540).

So if you were to use division, it would be equivalent to (width / 15 + width/20, height/2). Because 1920/15 + 1920/20 is equal to 224, and 1080/2 is 540. Now what I said above is going to be what you will have to put in. Notice that how I never include any constant values. All values are dynamic within that coordinate.

eternal oxide
#

when you want to place things on teh screen you have to decide where they go relative to teh paper itself.

eternal oxide
#

they can be relative to centre, relative to left or right

dire marsh
#

elgar, are you leo?

proud basin
#

ok ok

eternal oxide
#

leo?

proud basin
#

wait

dire marsh
#

you speak like him lol

eternal oxide
#

Not me.

proud basin
#

ok so

#

if I wanted 120, 480

dire marsh
#

LeoCab, the spammer guy, was banned here few days ago, long story.

proud basin
#

and window size is 1920x1080

#

ok nvm

#

im lost

#

scratch what I said

quaint mantle
#

1920 is the width of the graph

eternal oxide
#

lets say you wanted something drawn up against the left, you'd set 0 as x

paper viper
#

And also another way to think about it is math. Suppose I had a cubic 3x^3 + 2x^2 + 6x + 5.
3 is the leading coefficient
2 is the quadratic term coefficient
6 is the linear term coefficient
5 is the constant term.

When we refer to constant we refer to that specific last element. Notice that 5 has no relation to x. 3x^3 has x cubed. 2x^2 as x squared. But 5 has nothing to do with x.

formal dome
#

what kind of sql url do i need to pass into DriverManager.getConnection()
No suitable driver found for mysql://localhost:3306/logReader

quaint mantle
#

1080 is the

#

oh hello math

paper viper
#

its true tho

#

lmao

paper viper
#

xD

proud basin
#

honestly prob should

#

so chat doesn't get spammed

formal dome
#

i asked my question 3 times in 30 minutes ๐Ÿ˜ฆ

paper viper
#

and we gave you an answer the first time

#

or at least Elgar did

eternal oxide
formal dome
#

i didn't get notified

eternal oxide
#

Sorry

formal dome
#

ur good

proud basin
#

so

#

when I do this

#

what should I think of

eternal oxide
# proud basin yea

ok, now lets say you wanted something drawn far right.
You would set x to width - widthOfItem

proud basin
#

wait what

eternal oxide
#

Now you know how we said don;t use constants.

proud basin
#

yea

eternal oxide
#

you can, if adding things like border spacing

proud basin
#

so it's not right up against the border?

eternal oxide
#

yes

proud basin
#

hm ok

quaint mantle
#

help?

eternal oxide
#

ah you changed it

quaint mantle
eternal oxide
#

which is line 21?

quaint mantle
#

this

proud basin
#

so

#

you know the image I was talking about

eternal oxide
#

That screenshot says it can;t find stats so possibly MainEngines isn't the correct class name?

proud basin
#

I would set x to 0 then add something

eternal oxide
#

yes, but be careful

proud basin
#

why?

eternal oxide
#

because as teh resolution increases you will want teh space to grow with it

proud basin
#

and I don't want that right

quaint mantle
#

what this command for post my code?

proud basin
#

?paste

undone axleBOT
quaint mantle
#

thx

eternal oxide
proud basin
#

wait wym space

quaint mantle
proud basin
#

like the empty space?

quaint mantle
eternal oxide
quaint mantle
eternal oxide
#

stats in your main class is null

quaint mantle
#

๐Ÿ˜ณ

eternal oxide
#

stats = new HashMap<>();

proud basin
#

Is it the same if I wanted to do the height

eternal oxide
quaint mantle
#

Every time the player enters the server will it be put back into the hashmap or will it overwrite?

eternal oxide
#

the reason everything is relative. a 5 pixel gap on the left is going to look ok on a 1080 monitor. That same gap on a 4k monitor is going to be invisible.

eternal oxide
proud basin
#

so if I wanted to achieve that image before

#

I'd do

#

0 + 120, 0 + 80, this.width - 100, this.height - 80

eternal oxide
#

IF you only ever ran at that resolution

proud basin
#

oh

#

what am I doing wrong?

eternal oxide
#

CONSTANTS

#

+120 is a constant

proud basin
#

hm

eternal oxide
#

all are constants

proud basin
#

so I would do 0 + this.width / 4

median anvil
#

so my code is getting the job done, but it feels extremely sloppy, any tips?

eternal oxide
proud basin
#

screen size

#

window size

eternal oxide
#

then no

proud basin
#

you told me not to use Res size

eternal oxide
#

you divide by 2 to get centre

#

then subtract half of the width of the box you are drawing

proud basin
#

so

#

0 + this.width / 2 - this.width / 4

eternal oxide
#

no

median anvil
#

an example of my slop is that for my gui im creating a new instance of the class that has the inventory variable, and then storing the instance of the class in a hashmap so if the player opens it they get a custom generated inventory based on their permissions

eternal oxide
#

what are you using to specify the width of the rect?

proud basin
#

wym

eternal oxide
#

teh rectangle you are going to draw

proud basin
#

are you talking about this.width

eternal oxide
#

ok so this. width is the size of the rectangle you are wanting to draw?

proud basin
#

no

eternal oxide
#

what is

proud basin
#

this.width is the application window size

eternal oxide
#

what is the width of teh rectangle?

#

what variable

proud basin
#

oh wait

#

maybe this.width is

#

so then what is window size?

eternal oxide
#

you tell me

proud basin
#

I mean I didn't make the variable

#

part of forge

#

so

#

this.width is the screen object

#

meaning the rect right?

eternal oxide
#

if you say so ๐Ÿ™‚

proud basin
#

well

#

screen object isn't the window size

eternal oxide
#

so width is teh size of the rectangle

proud basin
#

I guess so

eternal oxide
#

to draw in the centre java centre = pageWidth / 2; x = centre - (width / 2);

proud basin
#

now im curious

#

how do I get the window size

#

because ScaledRes is not it

eternal oxide
#

if you want to move it right of centre x += (pageWidth / 10)

proud basin
#

unless it is

#

ima try it with ScaledRes

eternal oxide
#

try sysout the value and see

proud basin
#

I guess

#

what the hell

#

every time I try to print sr.getScaledWidth()

#

it changes it to ```java
System.out.println(this.width "/" + sr.getScaledWidth());

eternal oxide
#

The IDE's are learning. When they start talking to each other we need to be worried

quaint mantle
#

IDE spittin shade ;o

proud basin
#

BRO WHAT THE HELl

#

its actually nanoying me

proud basin
#

like im not even joking

eternal oxide
#

run for the hills and get some weapons

proud basin
#

bruh

#

why is it doing this

eternal oxide
#

Its alive

proud basin
#

if I add a + to it

#

it removes it

#

how do I clear my cache

#

found it

#

okay yea

#

looks like im not printing

#

how else can I check Elgar?

eternal oxide
#

sysout always

proud basin
#

I can't

#

do you not see my ide is being rude to me

eternal oxide
#

Yeah, I don;t use IDEs that don;t do what I tell them to do.

proud basin
#

BRUH

#

I can't change anything in my ide

#

it just adds the sysout thing

#

and removes what iadded

eternal oxide
#

start with ""+

proud basin
#

huh?

eternal oxide
#

then the field

proud basin
#

oh my god its because I had the class opened twice

#

so this.width is 427 and sr.getScaledWith is 427

#

so I guess they are the same thing?

eternal oxide
#

seems so

proud basin
#

so does that mean I was doing it right?

#

0 - this.width / 4

eternal oxide
#

no

#

2

#

alwasy find centre

#

but you need to width of the thing you are going to draw too

proud basin
#

so I should do width first then x?

eternal oxide
#

uh?

proud basin
#

oh wait

#

sh

#

so I have this.width / 2

#

I should have this.width / 2 - (width / 2)

eternal oxide
#

are this.width and width different objects?

proud basin
#

no

eternal oxide
#

then no

proud basin
#

oh

eternal oxide
#

pageWidth is the page you are drawing on

#

width is the width of the item you are going to draw

proud basin
#

hm

#

wait

#

huh

#

ngl

#

so I have to get the item width?

paper viper
#

are you guys really still talking about this

proud basin
#

yes

#

because this.width and sr.getScaledWidth is the same thing

eternal oxide
#

as I said, you need the width of the item you are going to draw

proud basin
#

so I need to some how get the width of what im drawing

eternal oxide
#

you should have the width. you can;t draw it without knowing

proud basin
#

well this.wifth

#

this.width isnโ€™t

eternal oxide
#

again no, thats the page you are drawing on

proud basin
#

yeah I know

#

I said it isnโ€™t

#

I'm actually confused as hell

proud basin
#

if I don't know it

#

wait

#

is what im drawing

eternal oxide
#

because somewhere you already have the width

proud basin
#

is the width the this.width / 2

eternal oxide
#

no

#

well you tell me

#

its your code

proud basin
#

this.width isn't mine

#

it's part of GuiScreen

eternal oxide
#

I can tell you how to calculate positions and do the math but its your code. You need to understand what variables are what.

proud basin
#

I'm sticking with this.width / 2 is my item width

eternal oxide
#

its not

proud basin
#

well sr is def not it

eternal oxide
#

do you have a texture width?

proud basin
#

no

#

this isn't a image btw

eternal oxide
#

what is it?

proud basin
#

I was drawing a rec

#

were you thinking I was doing the image

eternal oxide
#

If YOU are drawing a rectangle you MUST have its dimensions

#

you can;t draw a rectangle without them. Its impossible

proud basin
#

I just found out Minecraft#getMinecraft#displayHeight is a thing

#

well

inland scaffold
#
if (player.hasPermission(mainClass.getConfig().getString("permissions.discord"))) {

would this work?

config:

permissions:
  discord: "slashtools.discord"
  media: "slashtools.media"
  youtube: "slashtools.youtube"
  instagram: "slashtools.instagram"
  twitter: "slashtools.twitter"
  website: "slashtools.website"
  store: "slashtools.store"
  forums: "slashtools.forums"

?

proud basin
eternal oxide
#

how much different?

proud basin
#

854/427

#

left is mc.displayWidth

#

wait

eternal oxide
#

then this.width is correct. its yoru rectangle

proud basin
#

ok

eternal oxide
#

and displayWidth is the page

proud basin
#

so that's my item width then

eternal oxide
#

yes

proud basin
#

so how is ScaledResolution my item too?

#

im confused

proud basin
#

mc.displayWidth / 2 - (this.width / 2)

inland scaffold
#

ok

eternal oxide
proud basin
#

so at this point im allowed to add a constant right

eternal oxide
#

no

#

you are relative to centre

#

so to move it left or right x += mc.displayWidth / 10

#

or whatever you need to get it in teh correct place

#

scaledResolution is probably to do with Minecraft UI scaling

proud basin
#

idk

eternal oxide
#

anyway I'm off to bed

proud basin
#

mc.displayWidth / 2 - (this.width / 2) - mc.displayWidth / 9

#

peace

inland scaffold
#

im stupid

#

lol

#

I didnt put it in the plugin.yml

#

wait how much spaces do I do for a command in the plugin.yml

#

wait fixed it

#
permissions:
  discord: "groups.default"

It still says I have no perms?

inland scaffold
#

but it doesnt for me

#

if I deop myself

#

and thats groups.default

sharp bough
#

debug it

#

print the perm that you get from the config

#

print if the command the registered

inland scaffold
#

mabey I remove the "" or add ''

sharp bough
#

no

#

debug it

inland scaffold
#

ok

sharp bough
#

that line is correct

#

debug mainClass.getConfig().getString("permissions.discord")

inland scaffold
#

System.out.println(mainClass.getConfig().getString("permissions.discord"));

inland scaffold
upper vale
#

what

sharp bough
#

no error and no null?

inland scaffold
#

oh wait

sharp bough
#

then you are not registering the command in the main class

inland scaffold
#

I put it in the wrong spot

#

in the cmd

upper vale
#

wp

inland scaffold
#

wait is there a perm for the Default Group

thin venture
#

What do i do with setLockโ€‹() so that i can lock a chest

upper vale
#

Why do you need a separate perm for it?

inland scaffold
# upper vale Doesn't everyone have the default group?
permissions:
  discord: "slashtools.discord"
  media: "slashtools.media"
  youtube: "slashtools.youtube"
  instagram: "slashtools.instagram"
  twitter: "slashtools.twitter"
  website: "slashtools.website"
  store: "slashtools.store"
  forums: "slashtools.forums"

I need it so people can set whatever perm they want

#

but how will they set it to default group

#

btw it prints group.default

#

because in my config I set it to group.default

upper vale
#

well i dont really see the point of having customizable permissions in the first place

inland scaffold
#

oh

proud basin
#

^

upper vale
#

but ik luckperms gives players group.<id> permissions

#

not sure about other permission plugins

proud basin
#

Why is this so confusing ugh

thin venture
#

that's doesn't really help me but ok

upper vale
#

What are you looking for exaclty

thin venture
#

I want to be able to lock a chest

#

and only have the person who placed it down be able to access it

upper vale
#

im not sure if setLock would be useful in your case

thin venture
#

ok

upper vale
#

iirc Lockable makes it so that you have to open the chest with an item that has the name of whatever you set the key as

thin venture
#

ok

upper vale
#

Yeah, When a lock is active an item with a name corresponding to the key will be required to open this block.

sharp bough
#

other than that idk

thin venture
#

I'll try that

#

how would i have 2 arguments or what ever it is?
public void onPlace(BlockPlaceEvent e event) { the event is red

upper vale
#

what-

#

what is e event supposed to do?

thin venture
#
@EventHandler
    public void onPlace(BlockPlaceEvent e event) {

        final Block b = e.getBlock();

        if (b.getType() != Material.CHEST) {
            return;
        }

        final Player p = e.getPlayer();

        System.out.println(p + "Placed down chest");

    }```
#

this

upper vale
#

Use either e or event, not sure why youre putting both

thin venture
#

event.getBlock().getLocation() i havent added this yet

#

which is what needs the event

upper vale
#

huh?

#

just use e instead?

thin venture
#

ok

quaint mantle
#

How to return double in async?

#

help

worldly ingot
#

You probably want to look into using CompletableFutures

thin venture
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>me.chrissquartz</groupId>
    <artifactId>nocheststeal</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <name>NoChestSteal</name>
    <description>Players can't steal items in chests</description>
    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <url>chrissquartz.cf</url>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <repositories>
        <repository>
            <id>papermc-repo</id>
            <url>https://papermc.io/repo/repository/maven-public/</url>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>io.papermc.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>```
#

                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>
        </plugins>
    </build>
</project>

What's wrong with it agian`

quaint mantle
#
    public static void getMoney(OfflinePlayer player) {
        Bukkit.getServer().getScheduler().runTaskAsynchronously(MainEngines.getPlugin(), new Runnable() {
            @Override
            public void run() {
                double i = 0.0;
                PreparedStatement stm = null;
                try {
                    stm = connection.prepareStatement("SELECT * FROM `players` WHERE `uuid` = ?");
                    stm.setString(1, player.getUniqueId().toString());
                    ResultSet rs = stm.executeQuery();
                    while (rs.next()) {
                        i = rs.getDouble("money");
                    }
                } catch (SQLException e) {
                    console.sendMessage("ยงcLBEngines: Ocorreu um erro ao ver o dinheiro de " + player.getName() + ".");
                }
            }
            return i;
        });
    }```
#

How to return double in async?

#

help

worldly ingot
#
public static CompletableFuture<Double> getMoney(OfflinePlayer player) {
    return CompletableFuture.supplyAsync(() -> {
        // Do your SQL stuff
        return money;
    });
}
paper geyser
#

I'm trying to remake skript code in java but

#

wait im gonna google it first

#

wait i rememebred nvm

median sable
#

Need help
Why isn't this working ?

 @EventHandler(priority=EventPriority.HIGHEST)
  public void onPreLogin(AsyncPlayerPreLoginEvent event)
{
  if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) {
    String name = event.getName();
    String regex = "\\d+";
    
    if(name.matches(regex)b || name.toLowerCase().contains("mcdown") )
    {
       event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, "STOP SPAMMING OUR SERVER!!!!!");
    }
    
}
}
 
paper geyser
#

i did

#

lol

#

ill just figure it out myself

deft patrol
#

getEnvironment() was working before for me but now it isnt working at all and i cant figure out why, Ive tried using it in different classes and all kinds stuff but it wont work again, how do i resolve this? for example player.getWorld().getEnvironment(); works up to getEnvironment()

#

ok nvm i guess? i added spigot as a dependency but i already had purpur so im unsure of why it wouldnt work

quaint mantle
#

๐Ÿ’€

jolly stone
#

I have a Survival world and a custom world named as lobby but I want to teleport the player from survival world to custom world as he joins the game. How to teleport player? and pls ping me

World lobby = Bukkit.getWorld("lobby");
    @EventHandler
     public void  onPlayJoin(PlayerJoinEvent event){
        Player player = event.getPlayer();
        player.teleport(lobby.getSpawnLocation());
        player.playSound(player.getLocation() , Sound.ENTITY_EXPERIENCE_ORB_PICKUP , 10,1);
        player.setGameMode(GameMode.ADVENTURE);
        if(player.getWorld().getName().equalsIgnoreCase(MainLobby.lobby)){
            event.setJoinMessage("ยงcSG [+] " + "ยงa" + player.getName());
        }
    }

I am using this event

hazy igloo
# quaint mantle

AccountManager.getMoney(player).join() or AccountManager.getMoney(player).thenAcceptAsync(money -> stats.setMoney(money))

ivory sleet
#

You can use just thenAccept(Consumer)

#

It will run on the same thread

#

But yeah also make sure the money variable is volatile since it looks like it got state

maiden briar
#

How can I despawn a Wolf temporary and spawn when a action is preformed exactly the same wolf?

#

I saw something about NBT data setting it invisible but how would I do that, and does the wolf then really attack nothing?

chrome beacon
#

I would use nms to save the NBT

prisma needle
#

How can I remove a permission to a vanilla command (e.g. "minecraft.command.msg" from a player?

chrome beacon
#

Are you making your own permission plugin?

ivory sleet
#

If you use LuckPerms (like you should) then use its api to remove a permission else you could go with the vault api.

prisma needle
#

No it's not a dedicated permission plugin, it's just a plugin that needs to manage some permissions :P

ivory sleet
#

Oh

prisma needle
#

ah so an API is the best option?

ivory sleet
#

Well Iโ€™d argue that yeah

chrome beacon
#

I would recommend hooking Vault or LuckPerms like Conclure said

prisma needle
#

is it worth it just to disable a few vanilla commands?

ivory sleet
#

Though making your own permission management system can be a good way to learn (3

prisma needle
#

yes yes I want to learn :)

ivory sleet
#

You could alternatively block those commands with the pre command event

chrome beacon
prisma needle
#

also ideally (not necessary though) it would be nice to have the command not even show up (turn red) in chat

maiden briar
chrome beacon
#

Then the entity would still be there

#

And attack stuff

maiden briar
#

.setAI ?

chrome beacon
#

Then it won't move

#

And can be come unloaded

maiden briar
#

It can't attack stuff

chrome beacon
#

It can also take damage

maiden briar
#

Ok yeah true

#

Do I seriously need to work with nms?

chrome beacon
#

I'd just use NBTAPI

#

It handles the nms part for you

maiden briar
#

Ok link?

chrome beacon
#

Google it

maiden briar
#

Ok

#

Do I need to use this as a seperate plugin? Or is just shading enough

chrome beacon
#

Either

maiden briar
#

Shading is enough?

chrome beacon
#

You can shade or use as plugin

maiden briar
#

Ok I will shade it then

#

Will the wolf then also be attacked or moving?

#

Ok and what do I need to set to make him invisible?

#
((CraftEntity) wolf).getHandle().setInvisible(true);
((CraftEntity) wolf).getHandle().isInvisible();

@chrome beacon will do this the same?

lean gull
#

i stil need halp

#

some1 pls halp

maiden briar
#

Ok

eternal oxide
#

The crafting matrix is simply an array

lean gull
#

to make a non existent crafting table to test out recipes for my existent crafting gui

eternal oxide
#

items 0-8

#

then thats not what you want

lean gull
#

List<ItemStack>?

#

with new ArrayList<>()?

eternal oxide
#

Bukkit.craftItem actually makes an item with no interface or input from the player

lean gull
#

?paste

undone axleBOT
thin venture
#

ok ill do that

lean gull
#

ty

eternal oxide
#

Asking whats wrong with it is unlikely to garner any response. you don;t tell us anything. like an error/warning, what its not doing that you think it should

quaint flax
#

If i want to make a server selector will i need to use bungeecord or can it work with just spigot?

eternal oxide
#

multiple servers require a proxy like Bungee

quaint flax
#

i know how bungee works but server selector ;/

#

when creating the plugin

eternal oxide
#

You can;t create any server selector UI

#

You create a lobby server, where all players join and pick a server from there

quaint flax
#

i know ๐Ÿ˜ but right now i made a cheap version by using command panels and permormCommand to that selected command panel

#

lol

#

i want to make a full on server selector without command panel ;3

eternal oxide
#

Explain what you mean by "server selector"

quaint flax
#

so, a item spawns in inventroy, right click a gui opens then bunch of servers go into that gui... you select one and it sends you to a certain server that you have selected

eternal oxide
#

You need to learn custom GUI and plugin messaging channels

quaint flax
#

why you assume idk how to create gui

#

;/

eternal oxide
#

Seriously? You ask questions, I give answers and you back chat!

quaint flax
#

no

#

i asked 1 question

eternal oxide
#

If you don;t have an actual question stop wasing time.

quaint flax
#

do i need to place bungeecord in jre system libery or just spigot

eternal oxide
thin venture
quaint flax
#

ok fuck it, bukkit discord server is more smarter than this

eternal oxide
lean gull
#

pls help idk how to use getCraftingRecipe

#

dis is ma code

reef wind
lean gull
#

where do u think i got dis from

reef wind
#

they should tell you

#

else google

lean gull
#

prouddesk do you think what you're doing is helping

reef wind
#

Yes

eternal oxide
reef wind
#

I am giving advice

lean gull
#

ok, then please, quit "helping"

#

quit "giving advice"

lean gull
#

i do not want any of your "help" or "advice"

reef wind
#

To look at the docs and googling, if you haven't already.

lean gull
eternal oxide
#

Recipe recipe = Bukkit.getCraftingRecipe(craftingMatrix, e2.getWhoClicked().getWorld());

#

if recipe == null then thats not a valid recipe

lean gull
#

it says the required type is ItemStack[]

eternal oxide
#

You are trying to get an ItemStack not a recipe

lean gull
#

yes

#

the result from a recipe

eternal oxide
#

getCraftingRecipe returns a Recipe not an ItemStack

#

you use that Recipe to get the result

lean gull
#

i was told to use this

eternal oxide
#

Yes you can use that

#

but you first get teh recipe, then check its not null, then get the result

lean gull
#

am confusion

thin venture
eternal oxide
#
Recipe recipe = Bukkit.getCraftingRecipe(craftingMatrix, e2.getWhoClicked().getWorld());
if (recipe == null) return;
ItemStack result = recipe.getResult();```
lean gull
#

how u return in event

#

das a thingie?

eternal oxide
#

return is when you want to exit without doing anything else.

lean gull
#

first line wont work doe, we already tried

#

...like a minute ago...

eternal oxide
#

, if its a registered recipe it will work

lean gull
#

it has errror

eternal oxide
#

what error?

lean gull
#

-_-

eternal oxide
#

oh you are using a List

lean gull
eternal oxide
#

convert to use an array or convert your list to an array

lean gull
#

it arraylist

#

is that gud?

eternal oxide
#

yes, arrayLIST not an array

sullen dome
#

ArrayList != Array

lean gull
#

ok

eternal oxide
#

ItemStack[] craftingMatrix = new ItemStack[9];

#

then set each instead of put

sullen dome
#

if you need a List, use Arrays#asList

#

i guess

lean gull
#

how 2 set

#

wait from when did i get image perms

thin venture
#

So i have this

        System.out.println("Chest was placed at" + loc1);,( and some coords here )```
and it print's out ```atLocation{world=CraftWorld{name=world}``` which i dont want how would i do that?
lean gull
#

oh nvm it just thread perms

sullen dome
#

location is an object

lean gull
#

i used all my brain power for now, i go

#

ok baiii hav gud day

sullen dome
thin venture
#

why cant i post a image?

sullen dome
#

not verified

thin venture
#

oh ok

#

It prints ```Chest was placed atLocation{world=CraftWorld{name=world},x=636.0,y=64.0,z=493.0,pitch=0.0,yaw=0.0}

#

ill just do it in text then

sullen dome
#

ah bc you forgot a space in code

#

i see

thin venture
#

oh xD

sullen dome
#

so yea

#

it prints out the location object, like isaid

#

what should it look like?

thin venture
#

I mean it doesnt matter like im only gonna see that

#

Just would want it a bit cleaner

sullen dome
#

if you want for example
Chest was placed at X=123, Y=123, Z=123
you'd do

System.out.println("Chest was placed at X=" + loc1.getX() + ", Y=" + loc1.getY() + ", Z=" + loc1.getZ());```
thin venture
#

ok

sullen dome
#

same as printing out a player's name

Player player;
System.out.println(player);

would print out smt like
{CraftPlayer=<playername>}

thin venture
#

yeah i got that already

#

What was the code for sending built jar to another folder ( plugin folder )

sullen dome
#

uhh

#

wdym

thin venture
#

I had seen it before but forgot what it was

sullen dome
#

in pom.xml?

thin venture
#

yes

sullen dome
#

uhhh

#

lemme look

thin venture
#

sorry probably should have said that

sullen dome
#

it was

<outputDirectory>"Your Path"</outputDirectory>```
#

afaik

thin venture
#

ok thanks, that's probably the last thing i annoy you with bc i gtg soon

sullen dome
#

asking stuff is what the channel is for lol

thin venture
#

ยฏ_(ใƒ„)_/ยฏ

sullen dome
#

i'm gonna play some bo3 tho, so i'm out too

thin venture
#

cya

red apex
#

Im trying to hook vault economy api, when i do economy.getBalance(p) it prints error to console saying the return of Vault.getEconomy() is null. Any solution?

eternal oxide
#

?paste the error

undone axleBOT
opal juniper
#

Im trying to think of a way to "eat" the world from the edges - ie every second certain x/z collumns will be removed. (better version of a world border) but i cant really think of the logic to do so?

#

i cant just generate a random number cause i would like to eat outside in

timber saffron
#

Can someone help me I just downloaded the build tools but I cannot find the Spigot-API folder

#

Cannot find Spigot-API folder

upbeat sky
#

Hey! I'm trying to use one of my plugin as a dependency in another plugin, but when I try to build using maven i get the error:

package nl.naimverboom.aresessentials does not exist```
Which is the plugin I'm trying to extend from. How do i fix this?
eternal oxide
upbeat sky
eternal oxide
#

no

#

You imported it as an external lib

#

maven knows nothing about that

upbeat sky
#

So how should i do it?>

tacit drift
upbeat sky
#

It compiled, thanks people

proud basin
#

what am I doing wrong because when I go full screen my drawing is gone but if im in windowed it's not
DrawUtils.drawRoundedRect(mc.displayWidth / 2 - (width / 2) - mc.displayWidth / 9, mc.displayHeight / 2 - (height / 2) - mc.displayHeight / 13, mc.displayWidth / 2 - width / 4, mc.displayHeight / 2 - height / 3, 2, 0x90000000);

eternal oxide
#

braces. You need to be sure what math is performed in what order

#

are you trying to render slightly left of center?

proud basin
#

yea

eternal oxide
#

what are teh second two values of yoru drawRoundedRect?

proud basin
#

width and height

eternal oxide
#

then you shoudl pass width and height, not modified

proud basin
#

so just width

eternal oxide
#

yes

proud basin
#

DrawUtils.drawRoundedRect(mc.displayWidth / 2 - (width / 2) - mc.displayWidth / 9, mc.displayHeight / 2 - (height / 2) - mc.displayHeight / 13, width, height, 2, 0x90000000);

#

will give that a try

eternal oxide
#

you need to loop the hashMap and count the items

#

then your logic is bad

#

ah using all it only finds slots that match both ItemStack and stack size

#
HashMap<Integer,โ€‹? extends ItemStack> allโ€‹(@Nullable
ItemStack item)
Finds all slots in the inventory containing any ItemStacks with the given ItemStack. This will only match slots if both the type and the amount of the stack match

The HashMap contains entries where, the key is the slot index, and the value is the ItemStack in that slot. If no matching ItemStack with the given Material is found, an empty map is returned.

Parameters:
    item - The ItemStack to match against
Returns:
    A map from slot indexes to item at index ```
#

meaning if you provide an ItemStack of size 1 it will only return stacks matchign the item and are of size 1

#

do you need to find a perfect item match or can you search for a material?

#

then you can either search by material or forEach the inventory yourself and match

violet depot
#

What is the best way to teleport named entity to player respawn point?

crimson terrace
#

Entity.teleport(location) could work

#

Unless youre on an older version there should also be a method to get a players spawn location

violet depot
crimson terrace
#

You ever worked with spigot or do you want heavy help?

violet depot
crimson terrace
#

Lets assume your player variable is called p. You should be able to get their respawn location with p.getBedLocation or some method like that. Just look through the ones that pop up

#

Am on phone so i cant look up stuff properly

violet depot
crimson terrace
#

Whats your entity variable called?

#

And what version you on

violet depot
honest iron
#

For some reason im getting this error: Can not set int field net.minecraft.server.v1_12_R1.PacketPlayOutScoreboardTeam.g to java.util.Arrays$ArrayList
And i don't know any way to fix i tried googling i didn't find any, the packet is: PacketPlayOutScoreboardTeam

            tList.setAccessible(true);
            tList.set(plPacket, Arrays.asList(new String[] { playerName }));
            tList.setAccessible(false);```
crimson terrace
#

entity.teleport(p.getBedLocation) or aomething?

eternal oxide
#

check bed location. They may not have a bed

#

if no bed they will goto the world spawn

violet depot
eternal oxide
#

You can not fit an arrayList into a int

crimson terrace
#

Look through the available methods for p @violet depot

honest iron
violet depot
eternal oxide
crimson terrace
#

If it exists you can use it

violet depot
crimson terrace
#

Then use it ๐Ÿ˜‰

#

Scrolling through the available methods is how i usually fix all my problems

#

Sadly that doesnt work well outside of coding

violet depot
timber saffron
#

Why is this happening I have a plugin in it but still it's not showing it

crimson terrace
#

You cant cast a location to player

crimson terrace
timber saffron
eternal oxide
crimson terrace
#

You have a problem in your pom i think

timber saffron
eternal oxide
#

Not in your jar you don't

timber saffron
#

?

#

how do I fix that

eternal oxide
#

I can;t work from screenshots.

#

are you using maven?

timber saffron
#

nope

eternal oxide
#

then select teh plugin.yml when you export your jar

timber saffron
#

k

violet depot
crimson terrace
#

Paste code

stone sinew
crimson terrace
#

Just teleport the entity to the player. Dont need to tp it to the respawn loc

timber saffron
#

Egarl like this ?

eternal oxide
#

You can;t do that in the respawn event

eternal oxide
#

The player hasn;t respawned yet so has no location

crimson terrace
#

Event.getLocation or something?

stone sinew
eternal oxide
timber saffron
#

k thanks

timber saffron
eternal oxide
#

just unticking those shoudl not disable it, unless you have not built your project

timber saffron
eternal oxide
#

project menu

#

bad tutorial if its not told you to build

timber saffron
#

the tuto

eternal oxide
timber saffron
#

k thanks

timber saffron
eternal oxide
#

It makes life so much easier

#

especially when you start wanting to interact with other plugins and libraries

timber saffron
#

is it java or a diffrent language

reef wind
#

don't use youtube tutorails to learn

eternal oxide
#

neither, its a build tool

timber saffron
tame fern
#

How does the base game blend biome noise together? Been trying to write a world gen plugin and I can't wrap my head around it.

lean gull
#

i need help! i have a private void method calling a public void method that is in another class, the private one is in a implements listener class and the public one doesn't extend or implement anything and it says that i can't call a non static method from a static context

tame fern
#

Exactly what it says. You cannot call a non static method from a static one.

lean gull
#

neither of them are static, both are void

tame fern
#

static void? or void? You can have both.

lean gull
#

just void

#
    private void doThing(Inventory inv, ItemStack[] items) {
        CraftingRecipes.recipesCrafting(inv, items)
    }```
#

public void recipesCrafting(Inventory inv, ItemStack[] list) {

#

on recipesCrafting it says the error

#

in the second one

#

sorry i mean in the first one

#

in doThing

tame fern
#

You're calling recipesCrafting like it's a static method, but it's not.

lean gull
#

how so?

#

k i fixed it

#
        CraftingRecipes recipesThing = new CraftingRecipes();
        recipesThing.recipesCrafting(inv, items)```
#

oops i forgot a semi colon

quaint mantle
#

Is there a way to modify block drops in a blockbreakevent e.g.

            ItemStack item = new ItemStack(Material.GOLD_INGOT);
            block.getDrops().add(item);
lean gull
#

anyone know why player.getItemOnCursor() == null says it's always gonna be false? (btw this is on a inventoryclickevent

        Player player = (Player) e2.getWhoClicked();
        if (e2.getCurrentItem() == null) {
            if (player.getItemOnCursor() == null) {
                e2.setCancelled(true);
            }
        }```
tame fern
#

Use .equals(null) when comparing objects, they have their own method for comparisons.

lean gull
#

still says it's always gonna be false

#

wait whoops i did it in the wrong area

quaint mantle
#

you heckin genius

lean gull
#

ok it still says it's gonna be false, this time i did it in the right area

olive valve
#
                    if(args[1].equalsIgnoreCase("2")){
                        ArrayList<String> lore = new ArrayList<>();
                        lore.remove("ยง7Snipe I");
                        lore.remove("ยง7(Snipe) > Shoot fast arrows!");
                        lore.add("ยง7Snipe II");
                        lore.add("ยง7(Snipe) > Shoot faster arrows!");
                        meta.setLore(lore);
                        item.setItemMeta(meta);
                        p.getInventory().getItemInMainHand().removeEnchantment(SnipeRegister.SNIPE);
                        p.getInventory().getItemInMainHand().addUnsafeEnchantment(SnipeIIRegister.SNIPEII, 1);
                    }``` so args[0] runs and cancels args[1] how can i make it so args[0] doesn't run but args[1] does?
#

Command: /enchantments snipe 2

lean gull
ancient plank
#

iirc in more recent versions if a slot or smth is empty its not null but Material.AIR

lean gull
#

this works fine btw if (e2.getCurrentItem() == null) {

tame fern
#

Then use that.

lean gull
#

well atleast i think, it just doesn't say it's always gonna be false

lean gull
tame fern
#

Then remove that and just check the item on the cursor??

lean gull
#

but i need both???

ancient plank
#

material air

tame fern
#

Also try that ^ haven't tried any item compares in the newer versions.

quaint mantle
quaint mantle
#

thank you!!

#

I get an error when trying to add an item. I require an Item instead of ItemStack

tame fern
#

Item item = world.dropItem(location, itemstack);

eternal oxide
#

You can;t add ```
getItems
@NotNull
public List<Item> getItems()
Gets list of the Item drops caused by the block break. This list is mutable - removing an item from it will cause it to not drop. It is not legal however to add new items to the list.

Returns:
The Item the block caused to drop

#

manually drop as Austin said

tame fern
#

Likely easier to just use BlockBreakEvent then setCancelled(true), setDropItems(false), event.getBlock().setType(Material.AIR), spawn the item then return

lean gull
#

lemme try to test the type to a material instead of the item to a new itemstack

lean gull
#

someone pls help

summer violet
#

I'd definitely compare the materials. Are you sure that's the line that's giving the error? Can you give more code and point out the line it's giving the error on?

halcyon mica
#

Is it possible to disable collision for a entity, so that they can walk through certain kinds of blocks

summer violet
#

If you want to know how to delay stuff, it's done using BukkitRunnable

waxen plinth
#

You literally should never do .equals(null) because that will throw an NPE if the object is null

quaint mantle
#

Lmaooo

tepid thicket
#

Spawning 3000 particles per tick seems to overwhelm and fully consume a whole Netty Thread.

#

How could I optimize sending particles, to increase throughput?

quaint mantle
#

why are you spawning 3000 particles a tick

tepid thicket
#

I am making a display with particles, to make it smooth, it would update once per tick.

quaint mantle
#

pass the task throughout multiple threads

proud basin
#

Why not just add -org.spigotmc.netty.disabled=true

quaint mantle
#
     3000
    /    \
Thread  Thread

1500/thread, not clogging the main
i still dont understand why you're even spawning so many particles

#

is what you're trying to accomplish worth the network/cpu usage?

#

you told him how to disable it

tepid thicket
#

You see line 15 which sends the particles? How would I split that up?

#

To my understanding the player has only one connection to the server? Or can it have multiple?

paper viper
#

what

tame fern
#

@waxen plinth Yea that's on me. Early over here. ๐Ÿ˜‚๐Ÿ˜‚ just wish I wasn't so sure of myself.

paper viper
#

i screenshotted that message cause its funny lmao

tepid thicket
#

imaginedev, The problem is, as the netty thead is overwhelmed, it doesn't respond to the player while the action.

#

I guess the problem occurs even on lower rates like 1000/2000 particles. So can netty handle just 1000 packets per tick?

paper viper
#

we just dont understand what you are trying to do

#

and why you are trying to spawn 3000 particles...

#

cause that seems dumb

quaint mantle
#

thats what im saying

tepid thicket
#

I make a display for a chunk-based town system. It displays the borders arround the player.

#

So a single line of a chunk would aready consume 20 particles. If you sum it up, you get some thousand.

paper viper
#

you dont need 3000 of that...

young knoll
#

Sadly I donโ€™t think that method works for players

tepid thicket
#

Maybe its not 3000 but 1000, if I lower the render distance. But that still lags netty.

quaint mantle
#

use it in playerJoin and damage event

paper viper
#

think of using Workers or something to divide it up

#

per tick

#

instead of spawning 3000 per tick

#

like do 150 per tick, and do that with 20 workers

#

so that it occurs every second

#

and divides it up

tepid thicket
#

I mean, there is some room for optimization in the operation itself, true.

paper viper
#

this isnt optimization

#

what you are doing is simply just impossible

#

or not impossible, rather, like

tepid thicket
#

But are like 1000 packets the limit? What's the bottleneck?

quaint mantle
#

๐Ÿ˜ฉ

paper viper
#

there isnt a bottleneck... you are just sending way too many packets

#

do you know how heavy packets get too

#

the bandwitdth too from that

#

sheesh

tepid thicket
#

How much bandwitdth consumes a single particle packet?

paper viper
#

if you are spawning like 3k...

#

its basically the same thing as if you are eating 30 graham crackers at once

#

you should instead do it so you eat 3 graham crackers per second or something, to divide it

#

so you dont time out the client or lag them to hell

tepid thicket
#

Thats the point. It doesn't seem too much actually. To what I profiled, it measured 2KB of bandwidth usage.

#

But I don't now about the internals of netty, if it might perform badly with many small particles.
That's what I want to find out. So I can calculate the limit and optimize divide my operation by that.

quaint mantle
#

bruh

tepid thicket
#

It's a point. Or can you explain why the limit is 1k packets and not 100k? What's the bottleneck?
Without knowing what's actually going on, there is no room for optimization of any kind.

quaint mantle
#

just set custom name

#

w/o timer

#

and in damage event change name

waxen plinth
#

Honestly using a repeating task isn't that unreasonable

#

Plugins can also set a player's health without firing an event I believe

young knoll
#

I don't think setCustomName works on players

#

Correct me if I'm wrong

quaint mantle
#

its probably in chat

waxen plinth
#

Oh yeah but you can use a scoreboard objective

proud basin
#

also if I go full screen windowed it's not there

reef wind
#

by not casting int to a byte

#

like the error says

solid cargo
#

prolly something very simple

#

the yellow thing is the nullpointerexception thing btw

reef wind
solid cargo
fading lake
#

cast it to Player

reef wind
solid cargo
#

ahh

#

ok wait

prime reef
#

is...is there a reason the scoreboard has decided to append the score + 1 to the end of each line and stop updating?

solid cargo
prime reef
#

there are no errors whatsoever and I didn't change jackshit, this just started happening pretty much at random.

solid cargo
#

give me hints not spoonfeeding

fading lake
#

its because CommandSender does not have that method

reef wind
prime reef
fading lake
#

you need to cast CommandSender to comething that does

prime reef
#

are you using an IDE?

#

oh nvm

#

just saw the screenshot, mb

#

CommandSender can also be the console, and you can't play a sound to console lmao

solid cargo
#

ahh