#help-development

1 messages ยท Page 170 of 1

torn shuttle
#

normalized vectors are a beautiful thing

echo basalt
#

It's also used for stuff like lighting engines in 3d games but that's something much more complex

#

You can rotate vectors by an axis, which just does trig

tender shard
#

typical useless intellij information

echo basalt
#

So rotating around the Y axis means you're changing XZ values, as the Y axis is solid

tender shard
#

"109+ matches in 51+ files"

#

so how many matches are those? and how many files?

#

110 matches? 29517 matches? and how many files? 52? or 2851?

torn oyster
#

should I remove my entities from a team on death

#

or does it do that automatically

tender shard
#

it cannot hurt to remove them

torn shuttle
echo basalt
#

There's not much more to vectors, they're just representations of offsets

torn shuttle
#

intellij's telling you "nah man look for something more specific"

torn oyster
fluid river
#

hey guys

#

teach me something

tender shard
#

this is my favorite explanation of adding vectors

echo basalt
#

yeh

fluid river
#

i wanna do smth

echo basalt
#

Now let's talk about completablefutures

tender shard
# fluid river teach me something

in germany, it's totally legal to possess a bottle of booze when you're 3 years old. and it's also totally allowed to give newborn babies a bottle of vodka

echo basalt
#

as some people here seem to have never used such a useful thing

torn shuttle
fluid river
#

what is a booze tho

tender shard
#

"hard alcohol"

worldly ingot
#

I was going to use them for a sign editor

#

Not async, but completable some time in the future

fluid river
#

i see

#

alr @echo basalt teach me completable future

vocal cloud
torn shuttle
#

I didn't forget

worldly ingot
tender shard
worldly ingot
#

fwiw I did attempt a pathfinding API until I deemed it stupidly overcomplicated

tender shard
#

I'm very familiar with shooting dogs. I already thought about writing a library

worldly ingot
#

I made a PR at the time

torn shuttle
fluid river
#

tell Imlllusion to unban me pls

#

i literally did nothing to him

#

blocked me for no reason

#

i really wanna see his guide on CompleteableFuture

tender shard
#

I also once blocked you

fluid river
#

for no reason

tender shard
#

a few weeks ago iirc

fluid river
#

and unblocked me later

tender shard
#

yes

#

I always unblock people later again

fluid river
#

was just a misunderstanding

tender shard
#

yeah I remember

fluid river
#

basically had same position

#

in different words

torn shuttle
#

man I don't even know what I'm putting off at this point, my code works and should be good to go live

#

I need to get back to it

remote swallow
#

your still grieving' over your dog

fluid river
#

tho he blocked me cuz i trolled one guy who needed help with git merge

#

still sent him help after, was just a joke

torn shuttle
#

also is there a weird bug where you can get a configuration section right after you set a value on a fileconfiguration because that seems to be a consistent issue that I get

#

it's just never set

#

(unless I wait for 1 tick iirc)

tender shard
#

discord blocks are so useless anyway, since you still see "2 blocked messages"

#

and ofc everyone is always curious what they say and click on it anyway

fluid river
#

also Imlllusion dislikes my FREE JAVA LESSONS suggestions

#

๐Ÿ˜ญ

#

That's so mean

remote swallow
#

why learn it when you can just ask every question you ever get here

tender shard
#

just get over it. even optic had me blocked for a good month or so once lol

torn oyster
#

what events should i listen to for knowing when an entity dies

fluid river
#

well i already helped 4 guys at least

torn oyster
tender shard
torn oyster
#

but that doesn't cover everything like despawning or creepers exploding

remote swallow
#

is that russian google or something

remote swallow
#

spelled correctly ofc

fluid river
#

EntityExplodeEvent with entity instanceof Creeper

quaint mantle
#

How do I programically disable chat reporting in java

fluid river
#

And ChunkUnloadEvent probably

#

for despawning

fluid river
#

Mod i guess

remote swallow
echo basalt
#

ILLUSION SEARCH INDEX - COMPLETABLE FUTURES

This guide uses lambdas. If you're new to them, read my lambda guide -> #help-development message

