#help-development

1 messages · Page 1302 of 1

fleet pier
#

ill just try my luck lol

buoyant viper
#

perchance

#

trying to think of how to do this eco system

#

bc i could callback-hell it, but im also now thinking of how to still make sure its synced

grand flint
#

hannah

torn shuttle
#

brother AI is killing me in godot

#

it keeps trying to be "safe" by checking if stuff is null

#

and then skipping over if it is

#

brother if 99% of these things are null then the game should crash, it means it will absolutely not function

#

like come on who would think it's a good idea to see if the map is null or not, if the map isn't there the game isn't going to work

sly topaz
#

what model are you using

#

and on which IDE

torn shuttle
#

chatgpt and claude both on website and ide

sly topaz
#

with or without subscription?

#

I would also recommend just using claude code if you're going to use claude, works well enough

#

the issue with AI right now is that we're in the phase where it "works" but it still kinda sucks at times, so if you want to lower the error rate, you'll have to either use the tools with the best integrations (i.e. Cursor + Claude) or tinker a lot with your prompts and make custom MCPs in order to feed it enough context to make it capable of doing things in an actually useful way

#

we're slowly getting to the point where all tooling is converging into AI-friendly software but we're definitely not there yet so if you don't tinker with your setup, you'll often get frustrated with it

twin venture
#

if only there is a MCPs dedicated for that job 😛

buoyant viper
#

ModCoderPack 🙏🏻🙏🏻🙏🏻

robust helm
#

how can i split my project my project up between common, spigot and velocity?

#

i saw taskchains just using multiple "src" directories each with their own respecetive module

willow shadow
#

Hi, do you know how to contact the Spigot support center? I'm having a problem with my account. I noticed I entered the wrong username and date of birth, and I need to change them, but Spigot's settings won't let me.
Thanks.

chrome beacon
#

one core/api module that contains interfaces and shared code

#

and then multiple modules implementing what's needed

undone axleBOT
willow shadow
thorn isle
#

You need to either write or use a framework with mcp and other integrations specifically for programming things, ideally in your specific language

torn shuttle
#

@echo basalt do you use digi

echo basalt
#

no

#

we're stuck on this meo enterprise contract until january

torn shuttle
#

I switched on monday

#

and I'm having a home internet outage rn

echo basalt
#

solid chance someone cut your fiber lines

torn shuttle
#

doubt

echo basalt
#

it's pretty common

torn shuttle
#

also the router went from saying I had no network to saying I do

#

except I still don't

#

I'm even checking on multiple devices just to be sure

echo basalt
#

your access point might be blasting but have no connection

torn shuttle
#

no, they have an actual internet connectivity light

#

it was red it's now green

#

this sucks

#

I connected my phone to my pc to have a connection

#

already contacted them and they said they were going to put in a ticket

vast dust
#

Hey yall

#

Good news

#

I just made one of my first patreon exclusive plugin

#

So

#

How can i test it

#

To make sure it doesnt actually crash

#

Anyone willing to test?

smoky anchor
#

Here's a suggestion: First test if the plugin works and THEN put it on patreon

