#help-development

1 messages ยท Page 212 of 1

vast raven
#

PlayerChatTabCompleteEvent in 1.16.5?

abstract rampart
#

Or a runTaskLater every time they pop a totem. Then it only runs once

glad prawn
vast raven
#

It's deprecated

round finch
vast raven
abstract rampart
#

No, client doesn't listen to the server for tab completion unless there's a /

charred blaze
#

what is it called when you launch minecraft server in editor itself and test the plugin

round finch
#

Debug?

tardy delta
#

hot reload?

charred blaze
#

hot reload?

#

what

#

why

abstract rampart
round finch
#

you can reload after exporting plugin

charred blaze
round finch
#

but some probably yell at me for this one

tardy delta
#

looking so bloat lmao ๐Ÿ™„

round finch
#

Mango is that DataBase stuff?

tardy delta
#

is there even a reason to use an uuid representation instead of the standard stuff?

#

yes

glossy venture
#

fucking filter

round finch
#

fuck

#

isn't filter me

glossy venture
#

mf

#

is filtered

#

i guese

raw prairie
#

hey, uh the send player message thing is sending multiple times

#

how could I stop that?

#

only send it one time

tardy delta
raw prairie
#
    @EventHandler
    public void onEntityDamage(EntityPotionEffectEvent e){
        if(e.getCause().equals(EntityPotionEffectEvent.Cause.TOTEM)){
            Player player = (Player) e.getEntity();
            player.sendMessage(ChatColor.RED + "[CrystalBall] " + ChatColor.GREEN + "Your shield is down! Wait 10 seconds for it to replenish!");
            Bukkit.getScheduler().runTaskLater(plugin, () -> {
                player.getInventory().setItemInOffHand(new ItemStack(Material.TOTEM_OF_UNDYING));
            }, 200);
        }
    }``` @abstract rampart
#

oh wait

#

me dumb

glossy venture
#

fuck groovy

#

my eyes are burnt because the mf warnings

#

if you cant implement type checking correctly dont implement it fucking stupid IDE

raw prairie
#

@abstract rampart doesn't work

abstract rampart
#

Also EntityResurrectEvent

raw prairie
#

?

abstract rampart
#

Basically totem use event

raw prairie
raw prairie
abstract rampart
#

bro with the pings ;-;

raw prairie
#

but how

glossy venture
#

lets go code generation

#

its horrible

#

but it works

remote swallow
glossy venture
#

holy shit this is fun

abstract rampart
# raw prairie how would I check for a totem pop?

If EntityResurrectEvent is fired, it's a totem use. I would add a print statement before your runnable declaration. If you get that print statement, the problem is in your runnable. If you don't, the problem is in the event

round finch
abstract rampart
#

They chose a terrible name

round finch
#

my bad

round finch
#

should have done google search smh

spiral light
#

Where can i see the changes between CraftServer-Class in MC-1.18 and MC-1.19 ?

undone axleBOT
fluid river
#

where can i see the noobs

tardy delta
round finch
#

cope pliot

fluid river
#

cop pilot

round finch
#

coke pilot

fluid river
#

cock pilot

round finch
fluid river
glossy venture
round finch
# fluid river

this makes me wanna make a flying Chicken in minecraft

#

you can fly on

tardy delta
#

give a chicken a tiny helmet

fluid river
#

call the plugin cock pilot

#

i love kfc

round finch
#

kfcock

fluid river
#

chick

#

EN

round finch
#

i love me some kfChick

fluid river
#

my kfcheeks are full of dope

glossy venture
#
sourceSets {
    main {
        java {
            String grd = "${buildDir}/generated/main/java"
            project.ext.generatedResDir = grd
            srcDir(grd)
        }
    }
}
``` anyone know why it isnt being picked up?
#

ive included the generated files as a source folder

zenith spire
#

hey there, what is the difference from normal advancements to recipe advancements?
I need to only register normal advancements and get completely spamed of the others.

fluid river
#

advancementdoneevent

#

getAdvancement()

#

getType()

#

might be some of those 3

#

or this one

#

basically cancel the event or smth

tardy delta
#

heeheehee

fluid river
#

you already made it accessible

#

also are you fan of no-multicatch

zenith spire
fluid river
#

this one

#

disgusting advancement system

tardy delta
#

also people doing ::isAnnotationPresent and then ::getAnnotation

fluid river
#

answer my 2 questions

#

above

#

also >> hehe nested ifs fan

tardy delta
#

what questions

fluid river
#

why

tardy delta
#

not my code

fluid river
#

oh

tardy delta
#

just looking at plugins that use mongodb now lmao

fluid river
#

cock pilot

tardy delta
sterile token
#

Lmao what that code

fluid river
#

highly obfuscated

sterile token
#

No lmao

#

That is the definition of not knowing how to code

fluid river
#

hey uuid fans

#

is it possible to have uuid

tardy delta
#

who tagged me

fluid river
#

00000000-0000-0000-0000-000000000000

#

or

sterile token
fluid river
#

FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF

sterile token
#

Its imposible because how uuid are generate

tardy delta
smoky widget
#

How can I change the texture of a placed skull ? i tried with skullmeta but it's not working

fluid river
#

if that's just a hex representation

#

you can definitely have all F's

#

cuz just a number

undone axleBOT
#

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

sterile token
kind hatch
sterile token
#

Hex is a mix of numbers and chars

kind hatch
#

Not sure if it would cause any issues though.

fluid river
#

char F represents 15

#

so

#

FFFFFF... is possible

#

i guess

tardy delta
#

UUID.fromString("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"); works

fluid river
#

what about all zeros

#

8 zeros-4 zeros-4 zeros-4 zeros-12 zeros

tardy delta
#

all zeros with the same pattern works too

fluid river
#

ez

smoky widget
# sterile token ?notworking

I have this error :