A CompletableFuture (javascript seems to call it promise, don't quote me on this) is an object that represents an action that will be executed, tied to a "CompletionStage"

  • The default thread pool is the ForkCommonPool, you can set your own executor with the provided parameters

  • A task may be completed exceptionally (a throwable has been thrown during the execution), you can handle this using the exceptionally methods (usually just pass a Function<Throwable, T> where T is the future type, which returns a value)

  • CompletableFutures usually complete with a defined value (return type of the function), it can be the boxed Void.

  • You can handle completion using the following methods:

  • thenRun(Runnable) - Just runs code once the future has been complete

  • thenAccept(Consumer<T>) - Provides a variable, you do whatever

  • thenApply(Function<T, U>) - Provides a variable, you can return whatever you'd like

  • thenCompose(Function<T, CompletionStage<U>>) - Used for chaining futures, where the main future now runs the sub-future's task

  • Most then... methods (thenRun, thenAccept, thenCompose) have an async variant, the main difference is that it runs on a separate thread from the default (the one the future is using) one, but you can pass your own Executor (You can make a funky executor that runs code on the main class)

  • To initialize a CompletableFuture, you should use the runAsync or supplyAsync methods, depending if you'd like a simple Runnable with no return type, or if you'd like to pass a Supplier to obtain a value:

  • CompletableFutures like to "suck up" exceptions. When they do so, they trigger an "exceptional" state. You can then handle exceptions with either the exceptionally method, or use combined methods like whenComplete(? super T, ? super Throwable)

Example:

CompletableFuture<Data> future = CompletableFuture.supplyAsync(() -> {
  Data data = database.fetchData(playerId); // blocking method
  data.setSomeValue(true);
  return data;
});

future.exceptionally(error -> {
  error.printStackTrace();
  return new ErrorData(); 
});

future.thenAccept((data) -> {
  player.sendMessage("The value is " + data.getSomeValue());
});

// This code still executes first, as the database code is being ran on another thread and won't be available this soon
player.sendMessage("Fetching data.."); 

Real-life scenario:

public interface MyFancyDatabase {

  CompletableFuture<PlayerData> fetchPlayerData(UUID playerId);
  CompletableFuture<Void> savePlayerData(UUID playerId, PlayerData data);
  CompletableFuture<Void> deletePlayerData(UUID playerId);

}

MyFancyDatabase database = ...;
database.fetchPlayerData(playerId).thenAccept(data -> {
  // This block of code will run once the data has been fetched
}
quaint mantle
#

thanks

tender shard
echo basalt
#

future go brr

#

Basically multithreading abstraction done easy

tender shard
#

"a completablefuture is something that is or was happening and will sometime be done, or already is"

#

that's how I'd describe it lol

tender shard
#

"and you can attach logic to it"

torn shuttle
#

tbf I never used it but I've known about it for long enough that I recognized what the javascript promises were from the java completable futures

#

just don't really have a use for it

echo basalt
#

haha code go brr

torn shuttle
#

ew

#

this man's out here making lines longer than mine and then complains about my beautiful code

tender shard
#

$ as var name

echo basalt
#

I don't need the var name

fluid river
#

From which Java version does it exist tho

echo basalt
#

but there's no method without the consumer

echo basalt
tender shard
fluid river
tender shard
#
__ -> this::doSth
// or
String -> this::doSth
echo basalt
tender shard
#

two _ _

#

__

echo basalt
#

eh sure

torn shuttle
tender shard
#

oh boy, if I'd get paid by the line...

echo basalt
#

this u?

tender shard
#

while true; do echo \n >> myfile.java; done

torn shuttle
#

unlike some people I don't get paid by the line

echo basalt
#

not my fault that I gotta do a whole classroom system that's multi-server synchronized to a database and supposed to update in real time

torn shuttle
#

love the supposed to

tender shard
#

the funny thing about "getting paid per minute/hour/whatever" is that you make more money the worse you are, at least the first time

echo basalt
#

ehh

#

it depends

torn shuttle
#

that's big bux baby

echo basalt
#

if it takes you a lot of time to make very little progress then people will pay you less

tender shard
# echo basalt it depends

well for the first time, it's true. if you take 100โ‚ฌ per hour and you take 10 hours, you make 1000โ‚ฌ. while someone else might be done within 2 hours. so you made 800โ‚ฌ more. ofc, the people won'T ask you again after that, lol

echo basalt
#

If you write a ton of code in little time then your rates will be higher

hoary quartz
#

hey guys, I needed to put like

Bukkit.getPluginManager().registerEvents(this, plugin)

But the IDE doesn't auto complete, so I need to import anything before using it?

tender shard
echo basalt
#

mans lackin copilot

hoary quartz
#

when I try to put it manually, it turns red

tender shard
#

which option?

#

what "turns red"?

#

and what does it say?

torn shuttle
#

alright that's enough procrastinating, later losers

tender shard
#

it doesnt just "turn red", it also tells you something

tender shard
#

see you tomorrow

#

๐Ÿ˜—

#

yeah, this turns red, but now look at this:

#

it actually shows more information when you hover over it

hoary quartz
#

it's like this

remote swallow
#

does it still happen on getServer().getPluginManager()

tender shard
# hoary quartz

"this" does not implement Listener, or "plugin" does not extend Plugin

quaint mantle
#

How do I execute code when a player sends a message

tender shard
#

oh

#

I havent even seen that

#

yeah you cannot run code outside of code blocks lol

remote swallow
#

i just realised that

tender shard
#

yeah I havent even seen that

remote swallow
#

register events on onEnable

hoary quartz
pseudo hazel
#

its not working cause you are trying to type it outside of a function

remote swallow
tender shard
#

@hoary quartz

hoary quartz
#

oh

#

I am stupid

#

lol

tender shard
#

it annoyed me so much, I made conclure add the ?notworking command

#

?notworking

undone axleBOT
#

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

hoary quartz
#

sorry to bother you guys

tender shard
#

np lol

#

that's what this discord is for

remote swallow
tender shard
remote swallow
#

thats actually true

tender shard
#

"I made event but it's no workings, help pls"

remote swallow
#

the amount of people ive seen not realise how ?paste or ?img work is insane

tender shard
#

or like this:

Dear Sirs and Madams, or whomever it may concern,

I happened to write an event listener today, that's supposed to listen to the death of all entities, but for some reason it does not trigger when I "kill" an ItemFrame. I know that ItemFrames are Entities, and I am listening to the EntityDeathEvent, yet, it only gets called for entities like Zombies, but not for ItemFrames. Is there any other event I should listen to?

fluid river
tender shard
#

what I also hate is people starting their forums post with

"so I want to do XY..."

quaint mantle
tender shard
#

duh at least say "hi"

#

why do they always start their post with "so"

fluid river
#

so...

how to increase tickrate to 21

remote swallow
#

create a new /tps command that only returns 21

#

problem solved

tender shard
#

all I wanted to say is that I prefer people who at least try to formulate a proper english sentence lol

tender shard
fluid river
#

so

why do i get Unsupported major class version (52.0) when play need for sync: mine crafted

fluid river
#

didn't know that lol

fluid river
tender shard
fluid river
#

and then asking question here

tender shard
#

change this with reflection and you can way more TPS

#

doesnt work on paper though

fluid river
tender shard
#

on spigot, it does work totally fine

fluid river
#

well i guess it would break a lot

#

cuz "tick is waiting" time would decrease

tender shard
#

actually it works extremely fine

fluid river
#

to - value

tender shard
#

it just makes everything faster

dry pike
#

Advice desperately needed! I am always looking to follow best practices and keep projects organized to help me sleep at night.

I guess this question is more about project structuring and I'm probably overthinking it, don't judge me.

I'm using NPCLib and it does what it needs to. I extend the functionality in another wrapper class(I think that's what its called...) to satisfy my needs :D.

Now the package structure of my project is as follows;

    -components(this is where most of my project is and I try to keep things decoupled into "components" each being independent of eachother)
        -npc
            BLNPC.class
            -listeners
    -utilities
    -listeners(this one is more temporary as id like listeners specific to a component to be located within that components package)```

The problem I'm having is in the BLNPC.class... it needs to know when players quit the server. Sure I can make BLNPC implement Listener and add the event inside of there but that can make it hard to find as the project grows and also dosen't seem like a best practice.

Another solution would be to create a listeners package under the components.npc package and add it there which seems like a better solution. Now when it comes to naming this... something like PlayerQuitListener seems okay but if another component also listens for PlayerQuitEvents then they would have a PlayerQuitListener.class as well, although they would be under different packages the class names are the same and could cause confusion later down the road.

How would a advanced developer structure this?
fluid river
tender shard
remote swallow
#

my brain doesnt like reading that

fluid river
dry pike
tender shard
#

oh ok sorry, nvm then

fluid river
#

hello y2k

river oracle
#

?paste

undone axleBOT
fluid river
#

yeah i use telepathy

#

don't worry

dry pike
tender shard
#

tbh I'm already angry at the BLNPC class name

tender shard
#

what does BLNPC mean?

river oracle
#

might as well ask here I'm hyper confuesd I need a based intelectual to help me with maven
https://paste.md-5.net/fadajiquga.sql

I'm so confused why it gives me a post error ONLY when i use the maven deploy plugin as soon as I remove the deploy plugin it works fine

fluid river
#

my head stop existing after 15th word in the sentence

dry pike
tender shard
#

it will tell you why it caused a BAD REQUEST

fluid river
#

it just once exploded after i counted to 14

#

so yeah it's 15 i guess

#

may be more if i put some effort

#

but my lazy ass controls y head

tender shard
#

sort?

#

wdym?

tranquil viper
#

How can I check if an OfflinePlayer is a real player, since it never returns null?

fluid river
#

make small sort method xD

tender shard
#

well you can set everything as helmet etc

fluid river
#

or put them in right order from the beginning

#

why should spigot devs spend their time on it

#

maybe users want to put leggings as helmet

#

And also there might be nulls

#

or two leggings in one array

#

you would have to work around it too tho

#

just put items in right order

#

before you set contents

tender shard
#

but why would your ItemStack[] ever be "off"?

fluid river
#

bubble sorting helmets by colors

#

R to B way

#

write me an algorith

tender shard
fluid river
#

will clap for you

tender shard
#

you cannot remove elements from arrays though

#

only set them to null

#

arrays have fixed sizes in java?

fluid river
#

.hasPlayedBefore() should work too i guess

tender shard
fluid river
#

hmm

#

then try OfflinePlayer#getPlayer()

tender shard
#

that's only for online players

#

OfflinePlayer#getPlayer will be null for valid players who are not online

fluid river
tender shard
#

huh

fluid river
#

OfflinePlayer#getPlayer() != null

tender shard
#

oh

#

I thought they wanted to check if a UUID actually belongs to a valid account

fluid river
#

Oh nvm then

tender shard
#

I am like 80% sure that
OfflinePlayer(randomUUID).getName() will be null for "fake accounts" and return a String for actual accounts

fluid river
#

You mean pirated?

tender shard
#

yeah

#

but, I am wrong

fluid river
#

then no, it returns a name

tender shard
#

it's also null for valid players who never joined before

fluid river
tender shard
#

so ignore what I said

fluid river
#

non of them are valid

#

but played once

#

when i run command they are offline

tender shard
#

I wonder though...

#

why would anyone ever need to check if a UUID exists?

#

Just use online mode

fluid river
#

I don't have minecraft license tho

#

well actually i do now

#

Since 2021

#

But from when 1.2.5 released i didn't have it

#

played on old cracked launchers

#

then switched to TLauncher

#

Most of russians don't own licenses too

#

And i guess most of the players

#

And now we can't even buy one

#

cuz ya know ukraine

#

and stuff

tender shard
#

on my discord, it's usually chinese people who want to "verify their purchase" without having bought anything from me lol

fluid river
#

๐Ÿ™‚

#

well i never played on online-mode true server

#

except my test localhost server when i got license

fossil lily
#

๐Ÿค”

fluid river
#

tho does online-mode support bungeecord

#

i mean

#

can you make a bungeecord server structure

#

for license only

torn shuttle
#

wassup gamers

#

remind me, combinatory probability

fluid river
#

@tender shard

torn shuttle
#

the odds of anything at all happening if there are several odds of different with different chances is multiplicative right?

#

or how did it go

fluid river
#

no

tender shard
#

no, there's still a Player object

#

would be pretty stupid otherwise

#

every PlayerEvent ALWAYS returns a valid player object

fluid river
tender shard
#

for bungeecord, all backend servers will have online-mode disabled, and bungee does the online mode verification stuff

fluid river
#

so actually you can

tender shard
#

and it will forward the proper UUID

fluid river
#

tho, which plugins are gonna become redunant with online-mode true

#

like anti-bot-attacks plugins

#

Or smth

#

Some authorization plugins too i guess

main dew
#

Hi how I can disable render new chunks?

vernal basalt
#

what is the event for entity eating

#

not a player

#

but if i fed a mob

remote swallow
#

you cant feed a mob?

fluid river
#

cows

#

pigs

#

for having sex

remote swallow
#

forgot that they were a thing

fluid river
#

chickens also

fluid river
#

forgot completely

vernal basalt
#

i may or may not be adding straws to the game which you can feed to the turtles to kill them

remote swallow
#

like feeding a parrot a cookie

vernal basalt
#

yes

remote swallow
#

i suppose the PlayerClickEvent might help

fluid river
#

use PlayerInteractAtEntityEvent

remote swallow
#

thats probably better

fluid river
#

where entity instanceof Turtle

vernal basalt
#

What is the difference between PlayerInteract__at__entity and without the at

fluid river
#

location

#

which method with at returns with e.getLocation()

#

and method without at doesn't return

vernal basalt
#

what is the point of thta

fluid river
#

idk

#

don't ask me

#

bukkit devs only

#

hey guys

#

you ever played ESO or Skyrim

#

Wanna try adding Alchemy or Enchanting from these games

#

or chest locks and lockpicks

#

with custom maze

#

anyone has some ideas about that

hoary quartz
#

guys, how do I register an instance of a certain class (as a listener) in my main class? I tried to put the Bukkit.getPluginManager().registerEvents(this, plugin); but it doens't work

vernal basalt
#

ahhh i just realized why nothing was working

#

i was tried to use fabric methods to do stuff

#

i was trying to get the items in the players hand an no pop ups were showing up and i was getting mad

#

ok so how do you get an item type

fluid river
#
public class MainClass extends JavaPlugin {

    public void onEnable() {
        getServer().getPluginManager().registerEvents(new ListenerClass(), this);
    } 

}```
```java
public class ListenerClass implements Listener {

    @EventHandler
    public void onChat(AsyncPlayerChatEvent e) {
        // code
    }

}```
hoary quartz
# fluid river ?

like
i have a method in a class that has an event on it, and need to run this event, for that I need to register an instance of this class as a listener in my main class

hoary quartz
#

the main one no, only in the other class

fluid river
#

don't do this in public plugins tho

#

i basically already posted the same

#

no need

hoary quartz
#

I think I got it, at least there is no more error

#

I will try to run here and hopefully it will work

fluid river
#

?learnjava

undone axleBOT
fluid river
#

tho

#

there is no need for override annotation lol

#

it's just annotation

#

code works fine without it

#

it would still override tho

hoary quartz
#

I mean, it's not my plugin, I took the source code and I an editing

fluid river
#

strange

#

override is like 99% unnecessary now

#

the only thing i use it for is to check that i override method correctly

#

cuz if there is no method like this it shows error

#

you are trying to override non-existing method

#

well you just said make sure to to me

hoary quartz
fluid river
#

๐Ÿ™‚

hoary quartz
#

gonna try here see if now it goes the way I want

#

okay

#

thanks dude

main dew
#

How disable render new chunks?

hoary quartz
#

didn't work

#

bruh

undone axleBOT
#

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

hoary quartz
#

yeah, i know

#

gonna take the code

#

because my pc it's a potato and doesn't run the minecraft with intelliJ

#

just one or another

main dew
#

Always you can copy code from notepad ๐Ÿ˜…

hoary quartz
#

well, let's go

I am trying to edit a plugin so that delete his own letter (or someone else letter) when the player enter the server, so I have basically three classes, the Letter Checker, the CommandExec and the CourierNew (main one). The letter checker it's just to check if it's his own letter or someone, the CommandExec it's for executing the commands and check this conditions I said early, the main one checks for permission and this kinda stuff. The plugin it's working fine, but I tried to log off the server and came back (to see if deletes the letter) but it doesn't delete, how do I fix this?

LetterChecker code: https://paste.md-5.net/osoxuhisit.java
CommandExec code: https://paste.md-5.net/afihelawer.java
CourierNew code: https://paste.md-5.net/adabanobeg.java

#

trying to be as clear as possible

#

I am not used to speak English, I usually speak Portuguese

#

okay, done that

#

okay

hoary quartz
#

that make sense, gonna try here

#

idk what this is, this plugin it's someone else and I took the source code to try, if it work thought I gonna try

#

DUDE

#

YOU ARE A LIVE SAVER

#

IT WORKED

#

thanks

#

yeah, I have this bad habit that I try to learn thing without knowing then, like when I learned unity

#

plugin although I am trying to edit like, 2/3 days I thinking

#

but I gonna try to see more the code and understand it

#

anyway, thanks dude

#

really helped me

rigid loom
#
    public static void setupConfig() {
        file = new File(Bukkit.getPluginManager().getPlugin("Kingdoms").getDataFolder(), getConfig().getString("Kingdom").equalsIgnoreCase(kingdomName) + ".yml");

        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                System.out.println(ChatColor.RED + "Couldn't create Kingdoms Config as it already exists.");
            }
        }
        customFile = YamlConfiguration.loadConfiguration(file);
    }```
How would i make it so that i can get the kingdomName in this?
wet breach
rigid loom
#

what do you mean by 2?

#

if i did
file = new File(Bukkit.getPluginManager().getPlugin("Kingdoms").getDataFolder(), args[1] + ".yml");
how would i get the args that created the kingdom?

hoary quartz
undone axleBOT
hoary quartz
#

yeah, 3 days ago with java

#

like, I know c#, it's not that different

#

is it?

#

oh

#

well, gonna learn java so

#

yeah, I know

#

I thought that it was not that difficult

hazy parrot
#

I mean, they are pretty same

fluid river
#

basically it is

#

except keywords and namespaces they are like same in most cases

#

Well the biggest difference is Java's JVM made on C

#

Which is highly tunable

#

And no tunable JVM of C#

#

xD

hazy parrot
#

that is slightly different syntax lol

fluid river
#

: = extends tho

#

in that case : = implements

#

tho same rule as java applies

#

extend one class

#

implement 9999 interfaces

#

Well C++ and Java are uncomparable

#

really

#

Java just don't have &

#

at all

#

In c++ you can change any variable using &

hazy parrot
fluid river
#
int change(int &a) {
    a = 5;
}```
fluid river
rigid loom
#