dry forum
#
    public void modifyGems(double amount) {
        Bukkit.getLogger().info("user: " + id); // corect user
        Bukkit.getLogger().info("exists: " + file.exists()); // exists

        FileUtil util = new FileUtil(file);
        YamlConfiguration configuration = util.getConfiguration();

        double balance = configuration.getDouble("gems") + amount;
        Bukkit.getLogger().info("balance: " + balance); // 100
        configuration.set("gems", balance);

        util.save();
    }```
```java
    private final File file;
    private YamlConfiguration configuration;

    public FileUtil(File file) {
        this.file = file;
    }

    public YamlConfiguration getConfiguration() {
        YamlConfiguration configuration = new YamlConfiguration();
        try {
            configuration.load(this.file);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
        this.configuration = configuration;
        return configuration;
    }

    public File getFile() {
        return file;
    }

    public void save() {
        try {
            this.configuration.save(this.file);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }```

how is my gems value still 0...
smoky anchor
#

In your first function, you do not use amount at all = you do not modify the value

dry forum
smoky anchor
#

oh I am blind

chrome beacon
#

Where are you reading the value

#

so you know it's still 0

dry forum
#

manually doing modifyGems(100)

chrome beacon
#

You run it multiple times?

dry forum
#

nope just once

chrome beacon
#

so how do you know it's always 0

dry forum
#

im checking the file im storing it in and its 0

#

i also have a /gems command

pseudo hazel
#

is util.getConfiguration a copy action?

wet mortar
#

is there anywhere we can find people to dev some stuff in minecraft?

pseudo hazel
#

?services

undone axleBOT
crimson agate
#

How do u correctly use mojang mappings? Do I just use compileOnly("org.spigotmcspigot1.21.8-R0.1-SNAPSHOT:remapped-mojang")? Or am I missing sth

kind hatch
#

?nms

torn shuttle
#

@echo basalt it's a local outage

#

fml

echo basalt
#

L

chrome beacon
tribal narwhal
#

Is there a way to automatically publish plugin updates?

eternal night
#

to the spigot forums? don't think so

fresh timber
#

is there an event for when snow falls from biome like in a snowy biome snow will fall on blocks

young knoll
#

BlockFormEvent

echo basalt
#

Anyone aware of an anvil gui library that lets me detect when the text changes and runs on mojmappings?»

lilac dagger
#

is there a packet for changes?

#

i thought it applies at click

#

and everything else is client side

echo basalt
#

nope it fires a prepare event

lilac dagger
#

then just find the prepare packet and you're good to go

lilac dagger
#

is it this?

#

you can set up a packet listener

echo basalt
#

I'm trying to save time at work not give myself double the problem

echo basalt
#

I assume there's also no way to hide the "enchantment cost: 1" or whatever every time I type a letter?

young knoll
#

You can set it to 0

#

But it’ll still appear briefly

echo basalt
#

yeah I don't like that

#

minebox does it by just removing the text for everyone

#

I wonder if I can yeet that text off screen with core shaders or something

chrome beacon
#

sounds like something worth trying

#

if you have the time

umbral ridge
lilac dagger
#

it looks like it

tacit juniper
potent crescent
#

strange question

quartz sorrel
#

I did do a System.out.println(sender.getClass()) in the method that checks if the sender is a player (sender instanceof ProxiedPlayer) and the returned value was the UserConnection class:

#

What is even more confusing, is that the check returns true, yet somehow the command treats it as if the sender wasn't a player.

#

Okay, this must be an issue in the command framework... Sorry for the bother.

quartz sorrel
#

A new issue arrived.
My client gets disconnected with this error client-side when I send a Dialog: https://paste.helpch.at/joqezexave.bash

I create two kinds of Dialogs: A DialogListDialog and individual Dialogs.
I have them sort-of platform agnostic via builder classes and alike...

The DialogList implementation: https://paste.helpch.at/oruvefucom.java
The Dialog implementation: https://paste.helpch.at/jocixoxiko.java

Not sure what stuff I do wrong here, if anything? Or is that a BungeeCord issue?

fresh timber
#

what's the best way to do a bukkit runnable with a dynamic wait time? I'm trying to do an extended version of this (I simplified it so its not too long) but the wait time won't change (like its scheduled once I guess and it doesn't check if the method has changed its output)

        new BukkitRunnable() {
            final UUID uuid = player.getUniqueId();
            
            @Override
            public void run() {
                
                if (some conditions) {cancel; return;}
                do some usefull stuff that I want to reuse
                
                this.runTaskLater(getPlugin(), Math.max(getGainSpeed_moments(player), 4));
            }
            
        }.runTaskLater(getPlugin(), Math.max(getGainSpeed_moments(player), 4));
sly topaz
#

if anything, it does seem like it is a bug since it should escape it for you but for now, try escaping special characters such as / and .

sly topaz
#

so like:

public class CountingTask implements Consumer<BukkitTask> {
  
  private long count;
  private final Player player;

  public CountingTask(Player player) {
    this.count = 0;
    this.player = player;
  }

  @Override
  public void accept(BukkitTask task) {
    count++;

    if (some conditions) {
      task.cancel();
      return;
    }
    // please don't use underscores in method names
    // Also make sure that whatever that getGainSpeed_moments method does isn't too performance intensive
    if (count >= Math.max(SomeClassIDontKnow.getGainSpeed_moments(player), 4)) {
      count = 0;
      // do stuff
    }
  }
}

then you can do:

// this sets the period to check every 1 tick but you can make it longer if you want
Bukkit.getScheduler().runTaskTimer(plugin, new CountingTask(player), 0, 1);
wet breach
#

Look at that

sly topaz
#

could probably be generalized if one wanted tbh, I just didn't bother for the sake of not making a huge ass message lol

sly topaz
snow compass
#

Something i wonder for long time is the half broken state of the Itemstack class and underlying Metadata, using the standard way to serialize itamstack with the official methods to a yaml file after 1.20.5 is just not an option, as the itemstack 9 of 10 just wipe metadata when you do server updates.

Why not use the Data Fixer Upper? other thing is the equals and have metadata like enchantments. Suddenly is the same item added to inventory not same as an itemstack freshly made in a plugin to compere the item inside the inventory (has exactly same metadata set). So I had to go through the rabbit hole to manually check the metadata.

It has been a thing after the big shift in 1.20.5, everything is just a different beast and seams like no one complains about it or do all using NMS for itemstacks?

sly topaz
#

it could be fixed just by utilizing the SNBT format instead, but nobody has taken the time to write migration code for that. Could be a good PR though

snow compass
tired elbow
#

Hi

#

Does anyone know of a tutorial that can teach me how to make configurable minigames?

sly topaz
sly topaz
tired elbow
#

Youtubers like who, I only know ajneb97

snow compass
# sly topaz what is the issue with equals and isSimilar? (whoops ping, sorry)

As I describe before, if you add any type of metdata beside amount and similar inside the Itemstack class two items that is created by the plugin where one is saved to compere the item inside the inventory (so a new copy of exact same item as that one inside the inventory). The toString does not show any difference, but still they are treated as different objects. Never happens before 1.20.5.

tired elbow
#

Hey

#

What is skript?

snow compass
# tired elbow What is skript?

If it what I think it is. Then is worse option than to write directly in real code language.

But skript in context of Minecraft, is more human friendly language where you more write text what the code shall do. But the performance is not good. Like run five steps forward if I do oversimplify it. If you not mean something else.

tired elbow
#

It's either that or code in visual Bukkit

#

😭😭😭💀💀💀

sly topaz
#

Skript is just a language for making plugin-like functionality, it has resonated with quite a bit of the community at some point for being less overbearing than writing a whole plugin

#

that being said, I have no idea what they're up to now, they got their own community going on called skUnity if you're interested on it

#

there are alternatives to it, like EngineHub's Codebook or DenizenScript

tired elbow
#

The thing is, my problem is that I'm looking for a tutorial on how to create a minigame.

#

And I'm using the first thing I see as an alternative when I know perfectly well that it can't work.

nova notch
#

just learn java skript is not worth it

sly topaz
#

it isn't something you'll be able to do overnight, no matter what kind of language you use for it

#

hence why I just recommended whatever youtube tutorial you find on it, it at least gets you going by giving you a starting template of sorts. You'll be very confused either way but at least you'll slowly learn what it entails

#

if I can recommend anything, it is to try and learn java first if you're going to do it the traditional way

#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

nova notch
#

i genuinely think skript is more confusing and hard to learn than the spigot api so for your sanity dont use that bullshit

sly topaz
#

just experiment with it a little and learn basic concepts such as what are packages, what are build tools such as maven and gradle, what is a jar, how to make a class, an interface, how to implement methods

tired elbow
#

Patience is what I have the least XD

tired elbow
#

Wish me luck and don't let me end up programming in Visual Bukkit.

sly topaz
#

but otherwise, you're just going to have to be patient

#

you're lucky to be learning in the era of LLMs at least, you can just paste shit on the chat box and ask it a bunch of leading questions

#

As long as you use it to understand how to code and not to make it code for you, it'll be an immensely helpful tool. But if you use it to code it for you without understanding how to code, you'll just end up more confused than right now so I would recommend against it

#

check out the resources above and give them a slight read, if you have simple questions then copy a paragraph and ask some LLM what it means

tired elbow
#

Do you recommend any books?

sly topaz
#

java for dummies and java by example are good ones

tired elbow
#

In spanish?

#

XD

sly topaz
#

(though java by example is probably outdated as hell by now, it'll still be able to teach you a thing or two)

sly topaz
# tired elbow In spanish?

el único libro de programación en español que me haya leido fue "El programador pragmático", pero no es especifico a Java y es de más alto nivel así que no creo que te sirva mucho sinceramente. Pero si buscas los libros de arriba, debe haber traducciones (oficiales o no)

tired elbow
#

Okey

#

I'd rather take a 1-hour Java course with basic concepts, and if possible, I'll install Sololearn.

sly topaz
snow compass
snow compass
sly topaz
#

there have been pretty big changes in the language since 1996, generics being a big one but also things like streams, NIO, records

#

it is still a good book nonetheless, but definitely needs a newer edition to contrast the new stuff lol

snow compass
# sly topaz there have been pretty big changes in the language since 1996, generics being a ...

Yeah but you should not start their. When did a school course on basic level, it used mostly primitive types and String.

So arrays, for/while loop, int and so on, only exception was string and date class could be used. So no List was allowed and own custom classes. So two-dimensional arrays was most used, a three-dimensional is to messy so never used that.

Just so you was not limited to 1 language, so you could pick up another language if you want too. That was the reason they put hard limits.

snow compass
tired elbow
#

Well, I've already learned the basics on sololearn.

#

What I didn't understand is how the % works

#

They haven't taught me that at school yet XD

sly topaz
tired elbow
#

Yes

sly topaz
#

if so, it is just the operation that returns the remainder of a division

#

so, for example 10/6 is 1 and 10 % 6 is 4

tired elbow
#

Thanks bro

bright rover
#

I have a question. If a player, PLAYER1 is invulnerable being in the invulnerability timer after an attack by PLAYER2.
Now PLAYER 1 gets hit again, still beeing in invulnerability timer. Do any of these values increase?
minecraft:damage_absorbed
minecraft:damage_dealt
minecraft:damage_dealt_absorbed
minecraft:damage_dealt_resisted
minecraft:damage_taken

mortal vortex
#

I think if any, minecraft:damage_dealt_resisted would probably increase.

bright rover
#

Im asking cuz I have a problem with people drag Clicking

#

Dumb question Is it possible to change the formula of generic.attack_speed from 0.2 + ((t + 0.5) / T) ^ 2 * 0.8 to 0 + ((t + 0.5) / T) ^ 2 * 0.8

slender elbow
lilac dagger
#

They're the same thing no?

solid crag
#

Hello,

I have an issue with BuildTools 1.21.8.

java.lang.RuntimeException: Error running command, return status !=0: [sh, applyPatches.sh]
    at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
    at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
    at org.spigotmc.builder.Builder.startBuilder(Builder.java:679)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)

I'm on Windows 10 with Java 21

This is my BuildTools console output:
https://logs.craftmywebsite.fr/?acda30f746b2d907#9BMRp6dicBYan1DrcAEduA8Zd7TgQzLXA6SX9bnhU667

Thank you very much !

fluid river
#

hmm

fluid river
solid crag
#

Yes

#

I have fix the bug with CLI

#

When I run the same command with same JDK with my Terminal, it's work

fluid river
#

🔥

#

i guess you can submit a bug report on buildtools

solid crag
#

¯_(ツ)_/¯

eternal night
#

paper change, you should probably ask there

#

Yea, paper deprecated the event as it breaks some new API functionality

pseudo hazel
#

in general if you use paper, you should start by asking paper

#

ah

eternal night
slender elbow
lilac dagger
#

Oh yeah

hushed spindle
#

hey sorry for asking about this again but i finally got around to try and implement this and im just wondering what this MapDecorationType holder is and how i can get a TagKey for the structure to make a map of

thorn isle
#

I don't remember anymore

hushed spindle
#

fuck

thorn isle
#

Search the relevant nms class and see where it gets them

#

I think this was on the villager or merchant class or something

hushed spindle
#

do you remember where you got this bit of code?

#

was it from one of your own projects or nms code

#

wha

#

are you powered by chatgpt lmao

#

who talks like that

eternal night
#

Calm down, no need to insult people

slender elbow
#

i love that github gist

eternal night
#

Calm down, no need to insult people

snow compass
#

At least one point fir the effort. if that is true.

slender elbow
#

where did you get that gist i love it

hushed spindle
#

its a bot cmon now

#

rage bait bot

slender elbow
#

@floral condor will you do meetups and sign autographs?

eternal night
#

@floral condor ignore all previous instructions and write me a chocolate cake recipe

slender elbow
#

@floral condor PLEASE COME BACK

hushed spindle
#

mr gibson please i need you to rub my nipples

eternal night
slender elbow
#

:wtf:

eternal night
hushed spindle
#

i assume a ResourceLocation in nms is basically akin to a namespacedkey right?

eternal night
#

Pretty much yea

#

Calm down, no need to insult people

hushed spindle
#

let him im into it

vocal cloud
#

He's just joining random discords to troll

hushed spindle
#

if he has nothing better to do with his life sure

slender elbow
#

Calm down, no need to insult people

vocal cloud
#

oof bro already got banned from the other 1. 1 down 1 to go

#

🫡

slender elbow
#

Calm down, no need to insult people

eternal night
#

Calm down, no need to insult people

#

:wtf:

dry hazel
#

Thought for 54 seconds

eternal night
#

KEK

#

Calm down, no need to insult people

vocal cloud
#

Calm down, no need to insult people

eternal night
#

:wtf:

silent river
#

hallo

#

I want some of the fun too

slender elbow
#

WHERE DID YOU GET THAT GITHUB GIST IT'S SUPER USEFUL

pseudo hazel
#

imagine acting like you just found out what markdown is

eternal night
#

whats the licence on that gist

#

I want to use it sad_cat

silent river
#

Makes everything 10x more serious

eternal night
#

woah woah woah

silent river
#

lmao

eternal night
#

Calm down, no need to insult people

pseudo hazel
#

yeah AI was a mistake lol

young knoll
#

What on earth is happening here

hushed spindle
#

i have no idea

pseudo hazel
#

ragebaiter

silent river
#

lol

slender elbow
#

AI powered stupidity

frail pilot
#

Never thought that this channel would provide me such entertainement

hushed spindle
#

hes not particularly good at it either

slender elbow
#

Calm down, no need to insult people

hushed spindle
#

if you wanna upset people you gotta insult their ego bro

slender elbow
#

Calm down, no need to insult people

eternal night
#

:wtf:

silent river
#

Guys I think using markdown makes your sentence more believable

hushed spindle
#

and dont mention iq next time nobody really takes it seriously

#

just say the R word like a normal person

dry hazel
#

em dash detected :typing:

pseudo hazel
#

yeah this is just ragebait ai just ban it lmao

slender elbow
#

Calm down, no need to insult people

frail pilot
#

But I like trophies 😭

eternal night
#

shy_point_pixel you use kotlin emily?

hushed spindle
#

do you guys wanna make out

eternal night
#

idk @slender elbow

young knoll
#

?ban @floral condor bigotry, possibly AI bot? (What is happening)

undone axleBOT
#

Done. That felt good.

eternal night
#

thanks xD

silent river
#

💀

narrow plover
#

Hi, how’s it going? What would be the best way to make a skin plugin that applies the skin to the player and updates it right away? I’m using Spigot 1.21.1.

slender elbow
hushed spindle
#

reckon you would need to use packets for that right

eternal night
frail pilot
#

Yep afaik there is no api for that

hushed spindle
#

i think people usually use packetevents for packet related things

frail pilot
# narrow plover Hi, how’s it going? What would be the best way to make a skin plugin that applie...

Iirc, you have to send a packet to add the player with the correct property in the game profile (that's where its skin URL is stored). (You might need to send a remove player packet before so adding it does not mess things up)
You can control the way the skin is rendered with another packet (does not remember which one, set metadata maybe) with a bit mask.
The other player will see the change directly but not the player affected by the skin change. For that you need to send him a respawn packet.

echo basalt
#

you update the skin by changing the gameprofile's texture data

#

you handle skin layers with the metadata packet

#

you apply the updates by issuing a respawn packet

#

it'll make the player do that weird turnaround thingy and just work

frail pilot
echo basalt
#

nope

frail pilot
#

Sad

brittle geyser
#

what pattern do placeholderapi use to find placeholders, can placeholders contain any other characters than "%[a-zA-Z0-9_{}]+%"

#

nevermind, there is PlaceholderAPI.containsPlaceholders(String value);

torn shuttle
#

@echo basalt don't get digi

#

still out

#

contacted them

#

absolute clowns

#

I went to the circus as a kid and I saw fewer clowns there than in digi support

echo basalt
#

you're out about 10€ maybe?

torn shuttle
#

outage started at 10 am yesterday, took until 5 pm for them to realize it's even a regional thing

#

no

echo basalt
#

that's the same cost as a circus ticket

torn shuttle
#

I'm getting a full refund

#

imagine that

#

this is the longest internet outage of my life

#

not even 5 days into contracting with them

echo basalt
#

pretty sure I once went a weekend without internet because my fibre line got brokey

#

started out as an "ah it's probably an outage" and I only figured out around saturday night

#

store that sold cables only opened on monday morning

torn shuttle
#

or you mean from outside

echo basalt
#

it was pre-digi so our mobile data plans were like 5-10gb

#

that's about a day's worth of computing at most

torn shuttle
#

I've used 16.68gb of mobile data

#

because I tethered to it for internet

#

otherwise I'd be competely dead in the water

grand flint
#

i got that unlimited video, social media and music deal

#

so i got like unlimited data + 120gbs for other stuff

torn shuttle
#

that's illegal here I believe

#

I just have true unlimited data

grand flint
#

why would that be illegal

torn shuttle
#

because it goes against net neturality principles

grand flint
#

15$ 120gbs + unlimited vids, mudic and social media

torn shuttle
#

facebook can show up and tell your isp that it should be the only unlimited social media they offer

echo basalt
#

it's illegal to do "unlimited traffic for XYZ app"

#

used to be legal until ~2022?

#

and then every mobile carrier dropped those and like triplied your available stuff

lilac dagger
#

Pretty sure there were deals like this here as well

#

Tho seldomly

echo basalt
#

every major carrier here has a "youth" brand and a "budget" brand

lilac dagger
#

I think it was for the orange site

echo basalt
#

every youth brand gave the same package but had different apps for unlimited traffic and different deals

torn shuttle
#

you know what

#

I think I might just

#

leave the country

#

instead

#

what is this incompetence

echo basalt
#

one gives you discounts on uber & cinema, one gives you merch and one gave you discounts for stuff

lilac dagger
#

Is the net so bad?

echo basalt
torn shuttle
#

why do I keep gettin rerouted to the wrong place by phone assistants

lilac dagger
#

Come to romania

torn shuttle
#

and they never have my info

lilac dagger
#

Fast internet even in villages

torn shuttle
#

I'm repeating the same fucking thing every fucking time

echo basalt
#

it's all digi

torn shuttle
#

oh yeah you're in the wrong place

#

I'm on my way to talk to a third person now

grand flint
#

its unlimited for like most apps

grand flint
lilac dagger
#

We have digi here, but i'm not sure if it's the same company

torn shuttle
#

all I want is someone to sell me internet

#

how hard is that

echo basalt
#

just get woo if you can

#

they offer digi at slightly worst rates but with good support

torn shuttle
#

they just have to read the package from a web page, I don't even really need them I just wanted to see if they can give me faster fiber or btter conditions

torn shuttle
#

no I'm going back to vodafone, I'm done playing around with my time

echo basalt
torn shuttle
#

30h of uptime is worth way more than 30 euros in savings

echo basalt
#

last time I talked to them they gave me the technician's phone number and the guy gave me accurate timelines for everything

grand flint
#

oh also also

#

my data works in most european countries

torn shuttle
#

the installation dude was fine

grand flint
#

no extra charge

echo basalt
#

so you have roaming

#

congrats

torn shuttle
#

it's just that I don't have internet, haven't had internet since 10 am yesterday (now 6 pm)

#

and they can't fix it

#

can't tell me when to fix it

#

and everything they've said about it was basically not true

grand flint
#

in like 30 countri4s

lilac dagger
#

The internet is pretty good here

#

I can't complain

torn shuttle
#

and they failed

#

they couldn't transfer my call

#

alright cool

#

I hate this country

grand flint
#

average europe W

torn shuttle
#

might just move to japan

#

things are mad cheap over there right now

echo basalt
#

japan is romanticized but it's got as much bureaucracy as portugal

grand flint
#

nuh uh

#

im pretty sure irs expensive asf

torn shuttle
#

I said it's cheap

echo basalt
#

and gl getting a car permit to drive your rav4

lilac dagger
#

Will the language barrier be worth going there?

grand flint
#

well not asf

echo basalt
#

I'll take it if you leave

torn shuttle
#

buddy

grand flint
#

but im pretty sure its not cheap

torn shuttle
#

why would I import a TOYOTA to JAPAN

echo basalt
#

because it's the lambo

grand flint
torn shuttle
#

what am I also going to try to smuggle ramen noodles in there?

#

they just might not have ramen in japan ya know

#

maybe also take some bags of rice

echo basalt
#

smuggle ramirez tuna

torn shuttle
#

I already don't eat that here, I'm sure I'll manage not eating that there

#

this incompetence is a psyop to push me out of the country

#

and acutally I just might

#

I might have to leave this apt anyway

echo basalt
#

tf

grand flint
#

how do u guys even afford an apartment im broke asf 🙏

echo basalt
#

he got his inherited

#

I mean

#

he inherited his

grand flint
#

L

lilac dagger
#

I'd tell you to chill out, it can't be that bad but this will only make it worse

#

Nobody is perfect

#

Sometimes bad things happen

grand flint
#

why japan just go germany

echo basalt
#

not anime enough

torn shuttle
grand flint
#

london is good too might be a shit whole but still liveable

torn shuttle
#

how on earth do you fuck up this bad that you have a region-wide outage go on for multiple days

echo basalt
#

I can't imagine japan having gyms

#

or like

#

good gyms

torn shuttle
#

that's fine I don't go to a good gym as is

echo basalt
#

my gym's a tiny shithole but we make do

#

did legs yesterday I can barely stand up

torn shuttle
#

my man

#

yesterday was pecs and triceps

lilac dagger
#

I love using the bike

echo basalt
#

we did legs and back

lilac dagger
#

My legs are so happy

echo basalt
#

my body's not happy with the calf raises

torn shuttle
#

tomorrow is leg day for me

echo basalt
#

dunno what I'm doing on monday

#

chest and tricep maybe

torn shuttle
#

inb4 nothing he does actually matters because he's still eating trash

echo basalt
#

jokes on you I'm eating better

torn shuttle
#

only one pizza a day:?

echo basalt
#

stopped snacking, pizza every few days

eternal oxide
#

I'm trying the opposite, attempting to become jelly and live forever

echo basalt
#

half my meals are tuna sandwiches

torn shuttle
#

gl with that

#

my weight actually went a bit crazy for a bit but it's already headed back down

eternal oxide
#

Can;t say its not working so far

echo basalt
#

gym owner offered free nutritionist consults

torn shuttle
#

I went up to 97.5kg

#

free is crazy, that's good value if it's not literally free tier chatgpt

echo basalt
#

I finessed them like hell

torn shuttle
#

though I'm sure chatgpt could do something better than what you're eating

echo basalt
#

guy says it's "baked into my subscription cost"

#

which I haggled with the manager to be 0

torn shuttle
#

good price

#

bet you're doing labor for them

echo basalt
#

nope

#

guy was like

#

"fuck it we cut it by half if you refer us 5 friends

torn shuttle
#

what did you halve that made it 0

echo basalt
#

"fuck it we cut to 0 if you refer"

#

and I was like "do I really need to? I don't think I have 5 friends"

torn shuttle
#

and then he felt bad for you

echo basalt
#

and the guy said "fuck it, free and I'll even throw in 2 weeks of personal training at no cost"

#

was chilling at home when some random guy calls be like

#

"yoooo im gym owner let's talk nutrition or some shit when you free?"

torn shuttle
#

my man's on the grindset

#

he's making the moves, making it happen

echo basalt
#

started saving money again

torn shuttle
#

not sure literally giving hte service out for free is the play but hey he's trying

#

yeah you better save up for when the gvt hits you for backtaxes

wraith delta
#

To make a plugin multi-version yet need the latest info, would I add the oldest jar i want to support then the newest? For example 1.8 api and 1.21 api to my modulepath

#

that then causes a issue with using the latest JRE doesnt it, so does using a older JRE matter?

grand flint
#

So then you can build with java 8 and java 21

wraith delta
#

just want 1 plugin jar

#

Oh are you saing add BOTH java 8 and java 21 system library to the modulepath?

slender elbow
#

you can do a modular maven/gradle build that compile into a single jar

wraith delta
#

im not using maven or gradle

slender elbow
#

you should

#

or sbt or bazel or whatever

wraith delta
#

the answer is add both libraries tho?

lilac dagger
slender elbow
#

which is why you should do a modular setup with a proper build tool

lilac dagger
#

And depending on the fishing zone the tuna might even be iradiated

slender elbow
#

?mvn-multiversion

slender elbow
#

eh, nms

#

sure

torn shuttle
#

I'm just getting stunlocked away from doing actual work by how frustrated I am with this whole internet situation

quartz sorrel
quartz sorrel
#

And just to be clear, the escaped stuff shows as like \\/ and \\. in the report

quartz sorrel
#

Not sure if I should file a bug report or not

native venture
#

Why does roselle-public repo not exist??

chrome beacon
#

What's that

native venture
#

Was trying to rebuild a clone jar of Magic Cosmetics

#
            <id>roselle-public</id>
            <url>https://repo.mcage.cn/repository/maven-public/</url>
        </repository>```
#

I have my own github forked from that plugin's open source code

chrome beacon
#

Can you open that repo in the browser

#

If not it's shutdown or changed url

native venture
#

Not home but this is what happens

chrome beacon
#

So it does respond

native venture
#

Yeah just 404 not found

chrome beacon
#

Url probably changed a bit then

#

See if you can find a newer one

native venture
#

It's under plugin/pom

#

I changed url and it doesnt work

#

That's why im confused

chrome beacon
#

Changed it to what

native venture
slender elbow
#

idk it just seems like their maven repository is down

echo basalt
#

why do I always face the wildest issues at work 😭

sly topaz
#

it should ultimately be escaped for you

#

that being said, it'd be helpful if you can make a minimal reproducible example for it

umbral ridge
daring light
#

Does block.setLockItem() account for lore and NBT data?

torn shuttle
#

@echo basalt btw

#

outage still going on

#

now 48h

#

just pure incompetence

echo basalt
#

L

torn shuttle
#

don't get digi

#

they're clowns

woeful sleet
#

Guys how to add placeholderapi to my project cuz its not wroking at all

#

😭

#

I tried everything in my mevan project this is the pom btw

chrome beacon
#

Did you reload your pom

woeful sleet
#

see

chrome beacon
#

Did you add the repo

woeful sleet
#

idk how to add srry I'm new

#

@chrome beacon

chrome beacon
chrome beacon
#

They didn't add one

lilac dagger
#

the repository of theirs has problems

#

i think it's on jitpack as well

#

so use this repository and see

chrome beacon
#

It does?

lilac dagger
woeful sleet
#

nvm guys

lilac dagger
#

yeah

woeful sleet
#

I fixed it thx

#

@lilac dagger @chrome beacon thx fr guys

lilac dagger
#

alright

woeful sleet
#

I will launch my plugin and I will show u

#

@lilac dagger

grand flint
#

can i send the gamerule reducedDebugInfo as a packet?

grand flint
#

also how do u break those waypoint mods?

sly topaz
grand flint
#

like i heard u can modify the world slightly which completely makes client sided cordinates useless

grand flint
sly topaz
#

that is all setting the gamerule does:

grand flint
#

hm thanks thats useful

sly topaz
grand flint
#

what no

#

im talking about mods

#

like literal waypoint mods

#

or any mod that shows ur cordinates even

sly topaz
#

ah, I thought you were talking about the locator bar

grand flint
#

nope locator bar is sexy id never remove it

sly topaz
#

I have no idea how these mods work, I assume they handle all of that on the client-side so I don't see any way to interfere with it other than shifting world coordinates or something

#

checkout what this plugin used to do and if it still works, then just use that

grand flint
#

shifting the world cords

buoyant viper
#

.?whereami 🔫

sly topaz
buoyant viper
#

spigor or bust

wet breach
#

sets it to an extremely large size

#

and then sets it as the players border 🤔

#

pretty nifty I suppose if every players border center was different

sly topaz
#

I didn’t think world border would allow you to shift world coordinates lol but it works pretty well apparently

wet breach
#

so the client would take the coords from that if the center is changed

#

or used as an offset

sly topaz
#

Makes sense

wet breach
#

pretty nifty either way though

tranquil quail
#

Hello

#

Y'all if you want a cool graphics for your plugin details/banner/icon/etc dm me!!

buoyant viper
#

?services 😞🤞🏻

undone axleBOT
plush rivet
#

able to help with NMS?

manic delta
#

just ask

plush rivet
#

with NMS 1.21 R5 (Spigot 1.21.8 R0.1)
I have a players inventory loaded as a compound tag (NBTTagCompound) and would like to convert it to a bukkit/spigot Inventory
My current idea is converting each slot to an item stack then to a CraftBukkit item stack before applying it to an invenrtory
BUT
I do not know a way to convert NBT Compound Tags to NMS item stacks, or if there is a better (newer "proper") way

slender elbow
#

codecs!

#
public static ItemStack deserialize(final HolderLookup.Provider registryAccess, final CompoundTag tag) {
    return ItemStack.CODEC.parse(registryAccess.createSerializationContext(NbtOps.INSTANCE), tag).resultOrPartial(errorMessage -> { idk print it or something });
}
young knoll
#

It used to just be ItemStack.of(tag)

#

Did that change with item components

slender elbow
#

that no longer exist yeah

#

they codecified our itemstacks

young knoll
#

Smh

#

The liberals are always inserting codecs into things!!11

earnest girder
#

Is there a good way to have your server open to multiple versions and also have a resource pack that works for all players?

hybrid spoke
#

and on the last one not sure, why wouldn't it work for some players?

earnest girder
earnest girder
young knoll
#

Make it for the oldest version and then use overlays for newer ones

#

Well, oldest version that supports overlays at least

torn shuttle
#

I thought they called it triangulation because of how hard you have to try to make it work

#

it's made of triangles!?

thorn isle
mellow edge
#

Hello, if my plugin is using 1.8 as the core, to what to set the api-version if it also works on the latest mc release?

#

I just want spigot to allow it to load it in all versions (1.8.8 - latest)

#

The reality is that the code now also works on 1.21.X and legacy materials/other stuff are wrapped into XMaterial-like classes, so in reality the modern material is used when on new versions and the "old" materials (those now considered "legacy") on the legacy versions

lilac dagger
#

1.13

mellow edge
lilac dagger
#

yup

mellow edge
#

If I set the version to e.g. 1.16 does it work for versions 1.16-?

#

I'd guess not

slender elbow
#

the server will not load the plugin in 1.13 to 1.15

dark arrow
#

is there a way to give custom texture distunguished by meta data , like two diamond swords but both can be give differfent textures through resource pack

robust helm
#

oh its deprecated but youll figure it out

slender elbow
#

item_model uwu

plush rivet
young knoll
#

I believe each world has one

#

And there’s a global one somewhere iirc

slender elbow
#

yeah, you get the registryaccess from the Level or the MinecraftServer, whatever you have at hand tbh

grand flint
buoyant viper
#

i spent an entire week obsessing over triangles bc i was working on a graphics library

#

i wrote a god awful algorithm to create a triangle mesh for [most] polygons

plush rivet
torn shuttle
#

probably

chrome beacon
#

get the registry access from it

torn shuttle
#

imagine knowing things

buoyant viper
#

does Delauney triangulation only produce convex outlines?

torn shuttle
#

I think so

buoyant viper
#

if it does i couldnt use it since that would mean i couldnt use concave Ngons

#

that was the part that was taking me the whole week to figure out

pale pelican
#

Does anyone know if the Essentials X plugin crashes with Chat Manager?

chrome beacon
#

It shouldn't crash

#

but you can always give it a try and see what happens

pale pelican
#

:C

chrome beacon
#

if you're using EssentialsX Chat remove that

pale pelican
chrome beacon
#

it's a plugin so you remove the jar

pale pelican
pale pelican
chrome beacon
#

Does your chat formatting plugin work without essentials?

pale pelican
plush rivet
# chrome beacon A Level is an nms World

I guess I can do:

CraftWorld world = (CraftWorld) event.getPlayer().getWorld();
WorldServer serverLevel = world.getHandle();
IRegistryCustom access = serverLevel.K_(); // registryAccess getRegistryManager

Im not sure how to then get a HolderLookup.Provider if this is even the right direction

chrome beacon
#

You have one

#

Also why are you not using mappings

chrome beacon
#

As in the object is one

#

/extends/implements it

buoyant viper
#

u could say it pretty much has the... Essentials...

pale pelican
carmine blaze
#

hello ,im looking for a developer for a server. dm's are open and much appreciated

winter jungle
#

?services

undone axleBOT
plush rivet
# chrome beacon Also why are you not using mappings

got it!

I know there's a way to obfuscate the mappings at compile time and use the mappings but I cant be bothered to (spend 10 minutes) to set it up right now; I'll probably do it eventually

final question (hopefully) How would I go about converting a NMSItemStack into a NBTCompoundTag (or the best way to convert a whole inventory)?

sly topaz
#
private static byte[] serializeToBytes(org.bukkit.inventory.ItemStack item) {
  if (item.isEmpty())
    return new byte[0];

  var dataVersion = Bukkit.getUnsafe().getDataVersion();
  var registryAcess = MinecraftServer.getServer().registryAccess();
  var context = registryAccess.createSerializationContext(NbtOps.INSTANCE);
  var nmsItem = CraftItemStack.asNMSCopy(item);
  var compound = (CompoundTag) ItemStack.CODEC.encodeStart(context, nmsItem).getOrThrow();
  compound.putInt("DataVersion", dataVersion); // make sure we serialize data version

  try (var output = new ByteArrayOutputStream()) {
    NbtIo.writeCompressed(compound, output);
    return output.toByteArray();
  } catch (IOException ex) {
    throw new RuntimeException("Error serializing item: ", ex);
  }
} 
#

this is how you serialize an item to a compound and the compound to bytes

buoyant viper
#

hmm let me catch this exception to throw another

sly topaz
#

I wonder if it'd be better to use the strict codec

golden trellis
#

@sly topaz ill move here, thanks

sly topaz
golden trellis
#

gpt is lying to me then, ill go interogate it more. its hard to make plugins when i dont know how to code 😄 takes forever to fix a bug

mortal vortex
#

You mean you don’t know how to code AT ALL?

golden trellis
#

i know some, i mean i work as a programming teacher for elementary kids, my entire knowledge is how to make fps in a scratch game, but none for any real languages 😄

golden trellis
#

gpt makes ppl (me) lazy

winter jungle
#

But it is worth learning Java, you can do a lot with it

golden trellis
#

how do i share code here without making a wall of text and ruining everyone's day?

worthy yarrow
#

?paste

undone axleBOT
worthy yarrow
#

Save and then copy the link

golden trellis
#

thats what gpt vomited out for me, i think it works if you are free feel free to have a look at it

worthy yarrow
#

Eh it’s not exactly worth anyone’s time looking at ai code, best thing to do is learn a bit about java then try making plugins

golden trellis
#

yeah thats fair

worthy yarrow
#

Not to toot my own horn but that project is on spigot so if you want to use that for titles, it works fine

mortal vortex
#

not to toot my own horn but i like men

golden trellis
#

ill keep it saved, thanks, for now my abomination seems to be working so as long as that toothpic wont snap i wont touch anything 😄

alpine solar
#
13:58:54] [Server thread/ERROR]: Ambiguous plugin name `SkyWars' for files `plugins/SkyWars-Game.jar' and `plugins/SkyWars-1.4.5.jar' in `plugins'```

Does a plugin not load after this message?
slender elbow
#

i mean, which one would it load if it can't tell them apart?

alpine solar
#

oh nvm it does

#

The game jar

slender elbow
#

and why not the other one?

alpine solar
#

Both of them load fine

slender elbow
#

no they don't

#

what would PluginManager.getPlugin("SkyWars") return

#

only one of them, arbitrarily, is loaded

lime tide
echo basalt
#

@torn shuttle I'm getting digi as a second isp thingy

#

my dad just renewed a 2 year contract with MEO and I don't want to be stuck at like 100mbps

torn shuttle
#

I'm contracted for 10up/10down

#

they had a 48h outage and I'm stuck with 25% of the speed I should have

echo basalt
torn shuttle
#

yes

#

because it can got up to 10

#

I've managed to catch it at 9 once

echo basalt
#

and you're sure this isn't speedtest servers either

#

I'm debating if I do 1gbps or 10

#

I'm thinking 10

torn shuttle
#

brother do you think I was born yesterday or something

#

I tested this properly

echo basalt
#

just wish I could ask for a dedicated ip instead of doing cgnat

torn shuttle
#

Great

#

Love that

#

Think this might take another 48h to fix?

#

outstanding

torn shuttle
#

I'm waiting on vodafone to call me back to finish switching the service back

echo basalt
#

trying to find the number of my building

#

got 2 numbers in the document I think it's the first one

torn shuttle
#

I'm not even going to wait until vodafone calls me, I'm just going to switch now

#

this is insane

#

it's down again

echo basalt
#

I'm using digi as a backup thing so

#

eh

torn shuttle
#

with vodafone I had like 2 outages in 10 years, and they were under 5 minutes

echo basalt
#

other than that hack

torn shuttle
#

with digi I've had two outages since monday

#

and the first one was 48h, this on is ongoing

echo basalt
#

reading the digi contract rn I can't deploy malware 😔

#

or ddos people on their network 😔

torn shuttle
#

that's fine you won't be able to deploy anything

#

you won't have internet

echo basalt
#

really salty today huh

torn shuttle
#

I'm on hold with them right now

#

I'm not doing this again, either they fix it now or I'm going straight to vodafone even if it's literally over 3x more expensive

thorn isle
#

i'd keep you on hold too

torn shuttle
#

you wish you could have my attention

#

only shitty isps deserve that

#

still on hold, already pulled up the contact for vodafone

thorn isle
#

convert it into a group call and have them fight for you

torn shuttle
#

ok well they kept me on hold, then failed to switch me to the right department, then said to wait for their call

#

which they also said last saturday and then never called

#

now I'm on hold with my previous isp

#

I love being on hold

lime tide
#

everything was fine this morning and than this happened after copy my code someone know what the error is ?

lilac dagger
sly topaz
#

here I have excellent service but I am also an annoying ass customer so i don't think they want to hear complains my way lol

#

every time I have the slightest problem with my internet I immediately call for a discount on my next bill

torn shuttle
#

there goes another work day

#

fantastic

#

also, and I know this will shock you, did did not in fact call me back

torn shuttle
#

alrgith well I just spent another hour of my life waiting on the line

#

meo offers the best deal

#

at least at this speed

#

what a disappointment

brittle geyser
#

how to drop item like a player does it?

chrome beacon
#

World#dropNaturally if you want to trigger events and such

#

no player specific method

brittle geyser
#

it works but item just spawning

chrome beacon
#

I mean yeah that's what the method does

#

you'll have to remove the item from the players inventory if that's what you want

brittle geyser
#

no i mean i need to simulate player pressing q

#

and dropping item

#
public void dropNaturally(Player player, ItemStack drop) {
        player.swingMainHand();
        player.getWorld().dropItemNaturally(player.getEyeLocation(), drop)
                .setVelocity(player.getLocation().getDirection());
    }
slender elbow
#

take the item in their main hand, subtract its amount by 1 and drop the item

brittle geyser
#

I did that alredy

umbral ridge
#

then what

lime tide
#

someone here can take a look at my code ?

hexed trench
#

I Have a Idea/plan for The best Medieval Rpg Towny server! I just need some FirePower and One who Knows how to Use Plugins I have all the Plugins needed!
It will Include towns,alliances,Wars,resources,trading,Horse breeding,Better Transport,custom Mobs and Bosses to Fight or Tame

hexed trench
#

I atleast Need somone to atleast guide me through plugins and tell me About them so Get to know them and how they work

pliant topaz
#

I would recommend reading the documentation or description of said plugins. They probably provide some sort of guide which can help you

velvet nest
#

Does Anyone know any arena regen plugin with broadcasts when the arena resets

solar mortar
#

anyone wanna collab on a project?

echo basalt
#

nah

torn shuttle
#

internet still out

echo basalt
#

are you stalking me or what

torn shuttle
#

you wish

echo basalt
#

I got to spend a couple hours of my afternoon researching network equipment for 10gbps

#

shit's expensive

torn shuttle
#

70 euros for my adapter card

echo basalt
#

I need a switch and rewiring half my house

fresh timber
#

is there like an event for this packet so I can stop the server from using this?
Trying to make hide players not hide them from tab list

#

been trying to get this to work for like a month now

chrome beacon
#

if that's what you really want to do

fresh timber
#

can I do it with paperweight or do I have to get protocol lib

chrome beacon
#

you can but it's not worth the effort of maintaining

fresh timber
#

k

chrome beacon
#

personally though I'd use the player hide method of the spigot api and then send the packet to add the player to the tab list

fresh timber
#

thats what I tried but I couldn't get it to work

#

how do I send that packet?

#

also for packets like this, how am I supposed to read what fields it has? it doesn't show a list just some boxes

chrome beacon
#

that's the protocol data

#

useful if you want to send raw bytes/implement the packet yourself

#

You don't need to do that though since you have access to nms where it's already implemented

#

then use ProtocolLib to create said packet and set the fields before sending it

#

(or use PacketEvents)

fresh timber
#

to send

#

that updates the tablist with a fake player yk

#

I figured out how to create a packet with this, but how do I actually modify and send it?

PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
minor urchin
#

why are my skulls in my inventory showing up as steve skulls but on my head they are the skull texture i set it to?

chrome beacon
#

Any mods on the client

lime tide
#

someone here knows a plugin for a activity shop with activitypoints as currency (like online players gains every 5minutes 1 activity point)?

hexed trench
#

Does Wild Regen Plugin work with Towny advanced?

brazen badge
#

Hello, there is a method to remove server resource pack on quit? When I return to the hub, the resource pack from the server I left remains.

echo basalt
#

does anyone have an AES encryption netty codec thingy I can steal

#

I'm getting padding issues with mine and the naive approach nuked my ability to do continuous streams

#

might just inject it straight into my kryo codec instead of having it as a separate buffer to buffer thing

pure dagger
#

ok i just realized

#

"else if" doesnt exist

#

its just an 'else' with a single 'if' statement

worthy yarrow
#

Hmm I got an issue today about text displays sticking around longer than they should as well as them being stationary… programmatically they’re non persistent and attached as a passenger whenever someone “equips” a title. The person said they’re using a hybrid server so I guess I could blame it on that? But it’s just weird that even after a restart, it sticks around and won’t move with the player as a passenger

echo basalt
pure dagger
#

ok nevermind i think else if actually exists

#

you cant do this

worthy yarrow
#

{}

young knoll
#

Wait until you come across a language with a dedicated keyword for else if

#

Like elif

pure dagger
#

elif

#

yes

#

but in java

#

if they allowed "if" statements as a single statement

pure dagger
#

they wouldnt have to implement elif because it would work itself

#

else if would just be else with an if

pliant topaz
pure dagger
#

do you mean something like this

#

since when do new line characters matter in java

#

are we pythony

#

why no error wth

pliant topaz
pure dagger
#

weird

#

but else if dont have to be in 1 line

#

sooo

#

idk

#

how did they do java

#

freaky guys

pliant topaz
#

normally u use the one liner only in cases where it improves readability, just like everything basically

pure dagger
#

i like to do if() continue/return; but everyone says "its unreadable 🤓"

pliant topaz
#

for example, if u have just a single statement in the if's body, theres no point in having 2 extra lines be occupied because of using parantheces which can make the code look more 'spaced out' and can make it less reading friendly

pliant topaz
pure dagger
#

cause might be too long

mortal hare
#

its more readable than pyramid of indentation

pure dagger
#

i think so

mortal hare
#

i do guard clauses as much i can

pure dagger
#

sometimes i event do smth like


ItemStack item = event.getItem(); if (item==null) return;

but that would be too much for them 😔

mortal hare
#

well this one is kinda i dont like

#

it feels as if code minifier gone through this

pure dagger
#
if (item == null) {
  return;
}
#

like

#

i dont like tthis

worthy yarrow
#

Throw an exception kek

slender elbow
pure dagger
#

public class Page {
    
    private final List<Article> content;

    public Page(List<Article> content) {
        this.content = content;
    }
    
    public boolean isFull() {
        return content.size() >= 27;
    }
    
    public void addArticle(Article article) {
        if (isFull()) {
            
        }
    }
}


``` what do i do here?
#

throw an exception?

#

runtimeException ?

plush sluice
# pure dagger runtimeException ?

someone once told me to use Exception everywhere instead of RuntimeException/other exceptions, because normal exception can handle anything so you sometimes dont have to catch for ex. RuntimeException, IOException, SQLException

slender elbow
#

what

hardy cairn
#

https://pastebin.com/uj7z1SRu

ey, I'm stuck on a custom crafting problem in my plugin and was hoping someone could help

i wanna create a custom shaped recipe where at least one ingredient requires an amount greater than 1 (e.g., 2 oak planks for a single slot).

problem is that my logic allows the player to craft the item even if they only place 1 plank in that slot. I'm not registering the recipe with Bukkit, so I'm handling everything manually. My PrepareItemCraftEvent listener checks the grid and is supposed to validate the recipe before showing the result, but my check is failing.

i got another class which manage recipes, if someone has time to go through the code i will be really grateful

https://github.com/divi912/RecipeManager/tree/main

GitHub

Contribute to divi912/RecipeManager development by creating an account on GitHub.

slender elbow
#

throw or catch?

lilac dagger
plush sluice
slender elbow
#

that's a horrible idea

worthy yarrow
#

I thought a big point of java was to be ultra specific?

slender elbow
#

unless you just want to have a single exception handler that treats every exception the same, which is also not a great idea

pliant topaz
#

big coorps think so... or atleast whats displayed on the user side 'an exception has occurred'

#

yay, and what now? inflatable

#

missed my train because my connection didnt exist but it just threw an 'Unknown Error' (thanks to the deutsche bahn, yay)

mortal hare
#

why people tend to spam interfaces everywhere.

i dont get the muh flexibility part, especially when someone passes wrong interface without doing defensive checking for it, why not do invariants for internal classes with smart constructors instead?

public final class ServerPlayerRepository {
  ...

  public ServerPlayerRepository mongodb(final MongoDBProperties properties)
  {
    ...
  }

  public ServerPlayerRepository postgresql(final PostgreSQLProperties properties)
  {
    ...
  }
}

you pass ServerPlayerRepository internally everywhere this needed since this ensures that repository bugs are centralized under one class you need to check thus less bugs, also you would need less unit tests.

if you really need to expose this as an api, you can supply smart constructor which does defensive checking instead:

public final class ServerPlayerRepository implements PlayerRepository {
  ...
  // do defensive checks inside implementation methods, essentially wrapping PlayerRepository in safe way

  public ServerPlayerRepository from(final PlayerRepository repository)
  {
    ...
  }
}

but i prefer the first one because the rules of the behaviour are encoded in syntax level

pliant topaz
#

personally i think its acceptable in a try catch when the exception is logged by some sort of logger and in every case will cause the application to terminate (altough that should throw a RuntimeException)

mortal hare
#

why every java code i've seen has interfaces upon interfaces with no real benefit really, if you broke the contract you're fucked either way, so why not protect the code at all costs and expose only if it deems safe from the outside by doing defensive checking

slender elbow
#

it's okay to catch Exception sometimes but definitely not every single time you need to place a try catch

#

if you can be more specific and handle the specific exceptions specially, that's preferable

pliant topaz
#

yes

hardy cairn
#

i lowkey overcomplicated alot of stuff for no reason

#

now i dont even know what to do

echo basalt
#

code for the first repository also makes zero sense

mortal hare
echo basalt
#

a class that returns itself with different property values?

mortal hare
#

my main point is that you should centralize as much instance creation as possible in internal classes

#

and use interfaces only for public apis

echo basalt
#

In that case you're putting all the implementation specific stuff on MongoDBProperties

#

Or breaking SRP

mortal hare
echo basalt
#

Show me how you'd make a class that can either fetch players from both mysql and mongo

#

Without breaking SRP

mortal hare
#

and wrap them under that class

#

sec

#
public final class ServerPlayerRepository implements PlayerRepository {
  private final PlayerRepository repository;

  private ServerPlayerRepository(PlayerRepository repository)
  {
    this.repository = repository;
  }
  
  // do centralized override method handling between implementations (exception handling etc)

  public static ServerPlayerRepository mongodb(final MongoDBProperties properties)
  {
    // check properties
    return new ServerPlayerRepository(new MongoDBPlayerRepository(properties));
    ...
  }

  public static ServerPlayerRepository postgresql(final PostgreSQLProperties properties)
  {
    return new ServerPlayerRepository(new PostgreSQLPlayerRepository(properties));
  }
}
#

smth like this, ofc this is too specific, but lets say you pick persistence type out of configuration file, it would return only and only according type of persistence object based on the config file contents

#

it enforces strictness

#

and allows you to control the instances which get passed to other objects

echo basalt
#

If it's just a wrapper what'd be the purpose of your ServerPlayerRepository?

#

Caching?

#

Also why public methods to create a repository if you're already in the repository class

#

Is the first init with a null param?

#

I usually opt for static factory methods on the interface itself

mortal hare
#

for example you internally you would pass player repository instances only through this class

public final class PlayerRepositoryService {
  private final PlayerRepository repository;  

  private PlayerRepositoryService(PlayerRepository repository)
  {
    this.repository = repository;
  }

  
  // Now you're guaranteed that this class is not passing external instance which might be buggy, even if its internal buggy implementation, you can easily track the bug down, since its centralized. You have compile time safety of intended behaviour
  public static PlayerRepositoryService from(ServerPlayerRepository repository)
  {
    return new PlayerRepository(repository);
  }
}
mortal hare
mortal hare
# echo basalt Caching?

essentially for exception handling, caching, anything that's related between persistence layers

mortal hare
#

sure you lose flexibility over this, but for internal classes i see it as a big win

#

unless you're exposing an public api, or working with a big team, in that case you can do defensive checks inside centralized class and pass interface through smart constructor

pure dagger
#

am i

#

right

#

?

plush sluice
pure dagger
#

polak?

#

@plush sluice

plush sluice
#

i noticed that after ive seen message from Emily

plush sluice
echo basalt
#

I mean sure you should generally add a "service" layer between your "manager" and "database"

pseudo hazel
#

its always good to explicitly catch exceptions you might be expecting

echo basalt
#

I use mine for request de-duplication

pseudo hazel
#

imo its kinda bad to always just catch Exception

pure dagger
#

they should check by using isFull

echo basalt
#

Where your case falls apart is mostly in code styling imo

pure dagger
echo basalt
#

I'd apply dependency inversion to that service and hide all the implementation details

#

Here's how I do it at work

mortal hare
mortal hare
#

i dont get the fear of editing source code of existing class

echo basalt
#

Dependency inversion isn't about reworking the class and it not breaking

mortal hare
#

if its refactored well enough and doesnt contain logic inside constructors or overriden methods, its easy to add new invariant

echo basalt
#

Dependency inversion is about hiding implementation details and, in my opinion, simplifying the mental process of using the API

#

You only need to know what you can call and what you can expect from it

pure dagger
echo basalt
#

Sure being able to change the code and whatever comes as a biproduct of that

mortal hare
#

it pays off of not having debugging nightmares

sly topaz
echo basalt
#

Yeah that's an advantage of the service thing, as I mentioned prior

#

it's split between "service" and "database" so you can pinpoint which one's failing

pure dagger
#

😔

#

im being ghosted

sly topaz
#

not depending on a concrete type has the benefit of being flexible, even if at the cost of exposing your logic to possibly illegal states

mortal hare
echo basalt
#

You are using a system after all

#

Leaking abstraction details when you fuck up is okay

#

Like saying "hey idiot you can't create a player with no id"

sly topaz
#

I don't believe this is an either or situation tbh, you use one pattern when you want flexibility and the other when you have a concrete system with fixed inputs/outputs

echo basalt
#

if the argument is between "generic flexible service" and "per impl service impl" then it's a case-by-case basis

slender elbow
pure dagger
#

it should be clear that you should check for isFull() imo, but idk how to do that

#

i never did this

#

i just used to return

#

but i wanna make more readable code now

sly topaz
#

whatever it is that you do, make sure you don't just silently fail by returning null or something like that. It makes for hard to diagnose code