class org.bukkit.craftbukkit.v1_16_R3.block.impl.CraftSkullPlayer cannot be cast to class org.bukkit.inventory.meta.SkullMeta (org.bukkit.craftbukkit.v1_16_R3.block.impl.CraftSkullPlayer and org.bukkit.inventory.meta.SkullMeta are in unnamed module of loader 'app')

and my code is

 public static void blockheadBuilder(String texture, Block b){

        if(b.getType().equals(Material.PLAYER_HEAD)){
            Skull skull = (Skull) b.getState();
            SkullMeta skmeta = (SkullMeta) skull.getBlockData();
            GameProfile profile = new GameProfile(UUID.randomUUID(), null);

            profile.getProperties().put("textures", new Property("textures", texture));

            try {
                Method mtd = skmeta.getClass().getDeclaredMethod("setProfile", GameProfile.class);
                mtd.setAccessible(true);
                mtd.invoke(skmeta, profile);
            } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException ex) {
                ex.printStackTrace();
            }

            skull.setBlockData((BlockData) skmeta);
        }

    }
tardy delta
#

got mongodb to work lol

fluid river
#

you are casting blockdata to skullmeta

#

but skullmeta is itemmeta

smoky widget
#

But for a block you have to use what because I have looked at the forums and I can't find anything that works

fluid river
#

skullmeta is for itemstack anyways

#

you'd better create own skull itemstack

#

and work around it

smoky widget
#

I have already created a function that allows me to create custom head itemstack I based on that except that it is not possible to setblock with

hybrid spoke
#

org.bukkit.craftbukkit.v1_16_R3.block
org.bukkit.inventory

fluid river
#

good luck

smoky widget
#

Yes I know that except that if I put setowner I could not put texture no?

hybrid spoke
#

it will get the texture of the owning player

fluid river
#

my friend put texture of pipe on my skin

#

so i only have pipe head and no body

#

๐Ÿ˜‰

hybrid spoke
#

and no life

fluid river
#

and well, he used this texture in his pipes plugin

hazy parrot
fluid river
#

we already discovered it

#

all zeros and all f's work

hazy parrot
#

fuck discord scroll

flint coyote
# fluid river ez

Now make a random generator and see how long it takes to actually get that UUID

hybrid spoke
#

L

smoky widget
#

I think i should use setownerprofile except that it is not available in 1.16 :/

hybrid spoke
#

bet not

fluid river
#

make random uuid generator?

#

10 lines

hybrid spoke
#

no to get this uuid

fluid river
#

UUID.fromString()

flint coyote
#

UUID.randomUUID()

fluid river
#

oh

#

i see

#

you want to loop until you get this uuid

#

from random

tardy delta
#

probably takes a few days

hybrid spoke
#

but my question is not the how, but the if

flint coyote
#

I mean there's only 2^122 possible UUIDs. Will surely get it in a minute or 2 /s

hybrid spoke
#

since UUID is made out of the current timestamp with some extras

fluid river
#

also random can give you same uuid twice

flint coyote
#

"few" years

fluid river
#

so...

hybrid spoke
#

just if you would generate ~2B a sec

fluid river
#

i will just

hybrid spoke
#

then you could have a collision

fluid river
#
import java.util.UUID;

public class Main {

    public static void main(String[] args) {
        System.out.println(System.currentTimeMillis());
        UUID myFUUID = UUID.fromString("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF");
        UUID id = UUID.randomUUID();
        while(!id.equals(myFUUID)) {
            id = UUID.randomUUID();
        }
        System.out.println(System.currentTimeMillis());
    }

}```
hazy parrot
#

undefined variable ๐Ÿคช

fluid river
#

done

tardy delta
#

i would probaby use TimeUnit.YEARS

fluid river
#

i don't remember

tall dragon
#

its java.util

fluid river
#

done

hazy parrot
#

use do while ๐Ÿ’ข

fluid river
#

why

vocal cloud
#

Just use a db system with an increment

fluid river
#

just build a supercomputer

#

and write on c

flint coyote
fluid river
#

๐Ÿ˜ญ

#

currentTimeMillis

#

still

#

i guess i'd better switch to string mafs

flint coyote
#

nah millis should be fine

tardy delta
#

jit will optimize so hard

fluid river
flint coyote
#

Long.MAX_VALUE leads to Sun Aug 17 08:12:55 CET 292278994 as a date. So you still got 292.276.972 years left for your result

tardy delta
#

๐Ÿ˜

hybrid spoke
#

im at around >> 11189327 generations and still didnt found one with nearly the same letters

wary topaz
#

Quick question, can I add commands to config.yml? (Initalize) And not plugin.yml?

fluid river
#

time to run

tardy delta
#

you can inject them in the commandmap if they werent defined in plugin.yml on start

#

reflections time

flint coyote
# fluid river

now overengineer it and compare every character by itself and show how close you have been to your goal with each generated one (e.g. how many Fs you got or even better: Add up how far you have been on each. E is off 1 D is off 2 etc.)

hybrid spoke
# flint coyote now overengineer it and compare every character by itself and show how close you...
    public static void main(String[] args) {

        boolean diff = true;
        UUID same = null;

        long index = 0;

        while(diff) {

            same = UUID.randomUUID();
            System.out.println(same + " >> " + index++);

            diff = hasDifferentLetters(same);
        }

        System.out.println("Found one: " + same + " >> " + index);
    }

    private static boolean hasDifferentLetters(UUID uuid) {

        char[] chars = uuid.toString().toCharArray();

        char first = chars[0];
        for (char c : chars)
            if (c != first)
                return true;

        return false;
    }

sadge

fluid river
#

println slows program down

tardy delta
#

comparing longs would be faster

#

println slow asf

flint coyote
#

nah make a diff function that returns an int and calculate the diff characterwise

flint coyote
fluid river
#

my laptop

#

it's heating up

flint coyote
#

You B's are broken

fluid river
#

russian

#

ะ‘

flint coyote
#

ye ik

mellow edge
#

Hi, any simple way to make clickable text in spigot? (without apis)

fluid river
#

we copied from greek ะฑ

#

i guess

mellow edge
#

I searched on formus and found not many userful things

hybrid spoke
#

or whatever its called

fluid river
#

Component with ClickEvent

#

hey guys can maybe i can add some JVM flags

#

to increase speed of this sheed

quaint mantle
#

Hey guys Can I add tab list group like this?

hybrid spoke
sterile token
#

What are u trying to do?

fluid river
#

it still runs sadly

sterile token
flint coyote
# hybrid spoke ik but who cares

for something like that it really matters. You will easily have times 10 of your runtime by printing every result.
Ik this is all a joke so it doesn't really matter but usually it would

sterile token
hybrid spoke
#

code performance is literally my specification

wary topaz
#

?jd-s

undone axleBOT
wary topaz
#

i just needed the link

sterile token
tardy delta
#

id want to see how many uuids could be generated in one second

sterile token
tardy delta
#

with heating up jit

tardy delta
#

verano, why dont you put your (idk i forgot the name) region plugin on github?

fluid river
#

i'm tired

#

closed my uuid cringe

sterile token
#

Im still finishing it

#

I have been working on it 4 months right now

#

๐Ÿ˜‚

tardy delta
#

2 million instances per second?

sterile token
#

fourten

#

is pojo working for u?

vocal cloud
#

Mongo Pojo?

tardy delta
#

yes but i hate that you need everything mutable cuz its too stupid

#

i probably wont use it

sterile token
#

is easier and works perfect

tardy delta
#

ye

#

thinking about a new plugin where ill implement it

#

hmm how does this work?

#

ah need to synchronize it

#

synchronizing it takes 500k less instances per second kek

hybrid spoke
sterile token
hybrid spoke
tardy delta
#

thread t might have it in its own register, which is not reflected with the main state

#

so volatile keeps count in the main memory

hybrid spoke
#

not directly

#

count will always be in the main memory

#

but each processor has its own cache

#

volatile tells them to not cache this variable and keep the updates to the main memory

tardy delta
#

ye that

#

im explaining it weird but ik how it works

flint coyote
#
public static void run() {
        UUID bestResult = UUID.fromString("00000000-0000-0000-0000-000000000000");
        UUID fullFUUID = UUID.fromString("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF");
        UUID uuid;
        do {
            uuid = UUID.randomUUID();
            if (uuid.compareTo(bestResult) > 0) {
                bestResult = uuid;
                System.out.println("Best result: " + uuid);
            }
        } while (!uuid.equals(fullFUUID));
    }```