i think i get the logic of what you are saying. i just cant for the life of me think how to properly execute it

fluid river
#

memory pointers i should say

#

idk real name

#

just not the * pointer

#

but &

#

you can change the value of variable which is sent to the method

#

not inside the method itself, but for the entire program

#

well this feature is implemented to rust

#

which is like modern c++ i guess

rigid loom
#

that would probs be helpful

fluid river
#

well i just took a look at it

#

it seems really beautiful

#

it basically doesn't have GC

#

but also no need for free() or delete()

#

and allocate

#

malloc(), realloc(), cringealloc() and so on

#

it just uses & everywhere

#

which is kinda funny

rigid loom
#

what ive tried hasnt worked and ive tried a few things. dk how many i could actually name just cause of how much ive tried

fluid river
#

provides really fast access

#

Tho you can probably build a new language similar to java upon it, same as kotlin is upon java

#

Where you basically add full Collections Framework to rust

#

And you basically created new language called Just

#

Java+Rust

#

Also rust is most loved programming language through users

#

Probably gonna do something on it later

#

well it's on same level as java i guess

rigid loom
#

Rust or Just?

fluid river
#

it has different Patterns

fluid river
#

i just imagined it

rigid loom
#

i was joking

fluid river
#

alr

fluid river
#

Has different DI model

