#help-development

1 messages ยท Page 520 of 1

karmic salmon
#

bruh

rigid vault
#

hi

remote swallow
#

you need the instance elsewere

karmic salmon
#

all this fornothing

remote swallow
#

just not right theere

vast ledge
#

event.getPlayer().hasPlayedBefore();

#

@spring creek

karmic salmon
remote swallow
#

dont need the new File(

spring creek
karmic salmon
#

bruh ๐Ÿ˜ญ

vast ledge
#

then check taht function

karmic salmon
remote swallow
#

its your plugins data folder,

#

its named after your plugin

karmic salmon
#

i see

spring creek
karmic salmon
remote swallow
#

plugin.yml

karmic salmon
#

just need understand how this works

karmic salmon
vast ledge
karmic salmon
#

hope it works ๐Ÿ˜ญ

#

fainly

remote swallow
#

why is your jar 32 megabytes

karmic salmon
#

oh

#

it Kb ๐Ÿ’€

#

idk

remote swallow
#

yeah, kb to mb is divide by 1000

#

are you shading spigot or something

karmic salmon
#

idk

#

no.

remote swallow
#

maven or gradle

karmic salmon
#

maven

remote swallow
#

?paste your pom

undone axleBOT
karmic salmon
#

yessir

karmic salmon
remote swallow
#

why no

karmic salmon
#

ah

#

it not done

#

it have alot of dumb code

#

so no.

#

or you brian will die

remote swallow
#

pom doesnt have code

#

its a build file

#

idc what ur build file looks like

vast ledge
#

is he using maven or gradle?

remote swallow
#

maven

karmic salmon
#

gradle is hard

vast ledge
#

yea, pom is pretty clean by default

remote swallow
#

not really

vast ledge
#

Gradlen is alot faster

#

gradle*

remote swallow
#

gradle is bae

karmic salmon
#

rip

#

i will use maven for now

remote swallow
#

thats fine, paste ur pom and i can tell you why ur jar is 32mb

karmic salmon
#

it kb

#

not mb

remote swallow
#

yes

karmic salmon
#

good

#

and i will not paste my code

remote swallow
#

kilobytes is smaller than megabytes

karmic salmon
#

thank for helping!

remote swallow
#

they are on the same scale

vast ledge
#

bruh xD

delicate lynx
vast ledge
#

fact

remote swallow
#

smh @vast ledge

#

using a domain package you dont own

vast ledge
#

ik

#

its depressing

#

imma but it soon

#

buy**

echo basalt
#

.

remote swallow
#

thanks illusion

karmic salmon
#

Guys need help

vast ledge
#

again?

karmic salmon
#

yes

#

alot

#

2 more things

remote swallow
#

?ask

undone axleBOT
#

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

karmic salmon
#

i See!

#

Frist of all

echo basalt
#

epic you got this

#

I'll go back to playing my hatsune miku game clown_2

remote swallow
#

lul

karmic salmon
#

I have system like you write name and it create the name you write to folder but some people write something that windows don't understand and it give me error

#

can you make like

#

when it fine error

vast ledge
#

wat

karmic salmon
#

it say "sorry something went wrong"

tardy delta
#

hell ye what happens again when people realize they can create files on their own?

vast ledge
#

Omg

#

it legendary

rigid vault
#
Player player = (Player) sender;
            loc = player.getLocation().add(0, -3, 0);
            sz = (int) loc.getZ();
            world = player.getWorld();
            if (args.length == 1) {
                try {
                    BufferedImage img = ImageIO.read(new URL(args[0]));
                    ItemStack map = new ItemStack(Material.FILLED_MAP, 1);
                    MapView view = lazyx2.Utils.MiscUtils.mapViewFromImage(img);
                    MapMeta meta = (MapMeta) Bukkit.getItemFactory().getItemMeta(Material.FILLED_MAP);
                    meta.setMapView(view);
                    meta.setDisplayName(ChatColor.RED + "Test Map");
                    meta.setMapId(map.getDurability());
                    map.setItemMeta(meta);
                    player.getInventory().addItem(map);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return true;
            }``` this just gives me one image and after that its all ways stuck with that image can anyone help me?
vast ledge
#

@karmic salmon If you wanna go sure, just generate a folder with a uuid then have a file in the folder with the display name

karmic salmon
vast ledge
#

no brekain anythign

remote swallow
karmic salmon
#

ah

remote swallow
#

you would want a yaml file

karmic salmon
#

database?

rigid vault
karmic salmon
#

oh

vast ledge
karmic salmon
#

what is yml file

remote swallow
undone axleBOT
vast ledge
echo basalt
rigid vault
#

?paste

remote swallow
#

its them

#

but you can create custom ones

tardy delta
#

is that bot dead again

remote swallow
#

no

echo basalt
#

I played a lot with maps

karmic salmon
#

i see

echo basalt
#

no clue about your MiscUtils method tho

karmic salmon
#

but why i can't just cerate .txt

#

it the same

remote swallow
#

you can

echo basalt
#

But overall a map view is what contains your data and your mapmeta just points to the map's contents

#

so like

remote swallow
#

its just harder to use

karmic salmon
#

i see

echo basalt
#

if you want mutable maps just use the overwrite the same view

tardy delta
#

probably wouldnt be profitable to use opengl to draw a map

echo basalt
#

otherwise they immutable

karmic salmon
#

Ok I Will create .yml

#

it sound more easy

remote swallow
karmic salmon
#

so no need create folder on it files just 1 yml?

vast ledge
#

why not json

#

why yaml

#

PAIN

rigid vault
remote swallow
undone axleBOT
karmic salmon
#

no need folders yay

vast ledge
#

My bw plugin saves in json, mongo MySQL or yaml

remote swallow
#

mongo sus

#

also no sqlite?

vast ledge
#

no

remote swallow
#

damn

vast ledge
#

haven't made adaptrt

echo basalt
#

hm

#

I gotta make a leaderboards system that's compatible with like

remote swallow
#

tell me you did it smartly and use an interface and each class has impl

echo basalt
#

all major database types

#

and maybe incorporate it with like

#

my minigame lib

remote swallow
#

hypixel

echo basalt
#

lol

#

they still haven't replied

#

today's the 14th day

remote swallow
#

about what

echo basalt
#

I applied again

remote swallow
echo basalt
#

nah

#

I'm adult now

remote swallow
echo basalt
#

and I've been like

vast ledge
#

noice

echo basalt
#

working my ass off for the past year to learn all the things I lacked last year

#

like uhh

#

working with influxdb and grafana

#

or minigames in general

remote swallow
#

those graphs

echo basalt
#

I still don't like the way I'm doing teams here

tardy delta
#

what you using graph databases for

echo basalt
#

like how many players did something in the last hour, for example

tardy delta
#

ah like that

echo basalt
#

or graphing out how many online players there are

#

or server uptime

#

all that stuf

vast ledge
karmic salmon
#

what this will do java if (Files.isRegularFile(Paths.get("plugins\\TreasureHunt\\" + args[1] + ".yml"))) {

echo basalt
#

I just mean like

#

the way I abstracted it

karmic salmon
#

it will like check if file calledargs[1] + ".yml?

echo basalt
#

outside of the game unlike everything else

remote swallow
#

if it doesnt create it

tardy delta
#

also dont hardcode your plugin name

echo basalt
#

I even handle the map logic in the game class

#

but like

tardy delta
#

new File(plugin.getDataFolder(), args[1])

remote swallow
#

im taking a wild guess you havent read the wiki i sent you

tardy delta
#

and sanitize that input

karmic salmon
tardy delta
#

uh ye whatever

echo basalt
#

where braincell

karmic salmon
tardy delta
#

use /

remote swallow
#

?nearjava! then come back to this

#

?learnjava!

undone axleBOT
tardy delta
#

never use platform dependent stuff

#

unless youre on c++ ๐Ÿคก

remote swallow
#

you will do stuff a lot quicker and by yourself

karmic salmon
#

?whereiam

tardy delta
#

how many times have you sent ?learnjava in the past hour

remote swallow
#

2

karmic salmon
#

lol

tardy delta
karmic salmon
tardy delta
#

cuz thats where you ask the datafolder from

#

?di have you looked at this

undone axleBOT
remote swallow
#

because the getDataFolder only exists on a plugin instance

#

if you didnt remove the getInstance code you can use TreasureHunt.getInstance()

tardy delta
#

pls dont

#

people will look weird at you when doing that in an enterprise

quiet ice
#

It will take a few years until they will work there, if ever

echo basalt
#

it lets me do stuff in futures

quiet ice
#

This is something one can worry about once you are in an intermediate level of java

tardy delta
#

my first messages here are absolutely idiot too

echo basalt
#

at work we just use our custom future class that lets us thenRunSync

tardy delta
#

but ye

remote swallow
#

the first like 4 months of my dms to coll are me refusing to learn java and asking for help

tardy delta
#

better learn things now than having to adapt later imo

#

like static abuse

echo basalt
#

mfs making me write a static abuse guide

vast ledge
#

@echo basalt This is how i handle playerdata

quiet ice
#

Thankfully my first messages on here are unfindable thanks to me accidentally nuking my account

tardy delta
echo basalt
tardy delta
#

i cant even read

#

ah yes public stuff

echo basalt
#

also mf got the 8k monitor

vast ledge
#

How u handle ur arenas?

quiet ice
#

Though I believe they wouldn't be too cringe given that I had a few years of off-on programming java already

echo basalt
#

uhh

#

I have cosmos for that

vast ledge
tardy delta
#

i had like one year of experience and i was an absolute noob

vast ledge
#

wrong image

#

bruh

hazy parrot
#

getInstance on javaplugin is not really static abuse

echo basalt
#

I literally just made cosmos for arena handling

tardy delta
#

its just useless to make a singleton

#

but anyways

hazy parrot
#

How is it useless lol

#

It is in fact singleton

echo basalt
#

just DI

tardy delta
#

only clutters up code imo

hazy parrot
#

Well, I'm not too, but it's far from abuse

tardy delta
#

and spigot will already prohibit you from making multiple plugin instances so nothing wrong with di

#

im clearly not a fan of singletons :)

echo basalt
#

but yeah @vast ledge it just boils down to this

#

and GameMap is just a wrapper

vast ledge
echo basalt
tardy delta
#

<insert record here>

echo basalt
#

so yeah for like

#

custom games

#

you just extend the map class

#

and register the maps in the registry

tardy delta
#

ah blame java

echo basalt
#

and since the minigame class like

vast ledge
#

Here the massive image

echo basalt
#

expects a map by default

#

you can just

#
new SkywarsGame(mapRegistry.getSpecificMap("skywars-one", SkywarsMap.class));
echo basalt
vast ledge
#

BRUH THE IMAGE IS TO BIG

#

WTF

echo basalt
#

and it creates a skywars game with that map

#

which contains all the spawn points and chest categories

#

(each category holds a loot table)

#

and we use vectors because they're all offsets of a common anchor point which is where the map is pasted at

#

So yeah then for like filling chests just convert all of those to absolute

#

get the loot table from the registry and fill it in

#

and if I want to make bedwars instead I can just change the map stuff

#

to like

#

Generator and whatever

#

make a custom BedwarsTeam class that extends my GameTeam class and have it include stuff like the generator tier

#

write some logic for the generator, phases for levelling the global emerald and diamond generators

#

and you can write the game in less than a week

vast ledge
#

There Have fun with this image

vast ledge
echo basalt
#

500mb ram image

remote swallow
echo basalt
#

yeah this code's ass

#

immediately

remote swallow
#

nothing should be that long

echo basalt
#

mans storing block and entity references directly instead of positions and uuids

#

memory leak go boom

#

also world reference yikes

#

and this all goes in a static list

#

hell nah

#

you got a memo leak right there

vast ledge
#

yea ik i gotta rewrite it

echo basalt
#

also I'd use proper phases and like

remote swallow
#

ever heard of enums

echo basalt
#

not registering listers dynamically lmao

#

like this is all really hardcoded

tardy delta
#

where code

remote swallow
vast ledge
remote swallow
#

too late

#

i already pes rage shot you

echo basalt
#

here's some inspiration

lavish wing
#

Hey guys tell me pls how i can create online map for old minecraft server without using dynmap

echo basalt
remote swallow
echo basalt
#

or my scripting engine

#

doesn't need generics

vast ledge
remote swallow
#

it needs more generics

lavish wing
echo basalt
#

uhh

remote swallow
#

you look at the code and see how dynmap works

echo basalt
#

good luck with that

vast ledge
#

You need to create an Webserver

echo basalt
#

basically you gotta create a renderer

#

and then scan stuff

#

and render it

vast ledge
#

what he said

echo basalt
#

backend, frontend

#

protocol between your server and your web backend

lavish wing
echo basalt
#

I'm working on/off on a school project that's basically like

#

mcjukebox but with mic in

#

aka openaudiomc

#

but my own version

#

and even without any graphics it's the biggest ass pain

tardy delta
#

๐Ÿ‘€

vast ledge
#

WELCOME TO MY GAMEPHASE

tardy delta
#

mf firefox can only zoom to 500%

echo basalt
#

yeah this is straight ass

vast ledge
#

MUAHAHAH I SHALL INSTILL PAIN IN EVERY ENTITY THAT READS MY CODE

tardy delta
#

lemme try tv screen

echo basalt
#

I just download the image and toss it on ms-paint

tardy delta
#

anyone who can read this

zealous osprey
#

:)

echo basalt
#

occupies a few hundred mb ram

zealous osprey
#

I feal like that person from NCIS who goes "inhance"

tardy delta
#

oh no i smell a double map lookup

zealous osprey
#

It's cluttered aswell, both gamephases and eventhandlers intertwined

vast ledge
tardy delta
#

and that second check should be first

zealous osprey
#

please tell me that this is actually ONE file?

tardy delta
#

this is better

vast ledge
tardy delta
#

phaseBoard::applyBoard pls

vast ledge
#

Ik the code is bad, you have already told me enough ๐Ÿ˜„

zealous osprey
#

Maybe you want to add something like a config file for these messages, so you don't have to delve into the code every time.

remote swallow
#

skull

echo basalt
#

or a map

remote swallow
#

use lambda

echo basalt
#

or a placeholder

zealous osprey
#

Also use a stringbuilder for all that string concat

tardy delta
#

and do your early returns in the right order

#

not doing slow checks as first

zealous osprey
#

Why is this here?

vast ledge
thick oracle
#

Hey I have the following problem (Spigot 1.19.3):

I want to set a player's spectator target, which by itself is no issue, however if the target is a farther away then it won't work and the player only gets teleported to the target.

v1: Only works on close distances

player.setGameMode(GameMode.SPECTATOR);
player.setSpectatorTarget(target);

v2: same results as v1

player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
player.setSpectatorTarget(target);

v3: this actually works, but the delay is very noticeable

player.setGameMode(GameMode.SPECTATOR);
player.teleport(target.getLocation());
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> player.setSpectatorTarget(target), 1);

Does anyone here have an idea what I could do differently so I wont have to add a delay?

remote swallow
zealous osprey
#

you have alot of those weird event blocks that don't do anything.
Correction, you have 2 1/2

echo basalt
#

something tells me it's a packet thing

remote swallow
thick oracle
remote swallow
#

probably what illusion said then]

tardy delta
sullen canyon
#

๐Ÿ˜ญ

split gull
#

requireNonNull gives me nightmares

tardy delta
#

fun what it does with anonymous classes

eternal oxide
#

You are just trying to break things now

tardy delta
#

nah just jdgui

eternal oxide
#

ah

tardy delta
#

still no dark mode

quiet ice
#

That is why recaf is better

tardy delta
#

imma try

#

skipping tests works lol

sullen marlin
cobalt thorn
#

Hi, im using a method for reloading, reloads the AnimationsList to then recreate it

    public static void reload() {
        AlixAPI.getInstance().reloadConfig();
        animationsList.clear();
        AnimationsManager.RegisterAll();
    }

but seems to not reload the config

tardy delta
#

jd-gui had a stroke or something

#

recaf looks pretty nice, i only miss syntax highlighting

echo basalt
#

c# naming conventions eyeszoom

tardy delta
#

you should be looking at c++ then

#

no conventions

quaint mantle
#

Hi everyone is there a way to be able to use CraftPlayer in 1.19?

chrome beacon
#

?nms

quaint mantle
#

Uh thanks ๐Ÿ˜…

tardy delta
#

some people just have to die

next stratus
#

Honestly, how can people write such good maths code?

sullen marlin
#

Maybe is hard

next stratus
#

I've been trying to write some code to spawn blocks in such a way where the blocks lift up then fall down in a wave effect but damn it's hard to do lol.

sullen marlin
#

Just a sine wave?

#

That shouldn't be hard

next stratus
#

I failed maths in school, so I'm trying to relearn maths now lol, I've been trying to make the wave come up out of the blocks then crash down a few blocks along the line

karmic salmon
#

guys there are var that in it string called [hiii.yml, hiii2.yml]

#

but i want add it do list

sullen marlin
#

?

karmic salmon
#

like , is the sprit letter that sprit between this string and the other string in the list

sullen marlin
#

Separator?

karmic salmon
#

Yes.

sullen marlin
#

Quotation mark? ["Test, string", "other"]

karmic salmon
#

hm

#

you Kinda Don't understand What i saying!

sullen marlin
#

I don't

#

Can you try a different translator?

karmic salmon
#

like There is var in that var there are string and that string is [hiii.yml, hiii2.yml]

#

now

sullen marlin
#

List? Array?

karmic salmon
#

i want hiii.yml and hiii2.yml be in a list

tardy delta
#

make a list from an array?

karmic salmon
#

make list from a string

#

string have a b

#

i want take a and b

sullen marlin
#

Arrays.asList("hiii.yml", "hiii2.yml")

karmic salmon
#

and put it in list

karmic salmon
#

Do Anyone get it?

sullen marlin
#

"a b".split(", ")

karmic salmon
#

i see

#

input:
string = "a , b"

so string.split(",")
System.out.println(string)

output:

"a b"

#

like this sir?

sullen marlin
#

Need return value of split

#

Is array

karmic salmon
#

Can you give me Example sir?

terse ore
#

it doesn't modify the initial string

sullen marlin
#
[a, b]
karmic salmon
karmic salmon
#

thank you Sir!

#

wait can we remove "[" and "]" from a string?

terse ore
#

that's a list

karmic salmon
#

i see

sullen marlin
#

can you explain what you are trying to do?

terse ore
#

yeah

sullen marlin
#

if this is configuration, use Configuration getStringList

tardy delta
#

its smth with his command args

karmic salmon
terse ore
#

a string or an array?

karmic salmon
sullen marlin
#

where are string from

karmic salmon
terse ore
#

this is confusing me

sullen marlin
#

how list made?

#

can you share code you have

karmic salmon
terse ore
#

@karmic salmon start from the beggining and explain what are you trying to do

next stratus
#

How would you guys go about generating code what makes a arch like this https://i.imgur.com/cYGFh0m.png the arch lifts itself up and falls back down in rows, I'm so confused how to do it and have been trying for ages lol

sullen marlin
#

ok but you already have list in code there

next stratus
karmic salmon
terse ore
#

there might be other ways but it is the easiest one

sullen marlin
#

blockY = sin(blockZ + ticks)

next stratus
#

I can learn it if needed

sullen marlin
#

something like that will get you started

opal saffron
karmic salmon
terse ore
opal saffron
#

f.ex.

for(String s : list) {
  System.out.println(s);
}
terse ore
#

this is getting messy

next stratus
#

yeah my bad

terse ore
#

dw

next stratus
#

I forgot threads existed lol

#

Arch / Wave effect using sin

quaint mantle
#
          - '[message] &#57F287โ–ถ Voting Li ... 
          ^
expected <block end>, but found '['
 in 'reader', line 34, column 10:
          - '[sound] ENTITY_EXPERIENCE_ORB_PI ... 
             ^```
#

what did i do wrong lol

severe oracle
#

Hi, what would be the best way to set block rotation in spigot 1.19?

sullen marlin
severe oracle
#

thanx

#

any idea why is this producing error NULL java System.out.println(loc.getBlock().getBlockData()); ((Rotatable)loc.getBlock().getBlockData()).setRotation(BlockFace.EAST);

#

while the sysout command outputs: "CraftBlockData{minecraft:oak_log[axis=y]}"

#

?

sullen marlin
#

Logs are Orientable

#

Not Rotatable

#

Check javadocs for data of material

severe oracle
#

thank you

terse ore
#

guys how are the new blocks that could stretch named?

sullen marlin
#

What blocks

#

Display entity?

severe oracle
#

bocks can stretch?

tardy delta
#

give some lines around it

terse ore
#

block display

young knoll
#

Sometimes the blocks need to stretch to warm up their muscles

quaint mantle
young knoll
#

Throw it in a yaml validator

unique sable
#

is there a way I can change a players display name and display like an icon along side the playername?

like this:
"[aVisualDiamondSword] aPlayersName"

is there a way to do it ?

young knoll
#

Use the AsyncPlayerChatEvent and make your own format

unique sable
#

I didnt specify how I want to use it actually, I want it to be like in their nametag / the name displayed on top of their head. (my main problem is , how do I obtain the icon of the sword and display it)

young knoll
#

Yes and no

#

Yes itโ€™s possible but not with the api

hollow grotto
#

What's criteria in registerNewObject(name, criteria, displayName)? is it like a group name?

young knoll
#

Itโ€™s the criteria the objective tracks

#

If you are handling it yourself use dummy

hollow grotto
#

What are the available criteria?

young knoll
#

Plus any statistic

karmic salmon
#

guys i have a werid qustien i want set a new boolen but for just a uniqe player not every one

#

like i want set boolen of the player who do the command to false or smth like that]

echo basalt
#

map?

#

or just

#

a set

karmic salmon
#

set

#

if any one know please ping me

tardy delta
#

wdym

young knoll
#

No they mean

#

Use a set

#

Put uuid in set for true

#

Remove for false

karmic salmon
#

yes

#

or display name

young knoll
#

Donโ€™t use name

karmic salmon
#

fr

young knoll
#

Uuids are designed to be unique

#

Take advantage of them

karmic salmon
#

i see do you have any idea how set it true or false?

tardy delta
#

so you need three possibilities? true false and absent?

karmic salmon
#

true or false

#

it boolen

young knoll
#

In set for true

#

Not in set for false

karmic salmon
#

just checks

#

and set

tardy delta
#

what are you even trying to do

karmic salmon
#

bruh

#

i try make like when some one make command code set there uuid to true then other code

tardy delta
#

i have no clue what thats supposed to mean

#

try speaking google translate

karmic salmon
#

;/

#

this rude man

#

ok

#

like

#

every player have unique uuid

#

and want set it to true

#

idk how

tardy delta
#

set what to true

karmic salmon
#

the uuid

#

idk how

tardy delta
#

how can you set an java.util.UUID to true

karmic salmon
#

tbh idk

#

but people making it

karmic salmon
tardy delta
#

just tell what you're trying to achieve in general

karmic salmon
#

ah

young knoll
#

Put in hashset for true

#

Remove for false

#

Check with contains()

karmic salmon
#

i just want get unique boolen that every player unique have to true or false

karmic salmon
karmic salmon
#

LOL

young knoll
karmic salmon
#

oh cool

#

if player.contains("true"){

}

#

right?

quiet ice
#

probably not what you want

karmic salmon
#

maybe this? Player player = (Player) e; player = (Player) new HashSet<String>();

#

should be write

quiet ice
#

won't run

karmic salmon
#

now i can add anything to player

karmic salmon
quiet ice
#

That will result in a class cast exception

karmic salmon
#

ah

#

so how D:

quiet ice
#

I guess you want to attach data to a player?

karmic salmon
#

yes

#

then check the data

quiet ice
#

Does it need to persist across restarts?

karmic salmon
#

ah in restarts it gone

#

the data that i will put is gone

quiet ice
#

Okay, then you can use Map<UUID, String> - or more concretely:

public class MyClass {
    private static final Map<UUID, String> map = new HashMap<>();

    public void myMethod() {
        map.put(player.getUniqueId(), "value"); // Insert data
        String val = map.get(player.getUniqueId()); // retrieve data
    }
}
karmic salmon
#

i see-

tardy delta
#

would be so much fun when spigot would let you make your own player provider

quiet ice
quiet ice
tardy delta
#

ye ofc

karmic salmon
#

oh

tardy delta
#

changing anything now will break all plugins

echo basalt
#

fuckin

#

?learnjava

undone axleBOT
karmic salmon
quiet ice
#

I just realize something ....

#

Don't ever use the variable value and instead always use map.get(player.getUniqueId()) otherwise you will be confused why stuff doesn't work like you think it does

#

Explaining why I recommend that is pointless though given that I am fairly sure you'll quit programming within a week

tardy delta
#

i believe you scared em

young knoll
#

You really donโ€™t need a map for a Boolean value

quiet ice
#

Issue is they won't comprehend how to use a set since from a beginner's standpoint sets don't make sense

#

A map on the other hand does make sense

young knoll
#

Player pdc should persist across deaths yes

quiet ice
#

And is more versatile - so it will avoid having to explain the same concept twice

young knoll
#

I doubt it matters much anyway

#

Hashsets are backed by a map

quiet ice
#

Judging by them attempting to use them like a map I doubt so

young knoll
#

HashSets*

#

LinkedHashSet anyone?

tardy delta
#

yes

rotund ravine
#

Idc much

tardy delta
#

depends on the amount of items you expect it to store, although you dont know, you kinda do

quiet ice
#

That is overkill

#

The basic put/get ops suffice for basic usage

young knoll
#

What about an AsyncImmutableCopyOnWriteDoubleLinkedHashSet

quiet ice
#

The issue with LinkedLists is that they are almost always inferior to array lists

#

which vectors?

quiet ice
tardy delta
#

i like those fastutil collections

quiet ice
#

So java.util.Vector?

tardy delta
#

๐Ÿ’€

quiet ice
#

I'll personally come to your house and burn it down with lemons

#

The real question is when that moment will be though

#

Could always be in 2^(10^(10^10)) years

tardy delta
#

undefined ๐Ÿ’€

quiet ice
#

Dayum. I bricked google

tardy delta
#

not enough bits

quaint mantle
#

Im making a plugin for custem achievments right now. Is there a way i can have other of my plugins trigger things on my achievment plugin

tardy delta
#

ik bruh

#

only undefined i know is 0/ 0

opal juniper
#

itโ€™s just too large, also any number over 0 is undefined

#

doesnโ€™t have to be 0/0

#

iโ€™m more of a fan of defining it as one

young knoll
#

Iโ€™ve been told anything to the power of 0 is 1

#

But my iPhone calculator says 0^0 is error

opal juniper
#

yeah 0^0 is an edge case

#

but it is also undefined because of what @quaint mantle said

young knoll
#

Cheeky edit

opal juniper
#

0^x = 0 but x^0 = 1

#

so itโ€™s normally 1 or undefined

young knoll
#

What if zero doesnโ€™t feel like being raised to the power of 0

opal juniper
#

i hate the proof for 0! = 1

young knoll
#

Wait how does 0! Even work

#

0! = 0 x ???? = 1

#

Math people are weird

opal juniper
#

i saw it as n! = (n+1)!/(n+1)

young knoll
#

Fuck you Pythagoras

#

Heโ€™s a nerd

#

And heโ€™s dead

#

Absolute beta

opal juniper
#

i dislike integration immensely

#

yes

#

they are cool

#

but integration calculus is cringe

#

thatโ€™s not what i said

#

i said i donโ€™t like it

#

mod arg form ๐Ÿ˜Ž

#

rotation formula?

#

yeah

#

volumes of revolutions i call them

#

????? why

#

itโ€™s fucking easy

#

oh yeah sure

young knoll
#

Nerds

opal juniper
#

doing this right now

young knoll
#

7

#

Next question

opal juniper
#

not quite, (3+sqrt(33))/4

#

where is the dx!!!!

#

the parametric version of this is cooler

tardy delta
#

math nerds

opal juniper
#

look iโ€™m on my 5th hour of maths revision today cause iโ€™ve got my exam this week

tardy delta
#

i got exam in two weeks and i failed the prev exam ๐Ÿ’€

opal juniper
#

iโ€™ve gone thru an entire pen

tardy delta
#

i believe i havent even used a whole pen in this whole year ๐Ÿ’€

#

on my pc every hour

opal juniper
#

math is mid but useful

#

ew

#

what course lol

#

we are missing 25%

tardy delta
#

not much programming?

#

that programming ๐Ÿค”

karmic salmon
#

guys

#

i want rename a file

#
File file = new File("oldname");

// File (or directory) with new name
File file2 = new File("newname");```
#

file.renameTo(file2);

#

does there are any other way to rename it

#

i like need make whole other file and then delete

#

anyone?

worldly ingot
#

Not sure what the issue is. #renameTo() is the way to do it

karmic salmon
#

Oh

worldly ingot
#

Unless you want to use NIO, in which case you could use Files#move() instead

karmic salmon
#

this way simple java Path source = ... Files.move(source, source.resolveSibling("newname"));

#

from #renameTo()

worldly ingot
#

Yeah, you'll just need to use Path objects instead of Files

karmic salmon
#

Ah ye it fine

worldly ingot
#

Which is fine. If you have a File already you can do File#toPath(), or you can do it with Path.of()

karmic salmon
#

i really was need path not file ๐Ÿ’€ so it fix other problem

worldly ingot
#

PES_BlankieThumbsUp Perfect

young knoll
#

Paths are just posh strings

tardy delta
#

what languages?

echo basalt
#

next addition in the minigame lib

#

the ability to individually disable certain mechanics present in vanilla

chrome beacon
#

No Minestom duke

echo basalt
#

what if you want uhc

chrome beacon
#

PR to VRI uwu

echo basalt
#

can't bother

tardy delta
#

reminds me i still have to work on my pr

#

recipes kinda fucked up

young knoll
#

stromine

tardy delta
#

myes just to print 1 2 3

#

big mistake to rewrite this in c++

#

actually only 9 instructions

#

we are doing js, java and python in college

#

and shell ๐Ÿ’€

#

actually powershell and cmd too

young knoll
#

We did all the fancy modern languages

#

No cpp

tardy delta
#

lessons are finished now

cobalt thorn
#

What are some plugin, I can add dependency to mine, currently, i have [Vault, PlaceholderAPI, ItemsAdder], but i don't have ideas to add something else to it

young knoll
#

What is your plugin

#

Canโ€™t just add dependencies for no reason

tardy delta
#

^^

young knoll
#

I mean you can I guess, but why

cobalt thorn
# young knoll What is your plugin

a plugin for a cinematic camera, with a simple scripting language to make actions in markers or when it start or end, all of them are softdepends

tardy delta
#

is it on github?

cobalt thorn
young knoll
#

Well

cobalt thorn
#

currently im not making it open source but in the near future probably yes, when the plugin will have a stable base

young knoll
#

What do you use those dependencies for

cobalt thorn
#

or use hud in itemsadder

young knoll
#

Idk maybe

#

The ability to give skill xp from McMMO and what not

cobalt thorn
#

why not, its not a bad idea thanks

hollow grotto
#

I have this string that will result a gradient text:
"ยบxยบ3ยบ3ยบ4ยบ4ยบaยบaMยบxยบ5ยบ5ยบ3ยบ6ยบ8ยบ8eยบxยบ7ยบ7ยบ2ยบ9ยบ6ยบ6mยบxยบ9ยบ9ยบ1ยบbยบ4ยบ4bยบxยบbยบbยบ0ยบeยบ2ยบ2eยบxยบdยบdยบ0ยบ0ยบ0ยบ0r"

Why is this not getting accepted in getScore in Scoreboard?

echo basalt
#

just use team prefixes for that funkery

#

and use the score as like... an index or something

subtle folio
#

How do I use EnchantmentStorageMeta and Damageable on the same ItemMeta?

young knoll
#

An item shouldnโ€™t be both

#

Enchanted books donโ€™t have durability

echo basalt
#

EnchantmentStorageMeta should be specific to like

#

enchanted books

subtle folio
#

ugh

#

another use case

#

gotta

#

it

dense falcon
#

How I get keys and values from a config.yml of a "main key" ?

Imagine:

players:
  p1:
    name: "Yo"
    description: "AHhahhahh"
  p2:
    name: "HEY"
    description: "Nice"

``` And I want to have : p1 and keys, p2 and keys.
echo basalt
#

you can add enchants whenever

subtle folio
#

yeah but for whatever reason that doesn't register the item as an enchantment book

echo basalt
#

that's because

#

enchantment book

subtle folio
#

just a book with an enchanement

echo basalt
#

is a specific material

subtle folio
#

ENCHANTED_BOOK?

echo basalt
#

correct

subtle folio
#

right

#

But I cant create those myself

echo basalt
#

Yes you can

#

And you wouldn't need them to be damageable

subtle folio
#

I have code that checks if the enchantment book is a enchant book and it fires with the creative inventory ones but not the ones made by me

echo basalt
#

show

subtle folio
#

?paste

undone axleBOT
echo basalt
#

I suspect either one of them doesn't have the meta

subtle folio
young knoll
#

You need to use EnchantmentStorageMeta to add enchantments to a book

#

Stored enchantments are different than regular enchantments

subtle folio
#

Got it

#

thanks

echo basalt
#

I remember that was a thing in ps3 edition

young knoll
#

Yeah

#

And mining grass blocks with a silk touch book

echo basalt
#

yeah

#

I see

#

they could've just been stupid

#

and hardcode a check to skip enchanted books lmao

young knoll
#

That would be a lot of checks though

echo basalt
#

just like

#

a check before all the usual checks

#

or embed it in the hasEnchantment check or somenthign

young knoll
#

Meh

#

Mojang has enough janky hacks

#

Donโ€™t encourage them

echo basalt
#

yeah no fire aspect

#

ah shit I gotta buy a fuckin suit

young knoll
#

Generally you donโ€™t want to wear a suit when butchering pigs

echo basalt
#

I got an IRL formal party to attend next week

#

and I don't think I'm allowed to wear this sexy and comfy minecraft tshirt

tardy delta
#

and thats the moment i quit the video

young knoll
#

The heck is a formal party

#

Sounds like a funeral

echo basalt
#

I was looking at nms code the other day

#

and today looking at it again with a fresh mind

#

fun thing

#

when you damage an entity with a non-crit attack

#

it spawns an amount of particles corresponding to the amount of damage you dealt, in hearts

#

So if you deal a ton of damage, it spawns a huge amount of particles

#

figured it'd be hardcoded but no

young knoll
#

Yep

#

Found that out the fun way

echo basalt
#

and apparently it's these hearts

#

and they have a spread pattern

#

that like

#

they spawn outwards and creep inwards

#

it's goofy

young knoll
#

Does spigot expose a way to set the last player that damaged an entity

#

I donโ€™t see anything in the docs

echo basalt
#

it exposes the last EntityDamageEvent that the entity caused

#

so you could cast that and see the damager

#

it also exposes the killer if the entity is dead

young knoll
#

The last damage event is not necessarily the last player to damage it

#

For example if you hit a mob off a cliff the last damage will be fall damage

#

But it will still recognize that a player caused the death

echo basalt
#

uhh

#

then no

#

I assume it's just nms

young knoll
#

I am upsetti

echo basalt
#

there's this within nms

#

which is used for death messages

#

but no exposure to spigot

#

@worldly ingot pr time

young knoll
#

I can always pr it myself :p

#

I think we are currently at a feature freeze though

#

Or at least close to one

weak bear
#

Hey do you know how to link a discord-server with a plugin like make a channel on specific discord with my plugn

young knoll
#

JDA

weak bear
#

?

weak bear
young knoll
ember estuary
#

maybe it just doesnt allow pinging?

young knoll
#

JDA is a discord api for java

ember estuary
#

is it your server?

soft hound
#

A quick question, is it a good idea to name your class as "EnchantHandler" if you just have the custom enchants in there and then call them thru different classes ?
If not, then what is the proper name of naming that type of a class ?

young knoll
#

Enchantments

#

EnchantmentRegistry

soft hound
#

Oh okay, Registry is a good idea, thanks a lot @young knoll!

weak bear
prime elk
#

general java question for creating an api, should i annotate a method @Nullable if it only returns null when there's been an exception thrown. i've only been annotating nullable if it should legitmately return null, but would it be better to add it to erroneous circumstances too

echo basalt
#

nullable means the return type is either as expected or null

#

if it throws an exception... it won't return null

#

but instead be at an exceptional state

#

I usually just handle bad inputs by returning null unless it's like

#

a critical fuck-up

prime elk
#

oh yeah thanks, i confused nullability with an exceptional state

echo basalt
#

but generally just use ufw

#

don't forget to not lock yourself

#

not my fault

#

server pings are part of the handshake

young knoll
#

Itโ€™s not null if itโ€™s an empty optional

#

Big brain

echo basalt
young knoll
#

Exactly!

echo basalt
#

no clue why a plugin would interfere with server status packets honestly

#

It's not something regarding iptables

#

otherwise you'd be able to connect

young knoll
#

Gotta have that server icon be the players skull

#

Itโ€™s very important

weak bear
young knoll
#

Yep

echo basalt
#

yeah so

#

here's the basic runner

#

a client pings a server to initiate handshake

#

and that initial ping has some basic data

#

which is like

#

client version, what hostname it is using, player's uuid and name

#

and a status

#

it either is "server list" or "connect"

#

If it is server list, the server just replies with the server list data and closes the socket

#

If it's "connect", the full handshake occurs

#

So like

#

You either have some wicked server list plugin

#

or a fucked server motd config

ember estuary
#

What am i doing wrong?

echo basalt
#

but yeah you gotta run buildtools

ember estuary
#

ahhh

#

ty

prime elk
#

do i still need null checks if i have annotations? intellij tells me no because it can statically analyse but i'm not sure if it's still safe when another package uses it as an api

echo basalt
#

annotations just trigger ide warnings

prime elk
#

cheers

echo basalt
#

they're pretty much just a warning signal

#

like

#

"ayo this can return null"

#

I already diagnosed your problem

#

maybe a bad server.properties

#

that has like

#

invalid motd data

#

or something

#

yeah but

#

what if it's like

#

just empty

#

alright so

#

and/or

tardy delta
#

there goes my memory

prime elk
echo basalt
#

I just have that as defaults

young knoll
#

Only looks like you have about 5gb in use from that screenshot

#

Plus whatever the OS is using

#

What is your total ram

torpid blaze
#

!paste

#

?paste

undone axleBOT
quiet ice
#

it could always be that they want to paste stuff for themselves

torpid blaze
#

I wanted to paste something in for my question that is comming up ๐Ÿ˜„

#

Hey,
I am trying to create a updating scoreboard for each player. I created this class: https://paste.md-5.net/nosizitivo.java for it and a TestScoreboard with the specific scoreboard data: https://paste.md-5.net/kadimejava.java.
Top test it, I just created a new TestScoreboard Instance and passed the player: new TestScoreboard(player).

But when joining the server is logging the score got set from the sout but I can't see the scoreboard and there are no error messages in the console.

Has anyone any Idea what is wrong?

echo basalt
#

haven't messed that much with the scoreboard api so idk how it works

#

but generally I just use a more basic scoreboard utility class

#

Here's what I got

torpid blaze
#

thats right, looks not that bad

#

I will try it

prime elk
#

will bukkit/spigot ever pass the plugin a null event to a handler

quiet ice
#

why would they

#

That question can be answered with a clear no

torpid blaze
karmic salmon
subtle folio
#

That scoreboard lib doesnโ€™t support values that change without resending the whole board..

torpid blaze
#

What do you mean?

subtle folio
#

You can set values to teams in a scoreboard

#

then you can get that team and edit that value and the scoreboard will reflect it

torpid blaze
#

but it is not working for me

eternal oxide
#

which PDC?

scenic onyx
#

how do I use a command to reset the plugin

#

so config, command, gui

eternal oxide
#

you write it to reload everything you need to.

scenic onyx
eternal oxide
#

Don't

scenic onyx
#

take do not insert

eternal oxide
#

a config is not the place for something that changes often

#

what are you changing and storing like that?

scenic onyx
#

I know but I server to count the time a player plays

eternal oxide
#

there is already statistics for that

scenic onyx
eternal oxide
#

WHICH PDC? there are many different PDCs

eternal oxide
#

Is your PDC on the Player, the Chunk, the world, an Item, and Entity?

#

then the PDC goes where the item goes.

eternal oxide
#

If it is a placeable item it does not get transfered to whatever it places.

#

Some blocks also have a PDC

#

anythign with a TileState

#

but you have to set the PDC when it is placed.

#

things like Chests

tardy delta
#

playing sound is fun lol, my man casually sending a soundwave at 40Hz ๐Ÿ’€

#

nice bass

#

hardcoded the id and lambda relation

eternal oxide
#

store the ID with the lambda code

#

I'm assuming this is for things like special effects or powers on the item

#

then it's simple, POWER_ID and code is all you need

#

the ID is whatever power you want, and it references the code to run

#

same ID as you put on the item

#

you could or better just store the ID, Interact

#

not every item, just one instance per code

#

Whatever event you trigger from, you get the ID from the items PDC, fetch the code from the Map and run it. Be it a consumer or a Function

#

what?

#

of course you can

#

get Item, read PDC for ID, fetch code from Map

#

you don;t give EVERY item an ID

#

you give abilities an ID

#

the ID corresponds to the code that item should run

#

not the item

#

so if you put that ID on a Block ItemStack or a Stick ItemStack, they run the same code if they have the same ID

#

you store your code as java Consumer<PlayerInteractEvent> code = event -> { System.out.println(event.getName()); }; yourMap.put(id, code);

#

in your interactevent you get the item in hand, get it's ID from PDC then java yourMap.get(id).accept(event);

#

You only store one instance of the code not every item that uses it

#

why would a different lambda be assigned to that ID?

#

you decide that

tardy delta
#

hardcode it in your code

tall saffron
#

How can i set on the tab the rank? like what should i use to display it?

eternal oxide
#
//Setup Fireball
Consumer<PlayerInteractEvent> code = event -> { Utils.fireball(); };
yourMap.put(0, code);```
#

Fireball will always be ID 0

tardy delta
#
Map.of(
"id0", event -> event.whatever(),
"id1", event -> event.smthElse()`
);```
eternal oxide
#

you NEVER change your IDs

#

you can delete them

#

don;t reuse

#

you ALWAYS assign the same id to the same Function

#

enum it if you want