Time to wait
#

in 5 mins the closest I got is 7ffffffb-e5a5-47e1-b82f-ae4378fcf02d :( didn't even get the most significant F

round finch
#

lol
reads your own error

#

deletes messages

flint coyote
#

Wanted to document the error for eternity and then decided not to

sterile token
flint coyote
round finch
#

yes

echo basalt
#

just for faster efficiency

round finch
#

it was actually naming xD

#

literally same method

tardy delta
#

wondering if theres a max amount of Threads in java

round finch
#

in everyway

echo basalt
#

uhh

#

the fork commons pool is just CPU Thread Count - 1

flint coyote
echo basalt
tardy delta
#

and how many threads would a cpu have ๐Ÿค”

echo basalt
#

grab a threadripper

mighty pier
#

wtf!!!

echo basalt
#

๐Ÿคฆ

flint coyote
#

It even tells you what's wrong

echo basalt
#

read the error message

tardy delta
#

rename it lmfao

mighty pier
#

cum!!!

smoky anchor
#

Hello ppl!
Is there any non-NMS and non-manual way of getting item burn duration and item cook time ?

echo basalt
#

I'll start cursing like a 14 year old if you ask once more

round finch
#

learn java moment

tardy delta
#

also where is stringbuilder

round finch
#

XD

smoky anchor
flint coyote
#

You are using generics that get erased for the JVM so you basically have public String arenasToString(List arenas) twice

tardy delta
#

in rust every generic type gets it own 'class' or smth iirc

#

wtf is wrong with mongo that they cant just use T

round finch
#

so many problems here

tardy delta
#

just having that method gives me headaches

#

dont tell me youre throwing that shit into a db

#

last time i saw someone throwing json into a db

round finch
#

saw a json in a yaml

#

:)

tardy delta
#

yaml is basically json lol

round finch
#

seems kinda pointless lmao

tardy delta
#

people are weird

#

and fuck holiday has ended

round finch
#

next holiday soon

#

mfecker

tardy delta
#

back to college tmrw

round finch
#

the end of this month

tardy delta
#

kek

flint coyote
#

Still running, got to 7fffffff-a189-4016-9e62-0f17b88f232d now x.x

echo basalt
#

I wonder if it's possible to display an abstract polygon shape by making a fancy png ๐Ÿค”

#

like a top-down bit where the R value represents the amount of blocks in the Y axis

#

G would be like how many interrupted blocks we'd have

#

idfk

#

just some extreme compression algorithm

mellow edge
#

20 ticks is one second?

sterile token
wet breach
echo basalt
#

uhh

#

basically minecraft is a voxel game yeah

#

and we can consider each block a voxel

#

How would we go about compressing an abstract (random-ish shape) in an extremely efficient way

#

Right now I'm using something I call "line regions" where each X-Y point has a set of palleted lines in the Z axis

wet breach
#

Well, MC already uses compression, as well as re-arranges how coords are stored

echo basalt
#

Yeah but I only need a very specific area

#

like just the glass here

wet breach
#

but if you want to store something more efficiently, you would start with Y, since it is typically the smallest in most cases

#

and then x,z

smoky anchor
echo basalt
#

I basically want to represent the area in as little ram as possible

#

While still having up to an O(N) contains check

#

Line regions are good and all

#