rigid loom
#

i can try

fluid river
#

i basically offer free java lessons tho

#

You can call me i will explain why you are bad

#

I offer
Calling you trash
Calling your code trash

You offer
Stop coding in Java
Crying all day

#

accept please

rigid loom
#
    private static FileConfiguration customFile;```
these are why that class is static btw
fluid river
#

Why are they static

#

Ya know that static is basically making your fields immune to erasing by GC through runtime

rigid loom
#

i was using a kody simpson tutorial. the way in which he used them may be unnecessary in the fashion i am using them, but idk

fluid river
#

Don't worry

#

3 months back i was nesting ifs

rigid loom
#

on how to do something along the lines of what i am doing

fluid river
#

i just thought it's more beautiful than if (!statement) return;

rigid loom
#

relatively*

fluid river
#

I used TheSourceCode tutorials years back

#

for entering spigot api

#

tho they are trash

#

The best way to enter spigot api is just have second monitor

#

On which JavaDocs are always on

#

yeah i watched some of his vids

#

don't remember which ones exactly tho

#

And if you have problems with spigot coding even with second monitor on which you have javadocs

#

then the only problem is you

#

?learnjava

#

only possible solution

rigid loom
#

i dont have the space for a second monitor ๐Ÿ˜ข

fluid river
#

actually there is second

#

?learnenglish

undone axleBOT
fluid river
#

sometimes helps reading javadocs you know

#

then install buildtools

#

download sources

#

and manually look through them

rigid loom
#

my brain is farting i think

#

it just cant come up with what to do

fluid river
#

always have it opened + have JavaDocs as main page when you start browser

#

not google

#

not bing

#

Spigot Api JavaDocs

#

there is a search line

#

Use it

rigid loom
#

๐Ÿ˜†

#

you arent wrong

#

its still funny tho

fluid river
#

How to make player do something

#

write player find answer

#

tho have a second page with Java JavaDocs

#

So you can type Map or Collection in search tab

#

If you are russian go to my java blog

#

screenshot javadocs with your eyes

#

Read from memory

#

Tho you would have OutOfMemoryError

#

really fast

#

i do this everyday tho

#

to prevent having NullPointerExceptions

#

When recalling some info about Player class

#

Bro write a java program in your brain

#

Run debug -> Catch NullPointerException

#

explode

#

Catch OutOfMemoryError -> get sick with amnesia

#

When caught StackOverflowException just faint

#

Restart in 1 hour

#

how do you compile your code

#

maven/gradle/by export

#

what is project setup

#

i told everybody

#

i have telepathy

#

and telekinesis

#

i basically fix all issues

#

When people ask

#

That's not the first time

#

here

#

run recursion with no exit clause in your brain

#

divide by 0

#

When i get NPE in my life i start calculating numbers in IEEE754

#

I surpassed god level already

#

Rust coders when forgot & ๐Ÿ’€

#

@last temple

#

Tune your brain with Brain Virtual Machine flags before debugging your brain code

#

show code

#

with your log

#

and without

#

cringe

#

I'm sure u messed everything up like 10 steps before this

#

and it's causing problems

fossil lily
#

How can .getItemMeta() be null?

vale anchor
#

Hey! Potentially (hopefully) super simple question. Playing around with the default HG gametype. I want to allow multiple lives before they truly "die" - where in the config would I do that?

fossil lily
#

Doesnt every item have meta?

fluid river
#

has null item meta

fossil lily
fluid river
#

which is not given to you by plugin

fossil lily
#

So how can I give it default meta?

fluid river
#

no it's not

fossil lily
#

thanks :)

fluid river
#
new BukkitRunnable {
    // here you can have some fields
    int a = 1;

    public void run() {

    }
}```
#

