#help-development

1 messages · Page 985 of 1

ivory sleet
#

yeaa i think it should work :)

young knoll
#

I wish java had a method to just round something to X decimals

vast ledge
#

isnt that in Math#

ivory sleet
#

*10^n

#

and then floor

#

right?

young knoll
#

Other than yknow, doing it via that

#

Yeah

glass raven
#

tbh didn’t understand much 😭

vast ledge
#

What are you trying to achieve?

young knoll
#

Presumably you could do it via some bit stuffs

vast ledge
#

Ik you want to modify offline players inventories, but for what use case?

ivory sleet
#

true, but that*s effffoooort

vast ledge
young knoll
#

Exactly!

#

Why can’t the code write itself

glass raven
vast ledge
#

I got so annoyed today by discord not being able to auto update on linux

vast ledge
glass raven
#

i have literally no idea on how to edit the playerdata

young knoll
#

It’s NBT

#

So you’ll need to use NMS or another library to handle it

glass raven
#

wait, instead of editing offline player data, how can i make it edit the inventory once the player’s online? so no data corruption risks and other unstable stuff

young knoll
#

Save the changes that need to be made and listen for the join event

glass raven
#

how could i store a change of a determined player and make the action run on determined itemstack for determined amount

#

i have no clue

vast ledge
#

save a snapshot of the leave inventory, when they rejoin apply the snapshot

ripe wing
#

yoo can someone explain how i can do async tasks?

remote swallow
#

?scheduling

undone axleBOT
vast ledge
#

The cold sholder tho

#

shoulder**

vast ledge
worthy yarrow
#

Now I’m curious of what an advanced bukkit task looks like

tranquil glen
#

Anyone have any thoughts on this UML diagram i've made for an assignment?
If you'd implement anything differently?

wet breach
#

You should actually not have http requests perform actions directly to avoid some potential bad things

#

As well as it makes it easier to log as well in case later you need to verify or whatever

rough ibex
#

I don't see +-#~

tranquil glen
#

whoops

#

you're right

rough ibex
#

also don't know what solid black arrowhead means

#

did you mean hollow arrowhead

#

also check your amount constraints, not sure 0..* is valid for everything

wet breach
rough ibex
#

hm

wet breach
#

For instance if you have an abstract class you cant just directly create those but indirectly

#

But they could extend another class at the same time

#

So they are associated but not directly

still delta
#

i can't run spigot-server project,because i Could not find artifact org.spigotmc:minecraft-server:pom:1.20.4-R0.1-SNAPSHOT in minecraft-libraries (https://libraries.minecraft.net/)

wet breach
#

This isnt to be confused witj convenience methods which can enable you to get info from one or the other if that makes sense

still delta
#

how do i find the artifact org.spigotmc:minecraft-server:pom:1.20.4-R0.1-SNAPSHOT ?

wet breach
#

It should be in your buildtools directory

#

But what are you trying to do?

#

Use nms?

still delta
#

i just wanna know how the spigot-server runing,because i wanna to be a contributor in spigot-server project

young knoll
#

?contributing

#

Dang

wet breach
# rough ibex hm

Think a good example is a spigot player and craft player. They are associated with each other but you cant directly get from one or the other if i recall

#

?contribute

rough ibex
#

cafebabe needs some coffee

#

that slow

wet breach
#

No coll used wrong command

rough ibex
#

oh wait its not ing

#

I need coffee

worthy yarrow
#

kek

young knoll
#

I choose to blame someone other than myself

wet breach
#

Lol

wet breach
#

Just fyi that is the bot. But you are welcome

still delta
#

ok,thank you. 😘

wet breach
worthy yarrow
#

That's cute

young knoll
#

The bot deserves love too

vast ledge
#

Wait

#

wait a second

#

There

#

btw wrong chat

#