But storing it to a file still gives me like 20k entries

#

for the bigger regions

wet breach
#

it should return how long it will take to cook

echo basalt
#

I was also thinking on how an algorithm that just represented the entire region in as few cuboids as possible would go

wet breach
echo basalt
#

still

wet breach
#

but MC already stores chunks in that time you are wanting

echo basalt
#

I'll eventually have to store block data per user on the database

wet breach
#

and compresses

echo basalt
#

The thing with MC chunks is that it stores data in a cuboid form

#

with pre-set sizes

wet breach
#

yes, in O(n) time

echo basalt
#

I don't know the size of the region here

#

or... the shape of it

#

necessarily

#

I can do some basic parsing

#

And convert to a cuboid which is essentially what I do

wet breach
#

And the way MC does it still works for you want

echo basalt
#

ehh

#

Not necessarily

wet breach
#

there isn't a way to get better then O(n)

echo basalt
#

I know

wet breach
#

which is what MC already does

echo basalt
#

But MC also stores a lot of unecessary data

round finch
#

if it is a cube easy 2 location points

echo basalt
#

and some stuff that isn't relevant

ancient plank
#

1(1)

wet breach
#

I am not saying store all the extra stuff

#

just don't store the extra stuff, use the same mechanism MC does

#

it is literally what schematics use

#

reason why they are relatively small given what is stored in them

echo basalt
#

Even schematics store air data

wet breach
#

not all of them do

echo basalt
#

ehh

#

they do

#

your copy doesn't

round finch
#

save -a

echo basalt
#

but they still store data internally

wet breach
echo basalt
#

FAWE for example stores air data

wet breach
#

you are assuming only one plugin can do schematics

echo basalt
#

because the default block state is air

wary topaz
#

sender.sendMessage("ยงaยงlYou gave " + ? (target.equals(Player)) "yourself" : target.getName() );
How would I do this?

echo basalt
#

Even if you don't copy the air data

#

I can't use cuboids in my case as I'll have multiple areas next to each other and they can overlap

wet breach
#

in either case you are just making excuses in why you can't use something that is already efficient

round finch
echo basalt
wary topaz
#

its a give command so if your the arg.0 i want it to say yourself

old cloud
wet breach
wary topaz
#

okie

#

[?(target.equals(Player)) "yourself" : target.getName()]
like this?

old cloud
#

like this

wary topaz
#

yes thank you!

echo basalt
#

y'all mfs don't know how to use the ternary smh my head

#

target.equals(player) ? "yourself" : target.getName()

round finch
#

Sender player name

old cloud
round finch
#

smh

echo basalt
#

condition ? case1 : case2

wet breach
#

lol

old cloud
#

yea you forgot the condition

#

but you will need the brackets too

echo basalt
round finch
#

if you are sending command

fluid river
round finch
#

that is you

#

smh

wet breach
fluid river
#

there are just some noobs who don't know how to use ?

#

not everybody here

wary topaz
#

sender.sendMessage("ยงaยงlYou gave " + target.equals(sender.getName()) ? "yourself" : target.getName());
It's erroring anyone know why?

#

Incompatible types. Found: 'java.lang.String', required: 'boolean'

old cloud
echo basalt
#

I have this abstract shape (just the glass blocks) that are flood-filled into a Set<BlockVector>

How would I go about minimizing that Set<BlockVector> into a Set<Cuboid> of a very low size

wary topaz
#

thank you ;D

wet breach
echo basalt
#

I accept either:

  • The lowest cuboid count possible
  • The largest cuboids possible, regardless if it adds some extra cubes
round finch
#

@wary topaz

Player p = (Player)Sender;

p.getName() ez

fluid river
#

true

echo basalt
#

Right now my solution is good enough but not perfect, which maps each X-Y point to a Set<Line> where each line is just a range on the Z axis

fluid river
#

but p.getName() won't turn into "yourself" ya know

echo basalt
#

I need to handle stuff like random holes in the set

wet breach
round finch
pine forge
#

Is there a way to check if the player is looking at the moon?
Maybe by assuming the position of the moon based on the game time?

fluid river
#

yes

wet breach
#

the server doesn't send the client a chunk, like you think it would, instead it sends it columns of a chunk with Y being the only factor

fluid river
#

you just get players yaw and pitch

echo basalt
#

I know yeah but I'm saying like

#

The server doesn't group blocks together

pine forge
echo basalt
#

It just... sends them individually

#

on the column

#

It doesn't say like

fluid river
#

well you would need to manually check it

pine forge
#

manually?

wet breach
echo basalt
#

"0.0.0 -> 15,15,15 is DIRT. 16,16,0 is ANVIL, rest is AIR"

#

I don't mind the extra processing

round finch
#

use time

#

that how

fluid river
#

i mean you need to get what time is it when moon is right above you

echo basalt
#

As long as the end result is easy to run checks on

wet breach
#

it doesn't do it one block at a time on a column

echo basalt
#

It sends lines not cubes

fluid river
#

ya know @echo basalt , there was some guide about how some developers made chunk system. It's not just block positions, and not even "lines".

#

I'm gonna google and share it

#

it's kinda complex

#

but might help you

wet breach
echo basalt
#

That's what I want to do

#

Grab a set of lines and convert it into the lowest amount of cubes

#

Imagine sending chunks by the largest cubes of blocks instead of sending each column individually

wet breach
#

Well the server ignores large sections of air already when sending those columns

bold gorge
#

Hello, What is the class "Content" supposed to be? (located in net.md_5.bungee.api.chat.hover.content.Text.java)

public class Text extends Content { ... }
//                        ^^^?^^^
echo basalt
#

I don't care about the air blocks grr

#

Think of this shape

echo basalt
#

We can just send lines like this

#

but my idea is to make a huge cube represented by the 2 corners where the red points are at

round finch
#

why not just skip air?

echo basalt
#