yeah you can only use final external variables inside of inner classes, forEach body and anon functions(as far as i remember)

rigid loom
#

i cant figure this out

tender shard
#

just get your wand and shout COMPILUS TOTALUS and it'll compile just fine

fluid river
#

make your own class which extends BukkitRunnable and has constructor you need

#

OR

rigid loom
#

idk if theres a resource or sum but i cant figure it out

fluid river
#

use code i sent above @gritty pebble

tender shard
fossil lily
fluid river
#

Bruh

fossil lily
#

well I know its not air because I'm doing a check

fluid river
#

i sent you code that you need

fluid river
fossil lily
#

it seems that my click event is running twice

#

and the second time its AIR somehow

fluid river
#

You use Inventory Click

#

or Player Interact

fossil lily
#
    public void onClick(InventoryClickEvent event) {
        if (event.getClickedInventory() == null) return;
        if (event.getCursor() == null) return;
        if (event.getCursor().getType() == Material.ENCHANTED_BOOK){
            event.getWhoClicked().sendMessage(event.getCursor().getType().toString());
            event.getWhoClicked().sendMessage(event.getCurrentItem().getType().toString());
            ItemStack book = event.getCursor().clone();
            ItemStack itemStack = Objects.requireNonNull(event.getCurrentItem()).clone();
            if (book.getEnchantments().size() == 1 && !itemStack.getEnchantments().containsKey(book.getEnchantments().keySet().stream().findFirst().get())) {
                if (itemStack.getType() == Material.AIR) return;
                ItemFactory factory = event.getWhoClicked().getServer().getItemFactory();
                ItemMeta meta = event.getCurrentItem().getItemMeta();
                if (meta == null) {
                    meta = factory.getItemMeta(event.getCurrentItem().getType());
                }
                List<String> lore = meta.getLore();
                if (lore == null) lore = new ArrayList<>();
                lore.addAll(Objects.requireNonNull(book.getItemMeta().getLore()));
                meta.setLore(lore);
                itemStack.setItemMeta(meta);
                itemStack.addUnsafeEnchantments(book.getEnchantments());
                event.setCurrentItem(itemStack);
                event.setCursor(new ItemStack(Material.AIR));
                }
            }
        }
    }
fluid river
fossil lily
#

Im just lazy

bright jasper
#

Trying to use lwjgl within a plugin

#
[19:28:11 WARN]: Exception in thread "Render thread #1" java.lang.NoClassDefFoundError: org/lwjgl/opengl/ARBParallelShaderCompile
[19:28:11 WARN]:        at discordlink-spigot-1.2-all.jar//org.lwjgl.opengl.GLCapabilities.<init>(GLCapabilities.java:6529)
[19:28:11 WARN]:        at discordlink-spigot-1.2-all.jar//org.lwjgl.opengl.GL.createCapabilities(GL.java:466)
[19:28:11 WARN]:        at discordlink-spigot-1.2-all.jar//org.lwjgl.opengl.GL.createCapabilities(GL.java:322)
[19:28:11 WARN]:        at discordlink-spigot-1.2-all.jar//de.hdskins.skinrenderer.RenderContext.openWindow(RenderContext.java:125)
[19:28:11 WARN]:        at discordlink-spigot-1.2-all.jar//de.hdskins.skinrenderer.RenderContext.run(RenderContext.java:96)
[19:28:11 WARN]: Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.ARBParallelShaderCompile
[19:28:11 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:179)
[19:28:11 WARN]:        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:126)
[19:28:11 WARN]:        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[19:28:11 WARN]:        ... 5 more
#

Loads til this point, i think its related to system classloader since its within the actual plugin zip and not the system loader

fluid river
#

Umm yeah

#

Shade LWJGL

fossil lily
#

Its an air check...

bright jasper
fluid river
#

tho it would your plugin size go to 99999

bright jasper
#

Unzipping it shows the actual class is found

fossil lily
#

Yea I know il fix the null later, but every time I click on another item with an item the event runs twice and the second time currentItem is null

#

il fix it later

fluid river
#

cancel the event after your manipulations

fossil lily
#

hm okay

#

im good at that