he removed his message :{

tender shard
#

good morning

trail brook
#

I am currently planning to make a custom plugin on my 1.19.4 server, is there a developer docs for 1.19.4?

And what about functions/classes, are they still the same despite different minecraft version/java?

undone axleBOT
blazing ocean
#

?jd-s as well

undone axleBOT
trail brook
#

nms?

vast ledge
#

Net Minecraft Server

trail brook
#

I'm quite new with Java and Spigot dev wise

#

Ahhh

blazing ocean
#

?nms is basically raw networking internals which you should avoid using

blazing ocean
#

ah i thought ?nms was a diff one ig

vernal oasis
#

How can I make a cooldown for an item. Not like a p.setCooldown(Material, time)?

#

Would I just use a hashmap or something?

plucky rock
#
HashMap<Player, Integer> PeaShooterCD = new HashMap<>();


    @EventHandler
    public void OnRightClickWithPeaShooter(PlayerInteractEvent event) {
        if (event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
            if (event.getItem() != null) {
                if (event.getItem().getItemMeta().equals(Items.PeaShooter.getItemMeta())) {
                  Player player = event.getPlayer


                    if (PeaShooterCD.isEmpty()) {

                        new BukkitRunnable() {

                            @Override
                            public void run() {
                                PeaShooterCD.remove(player, 1);
                            }
                        }.runTaskLater(RandomRoomGen.getPlugin(), 20);




                    }
                }

            }

``` smtn like this should work atleast it worked for me
#

there might be holes in it since i broke down a much larger script to get this and didnt really proof read

#

might not be the best way to do it but its how i did it

vernal oasis
#

private final HashMap<UUID, Long> cooldown;

    public Consumption() {
        this.cooldown = new HashMap<>();
    }


if (!cooldown.containsKey(p.getUniqueId()) || System.currentTimeMillis() - cooldown.get(p.getUniqueId()) > 20000) { // 20 seconds
                cooldown.put(p.getUniqueId(), System.currentTimeMillis());
                p.setSaturation(20);
                p.setFoodLevel(20);
            } else {
                e.setCancelled(true);
            }
#

Think this should work, right?

plucky rock
#

try it

vernal oasis
#

puts the players uuid in at the system time, then if they try it again it checks if 20000 ms has passed

#

yeah that should work

plucky rock
#

try it and see

vernal oasis
plucky rock
#

i think it should work

#

did it work cause i might do that too XD

#

that loos better than what I did

blazing ocean
undone axleBOT
trail brook
#

Do BuildTools normally take a long time?

blazing ocean
#

yea

#

on first run atleast

tender shard
trail brook
#

Huh, it's been minutes and it's currently on Starting clone of https://hub.spigotmc.org/stash/scm/spigot/builddata.git

#

I'm guessing that's normal

tender shard
#

oh that sounds like an internet issue

grim hound
vernal oasis
#

wdym?

grim hound
#

You can just use one #compute

grim hound
#

Func

#

does anyone know why this happens?

dawn flower
#

you can do that with bytebuddy?

#

wtf

lilac dagger
#

yo byte buddy is op

grim hound
lilac dagger
#

weird

#

it seems really cool being able to intercept methods on call

shadow night
#

Seems dangerous

lilac dagger
#

i dunno why i'm getting this warning

tardy delta
#

let me know if you figure it out, been looking at that for three months now

lilac dagger
#

a clean install usually removes the warning

#

but it's still weird

#

i think it has to do with jdk 21 and compiling down to java 17

#

but that makes no sense, it should work just fine either way

dry hazel
grim hound
#

will try rn

dry hazel
#

the javadoc of MethodDelegation#to says:

Delegates any intercepted method to invoke a static method that is declared by the supplied type. To be considered a valid delegation target, the target method must be visible and accessible to the instrumented type. This is the case if the target type is either public or in the same package as the instrumented type and if the target method is either public or non-private and in the same package as the instrumented type. Private methods can only be used as a delegation target if the interception is targeting the instrumented type.

grim hound
#

yeah it works xd

#

damn

#

I spent so long solving a silly issue like this

#

I got another error tho

#

Caused by: java.lang.IllegalStateException: Class already loaded: class net.minecraft.server.dedicated.DedicatedPlayerList

grim hound
#

and none of the subclasses

dry hazel
#

show the code and entire stack trace

grim hound
#

oh wait, nvm, it was because I was experimenting with redefine instead

#

mb

grim hound
ashen night
#

how i can do rebuild the ore every 10m same Boxpvp

polar forge
#

Hey guys

#

So I’m starting over with making my ban plugin, bc I wanted to implement a data storage, and 2 commands to get data out of that .txt file. Like /isplayerbanned <player> checks in the data storage txt file if that player is banned, and /banreason <player> checks the banreason of that player. I am now stuck at banning players when online and offline

#

They told me to use getUniqueId but I’m not sure how

tardy delta
#

please use a set

#

simply have a text file with an uuid per line ig

#

also use Path instead of File and Files.newBufferedReader and stuff

#

just recommendations

polar forge
#

I’m not that experienced with those

wet breach
tardy delta
#

i keep getting that same warning from somewhere else

lilac dagger
#

i don't use jfx

#

is it a glitch in intellij?

upper hazel
#

it is better to have an interface with implementation or a method as an argument for template code

lilac dagger
#

the later

#

bridges are generally prefered over default interface behaviour

glass raven
#

i have no idea why i'm getting this error, anyone wonders why?

if (params.get("auth-token") != null && params.get("auth-token").get(0).equals(authToken)) {
                            String strMaterial = params.get("material").get(0);
                            String amount = params.get("amount").get(0);
                            if (Material.matchMaterial(String strMaterial) != null) {
                                Material material = Material.matchMaterial(strMaterial);

                            }
                            res.status(Http.Status.OK_200);
                            res.send("Sent '" + amount + "' from " + from + " to " + to);
                        } else {
                            res.status(Http.Status.UNAUTHORIZED_401);
                            res.send("Invalid auth token");
                        }
desert loom
glass raven
#

it worked

vital ridge
#

I created a custom entity class that extends EntityZombie. It's called SupremeZombieEntity. I spawned it in and now under entitydamageevent I'm checking if the entity hit (my entity) is instanceof SupremeZombieEntity, but the if check returns false and says its an instanceof CraftZombie cuz entity zombie is it's parent class, I don't rly understand why it works like that if the object created and spawned in the world was SupremeZombieEntity.

stiff sonnet
#

a kind of general java question: I have a class (e.g. Myclass extends MySuperClass) where I call the super constructor. The super constructor itself passes this to another method. Would myInstance instanceof Myclass in that other method still work?

solid cargo
inner mulch
stiff sonnet
#

yes

#

the super constructor passes this to something else

inner mulch
#

yes im pretty sure taht would be true the instaneof thing

stiff sonnet
#

thanks!

inner mulch
#

as you are passing a instance of the subclass

#

and then in the superclass you are checking if its the subclass

inner mulch
stiff sonnet
#

now I'm getting confused. Let me give you an example:

class MySuperClass {
MySuperClass() {
foobar(this);
}
}

class MyClass extends MySuperClass {
MyClass() {
super();
}
}

public boolean foobar(MySuperClass clazz) {
return clazz instanceof MyClass; // true or false?
}
inner mulch
#

wait actually it prob works, but may i ask why u are doing this, maybe there is a better solution as this sound like an anti pattern to me

stiff sonnet
inner mulch
#

alr but why? do you want to change method behaviour based on that?

stiff sonnet
#

yes

inner mulch
#

alright in this case, go into ur subclass and just override the methods

stiff sonnet
#

depending on which one is which I want to change some behaviour in other classes

inner mulch
#

i think if i understand correctly you can simply override the methods

stiff sonnet
#

not really

inner mulch
#

this will make it much cleaner

stiff sonnet
#

since it's otehr classes

#

let me adapt my example:

class MySuperClass {
MySuperClass() {
new TheBigThing(this);
}
}

class MyClass extends MySuperClass {
MyClass() {
super();
}
}

class TheBigThing {
TheBigThing(MySuperClass clazz) {
if (clazz instanceof MyClass)
// do this
else 
// do that
}
cinder abyss
#

Hello, I get this error when trying to build 1.20.6 with buildtools and mojmaps (paste.md5 isn't working so I put a txt)

stiff sonnet
glass raven
#

how can someone get their uuid? server is offline mode

stiff sonnet
glass raven
#

e?

stiff sonnet
#

entity

#

also works in offline mode, but the server generates its own UUIDs

glass raven
#

what’s the problem with that?

#

would it fuck up if i use it with premium and non-premium users?

stiff sonnet
#

was half expecting you to try to get the UUID associated with a playername straight from mojang

glass raven
stiff sonnet
#

the server already does that in online mode

glass raven
#

but as it’s offline i would need my players to run the command and use e.getUniqueID()?

stiff sonnet
#

as I said getUniqueID works in both online and offline mode. The only difference being where the UUID comes from

inner mulch
glass raven
#

i just need the uuid to get OfflinePlayer as string is deprecated

inner mulch
#

im pretty sure then there is not authentication at all

stiff sonnet
#

It's funny how minecraft basically comes with a built-in way to pirate the game

inner mulch
#

if you are just running offline mod

glass raven
glass raven
stiff sonnet
glass raven
stiff sonnet
#

why? If you have a proxy authenticate a player once instead of authenticating every player every time they switch servers it significantly reduces the load on the auth API

#

it's useful

slender elbow
#

remember when LAN parties used to be a thing? :')

polar forge
#

I always used it on bedrock

shadow night
polar forge
#

Guys I need help in something pls

#

So

#

Im (re)making a ban plugin, that implements a storage data txt file, where I could retrieve some info with these 2 commands /isplayerbanned (checks if the player name is in the file) and /banreason

#

So I’m now stuck at the point to ban players offline and online

#

The plugin must also check if that username given is a real username

#

Here’s the full code

#

The problem is now to ban players offline and online, both using getUniqueId. And retrieve info with the commands I gave

young knoll
#

getOfflinePlayer can take a username to look up

#

Also I would recommend a more proper storage format

#

Either something like json or a datapbase

polar forge
#

So Player target = Bukkit.getOfflinePlayer()?

#

But is there a way to not differentiate between online and offline players?

young knoll
#

getOfflinePlayer should also retrieve online players

eternal oxide
#

ooh thats going to confuse him 🙂

remote swallow
#

#isOnline be like

polar forge
#

Indeed, I’m confused

#

So I wrote the thing, but it tells me to put an UUID inside the brackets

young knoll
#

You can also do a string

blazing ocean
#

should throw an error if offline

polar forge
#

But I don’t want to differentiate between offline and online

#

Is this possible?

blazing ocean
#

then use offline

eternal oxide
#

ALWAYS work with OfflinePlayer for a ban plugin

blazing ocean
#

yeah most certainly

eternal oxide
#

You only need a Player Object to send them messages or kick.

blazing ocean
#

surround it with a null check, getPlayer in there

eternal oxide
#

no

#

use OfflinePlayer#isOnline() to see if they are online

blazing ocean
#

yeah that too

#

that's what I meant

#
OfflinePlayer offlinePlayer = ...
if(offlinePlayer.isOnline()) {
    offlinePlayer.getPlayer().sendMessage(...)
}
polar forge
#

What should come after the =

eternal oxide
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

blazing ocean
#

^^

eternal oxide
#

You have been given the correct code (by myself) more than once.

#

and others

blazing ocean
polar forge
#

Bukkit#getOfflinePlayer right?

blazing ocean
#

yes

stiff sonnet
#

is there a less ugly way to do this?

if (Math.abs(Math.abs(pl.x()) - Math.abs(spawnPos.x())) > 50
                            || Math.abs(Math.abs(pl.y()) - Math.abs(spawnPos.y())) > 50
                            || Math.abs(Math.abs(pl.z()) - Math.abs(spawnPos.z())) > 50) {
#

all I'm checking is if one location is more than 50 blocks away from another location

stiff sonnet
#

I somehow doubt that

#

distance uses a square root and those aren't really efficient are they

sullen canyon
#

you asked for a less ugly way

stiff sonnet
#

that is still comparably efficient*

eternal oxide
#

or Math.abs(location.subtract(spawn).toVector().length))

stiff sonnet
#

.length does the same thing as getDistance though

sullen canyon
stiff sonnet
#

good point

#

shid I didn't think of that

polar forge
stiff sonnet
#

I was hoping to avoid Math.max and Math.min for that

polar forge
eternal oxide
#

We can only say the same thing so many times before we realize you don't listen or don't learn

polar forge
#

I read what u guys said, but I don’t understand what u guys mean

eternal oxide
#

Because you don;t know java basics

#

which we told you to learn

#

You don;t understand method arguments

#

So no matter how many times we tell you something, you do not understand it.

smoky lance
#

Has anyone here already handled setting many blocks in a world at once while also moving the player? I am having issues where after setting tons of blocks and teleporting the player to this place, the player's client freezes for some seconds. Why would that be?

I also see these warn messages in the console, should I worry?

[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=167, z=71} state Block{minecraft:air} invalid for ticking:
[09:33:50 WARN]: Block entity minecraft:furnace @ BlockPosition{x=534, y=166, z=71} state Block{minecraft:air} invalid for ticking:
stiff sonnet
#

god dammit this chat filter can kiss my butt

polar forge
#

That’s easy

stiff sonnet
#
double sx = spawnPos.x();
            double sy = spawnPos.y();
            double sz = spawnPos.z();

            double px = pl.x();
            double py = pl.y();
            double pz = pl.z();
            
            if (Math.max(sx, px) - Math.min(sx, px) > 50
                || Math.max(sy, py) - Math.min(sy, py) > 50
                || Math.max(sz, pz) - Math.min(sz, pz) > 50) {
                pc.get_Bukkit().teleport(spawnPos);
            }

I don't know if this is more or less ugly

shadow night
#

what

eternal oxide
vital sandal
#

Minecraft blocks id is in 8 bits = 256 blocks but in the newer version we have more blocks so where does these go ?

grim hound
#

yo

#

what packets does the player need

#

to join the game

#

like after everything when just "Joining world..." stays

slender elbow
#

several years

#

each block type has a namespaced key, minecraft:obsidian, minecraft:nether_portal etc

#

minecraft:waxed_weathered_cut_copper_stairs

remote swallow
#

what about the waxed lightly weathered cut copper stairs

slender elbow
#

the lightly was removed before it made it to release afaik

remote swallow
#

nooooo

young knoll
#

IF you don't want to use vector#distance

#

use distanceSquared

grim hound
#

login

grim hound
#

thanks

willow siren
#

br how do i verify i see no link in the conversatioon

remote swallow
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

willow siren
#

ik

#

but there no link in the message that it send on spigot

remote swallow
#

it should say click here and you click that

#

if you cant try a different browser

willow siren
#

@remote swallow how do i link my spigot to discord?

remote swallow
#

you have

willow siren
#

it says this

remote swallow
#

thats not spigot read the "This might take up to one day for the data to update"

willow siren
#

or could u plese tell me y mmoitems is not working on my server?

#

shows me this

#

@remote swallow

onyx fjord
#

i'd like to push player towards another entity however, i dont want player sprinting + jumping to affect the velocity, how can i do that?

willow siren
remote swallow
#

i cant help with mmo items as i dont own it or know anything about it

sullen canyon
onyx fjord
#

not gonna work i think

ruby sable
#

gonna be much faster than Math.min Math.max Math.min Math.max Math......

quaint mantle
#

if hytale has a plugin system like minecraft, can you make an api?

#

so do spigot developers have such an idea?

eternal oxide
#

If a platform has a plugin system, it already has an API

quaint mantle
#

then what happens to spigot and bukkit if minecraft has a special api for this?

dawn flower
#

how do i disable make camel dashing or make it weaker?

blazing ocean
#

(craftbukkit, paper, etc)

slender elbow
#

minecraft doesn't have an api

#

what

blazing ocean
#

yeah

#

wasn't 100% sure

quaint mantle
#

then let me change my question to this:

#

can you make an api to create plugins in hytale?

blazing ocean
#

mate

#

this is spigotmc

slender elbow
#

has that game ever seen the light of day lol

blazing ocean
#

"sir, this is a wendy's"

quaint mantle
#

isn't hytale the reason for minecraft's latest big updates?

blazing ocean
#

??

quaint mantle
#

some youtubers talking about this

#

hytale will be released in 2025

slender elbow
#

big copium

quaint mantle
#

well

#

where can i look at version 1.21 will bring and change for the api?

glass raven
#
package wtf.justmammtlol.plugins.LiquidREST;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class CommandUUID implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (sender instanceof Player) {
            Player player = (Player) sender;
            player.sendMessage(player.getUniqueID().toString());
        }

        return true;
    }
}```
slender elbow
#

you can already play some of the changes via the experimental datapack

#

some of the expected changes are also listed in the minecraft.wiki article for 1.21

slender elbow
#

that's odd

blazing ocean
#

i think it's getUniqueId()

earnest forum
#

Without the capitalised D at the end

blazing ocean
#

yeah

quaint mantle
#

new events or methods

glass raven
slender elbow
#

there is some of the experimental api as well

glass raven
#

this makes sense but also doesnt wtf

slender elbow
#

see e.g. Crafter block interface

blazing ocean
#

🤷

quaint mantle
#

luckperms can steal my db variables ?

slender elbow
#

wat

quaint mantle
#

yes

#

they can get my db?

#

with /lp editor

quaint mantle
#

how works ?

#

and lp editor site domain is yours

slender elbow
#

i mean it sure isn't mine mine

quaint mantle
quaint mantle
willow siren
#

bro

dawn flower
#

??

#

ik that exists

willow siren
#

can any1 tell me

#

y mmocore and items doesnt work

slender elbow
#

your permission data is uploaded to a site where the editor frontend takes it from, it is assigned a unique id that you need in the editor to access, and after some time that data expires

ruby sable
dawn flower
#

it doesnt work

slender elbow
#

mind you that it isn't a direct modification access to your permissions data, since you still need to apply the changes that you make in the editor in your server

dawn flower
#

it exists cuz it extends AbstractHorse

ruby sable
#

I gather that they both use the jump strength attribute because of that

#

ive honestly never touched a camel though

#

cant say

quaint mantle
# dawn flower it exists cuz it extends ``AbstractHorse``

isDashing Link icon
boolean isDashing()
Gets whether this camel is dashing (sprinting).
Returns:
dashing status

setDashing Link icon
void setDashing(boolean dashing)
Sets whether this camel is dashing (sprinting).
Parameters:
dashing - new dashing status

quaint mantle
#

what are u trying ?

#

sry o forgot

icy beacon
#

fucking double click

quaint mantle
#

wdym ?_ 😄

worthy yarrow
#

No con didn’t D:

remote swallow
#

#general message gg ez

worthy yarrow
#

D:

stiff sonnet
dawn flower
dawn flower
#

general exists

dawn flower
#

oml

dawn flower
summer gale
#

this is my error

eternal night
#

upgrade your maven shade plugin

summer gale
#

any specific command?

eternal night
#

just replace the version with 3.5.3

summer gale
#

Well that was too easy

#

ty any way

cinder abyss
#

I don't see my message

#

Maybe I need to resend it

#

So, hello, I get this error when trying to build 1.20.6 with buildtools and mojmaps (paste.md5 isn't working so I put a txt)

icy beacon
nova quail
#

How can I make particles go slower? Because when I spawn them from clicked block they shoot and fly far away.

public class HookahEvent implements Listener {

    @EventHandler
    public void onBrewingStandClick(PlayerInteractEvent e) {
        Action action = e.getAction();

        if (action == Action.RIGHT_CLICK_BLOCK) {
            Block clickedBlock = e.getClickedBlock();

            if (clickedBlock != null && clickedBlock.getType() == Material.BREWING_STAND) {
                Player player = e.getPlayer();
                Location location = clickedBlock.getLocation();
                player.spawnParticle(Particle.CLOUD, location, 10);
            }
        }
    }
}
cinder abyss
#

idk why

young knoll
#

I believe the arg is called extra

nova quail
#

thanks

grim hound
#

does anyone know why this happens?

eternal night
#

eh what is c

#

but presumably resourceAsStream yields null

grim hound
eternal night
#

Yea so

#

pretty much always call getResourceAsStream on the classloader

#

not a specific class

eternal night
grim hound
eternal night
#

read up ^

icy beacon
# grim hound

this is why you use descriptive names instead of one-letter names 😛

eternal night
#

Class.getResource can take a "relative" resource name, which is treated relative to the class's package. Alternatively you can specify an "absolute" resource name by using a leading slash. Classloader resource paths are always deemed to be absolute.

icy beacon
eternal night
#

facts KEKW

tardy delta
#

c.getResourceAsStream()
c must be a class or classloader, duhh

dawn flower
#

how do i cancel VehicleMoveEvent properly

#

(it isn't even triggering)

icy beacon
grim hound
grim hound
# grim hound

I thought this was the relative placement to the Class

grim hound
#

and that'll do?

remote swallow
#

id do class.getClassLoader().getResource

grim hound
eternal oxide
#

define "properly"

#

event.setCancelled(true) is "properly"

dawn flower
#

basically cancel it without making the player (passenger) outside and the vehicle inside

eternal oxide
#

The client extrapolates movement. You can;t cancel a move event and not have the client attempt to guess its location

dawn flower
#

i need to cancel it tho

#

or else itd mess everything up

eternal oxide
#

If you allow it to move teh client will always make a guess. You can;t prevent it

dawn flower
#

this is annoying

eternal oxide
#

possibly, disable any AI, read teh steer package from the client and calculate your Location and teleport as required.

#

No idea if steer packets still get sent when there is no AI

dawn flower
#

do u know what the steer packet is in protocollib

eternal oxide
#

I've never used it

dawn flower
#

oof

dawn flower
#

crap it doesnt tell me where the new location is?

#

so thats why u told me to calculate it :-:

#

oh wait it has xyz

#

im confused, what's the difference between VEHICLE_MOVE and STEER_VEHICLE

#

steering no ai mobs for whatever the damn reason works

young knoll
#

lol

#

It's not part of the ai step Ig

dawn flower
#

i feel like cancelling the packet will work

eternal oxide
#

cancelign will NOT work

dawn flower
#

dawg

young knoll
#

It might

dawn flower
#

dubai is here cuz whoever built it didnt listen to people, they told him it wont

young knoll
#

tas

eternal oxide
#

I've told you a few times, you are seeing teh horse move away because your client is predicting the movement and you cancelling the move event is resetting the position

dawn flower
#

u gotta be smart

young knoll
#

ah its a horse

#

yeah that might not work

dawn flower
#

crap

eternal oxide
#

you have to disable AI to prevent teh client moving the horse at all.

dawn flower
#

it didnt work cuz u said it wont

eternal oxide
#

listen to the steer packets, calculate the location and terleport the horse.

dawn flower
#

u cant teleport vehicles

eternal oxide
#

its an entity

dawn flower
#

ok?

#

it has passengers

eternal oxide
#

you can teleport entities

dawn flower
#

it yoinks the passengers

eternal oxide
#

just makes it a little harder

#

you could just send a move packet instead

nova quail
#

How to get block metadata and only if it has metadata run event. I have made a plugin in which when player do a right click on brewing stand spawns cloud particles.

eternal oxide
#

or remount the passenger, but then you get jerky passenger movement instead of the horse

#

?paste spam

undone axleBOT
dawn flower
#

dear lord

dawn flower
#

why are most java pastes .cs

storm crystal
#

oh, so you can just get and save inventory state using methods of that object?

eternal oxide
nova quail
eternal oxide
#

set a PDC tag, as you already do

nova quail
#

So not all brewing stand will spawn particles

eternal oxide
#

but you have to transfer that to the placed TileEntity when its placed

#

the PDC will not copy over from teh item to the Block. You have to do that yourself

dawn flower
#

why the flip isn't steer not in wiki.vg

nova quail
#

don't understand what I need to do

dawn flower
eternal oxide
fringe yew
#

i have a class that writes and reads from and to a yml file. the writing works completely fine - it sets the value to the correct value. though, after restarting the server and joining, it reads the file correctly the first time, and every time the plugin tries to read the value after that, it always returns the original value, as if the plugin is somehow caching the value?

https://paste.md-5.net/eroqozezes.java

eternal oxide
#

sorry wrong one

#

thats the client

#

No it is correct

#

thats the right packet

tardy delta
fringe yew
#

no, literally the first time it reads from the yml file after a server reboot it works fine, then every attempt afterwards returns the same value no matter what

storm crystal
#

Im thinking about creating object that would manage GUIs via inventories, so far I came up with 3 methods to retrieve, save and initialize certain inventory, but im thinking if I should list GUI listeners in separate object such as on item click etc.

fringe yew
#

until you restart the server

storm crystal
#

so I would eventually end up with two objects, one for managing inventories and one for managing events inside those inventories

#

would that sound like an okay plan?

tardy delta
fringe yew
#

no

#

the one after the restart

tardy delta
#

what

#

ofc its gonna return the same value from after the restart, what am i not understanding

icy beacon
dapper flower
#

How do i get an nms item stack and how do i import it, there is a plugin i am updating myself that is using that

#

it is like this rn

net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(itemStack);
inner mulch
remote swallow
dapper flower
icy beacon
#

?bt

undone axleBOT
remote swallow
#

follow this guide

#

?nms

dapper flower
#

why do i need to do it myself, isnt there a copy somewhere on internet or smth

eternal oxide
#

Illegal to distribute. Use Buildtools

#

double click it, it has a UI

dapper flower
#

weird laws, you cannot distribute it but people can sell their plugins

icy beacon
#

?dmca

undone axleBOT
icy beacon
#

distributing plugins != distributing the spigot core

eternal oxide
#

When compiled Spigot contains Mojang code so its illegal to distribute a compiled jar.

remote swallow
#

before you say paper

#

the jar paper distribute doesnt contain mojang code but downloads it at first run which puts it in a legal grayzone

foggy cave
#

so why does buildtools make it legal

#

basically the same thing

dapper flower
remote swallow
dapper flower
#

Why aren't ocelot Sittable entities

icy beacon
remote swallow
#

its cats now

foggy cave
#

buildtools redistributes the code tho

remote swallow
#

no

dapper flower
#

you can

remote swallow
#

buildtools has no mojang code it

icy beacon
remote swallow
#

it downloads the minecraft jar from mojang and patches it

foggy cave
#

so building it urself means u can get the code but you cant download a prebuilt binary

icy beacon
#

yes basically

shadow night
foggy cave
#

cold thats just stupid

#

who did that

remote swallow
#

blame the dmca

sleek estuary
#

the print code is executed when someone enters the server. the console displays "impl a" and "false" and then crashes. With debugging, I came to the conclusion that pluginmanager.ispluginenabled() was the reason for the crash, so I removed the line and the crash stopped. Why does it happen?

remote swallow
#

?dmca

undone axleBOT
foggy cave
#

who did the dmca

shadow night
#

Did you know forge or fabric installers both do the same thing as buildtools?

#

Well, dunno about fabric tbh, but forge does the same thing basically

remote swallow
#

if you read the dmca you'll see why

foggy cave
remote swallow
#

honestly it was fair

shadow night
#

They had some good reasons

foggy cave
#

like what

foggy cave
#

link isnt resolving

icy beacon
#

it is

remote swallow
#

mojang owned bukkit but didnt make it public so had people basically doing paid work for free

foggy cave
#

and?

#

its called volunteering

icy beacon
#

Bukkit's Retirement(top)
On August 24th 2014, the old Bukkit Development Team decided to retire the Bukkit project, due to a decline in development interest and a lack of new blood for contributions.

Mojang's Takeover(top)
In response to Bukkit's announcement, Mojang revealed that they had secretly owned the Bukkit Project for a few years, and revoked the Bukkit team's access to all bukkit resources (github, forums and others).

Wolvereness(top)

Wolvereness is someone who developed CraftBukkit. He was one of the largest contributors in the codebase. After the aforementioned event had occurred, he filed a DMCA takedown.

remote swallow
# foggy cave its called volunteering

okay so how would you feel if you went and volunteered for this small company that you think is only a few people with not that much behind it and it turns out to be a giant corp

foggy cave
#

nice he developed craftbukkit good job no need to dmca it

#

the guys a fart

remote swallow
#

he isnt

foggy cave
#

he only made it harder for the users not the big company

#

🤦‍♂️

icy beacon
remote swallow
#

if you contributed and made most of craftbukkit and it turned out to be for mojang i dont think you'd be very happy

shadow night
#

Wasn't the license also not properly enforced or some shit like that

dawn flower
#

wait where does this specify the vehicle being moved

dapper flower
#

corporate bs goes a long way

#

villager could hold emeralds in the past? i saw a method called .setRiches() for carrying emeralds

remote swallow
#

if you hold something they want to buy they'll show an emerald

dawn flower
#

dont they store stuff in chests and composters?

remote swallow
#

they use them but dont store anything

young knoll
#

They use composters to refresh trades

#

They don't interact with chests

dawn flower
#

i always thought they could wtf

remote swallow
#

sounds like uve been playing modded

dawn flower
#

i prob got this false memory from seeing filled chests

dawn flower
#

i can teleport the flippin vehicle

#

why isn't this in spigot

young knoll
#

I know there was a PR for teleporting entities with passengers

#

Idk if it ever got merged

dawn flower
#

but im still confused what vehicle its moving, i never specified an entity id

eternal oxide
#

its sent to the client so it moves teh vehicle the player is in

dawn flower
#

that makes perfect sense, but how does it get reflected server wide

eternal oxide
#

if the player is not in a vehicle its ignored

#

other clients get a position update packet for the entity

dawn flower
#

ah

#

this is still cool

fringe yew
#

e.g. if you read the file when the server just started up and it was true, then changed the value to false and read the file again, it'll still return true.

#

but when you restart it resets this

#

so it's caching or something

eternal oxide
#

each time you read from the config you are readign from memory

fringe yew
#

breh

#

so it is basically caching then

eternal oxide
#

memory does not get updated if you manually change a value in the file

fringe yew
#

i'm not manually changing it

#

i'm changing it via #set()

#

and then doing #save()

#

and it updates correctly in the file

eternal oxide
#

Then I (as well) have no clue what you are saying

eternal oxide
#

if you call save and the file IS saved, then your memory and file are correc t

tardy delta
eternal oxide
#

where is the incorrect value?

tardy delta
#

if you change thhe file externally, it wont update int the FIleConfiguration

fringe yew
dawn flower
tardy delta
#

please dont use lazy initialization, it only complicates things

fringe yew
#

i dont know what that means

tardy delta
#

if null init()

#

try reproducing in a minimal environment

fringe yew
#

what does that mean!

tardy delta
#

what does what mean

fringe yew
#

reproducing in a minimal environment...

tardy delta
#

reproduce it without extra code to worry about

eternal oxide
#

where are you using the SaveManager?

acoustic pendant
#

Hey, could someone help me?
I'm trying to configure my gpg key in intelij idea and did all the steps, but now it says this when trying to commit
gpg: skipped "mykey": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

fringe yew
#
public void GiveEffect(Player player) {
        String PlayerUUID = player.getUniqueId().toString();
        boolean toggled = manager.getValue(PlayerUUID);

        this.SendConsoleMessage("toggled: " + toggled);
        if (toggled) {
            player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 255, false, false));
        } else {
            player.removePotionEffect(PotionEffectType.NIGHT_VISION);
        }
    }
#

this

tardy delta
eternal oxide
#

so where are you defining manager?

acoustic pendant
acoustic pendant
#

and when trying to configure it in intelij

tardy delta
#

idk i dont use the gui tools for git

acoustic pendant
#

But this appears when trying to configure the key

tardy delta
#

do you have a eprivate key

acoustic pendant
#

i have just made it

dapper flower
#

What is the more modern version of NBTTagString and NBTTagList?

acoustic pendant
#

but for some reason it says that

dapper flower
remote swallow
dapper flower
remote swallow
#

the method valueOf

dapper flower
#

oh yeah

#

weird ass implementation but alr it worked ty

acoustic pendant
glass raven
#

how can i read a OfflinePlayer inventory?

#

if i transform it to Player, #getInventory() wont work

young knoll
#

You need to use NMS

#

Or a third party NBT library

glass raven
#

how much would that be difficult

young knoll
#

Define difficult

glass raven
#

long and intricated process

fringe yew
young knoll
glass raven
#

i have no idea tho, i was looking at projects like OpenInv but there's no clear info on how to use them in development

dapper flower
#

NoClassDefFoundError: net/minecraft/nbt/Tag aaaaaaaaaa

remote swallow
#

you arent remapping

#

read the docs again

#

?nms

remote swallow
dapper flower
#

it is remapped

remote swallow
#

?paste ur pom.xml

undone axleBOT
dapper flower
#
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier></dependency>
#

looks remapped to me

remote swallow
#

that is spigot remapped

#

you need to remap back to obsfucated

#

read the docs again

#

?nms

dapper flower
#

please shot me, rereading...

glass raven
remote swallow
dapper flower
remote swallow
#

bang on

tardy delta
dapper flower
#

can i ask as imple question:

What are Mojang mappings?

Mojang is obfuscating certain method and field names before shipping Minecraft. That means you will have a very bad experience when you want to access NMS in the classic way, because most fields are simply called “a”, “b”, “c”, etc. Fortunately, Mojang decided to release their obfuscation map, which means that you can actually use the same names that the Mojang developers are using.

Why?

remote swallow
#

why they obsfucate?

tardy delta
#

because obfuscation is a thing

dapper flower
#

why obfuscate then release the mapping

eternal night
#

✨ legal reasons ✨

dapper flower
#

we learning the loopholes with this one 🗣️ 🗣️ 🗣️ 🔥 🔥

glass raven
# glass raven chest?

well i just need to know if the inventory contains at least an itemstack but have no idea on how to use NMS and NBT @tardy delta r

tardy delta
#

dont either

dapper flower
glass raven
#

you know any library?

hybrid quartz
#

How can I close brewing stand's gui?

    @EventHandler
    public void onBrewingStandClick(PlayerInteractEvent e) {
        Action action = e.getAction();

        if (action == Action.RIGHT_CLICK_BLOCK) {
            Block clickedBlock = e.getClickedBlock();

            if (clickedBlock != null && clickedBlock.getType() == Material.BREWING_STAND) {
                Location location = clickedBlock.getLocation();

                if (Plugin.specialBrewingStands.containsKey(location)) {
                    Player player = e.getPlayer();
                    player.spawnParticle(Particle.CLOUD, location, 10, 0, 0, 0, 0.1);
                    player.sendMessage("§fВы затянулись");
                }
grim hound
lilac dagger
#

player.closeinventory

#

it also closes chat

warm mica
#

What I tend to do is to check when that version was released and rollback within its history a few days after that date

#

@grim hound

warm mica
#

No, there is a history on every page

#

It was removed. SPELL_MOB now allows you to add custom alpha values, making the AMBIENT one absolete

#

You're welcome Elon

grim hound
#

does anyone know why this screen won't go away? For context, I'm trying to let the player join whilst blocking the packets from the server (internal mechanic, the server doesn't even send the packets because of it)

#

The version is for both 1.20.1

#

and this is my packet send order

lilac dagger
tardy delta
#

scary

grim hound
#

pl is terrible

tardy delta
#

since when is Main responsable for logging? no logger?

lilac dagger
#

this isn't much better tho

#

oof

tardy delta
#

forgive me my questions but i have nothing to do atm

fleet kraken
#

Is possible voice chat without client-side?

grim hound
# lilac dagger

what the fuck can the guy do about the fact that this is minecraft's protocol

tardy delta
#

wddfwdwdw() beautiful

grim hound
grim hound
fleet kraken
grim hound
#

and move from channels

lilac dagger
grim hound
#

what are you on about

#

and a builder doesn't even make sense here

lilac dagger
#

it's alright

grim hound
#

this is how I make em chunks

#

cuz the author forgot the set methods for these

tardy delta
#

VarHandle?

grim hound
tardy delta
#

you dont realize how slow reflection is

grim hound
#

a testing stage

#
  1. All of this will be static final when it'll work
#
  1. If I was worried about speed, I would use Unsafe
grim hound
#

does anyone know how to have it progress to "Loading terrain..."

grim hound
#

the wiki covers that if you're struggling

tardy delta
#

im wondering if its already disallowed to directly mmodify variables using field offsets 🤔

grim hound
#

but I can't even get past "joining world" xD

tardy delta
#

saw a jep for it

#

either way doesnt matter for this subject

tardy delta
grim hound
#

probably Login Success

tardy delta
#

been a while ago since i implemented packets and it was in minestom

grim hound
#

since it ends the login phase

grim hound
remote swallow
#

?maven for me

undone axleBOT
tardy delta
acoustic pendant
#

Hey, i cannot commit to github because it says i don't have a private key, i have tried to set the gpg key but it says the same thing... I've searched in google but no post seems to work... do someone know how to solve this problem?

#

intelijj says that it Cannot find suitable private key

grim hound
tardy delta
#

The packet that initiates the "Loading Terrain" screen is the Chunk Data packet (0x07)
~ ai

#

would make sense

glass raven
#

how do i add nms to an existing project?

grim hound
#

but wtf is that

#

it's a normal chunk packet

#

but with some identifier the client recognizes

tardy delta
#

talking about this?

weak bear
#

Hello do you know why I can send information to my server via sockets but when I try to response with my server the client does not get the response I used BufferedReader
That crash my client side

grim hound
tardy delta
#

talking about spigot? what crash

tardy delta
grim hound
#

this is what the server does

tardy delta
#

very clear to me /s

grim hound
#

sarcasm?

tardy delta
#

assume so

#

cant really help you with that

glass raven
#

Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find org.spigotmcspigot1.16.5-R0.1-SNAPSHOT.

remote swallow
#

if your using maven or gradle dont add jars to artifacts

eternal oxide
#

?maven

undone axleBOT
remote swallow
#

add mavenLocal() to your dependencies block

eternal oxide
#

that link ^ has a link for gradle at the bottom

glass raven
# remote swallow add mavenLocal() to your dependencies block

Execution failed for task ':compileJava'.

Could not resolve all files for configuration ':compileClasspath'.
Could not find spigot-1.16.5-R0.1-SNAPSHOT-remapped-mojang.jar (org.spigotmcspigot1.16.5-R0.1-SNAPSHOT).
Searched in the following locations:
file:/Users/mariopizzano/.m2/repository/org/spigotmc/spigot/1.16.5-R0.1-SNAPSHOT/spigot-1.16.5-R0.1-SNAPSHOT-remapped-mojang.jar

remote swallow
#

if you want to use remapped with gradle you need a 3rd party pluin

glass raven
remote swallow
#

?nms has something on for gradle

glass raven
#

build.gradle

plugins {
    id 'java'
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id 'maven-publish'
    id 'io.github.patrick.remapper' version "1.4.0"
}

group = 'wtf.justmammtlol.plugins.LiquidREST'
version = '0.2'

shadowJar {

}

dependencies {
    testImplementation platform('org.junit:junit-bom:5.9.1')
    testImplementation 'org.junit.jupiter:junit-jupiter'
    compileOnly 'org.spigotmc:spigot:1.16.5-R0.1-SNAPSHOT:remapped-mojang'
    compileOnly 'net.essentialsx:EssentialsX:2.19.0'
    compileOnly "com.github.MilkBowl:VaultAPI:1.7"
    implementation 'io.helidon.webserver:helidon-webserver:2.6.4'
    implementation 'io.helidon.media:helidon-media-jsonp:2.6.4'

}


java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}
tasks.remap {
    version.set("1.16.5")
}
tasks.build {
    dependsOn(tasks.remap)
}




repositories {
    mavenCentral()
    mavenLocal()
    maven { url 'https://ci.ender.zone/plugin/repository/everything/' }
    maven { url 'https://repo1.maven.org/maven2/'}
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
    maven {
        url "https://repo.essentialsx.net/releases/"
        name "Essentials releases"
    }
    maven {
        name "papermc"
        url "https://papermc.io/repo/repository/maven-public/"
    }
    maven { url 'https://jitpack.io' }
}

test {
    useJUnitPlatform()
}```
#

i did what was needed from the ?nms guide

#

theorically

remote swallow
#

mojmaps dont exist for pre 1.17

#

well they do but spigot doesnt work with them

glass raven
#

how should i add nms pre 1.17?

remote swallow
#

your stuck with obsfucated

#

so remove the patrick remapper and remapped-mojang classifier

glass raven
#

how do i work with nbt if nms isn't available on 1.16.5

#

there's no way im using a, b, c, d

remote swallow
#

update then

rough ibex
#

the consequences of using 1.16.5

glass raven
#

imma kms istg

sullen canyon
#

What's the packet when player logs out from the server? PacketType.Login.Server.DISCONNECT does not seem to work (I am using protocollib)

glass raven
#

how do i even update now

sullen canyon
arctic monolith
#

Salut il y aurai un français qui s'y connais en nms?

orchid gazelle
#

Je connais en nms un peu mais mon connaissances en francais est mauvais

arctic monolith
orchid gazelle
#

oh well

#

yeah you are much better off asking in English here then

sullen canyon
sullen marlin
#

?xy

undone axleBOT
sullen canyon
arctic monolith
# orchid gazelle oh well

Ok, well I have a problem I dev an ap for a launcher (az launcher launcher of funcraft) I sent a message to the creator he replied to me and to create classes but I manage to set what he puts but he asks me for a notchian and I don't know it...

quaint mantle
#

how do i get the int code of a bukkit chatcolor

worldly ingot
# sullen canyon nothing I can do about it

md is asking what you're trying to achieve and why you need a packet listener to do this over just the PlayerQuitEvent that Bukkit provides you, which is essentially an API, version-independent packet listener for plugins.

#

What about the PQE is insufficient?

sullen canyon
viral temple
young knoll
#

When life gives you PlayerQuitEvent you make PlayerQuitEventade?

viral temple
remote swallow
#

are you sure you didnt mean to say when life gives you the wheel you use it

sullen marlin
#

Also you probably won't get a packet if the connection just closes

#

So it's really unnecessarily bad design what you're trying to do

worldly ingot
#

I’m think if your system works mostly with packets, your system is flawed

remote swallow
#

your telling me hypixel isnt packet baseD?!?1

#

im telling symon hypicksel

tranquil beacon
#

does Simon still own the Hypixel server, or is someone else in charge now?

remote swallow
#

simon still owns it to what we know

tranquil beacon
#

pretty cool. I still remember when I first joined back in 2013 or 2012 when it opened, I can't quite recall

#

I didn't have a premium account back then; I only got one in 2014 when a friend gave me his because I heard that Hypixel had launched their server

#

God, he used to make the best adventure maps with Rezzus

tranquil glen
#

Making a library system for a project atm, it's just going to work inside of the console
I finished up a method to register users. Any thoughts or anything you guys would change?

#
public void register() {
        User newUser;
        String input;

        System.out.println("User registration");

        // Student or Librarian account creation selection

        System.out.println("(S)tudent or (L)ibrarian?");
        input = scanner.next();
        while (!(input.equalsIgnoreCase("s") || input.equalsIgnoreCase("l"))) {
            System.out.println("Unknown response. Please try again.");
            input = scanner.next();
        }

        if (input.equalsIgnoreCase("s")) {
            newUser = new Student();
            System.out.println("Creating new student account...");
        } else {
            newUser = new Librarian();
            System.out.println("Creating new librarian account...");
        }

        // Choose username

        String[] chosenUsername = {""}; // Container for chosen username
        boolean userNameTaken = true;

        while (userNameTaken) {
            System.out.println("\nPlease create a username: ");
            chosenUsername[0] = scanner.next();

            userNameTaken = library.getAllUsers().stream()
                    .anyMatch(user -> chosenUsername[0].equalsIgnoreCase(user.getUsername()));

            if (userNameTaken) {
                System.out.println("Username \"" + chosenUsername[0] + "\" is unavailable. Please try again.");
            }
        }
        newUser.setUsername(chosenUsername[0]);

        // Choose password

        String confirmedPassword = "";
        boolean passwordsMatch = false;

        while (!passwordsMatch) {
            System.out.println("\nPlease set a password: ");
            String password1 = scanner.next();

            System.out.println("Confirm your password: ");
            String password2 = scanner.next();

            if (password1.equals(password2)) {
                confirmedPassword = password1;
                passwordsMatch = true;
            } else {
               ```
#

            System.out.println("Passwords do not match. Please try again.");
            }
        }

        newUser.setPassword(confirmedPassword);

        if (newUser.isLibrarian()) library.addLibrarian((Librarian) newUser);
        else library.addStudent((Student) newUser);
    }```
#

Not trying to get u guys to do the work for me, just eager to learn lol

#

Here is the UML diagram again

#

That method is part of the LibrarySystemUI class

#

Example of it working:

eternal night
#

Generally, try to not print a new line after questions

#

the output rn looks pretty noisy

#

The code looks alright tho 👍

tranquil glen
#

okay, will keep that in mind

worldly ingot
#

Just doing it for fun to learn Java?

young knoll
#

Programmers do not have fun

#

Silly

river oracle
#

I do

young knoll
#

Stop lying

#

Banned

river oracle
#

not lying fr

slender elbow
river oracle
#

hell I've even enjoyed programming in C/C++

slender elbow
#

C is alright

#

C++ on the other hand

young knoll
#

What about JavaScript

slender elbow
#
typedef int $;
$ _=~!+[]()->$*{}();
worldly ingot
#

:I

slender elbow
#

jokes aside C++ is pretty okay imo

young knoll
#

I…

#

You know what I’m not gonna question it

slender elbow
#

I enjoy pain in more than one way

#

@winter cradle hi

winter cradle
slender elbow
#

the internet

worldly ingot
slender elbow
#

not a magazine

winter cradle
young knoll
#

Are you two secretly the same person

#

That would explain the names 👀

slender elbow
#

yes

#

but also no

#

but yes

#

have you ever seen both of us in the same place at the same time?

winter cradle
winter cradle
slender elbow
#

awhh

#

it's us

young knoll
#

Oh no e-dating

tranquil glen
#

but I just wanna learn, ya know?

slender elbow
#

but also with

#

but without

worldly ingot
#

Yeah, I can't really see anything wrong with it aside from maybe just extracting out your passwordsMatch assignment to the initial if condition

young knoll
#

Schrödinger’s e-dating

tardy mist
slender elbow
#

it is tho?

tardy mist
#

Nope

worldly ingot
#
passwordsMatch = password1.equals(password2);
if (passwordsMatch) {
    confirmedPassword = password1;
} else {
    System.out.println("Passwords do not match. Please try again.");
}
slender elbow
#

how not

tranquil glen
#

ohh okay

worldly ingot
#

That's really it just at a quick glance, and even that's a nitpick tbh

#

Code style is mostly pretty clean 🙂

young knoll
#

Crash the jvm if passwords don’t match

tranquil glen
worldly ingot
#

Fuck it. Bluescreen the computer

young knoll
#

Wonder if there’s an up to date exploit for that

#

Probably

tardy mist
#

valid identifiers in C++ cannot contain $ general

#

[] isn't a valid expression by itself

#

-> is used for member access but there is no object before it

#

{} defines a block but it comes after -> which is not allowed

slender elbow
#

have you ever heard of a lambda?

worldly ingot
#

tf is a lambda

tardy mist
#

Have you ever heard of the basics

slender elbow
#

I very much have

young knoll
#

A baby sheepda

slender elbow
#

have you heard of lambdas?

#

-> ret {}

slender elbow
slender elbow
slender elbow
tardy mist
# slender elbow I very much have

Looks like you haven't. Btw () at the end tires to call something but the preceding expression is not callable. Variable names like _ are allowed but discouraged, as names beginning with an underscore are reserved for use by the compiler and standard library

slender elbow
worldly ingot
#

You can definitely call a lambda :p

slender elbow
#

_ is discouraged but perfectly legal