so that we're left with another section which we can turn into 3 more cuboids

echo basalt
wet breach
# echo basalt Think of this shape

it wouldn't be any more efficient or less efficient to send blocks in the order of most to least since of how networks work. In the regards of storing however, it is generally better to store from least to greatest and not the other way around

echo basalt
#

This has nothing to do with chunk packets or sending blocks T_T

#

It has to do with representing abstract regions

pine forge
# pine forge

How can i convert the ingametime to a position of the moon?

tardy delta
#

i think i understand the idea, youre trying to store a shape in as little as possible rectangles that are as big as possible?

echo basalt
#

That entire example I sent can be represented as 4 cuboids, which represent 43 blocks

tardy delta
#

then at the point rectangles arent possible anymore, just storing blocks

echo basalt
#

It's about a 10.75 compression ratio

tardy delta
#

believe it but i dont want to be the person who has to implement the algorithm

#

ye i get it

echo basalt
#

my current implementation can represent it in about 4 line objects

#

but it still needs like 19 horizontal point instances

wet breach
#

you keep using terms that not exactly the appropriate ones to use o.O

tardy delta
#

how do those lines work? similar to rectangles?

round finch
#

oh saving cpu and ram?

echo basalt
#

uhh somewhat

#

basically it just makes lines like these

#

And stores the lines to a palette

tardy delta
#

so 1*1* some length?

echo basalt
#

yeah

#

so this is all considered 1 line

#

but on 17 different positions

tardy delta
#

cant you just extend that so those lines look for neearby blocks which could be added?

#

1 line huh

pine forge
#

Is there an event for when a player changes the direction theyre looking at?

echo basalt
#

and these are the other 2 lines

#

on 2 more positions

tardy delta
#

i thought a line was 1*1

echo basalt
#

well they are

tardy delta
#

or you mean 17 line instances or whatever

echo basalt
#

the master cuboid just helps speed up contains checks

tardy delta
#

primitive generics when

wet breach
#

use a conccurent collection method

#

to speed up such things

zealous osprey
# echo basalt eh

So basically a vector, where it's start and endpoint represent a corner of the cuboid?

echo basalt
#

Yeah

tardy delta
#

make it super slow and then feed it to a threadpool yummy

echo basalt
#

The flood-fill part is multi-threaded, parsing the line regions is not

#

I guess my next objective is to group HorizontalPoints where the line region is the same

#

but how would I go about converting all the points into a set of cuboids

zealous osprey
#

what are you even making?

echo basalt
#

stuff that is way too fancy

wet breach
#

they are basically wanting to come up with a whole different system to store stuff

#

because you know they want to

#

not that it is any better or anything

zealous osprey
grand flint
#

How can I check if the user accepted a resource pack?

tardy delta
#

anyways is there a reason to use an uuid representation other than the default in mongodb?

tardy delta
#

so? :)

#

ik it saves it to some format internally and is able to get it back to an uuid but im just wondering where the representation is for

wet breach
#

MongoDB generates BSON UUID's or it can and therefore answers is there a reason to use something other then the default and the answer is yes

#

because BSON UUID is smaller at 4 vs 36

tardy delta
#

so im fine using this?

wet breach
#

also BSON UUID is already binary

#

so no conversions

wet breach
tardy delta
#

it just looks different when looking at it in mongodb compass thing

wet breach
#

lol

tardy delta
#

like bindata vs uuid, its just smth i saw idk if its important

static ingot
ancient plank
#

player move event triggers when a player turns their head

pine forge
static ingot
serene sigil
#

whats the best way to make a while() loop (with a boolean) in spigot?

dry forum
#

whats the best way to allow aplugin to work on spigot & bungee? should i make a module for each?

vocal cloud
#

Man mongo and it's enormous IDs lol

static ingot
wet breach
flint coyote
#

Then they do something that takes too long for a tick

wet breach
#

the only reason it would be relevant is it depends what you are doing, but in most cases you are better off with using the event

static ingot
# serene sigil well, they lag the server

yea, because it's going to stop everything so it can finish your for loop. if you want to do something over a period of time in Spigot, you'd schedule a task with BukkitRunnable

serene sigil
#

and then detect stuff

ancient plank
#

things and stuff stuff and things

wet breach
#

you don't need a while loop to detect most things in an inventory

serene sigil
#

wdym?

static ingot
#

nvm

pine forge
serene sigil
#

lol

wet breach
ancient plank
#

I'm ngl the only time I've used a while loop in java was when doing user input in a cmd prompt

flint coyote
#

you can use events to detect things in an inventory

static ingot
#

Yeah, I mixed up comments while reading up again and doubted myself

#

maybe i shouldn't try to help here while smoking, lul

serene sigil
flint coyote
wet breach
ancient plank
#

I don't do database stuff, but true. I forgor about some of the matcher regex stuff I do

sterile token
wet breach
#

for instance, a scenario where you might want to have such a loop is when a player is looking inside say a donkey chest and the donkey disappears

#

you want to close the inventory if that happens

sterile token
#

I think that Mongo library is coded better than SQL libraries

wet breach
#

MC doesn't do that in some cases, like if the player happens to teleport away lmao

flint coyote
wet breach
sterile token
#

Is Location#toVector() an intensive operation?

wet breach
#

SQL is pretty good, where people go wrong is making use of inefficient methods for SQL because SQL doesn't do that stuff for you

#

or setting up DB's in an inefficient way

#

or not making use of foreign keys

flint coyote
wet breach
#

or even primary keys

flint coyote
#

a foreign key doesn't have an index by default. A primary key does

sterile token
wet breach
#

foreign keys links data that is relevant together

flint coyote
#

I know what a foreign key is and that there's only one primary key

#

but foreign key doesn't help performance at all. It only validates

wet breach
#

so if you have lets say 2 tables for users, some data between them is relevant together even though they are stored separate

#

a foreign key would aide this

flint coyote
#