fluid river
#
 public void onClick(InventoryClickEvent event) {
    var cursor = event.getCursor();
    if (event.getClickedInventory() == null || cursor == null || event.getCurrentItem() == null) return;
    if (cursor.getType() != Material.ENCHANTED_BOOK) return;
    var item = event.getCurrentItem();
    var itemEnch = item.getEnchantments(), cursorEnch = cursor.getEnchantments();
    if (cursorEnch.size() != 1 || itemEnch.containsKey(cursorEnch.keySet().toArray()[0]) return;
    var meta = event.getCurrentItem().getItemMeta();
    if (meta == null) meta = Bukkit.getItemFactory().getItemMeta(item.getType());
    if (book.getLore() != null) meta.setLore(book.getLore());
    event.setCancelled(true);
    itemStack.setItemMeta(meta);
    itemStack.addUnsafeEnchantments(book.getEnchantments());
    event.setCursor(null);
}```
rigid loom
#

is there any way for you to simplify the explanation?

#

ye. idk if ill figureit out anytime soon then

fluid river
#

what's your problem ryry

rigid loom
#

the whole statement is boggling my brain

rigid loom
# fluid river what's your problem ryry

file = new File(Bukkit.getPluginManager().getPlugin("Kingdoms").getDataFolder(), args[1] + ".yml");
where args[1] is the inputted kingdom name for a command /k create <kingdom>

#

ik. i was just answering his question

#

?

#

        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                System.out.println(ChatColor.RED + "Someone attempted to create a kingdom that already exists");
            }
        }
        customFile = YamlConfiguration.loadConfiguration(file);
    }```
#

that would cause that?

#

how would i fix it?

fluid river
rigid loom
#

ah

fluid river
#

so you can pass this args[1]

#

?

#

if file alredy exists cancel the command

#

and send message

#

"kingdom with same name already exists"

#

idk didn't have full code

#

oh you mean there is one field for file

#

with no reason

#

hey ryry

rigid loom
#

ye?

fluid river
#

What is your actual goal

#

you want each player to have kingdom?

#

Or smth

hazy parrot
fluid river
#

<T extends JavaPlugin>#getDataFolder()

hazy parrot
#

what

fluid river
#

ryry you alive?

fluid river
rigid loom
#

id make it so i could have

Kingdom: kingdomName
Admins: kingdomAdmins
Members: kingdomMembers

for multiple kingdoms in one folder or sum, but idk how to do that

fluid river
#

basically

rigid loom
#

one .yml rather

fluid river
#

So each kingdom has own YML right?

rigid loom
#

as of current that was my goal. idk if its possible to do them all in one yml

hazy parrot
#

why not just use database

fluid river
#
public class KingdomCommand implements CommandExecutor {

    private MainClass plugin;

    public KingdomCommand(MainClass plugin) {
        this.plugin = plugin;
        plugin.getCommand("kingdom").setExecutor(this);
    }

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (args.length != 1) return false;
        if (!(sender instanceof Player player)) {
            sender.sendMessage("only for players");
            return true;
        }
        File f = new File(plugin.getDataFolder(), args[0] + ".yml");
        if (f.exists()) {
            player.sendMessage("Kingdom with same name already exists");
            return true;
        }
        try {
            f.createNewFile();
            fillFile(f, player);
            player.sendMessage("Kingdom created");
        } catch (IOException ex) {
            player.sendMessage("Failed to create kingdom file!");
            ex.printStackTrace();
        }
        return true;
    }

    public void fillFile(File file, Player player) {
        var conf = YamlConfiguration.loadConfiguration(file);
        conf.set("key", value);
        // other values
        try {
            conf.save(file);
        } catch (IOException ex) {
            player.sendMessage("Failed to save kingdom data to file!");
            ex.printStackTrace();
        }
    }
}```
torn shuttle
#

why keep data which requires storage and computing power when you can just randomize the data someone has and hope it's correct

river oracle
torn shuttle
#

it's moments like these that I realize that I am just made different

#

you're out here with this PEASANT mentality of "haha let's randomize player data"

#

no

river oracle
#

Now make it and sell it on spigot for 20 dollars

torn shuttle
#

who needs to store chunks

#

this is what we call loser behavior

#

I will make a spigot fork that stores no data

#

it will not have a single file

river oracle
#

Beautiful

torn shuttle
#

you will have to hotload plugins in via debugger

river oracle
#

Actually plugins shouldn't be allowed especially ones that Try to store data

river oracle
#

And God forbid use a database

torn shuttle
#

disgusting peasant behavior

#

ew

rigid loom
#

ye. i see it

torn shuttle
#

your poor mentality is rubbing off on me, I need to go bask in the light of my greatness

river oracle
fluid river
#

SQLITE YAML JSON SQL

fluid river
#

which basically handles all of the file creation process

#

and saving

#

Would be util with all methods static tho

#

umm there are

torn shuttle
fluid river
#

come to dm i'll teach you in 2 minutes

#

how to run queries

#

how to setup connection

#

and so on

#

there are like billions of tutorials about SQL in plugins already

river oracle
#

Only use Mongo sql is beta behavior

fluid river
#

you don't need ondisable tho

#

depends

river oracle
#

Not depends definitely stupif

#

Lol

fluid river
#

i mean sometimes you would not need this

#

not when breaking blocks of course

#

Some other cases

river oracle
#

No you would almost under any situation not want that

fluid river
#

Well i don't give a shit

river oracle
#

I load player data into objects on join

fluid river
#

and mostly not code big plugins

#

which would require more than 2 files

#

config.yml

#

and locale.yml

#

also you just get ResultSet after execute query

#

no need for running task

#

or doing any shit async

#

Basically resultset =

#

ah you mean that

#

then yeah

hazy parrot
#

in fact mostly everything that can block thread should be done async

fluid river
#

in fact we need processors which work instantly with no delay

#

and remove the thread word from dictionaries

#

also instant internet

#

would be nice

river oracle
fluid river
#

Sadly speed of light breaks my life

agile vessel
#

Really dumb question but if I make stuff in mcreator using the minecraft forge setup will it work for basic stuff? I don't have internet so can't install the spigot setup. Thanks sorry for being annoying

fluid river
#

you are the reason why your plugins block main thread

fluid river
#

SpigotForge comes in

#

or how is it called

agile vessel
#

Thank you

river oracle
#

still waiting on IkeVodoo's Spigot/Fabirc thingy

#

lol

fluid river
#

waiting for Just

#

JavaRust

#

Rust with full collections framework setup

#

and voids instead of fns

#

and proper method namings

#

not len() but length() or size()

#

idk

#

& was a nice idea

#

#list is something i don't get

#

which language does that

#

rly

#

Lua bad

#

Java good

#

gtg sleep

#

good night

agile vessel
#

How to make custom block for spigot server without using mcreator? Please link tutorial if possible thank you

river oracle
#

spigot is not for mods

#

its for server side additions only

#

I highly doubt you can execute this with whatever block coding mcreator likely is

vocal cloud
#

You can easily do "custom" blocks with a resource pack assuming you're using a new version and not 1.8

agile vessel
#

Ah thank you

vocal cloud
river oracle
#

also you can't have the same attributes as they allow in forge

vocal cloud
#

They asked without mcreator

river oracle
#

oh

agile vessel
#

All my Google are just tutorials for mcreator xD

river oracle
#

resource packs but you won't get the same level of customizability you get with forge just a heads up

agile vessel
#

I will search more

#

I'm using spigot not forge

vocal cloud
#

I don't have a tutorial saved anywhere but it's not super hard. The hard part comes giving it life so to speak as you're really just creating a vanilla block with a texture

#

That you have to give it the facade of it being something else

agile vessel
#

I will try my best thank you Mike the taco

mossy gazelle
#

Is there a way to use a variable in a different eventhandler?

#

its in the same class, want to make an entity variable and use it in diffrent event

river oracle
#

?learnjava

undone axleBOT
river oracle
#

learn java if you wanna use spigot your going to go no where fast with your current set of knowledge

tranquil viper
#

What is a safe way to block my current code from continuing until something is done?

#

ie. Thread.sleep but safe

#

I was thinking RunTaskLater but figured I should ask before I try

hazy parrot
#

Or completable future ^

river oracle
#

I just sleep my main thread ๐Ÿคทโ€โ™‚๏ธ its the most effective not like anything fun would be going on, on the server while my plugin is doing its task anyways

worldly ingot
#

Yeah. Players can wait

#

What your plugin is doing is far more important than the players mining, or fighting mobs, or building a house. Weirdos

tranquil viper
#

Is there a way to check what closed the inventory? I want to check if a player closed the inventory or if my plugin itself closed it.

lethal frigate
#

On spigot website?

worldly ingot
#

I would hope so

lethal frigate
#

Can u ban this one I have?

#

The email I use isn't mine

#

I miss spelt it

#

And I can't make a second account since it said something about banned people with more than 1 account

worldly ingot
#

Because you don't have access to that email, you're fine to create another. It's no big deal

lethal frigate
#

Ok tyty

worldly ingot
#

If you'd like, @ me with a link to your new account and I'll leave a note on your account in case we see it in the future

lethal frigate
#

๐Ÿ‘ ๐Ÿซก

kind hatch
#

Hey Choco, what's the reasoning behind not being allowed to make multiple spigot accounts?

worldly ingot
#

Usually post/rating boosting and review spoofing

#

Or the obvious ban evasion

worldly ingot
#

Thanks

lethal frigate
#

๐Ÿ‘

quaint mantle
#

I'm having issues with this bit of code, the code works fine if a player is a floodgate player, but when it's not the commands still are blocked without reaching the setCancel. Any reason why that is?

remote swallow
#

hover over it and see what ij says

quaint mantle
#

"If the event is cancelled, processing of the command will halt." for the specific players i question the event never gets canceled. but it might be an issue caused by duplicate command. command in question is /shop which my plugin also uses, thats the reason i want to intercept the command for specific players. hmm

remote swallow
#

its probably ``private final List<String> commands;`