Unless you set an index on your foreign key field

wet breach
#

not sure who told you otherwise, however if you set foreign keys on everything or over use it, you would be correct in that it could hurt performance

flint coyote
#

Why would a foreign key help performance? The only thing it tells the DB is that there MUST be a fitting value on the related table

#

It can and will still result in a full table scan if there is no index

wet breach
#

Foreign keys put the โ€œrelationalโ€ in โ€œrelational databaseโ€ โ€“ they help define the relationship between tables. They allow developers to maintain referential integrity across their database. Foreign keys also help end-users by preventing errors and improving the performance of any operation thatโ€™s pulling data from tables linked by indexed foreign keys.

sterile token
#

pulling data from tables linked by indexed foreign keys

flint coyote
#

Well yeah they keep the database clean which is good for performance. But if your database is clean (without them) then there won't be an improvement

wet breach
#

Which goes back to what I said in people don't setup DB's efficiently

wet breach
#

unless you have a small DB

flint coyote
#

That's not about the db. It's about how you work with the db

wet breach
#

then it which case doesn't really matter much, but when you have a large DB however not feasible because in most cases that involves duplicate data

flint coyote
#

gotta go for a sec. will be back in like 15 min

wet breach
#

I will continue to recommend people using Foreign Keys where they are suited ๐Ÿ™‚

wet breach
serene sigil
#

can u detect from a Player variable if that player has an inventory currently open?

wet breach
#

can't move head position with an inventory opened

wet breach
#

hmm, guess it sends it now

#

I suppose you could use that

serene sigil
#

so like make a boolean (cuz i only need to detect one certain player) and set it to true while they have the inv open?

wet breach
#

however if you are making something that encompasses older versions, the older versions don't report when the inventory was closed but I suppose that event works for updated versions

cobalt thorn
#

hi a question for a checking a message some player can bypass for example like H e L l O but the plugin only detect hello or in caps how i can prevent this from happening or with numbers?

wet breach
#

you would need a more advanced regex

cobalt thorn
wet breach
#

the other dude isn't trying to do stuff with chat, therefore what would they need a regex for?

cobalt thorn
wet breach
#

the answer for you is simply you need a more advanced regex

#

however you are going to spend a lot of time on creating such a thing for chat filtering that it will most likely be the thing that lags your chat or possibly your server depending how you do it

little panther
#

Hey is there an Event i can use for when a player die that can give me information about what entity it was that killed the player?

cobalt thorn
#

mostly im trying to understand how i can change the number to words and trying getting the correct one

ancient plank
#

chat filtering SUCKS

ornate mantle
#

?stash

undone axleBOT
wet breach
wet breach
#

that event runs before the death event happens

ornate mantle
#

how do i see sources of older versions

flint coyote
#

Don't get me wrong. I'm not suggesting to be like "I do everything right - I don't need foreign keys". I just wanted to mention that an index on a foreign key is the way to go most of the time. You can do it without an index for small tables or for tables that you don't call select on very often

serene sigil
#

why tf does this not loop?????

vocal cloud
smoky widget
#

why java say 59/60*238 = 0 but windows calculator say 234

eternal oxide
#

integer division

#

59L/60*238=234

honest badge
#

how would i go about making a custom anvil recipe

#

when I use .setresult in anvilprepareevent

#

the item shows up

#

but i am unable to interact with it

smoky widget
# eternal oxide 59L/60*238=234

so i need to do : int dura238 = ((long)icont.get(dura, PersistentDataType.INTEGER) / icont.get(maxdura, PersistentDataType.INTEGER)) * 238; ?

sterile token
#

There is no way to get explosion location?

eternal oxide
crimson terrace
#

probably typed it in differently on the windows calc

smoky widget
#

oh yeah

#

thx

crimson terrace
#

actually no the windows calc doesnt round in between operations

#

thats the reason

smoky widget
#

yeea it work thx you !!

wet breach
#

when doing math such as that you need to use things like floats or doubles

#

so that decimal isn't just like axed off

#

you can use an integer but you need to use Modulo to do so

keen basin
#

i use !e.isCancelled() for block place event because I have worldguard plugin but it didn't work always returns true

static ingot
#

It doesn't address your problem, but you can also set ignoreCancelled to true in your EventHandler annotation so you don't have to make a check yourself

rare rover
#

anyway to improve the performance of this? It's still really good but im worried about like sorting 2000 variables

#
        for (String s : list) {
            UUID uuid = UUID.fromString(s.split("::")[1]);
            if (isLoaded(s)) {
                Variable var = VariableAPI.getVariableorCreate(s, 0);
                sorted.put(uuid, var.getParsedLong());
                continue;
            }
            sorted.put(UUID.fromString(s.split("::")[1]), VariableSave.getJson().getLong("storage." + s));
        }```
sterile token
rare rover
#

im sorting

#

but there

#

im grabbing the variables

#
    public static Map<UUID, Double> sortDoubleVariables(String name) {
        Map<UUID, Double> sorted = new HashMap<>();
        var list = getAllVariables(name);
        for (String s : list) {
            UUID uuid = UUID.fromString(s.split("::")[1]);
            if (isLoaded(s)) {
                Variable var = VariableAPI.getVariableorCreate(s, 0);
                sorted.put(uuid, var.getParsedDouble());
                continue;
            }
            sorted.put(UUID.fromString(s.split("::")[1]), VariableSave.getJson().getDouble("storage." + s));
        }
        return sorted.entrySet().stream().sorted(Comparator.<Map.Entry<UUID, Double>>comparingDouble(Map.Entry::getValue).reversed())
                .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (value1, value2) -> value1, LinkedHashMap::new));
    }``` here's the whole thing
#

works fine but im worried about performance

sterile token
#

What does that do?

rare rover
#

it just sorts variables, let me verify so i can send images

#

this is my old account but whatever

#

@sterile token ^^

#

it sorts the variables

#

but is there a better way of doing it?

#

since im worried about performance

#

since that's only 2 variables

#

im planning on sorting 2500 variables

#

ish

slow oyster
#

Hey guys, is there an api to use for custom localisation in plugins? For my last plugin I sort of rolled my own but wondering if there's anything else I don't know about

sterile token
#

I dont still understand it

rare rover
#

๐Ÿซค

sterile token
#

"custom locasilation"?

#

๐Ÿค”

rare rover
#

All im asking is if theres a better way of doing that and if that will cause a lot of lag while looping 2500 variables

sterile token
rare rover
#

I dont think it would but i used to use skript and im always worried about performance which probably shouldn't be my biggest concern

rare rover
sterile token
#

Hmn i dont still udnerstand why you need that

rare rover
#

Because im using a class for variables so i gotta retrieve the variable name then its value, or if the variable isn't loaded onto the memory it'll get the variable value from the storage file

#

Im guessing it'll be alright but im just double checking

#

Since everytime the player leaves all their variables get unloaded from the memory to minimize memory leaks

sterile token
#

How to ignore a specific file inside sub folders with .gitnogre?

twilit wharf
#

I am trying to remove a single item from an inventory, and give a percentage of the buy price depending on its durability. Currently, it comes with an error saying that ItemMeta cannot cast to Damageable ```java
for (ItemStack item : player.getInventory().getContents()) {
if (item == null) {
continue;
}

if (item.getType() != keys.get((finalX * 6) + finalY)) {
continue;
}

Damageable meta = (Damageable) item.getItemMeta();
conquest.get().addGold((int) (weapons.get(keys.get((finalX6) + finalY))(meta.getHealth()/meta.getMaxHealth())));
item.setAmount(item.getAmount() - 1);
break;
}

frail gale
#

what's the logic behind waiting 1 tick and then reopening an inventory?

full forge
#

is there a way to unregister an event listener?

frail gale
full forge
#

thanks

frail gale
full forge
#

yeah i wasnt thinking, lol

mellow pebble
#

Hi im using api from github for tablist (since i dont know how to use NMS) and there is some PacketPlayOutPlayerInfo but im not sure from where should i import it

#

i dont even have any sort of like import suggestion

#

i can just search for JAR on web

#

but we all know that is pointless

#

so any ideas what dependency i should add or something

#

also EntityPlayer

subtle folio
#

That is nms

#

?nms

#

whatโ€™s the prefix

#

!nms

#

-nms

#

here you go

mellow pebble
#

PacketPlayOutPlayerInfo or EntityPlayer

#

or even both

subtle folio
#

Both

#

EntityPlayer might not be if you can import it regularly i havenโ€™t checked.

#

but CraftEntity is apart of nms

mellow pebble
#

and really i cant find nothing

subtle folio
#

Send me the api you are using

mellow pebble
#

but im 100% sure i have found something

mellow pebble
subtle folio
#

Iโ€™m not sure I fully understand your question

mellow pebble
#

it is kinda old

#

but i really dont have many options to implement to my plugin

subtle folio
#

I see

#

you can take the jar it gives you and add it to your intelliJ project and server

#

but if itโ€™s not any of the supported versions I doubt you will have any luck

mellow pebble
mellow pebble
subtle folio
fresh timber
#

How can I get the characters from the last character of a string in a lore to the end of the line that that string of the lore is in if the lore contains that string?

subtle folio
fresh timber
#

well the last few letters

#

ok

#

ill tell u exactly what im doing to explain better

#

I have pickaxes that you upgrade through and I want to get the number after the string "&8pick_tier: " so I can get the tier of the pickaxe to see what pick to give them next

#

xd

subtle folio
#

^ for storing levels on an item this would be more efficient

fresh timber
#

I think I have an idea

sterile token
copper hemlock
#

How can I open an inventory in AsyncPlayerChatEvent?

undone axleBOT
copper hemlock
#

Its not possible with runTask

sterile token
subtle folio
#

Why canโ€™t you just schedule a run task later with your inventory ?

sterile token
#

either that, or doesnt know how to use DI

copper hemlock
#

I am using runTask

#

I'll try runTaskLaker

#

its a class of mine

#
public void openInventory() {
        this.player.openInventory(this.inventory);
    }```
#

which code?

undone axleBOT
sterile token
#

Send full code please

#

if not its imposible to help

copper hemlock
#

I think it might be because the Chat event is async

#

and openInventory is sync

#

idk

sterile token
#

Yu have to run full code on the scheduler

#

There you are doing "async + sync + async"

copper hemlock
#

I see

#

I'll try

sterile token
#

You have to move everything into the schedule

#

so would be:

void event(Event event) { runTask(plugin, () -> { all other cod ehere }) cancel; }

#

ok my bad

#

runTaskLater() queue them right?

copper hemlock
#

It worked, thx a lot guys

sterile token
#

Have a good day sir

copper hemlock
#

You too ๐Ÿ™‚

sterile token
#

So here you learn, that when you have async things you must run all of them async, if not you will have concurrency problems (if im not wrong)

#

is it called concurrency? or ima wrong

#

Also why the heck InventoryHolder allows me to call the methods from a class implementation?

#

yeah

#

๐Ÿค”

#

where i casted it?

#

oh ok

#

I didnt kno that tho - thanks

#

Wait now i have a dude

#

How would i know if the event holder equals to one of my InventoryMenu repository?

#

the holder returned from the event*

#

ik that, but i have a Set<InventoryMenu> as repository

round finch
#

getTopinventory == your inventory?

#

But what verano wants

sterile token
round finch
#

Isn't that for string?

sterile token
#

wait wait

#

That is my repository

#

You understand now?

#

"Im asking how i get a MenuInventory instance from the repository using InventoryHolder"

round finch
#

If inventory contains in map?

sterile token
#

Elaborate more please

#

Yeah i seen that

#

So i need to use that method right?

#