quaint mantle
#

Yep renaming by command fixed the issue hmm. Not sure how to solve that one. Thanks for the idea!

wary topaz
desert loom
#

this.plugin.getCommand("bettercommands") is null causing Objects.requireNonNull to throw an npe

wary topaz
#

but the other ones dont throw a null

desert loom
#

is bettercommands in your plugin.yml? pretty sure if it isn't getCommand returns null.

wary topaz
#

holly crap

remote swallow
#

dont call your main class main

wary topaz
#

I forgot to add it

#

LMFAO

remote swallow
#

?main

wary topaz
#

thanks man and I renamed my name

#

my main file*(

wary topaz
remote swallow
#

the case part ive got no idea, but thats not how reloading a plugin/config works

wary topaz
#

How would I do it?

#

I'm trying to reload it without restarting or reloading the server

#

Like essentials x (/essentials reload)

remote swallow
#

on your main class add a


 public void reload() {
        this.reloadConfig();
    }

call on MainClassName.reload()

wary topaz
#

alr

#

Non-static method 'reload()' cannot be referenced from a static context

#

oh wait i had to do plugin.reload();

remote swallow
#

forgot that needed di

wary topaz
wary topaz
#

(Removed)

remote swallow
wary topaz
#

I reloaded the plugi

#

plugin*

#

with /reload confirm

remote swallow
#

that sometimes break stuff, try actually restarting

wary topaz
#

alr

#

Still didnt work

remote swallow
#

is there anything else that could be mis-firing it?

wary topaz
#

Wdym

remote swallow
#

another class, or plugin

wary topaz
#

its the only plugin I have

remote swallow
#

check if it works without the switch

wary topaz
#

alr

#

Didn't work.

pearl zephyr
#

can I use colours when sending a message to the action bar?

balmy valve
#

Anyone know if it would be possible to stop zombie piglins from getting group agressive?

remote swallow
pearl zephyr
#

so what am i doing wrong?

#

it works fine without the colour thing

wary topaz
#

Try using ยง

remote swallow
#

is that actually an option for spigot#sendMessage

pearl zephyr
chrome beacon
remote swallow
pearl zephyr
#

pretty sure it doesnt

wary topaz
chrome beacon
# pearl zephyr '

Color needs to be a part of the text component. It's not an argument of send message

remote swallow
wary topaz
#

it doesnt even update the reloading message

chrome beacon
#

You can't just put a chat color there

#

It won't work

pearl zephyr
#

i got that part

wary topaz
#

oh wait i fixed it

remote swallow
pearl zephyr
#

how would i do that

chrome beacon
#

Use legacy chat colors

#

Like with ยง or translateAlternative... with &

quaint mantle
#

can you make a player completely blind?

#

i tried amplifier of 999

#

I still see some stuff

chrome beacon
wary topaz
onyx fjord
quaint mantle
#

new effect?

onyx fjord
#

Deep dark or whatever it's called

quaint mantle
#

oh that

#

what does it do again?

onyx fjord
#

It's like stronger blind effect

quaint mantle
#

oh, nice

#

will try that next, now trying night vision with blindness

#

heard it makes it darker

#

huh

#

@onyx fjord in low light levels combine blindness with darkness (not deep dark). You are pretty much blind

#

doesn't work on high light levels

quaint mantle
#

for example?

#

you mean sending it to the players surroundings and such?

#

i see

glossy venture
pearl zephyr
#

figured it out before but thanks :)