Hehe now having lambda problems i love them!

#

hehhee

#

Yeah my bad i realize that

round finch
#

Just thinking about something

What the quick way to get any angry entity

#

Does that return anger?

#

If any entity angry
Make happy

#

Just for lolz

#

So there is an event? Nice

#

Share

#

I wanna take a look later day

#

Gimme both

sterile token
#

send pack

#

thanks

round finch
#

Reminder for later..!

#

Thank you for being helpful

sterile token
balmy valve
sterile token
#

urls*

mellow pebble
#

So im using TabAPI which allowes me to use old tab look and that i can modify it on spesific way i have added everything as it should be as i assume but i get this on start of my plugin

undone axleBOT
molten hearth
#

does anyone know how to change the java version that gradle uses with intellij

#

shit keeps trying to use java 8 when the project version is 17

#

bruh its the ch4r0n guy again lmao

balmy valve
#

gradle.properties I would imagine

sterile token
mellow pebble
# sterile token ?1.8

yeah yeah i know 1.8 is not supported anymore and i know it is old and only reason that im using it is because minigame is pvp oriented so im going with it ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

sterile token
sterile token
#

You will get lot of headaches

#

1.8 is so fucking old

mellow pebble
sterile token
balmy valve
#

build.gradle

molten hearth
#

java.toolchain.languageVersion = JavaLanguageVersion.of(8)

#

bruh

#

I didnt see this

#

maybe this makes a difference

#

maybe it doesnt

mellow pebble
molten hearth
#

FUUUCK

#

it doesnt

balmy valve
#

try there maybe?

#

I don't use gradle much I was only just messing around with architectury and their build.gradle uses this to do java 17

balmy valve
mellow pebble
molten hearth
#

yea

#

its trying to compile to java 8

mellow pebble
molten hearth
#

kinda gay

mellow pebble
#

and see what you have put there

#

it was a problem for me lately

molten hearth
#

Its already 17 there too I checked earlier

#

F

mellow pebble
molten hearth
#

cause it doesnt make a difference lol

#

any java thats 17 is fine for me

mellow pebble
#

ehh yeah i guess so

balmy valve
molten hearth
#

not yet that structure is very different to mine

balmy valve
#

yeah this one does some fun stuff

molten hearth
balmy valve
#

yeah no ideas here

#

gl

molten hearth
#

๐Ÿ˜‚

#

tx

mellow pebble
#

why is gradle even a option

#

maven is 100 times easier to use

#

and easier to find everything you need

rare rover
#

?packets

#

Oop

#

Sadness

#

Anyone got a good tutorial on 1.19 packets?

mellow pebble
#

maybe kody simpson has something

#

he does some tutorials here and there

rare rover
#

He does but he using spigot's nms, im using a mapped version of mojangs

#

Because im using paper since it has better performance

#

But i cant find any tutorial on it

eternal night
#

you can translate between classes in spigot mappings and mojang mappings

rare rover
#

True

fallow violet
#

is there a way to check permission with only having uuid of offline player?

#

i need it in AsyncPlayerPreLoginEvent

eternal oxide
#

not really

fallow violet
#

ah shit

eternal oxide
#

you would need to directly access your permission plugin and query it

fallow violet
#

yeah im on it but im too idiot for that xd

sterile token
fallow violet
#

i do but its too complicated lmao

eternal oxide
#

simplest is to hook vault and require that

#

or change your plugin design so you don't need the permissions that early.

fallow violet
#

i got

#

it

#

my problem was that i runned something async but its need to be sync

sterile token
#

We already tell that a guy

#

When something is run async, you must run your code async. If its sync your code should be run sync

dry forum
#

whats the best way to allow aplugin to work on spigot & bungee? should i make a module for each?

wary topaz
#

How can I update the existing config file ?

#

getconfig.setDefaults?

hazy parrot
#

Just set(path, value)?

wary topaz
#

A string list?

#

I'm trying to add or remove something from a string lisdt

#

list*

#

will that work?

#

oh wait it does

#

thanks

#

Anyone have the slot numbers for the gray glass panes? just to save me time

golden turret
#

no need to use the + in the string too

#

I break the lines just to make it better to see

wary topaz
#

๐Ÿ˜ฎ

#

thank you ๐Ÿ˜„

golden turret
#

๐Ÿ‘

wary topaz
flint coyote
#

it wants an itemstack

#

new ItemStack(Material)

wary topaz
#

thank you

raw prairie
#

how might I use getLineofSight?

#

for detecting if there is a block in front of the palyer?

#

my current code

#
                        List<Block> sight =  player.getLineOfSight(null, 2);
                        if (event.getItem().getItemMeta().equals(ItemManager.GravHammer.getItemMeta())) {
                            if(sight.contains(null)) {
                                Location playersDirection = player.getLocation().add(player.getLocation().getDirection().multiply(2));
                                player.getWorld().createExplosion(playersDirection, 5f);
                                System.out.println("I work");
                            }```
#

im stumped here

flint coyote
#

as per documentation you get air only if you set null for the materials

raw prairie
#

so how do I set the explosion to create if it is 1 block away

#

or theres a block in the way

flint coyote
#

So you want it to explode if there is a block within 2 blocks range?

raw prairie
#

if there is a block within that range

#

or below

flint coyote
#

then do if(sight.isEmpty())

raw prairie
#

how would I spawn it on that block

flint coyote
#

ok wait it returns a list of blocks

raw prairie
#

yea

flint coyote
#

so basically you want an explosion only if:

  • the first block is air && the second block is an actual block
    right?
wary topaz
raw prairie
#

if there is a block on the first or second

#

spawn it on that block

wary topaz
#

line 79

#

and 80

flint coyote
raw prairie
flint coyote
#

ah I see

raw prairie
#

I already ahve that down

flint coyote
#

then basically get 3 blocks in line of sight

raw prairie
#

but it doesnt check for blocks