glossy venture
#

why

dusty herald
#

configuration and it's a lot easier to type than adding chat colors

glossy venture
#

nah its a long function name and its not a constant so its slower

#

it also does not matter when the message is not from a configurtion

tall jewel
#

Hi, I made a custom inventory and I open it after using a command. How to check if player has opened my custom inventory in InventoryMoveItemEvent?

crimson terrace
#

compare the inventories you can get from the event with the one you opened earlier

#

or you could get the inventory you opened earlier and check for the player in the Inventory#getViewers() method

sacred schooner
#

how do you rotate a boat with a player on it?

#

I tried Boat#setRotation but that doesn't seem to work

crimson terrace
sacred schooner
#

I tried doing that but constantly remounting the player looks weird

crimson terrace
#

how about rotating the player?

#

since the boat goes with player rotation

tender shard
tender shard
sacred schooner
#

can you teleport it while an entity is mounted?

tender shard
#

I guess

sacred schooner
#

I believe I already tried but I don't think it works

tall jewel
crimson terrace
#

google the event, it has 3 methods of accessing inventories iirc

tender shard
#

ugh I also tried to teleport the boat and it's really weird

#

it does not teleport at all. and when removing the passenger and adding it again, it's totally fucked up

#

the boat does rotate but then you cannot enter it anymore

mighty pier
#

boat.setcanenter(true)

#

easy

tender shard
#

you might want to pull request this method before suggesting people to use this lol

#

not even NMS' setYRot works

crimson terrace
#

setting velocity would work either, would it

tender shard
#

is there a reliable method to detect all those shitty hybrid server software? like mohist and all the other garbage?

#

I am tired of getting "bug reports" by people who think that combining forge + bukkit is a good idea

#

i'd rather do

if(isNotAProperServerSoftware()) {
  getPluginManager().disable(this);
}
crimson terrace
#

if(!serversoftware.isSpigot && !serversoftware.isPaper) {
plugin.shutdown();
}

chrome beacon
#

Methods
func_<number>_<obfuscatedName> For Forge
method_<number> for Fabric

Fields:
field_<number>_<obfuscatedName> For Forge
field_<number> for Fabric

#

or just check for a Forge/Fabric specific class

tender shard
#

but on what class could I call this on?

#

MinecraftServer.getDeclaredMethods().stream().filter(method -> method.getName().startsWith("method_") or sth?

#

well but what's "smth" lol

#

never used forge nor fabric nor anything like that on a server

#

I DONT WANT TO D:

#

well guess I'll have to

#

why is it always chinese people that use such weird server software

#

catserver, mohist, ...

#

maybe I'll just grep through latest.log and search for "forge" or "fabric" lol

#

thx

echo basalt
#

Ideally you'd cache it

tender shard
#

sure, sure

#

although I only need it once

#

is copilot right or is your class name right?

#

copilot suggested net.minecraftforge.server.ServerMain

#

oki thx

#

np

#

thanks

#

guess this should do it then

#

yeah lol

#

I use it quite frequently so I have it in a utils class

#

I am really so tired of people reporting "bugs" that only happen in mohist, catserver, lmaoserver etc

glad prawn
#

Lmaoserver xD

golden turret
#

lmao

crimson terrace
#

in order to make my plugin a dependency do I have to make an interface for everything I want to get from an instance of the plugin when I dont know the version of so I dont have to check?

crimson terrace
#

when i do Bukkit.getPluginManager().getPlugin() i dont want to implement something for each version of the dependency in order to make sure all versions are supported since the classes and methods might change, casts would probably not work for the concrete classes, they would probably for interfaces tho, right?

#

if I have a Controller for what should happen when a creature is hit, I would make an interface with the same method in order to support all dependency implementations of it, no matter what would change

#

sorry if im overcomplicating things XD

ivory sleet
#

Well

#

Usually just depend on the latest version of the plugin?

#

The plugin, if done properly should provide an api good enough

echo basalt
#

causes problems with Worldedit

#

as <1.13 is 6.2.3 or some shit

#

and it's completely different

#

than 1.13+

#

generally I just recommend to say "fuck it, 1.18+ or die"

ivory sleet
#

Yeah

#

Else probably wanna go with an adapter that facades polymorphic versioned plugins

crimson terrace
#

I mean like this and on the plugins getEventController() I put this interface as a return type and return the actual implementation.
If I change the interface I would have to have a new major version then, right?

#

which means, one interface for each concrete class I want people to be able to access during runtime

ivory sleet
#

Uh sure

#

Id avoid the suffix Interface

crimson terrace
#

how would you name it?

ivory sleet
#

Use Facade or well Handler seems fine in this case

crimson terrace
#

I like facade

#

thanks ๐Ÿ˜„

ivory sleet
#

Yeah, its the enterprise name for any abstraction basically

grim ice
#

having a hall of shame in each discord server is 100% needed

#

this specific person that doesn't even know the difference between javascript and java, thinks that their mod that is made with ct (skript for forge basically) is better than another mod which is been in work for ages

#

and that specific person keeps asking the original mod developer how they did something even though theyre making it in a totally different language, on how to do things

#

idk why im talking about this here but im having the worst day and im randomly spending my anger on channels that i usually talk in (clown behaviour but excuse me)

echo basalt
glad prawn
#

??

molten hearth
#

I am confused

#

my maths isnt mathing

fossil lily
#

math harder

molten hearth
#
System.out.println("health: " + this.getDynamicStats().getMaxHealth() + "Defense" + this.getDynamicStats().getMaxDefense());
return (this.getDynamicStats().getMaxHealth() * (1 + (this.getDynamicStats().getMaxDefense() / 100)));```
#

the output is 100 and 50

#

therefore it should be 150

#

but no

#

java says 100

silk mirage
#

maven goings nuts

fluid river
#

(1 + 50)/100 = 0 tho

silk mirage
fluid river
molten hearth
#

ah bruh

fluid river
#

smth like this

#

if you don't cast to double it won't be casted automatically

#

so you will have 0 everytime