#help-development

1 messages Ā· Page 1105 of 1

torn shuttle
#

and not like 6 laid back relaxed days, no, 6 days just grinding away at it

humble tulip
#

Typically you develop on the lowest version you wish to support

#

If you wanna support 1.16+ develop on 1.16

torpid sapphire
#

so forwards compatibility is easy

#

backwards not so much

#

or how should i understand that

quaint mantle
#

hey! ive been learning kotlin for plugin development, but im not really sure how to start making one in the language. i want to make a basic plugin that i can use to build other plugins out of, but i dont really know where to begin with making one! any help would be appreciated :D

torpid sapphire
#

all other guides on the wiki should still work, api is the same

quaint mantle
#

thank you :D

torpid sapphire
#

youd just have to rewrite the actual code snippets

#

but that should be simple enough

sleek island
#

how should i apply upwards knockback

young knoll
#

positive Y velocity

stuck oar
#

how do i register a command that is like in my main class

#

getCommand("levelup").setExecutor(this); i have this but it doesnt work

echo basalt
#

it's 4am and I gotta release this shit in like 4 hours

sly topaz
#

why are you doing reference equality on entities

echo basalt
#

(we have like 2 different custom entity systems at work and they're tripping up)

#

In specific, I spawn an entity -> convert it to a "component entity" (tracks with entity ids) and apply a model (converts back to the real entity) and that's throwing errors

#

Solution is to load the chunk. Fairly dumb imo

restive sierra
#

hi guys

#

i really need help

#

how do i fix this

#

how do i send images

#

but anyome

#

click here to see it

#

e

#

bruh

echo basalt
#

?verify

restive sierra
echo basalt
#

?noimg

#

bruh

#

?noimage

#

bot pls

restive sierra
#

?noimage

echo basalt
#

?image

restive sierra
#

?image

echo basalt
#

there's a command somewhere for that

#

in short you gotta verify

restive sierra
#

oh

#

il do it rn

#

this is the dir for my files

quaint mantle
#

Just split jars for each platform šŸ’€

dawn flower
#
TurboPlaceholder<?> placeholderSyntax = syntaxParser.parse(parsedPlaceholder, TurboPlaceholder.class);

Object result = placeholderSyntax == null ? "<" + placeholder + ">" : placeholderSyntax.get(parsedElement);

if (string && placeholderSyntax != null && result != null)
  return placeholderSyntax.toString(result);

is there a way to cast it? because i know for a fact that result is an instance of TurboPlaceholder's generic

#

String toString(T object)
T get(ParsedElement element)
these are the methods

acoustic shuttle
#

use intelliJ'

near furnace
acoustic shuttle
near furnace
#

guys, which is better? using minecraft development kit or doing it manually with gradle and using artifacts

pseudo hazel
undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

pseudo hazel
#

dont use artifacts in any case

#

build using gradle or maven

near furnace
#

some say use the plugin

#

which one is better if you are going to create a full fledge plugin to sell

pseudo hazel
#

do what manually

#

create build.gradle?

near furnace
eternal oxide
#

MDC really should not be used by beginners. Its for more advanced users to skip mundane tasks.

acoustic shuttle
#

Whats the point of setting it up manually?

eternal oxide
#

to learn

acoustic shuttle
#

ig

pseudo hazel
#

but who likes learning anyways

eternal night
#

the plugin also has to create a not too optimal build.gradle.kts as it supports like everything

eternal oxide
#

yeah, lets get a room, fill it with monkeys at keyboards.

eternal night
#

if you are just going to compile against spigot 1.21.1, you can create a much neater build.gradle.kts than the plugin can

near furnace
#

yay i can send pictures now! :)

pseudo hazel
#

I just create the project using the plugin and then edit it to what I need

#

but I guess that requires you to know what you need

eternal night
#

or that xD yea. But I mean, a plain build.gradle.kts for spigot is like, 6 lines after gradle --init -dsl kotlin

quaint mantle
#

hey guys. does anyone know good tutorials that explain how serialization to a yaml file works? I understand but it's just confusing how come there is a map of Strings and Objects - how does an object get stored to config as a readable value?

#

(spigot configurationserializable)

#

like i dont get how itemmeta saves in the serialize method of ItemStack

sly topaz
#

all it does when serializing is taking all of its fields, and putting them in a Map where the keys are the field names and the values are well, the values of these fields

#

some encoding might be done in the process to obtain a a more compact serialiazed form and whatnot, but that's the gist of it

eternal oxide
#

?stash if you want to see the source

undone axleBOT
astral pilot
#

how do you clone GameMode

eternal night
#

why would you clone GameMode

quaint mantle
astral pilot
#

previousGameMode() doesn't seem to work

eternal night
#

I mean, you just store the returned GameMode in a variable

#

it is an enum

astral pilot
eternal night
#

a reference to an immutable enum constant yes

shadow night
#

Bro has no idea what an enum is

astral pilot
eternal night
#

It would not no

#

calling getGameMode would simply return a different value

#

but the referenced enum instance itself is immutable

astral pilot
#

ok thanks

sly topaz
#

this is the serialize method for default ItemMeta impl

#

though since meta has various subclasses, each sub-class has its own serialize method where they put their own data into the map builder and pass it along to the parent

shadow night
sly topaz
#

that's generally how serialization of complex object graphs is done, albeit the one bukkit uses is pretty barebones to say the least

sly topaz
eternal night
#

you don't need to sign the CLA to view the code skully

shadow night
#

You don't need an account either kek

sly topaz
#

I might be remembering things wrong but wasn't it the case that you couldn't see the craftbukkit source unless you created an account and agreed to something first?

eternal night
#

that is for PRs

sly topaz
shadow night
sly topaz
#

there are fancier serialization frameworks out there such as the one GSON uses which scale much better for this kind of complex object graph

quaint mantle
# sly topaz that's because it delegates the serialization to the implementation of the ItemM...
    @NotNull
    @Utility
    public Map<String, Object> serialize() {
        Map<String, Object> result = new LinkedHashMap<String, Object>();

        result.put("v", Bukkit.getUnsafe().getDataVersion()); // Include version to indicate we are using modern material names (or LEGACY prefix)
        result.put("type", getType().name());

        if (getAmount() != 1) {
            result.put("amount", getAmount());
        }

        ItemMeta meta = getItemMeta();
        if (!Bukkit.getItemFactory().equals(meta, null)) {
            result.put("meta", meta);
        }

        return result;
    }```

wait so where here does it delegate to the implementation of itemmeta?
pseudo hazel
#

by putting in the meta

#

and the meta will serialize itself

#

similar to the itemstack

quaint mantle
#

interesting

#

so thats like a requirement of maps?

#

or smthn?

eternal oxide
#

Maps take whatever you tell them to accept

#

basic java

sly topaz
#

somewhere along the call chain, that Map will be iterated in order to create the yaml structure, and when setting the value corresponding the meta key, it'll call serialize on the Object (or rather, the ConfigurationSerializable)

quaint mantle
#

sorry lol i appreciate your help. i always like to understand as much as i can about what im doing haha

tawdry echo
#

\

sly topaz
#

it's fine, we're all here to help

quaint mantle
#

i wonder how painful it would be to serialize to a sql database 🤣

sly topaz
#

I mean, you don't really have to think of all of this when serializing stuff, often times you can just let the serialization framework do most of the work for you

upper hazel
#

question to those who know is there any sense to create class loading in runtime api plugins together with the build system or is it of no use?

sly topaz
#

and since things like items are actually serializable in multiple ways (you can serialize them as binary data by calling ItemStack#serializeAsBytes for example), all you have to do is pass that along in your query as a VARBINARY or a Blob

near furnace
#
package me.lolnypop.myplugin.commands;

import me.lolnypop.myplugin.myplugin;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;

public class SetFeedCommand implements CommandExecutor {
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Plugin plugin = myplugin.getPlugin();

        if (args[0].equals("true")) {
            plugin.getConfig().set("feed-player", true);
        } else if (args[0].equals("false")) {
            plugin.getConfig().set("feed-player", false);
        } else if (args.length > 1) {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
            return true;
        } else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));

        return true;
    }
}
#
[15:00:21 ERROR]: Error occurred while enabling myplugin v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.lolnypop.myplugin.myplugin.getCommand(String)" is null
        at MinecraftPractice-1.0.0.jar/me.lolnypop.myplugin.myplugin.onEnable(myplugin.java:41) ~[MinecraftPractice-1.0.0.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.21-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:640) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:589) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:754) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:516) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:329) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1215) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330) ~[paper-1.21.jar:1.21-130-b1b5d4c]
        at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]```
#

u hm

#

a h m

#

is there anything wrong with my code that spigot dislikes?

sly topaz
#

did you define the command in your plugin.yml?

eternal oxide
#

no command in plugin.yml

sly topaz
#

then that's your issue

near furnace
#

... my bad

#

how do you guys read this goobledy gock

#

this stacktrace

sly topaz
#

you just have to read the first line

eternal oxide
#

its easy once you understand it.

sly topaz
#

the rest is just the call stack

near furnace
#

which line gave you guys that something was wrong with the plugin.yml

sly topaz
#

it says me.lolnypop.myplugin.myplugin.getCommand(String)" is null

#

getCommand is a method from JavaPlugin

near furnace
#

i get it

eternal oxide
#

a stack trace is just a list of all calls currently on the call stack (in order). There is always an error and usually an explanation.

near furnace
#

spigot was unable to get the getCommand() since plugin.yml was not initialized

sly topaz
#

and the getCommand documentation says

ivory sleet
#

when you read stacktraces, usually reading the lines that involve your code (the classes and packages) will give away what went wrong

sly topaz
#

usually, you'll see the exceptions the method throws listed in the method documentation too

sly topaz
#

yes, basically

ivory sleet
#

I think plugin.yml was initialized for you still?

sly topaz
#

sometimes, due to there being too much abstraction going on, the cause might be buried deep into the call stack, but often times it's enough to check the first few lines of the stack trace to know

near furnace
#

im slowly learning to understand these stuff :)

ivory sleet
#

its just the command declaration in plugin.yml is missing

near furnace
quaint mantle
eternal oxide
#

its a common error here so easily recognised.

ivory sleet
#

Your plugin would still run fine if you didn’t call getCommand(…).setExecutor(…) even if the command is missing in plugin.yml

pseudo hazel
#

deserializeFromBytes or something

sly topaz
eternal oxide
#

so long as you caught the error and didn;t allow it to propogate through the onEnable the plugin would still run

sly topaz
quaint mantle
upper hazel
#

What do you think if we make some api plugin and add a system of its loading in runtime and update api maintaining old versions of the plugin (package names, methods, etc.) and change only the logic, then it turns out it will not be necessary to update the version of api in the build system at the first loading of classes?

near furnace
#

Hey there, why wont there be a auto fill suggestion? (true/false)

#
package me.lolnypop.myplugin.commands;

import me.lolnypop.myplugin.myplugin;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;

public class SetFeedCommand implements CommandExecutor {
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Plugin plugin = myplugin.getPlugin();

        if (args[0].equals("true")) {
            plugin.getConfig().set("feed-player", true);
        } else if (args[0].equals("false")) {
            plugin.getConfig().set("feed-player", false);
        } else if (args.length > 1) {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
            return true;
        } else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));

        return true;
    }
}``` 
My code
ivory sleet
quaint mantle
near furnace
pseudo hazel
#

implement TabExecutor

#

then you have onCommand and onTabComplete

upper hazel
quaint mantle
pseudo hazel
#

yes

ivory sleet
#

Like are we talking placeholder api expansion/luckperms extension stuff?

#

I mean papi is a bad example since their classloaders are leaking iirc

near furnace
pseudo hazel
#

yes

near furnace
#

good to know that ;)

upper hazel
pseudo hazel
#

iirc its just an interface that literally just extends commandexecutor and tab complete

upper hazel
#

no change maven version

ivory sleet
near furnace
#

i was thinking, if there isnt any tab completion how would people know its a true or false answer haha

upper hazel
#

As a result, the person just adds the necessary classes to the project via maven, but the logic of these classes is changed in runtime.

ivory sleet
#

You describe it a bit odd for being an addon system

near furnace
quaint mantle
#

im ngl im not the one to ask

#

im a noob

ivory sleet
upper hazel
#

my friend create this system and now we think how use it

ivory sleet
#

That includes parsing arguments, structuring literals and argument and deal with tab completion automatically and thread execution coordination

sly topaz
#

there's a whole lot of cruft when it comes to commands, these frameworks help with that

ivory sleet
#

There are a lot of command frameworks that utterly suck so its far from pure good

quaint mantle
#

yo @sly topaz do you know any good serialization tuts for bukkit / spigot or whatever that i can watch? its hard to know what info is reliable

ivory sleet
#

The spigot wiki has some info about it relly, not sure how ā€œupdatedā€ it is

sly topaz
upper hazel
#

The fun thing is that we make an api plugin with addons system and then we only realized at the end of the work that addons are not needed because the api user interacts with the code and in any case the classes will have to be loaded through the build system and the only benefit I saw in this is the ability to automatically change the logic of classes in runtime.

sly topaz
#

if you want to utilize commands to their fullest, it's better to go with a command framework like cloud or CommandAPI

ivory sleet
#

or just brigadier

#

you don’t have to use a third party framework for the sake of it

sly topaz
ivory sleet
#

you can invoke on nms

sly topaz
#

yeah but that's just messy

ivory sleet
#

a little bit

sly topaz
#

just use the framework at that point

rotund orchid
#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?

ivory sleet
#

Only argument against brig is that it doesnt support annotations

sly topaz
ivory sleet
#

Which seems to be a huge deal breaker to most

near furnace
#

Ahhhh, even though there are more than 1 arguments, the game still sets the value to true! Idk why I made sure in the code that if args.length > 1 then it should say Invalid Syntax and return true;

rotund orchid
#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug??????

ivory sleet
#

But sure, spigot does prioritize ver compat

#

so its maybe not aligned with their core values

sly topaz
#

only recently has the version been removed from nms packages, if you want to support older versions then you have to do the whole thing with reflections or creating interfaces which have an impl per version, it is just messy

pliant topaz
ivory sleet
#

Even better is paper w its little abstraction on top

sly topaz
#

then when you want to move to another platform, you have to do all your ccommands again

rotund orchid
#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?

near furnace
pliant topaz
#

but why should it say invalid syntax?

sly topaz
ivory sleet
rotund orchid
#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?

near furnace
#

Even if somebody writes /setfeed true oaijeoaij, There are two arguments here and i want to say Invalid Syntax here

sly topaz
#

I mean, it does already no?

near furnace
#

but instead the game sets it to true

rotund orchid
#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?

#

there is a problem with playerkits every time I try to move the kit to another slot it appears 2 times in the position I inserted and in the previous position how do I solve this Bug?

pliant topaz
#

so it doesnt matter

sly topaz
#

you have to return false if the command failed

pliant topaz
#

its only a restriction to the player

near furnace
sly topaz
#

but still, that part of the code shouldn't be executed, make sure your if statement is in the right place

sly topaz
ivory sleet
#

but returning false prompts the sender with an ugly message, a lot of devs just return true regardless and send messages to the sender themselves

near furnace
#

i mean i just wanted if the player says two arguments "/setfeed true aoijoiaej" or even gibberish "/setfeed oiajeo oijse", as long as there are two arguments, i want it to send an invalid sytax message and cancel the code yk

#

ok ill try it with return false;

rotund orchid
sly topaz
#

the channel is run by volunteers, people will answer when they want to answer

pseudo hazel
#

you check in your command if there are too many arguments

sly topaz
#

being obnoxious about it doesn't help

near furnace
ivory sleet
near furnace
pseudo hazel
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

rotund orchid
#

there is no error code I get the kit in the slot where the moved is in the previous slot and I cannot send test videos

pseudo hazel
#

but you have written code to do this behavior right?

#

are you a developer or a server owner?

near furnace
# sly topaz you have to return false if the command failed

Hey there i changed it to return false, still doesn't behave like the way I want it to. I also mentioned that

    plugin.getConfig().set("feed-player", true)
}```

I mentioned only the at arguments index 0, if its "true" then set it to true, but how do I make it that if there are multiple arguments even if the "true" is at index 0, it should cancel everything and provide invalid syntax :)
pseudo hazel
#

check the command on amount of arguments

#

if its more than you expected, return the error

near furnace
#
 if (args[0].equals("true")) {
            plugin.getConfig().set("feed-player", true);
        } else if (args[0].equals("false")) {
            plugin.getConfig().set("feed-player", false);
        } else if (args.length > 1) {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid syntax!"));
            return true;
        } else sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select between true or false"));```

here is my if statements
hushed scaffold
pseudo hazel
#

well you would have to return before you change the config

#

like perform all your checks that prevent it from working first, and then do stuff with whats left

#

in this case

#

args[0] has nothing to do with the overall size

#

so if you check that first, it will skip the size check

wintry dagger
#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project: Fatal error compiling: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid' -> [Help 1]

near furnace
#

@pseudo hazel thanks, idk why it didnt came into my mind earlier but will this work? im now checking for the argument length

if (args[0].equals("true")) {
            if (args.length > 1) return false;
            {
                plugin.getConfig().set("feed-player", true);
                sender.sendMessage(ChatColor.GREEN + "Set the value to true");
            }```
pseudo hazel
#

yeah

ivory sleet
#

(there’s a plugin.saveConfig() method)

pseudo hazel
#

if this command only supports 1 argument I would check it even before seeing if args[0] is true

near furnace
# pseudo hazel yeah

yippee lemme try it and see, idk sometimes these simple java stuff dont come into my mind and i go asking dumb questions

pseudo hazel
#

like if args.length != 1, you done messed up

upper hazel
#

How to add a separate module to the repository in a common project. I have several plugins

ivory sleet
#

maven?

upper hazel
#

i mean add to repository for use in build system

eternal oxide
#

?modules

#

there is a command but its odd

upper hazel
#

how i remember exists site where the project is added to the repository via a github link but there are several plugins in the github repository

near furnace
pseudo hazel
#

if (args.length != 1) {
// your failed
return true;
}
// everything else

near furnace
#

thanks

#

do i use return true;?

#

or return false?

#

whats the difference tbh :)

ivory sleet
#

true

#

false is generally a no go

near furnace
#

sometimes false returns the command you executed idk why

ivory sleet
#

false sends the command sender an ugly message

#

so people tend to return true

near furnace
#

i see

eternal oxide
#

return false if you want it to show an error/usage for the command. return true if you want a clean exit

pseudo hazel
#

or return true if you already show your own error

eternal oxide
#

yup

eternal oxide
#

what?

pseudo hazel
#

your plugin class implements commandexecutor?

eternal oxide
#

default JavaPlugin is already a CommandExecutor. IF the command is in your plugin.yml it will fire via JavaPlugin

#

so long as you add an override onCommand

pseudo hazel
#

oh nice I didnt know

near furnace
#

Whenever i set (args.length != 1) return true;, all the else if statements turn red

pseudo hazel
#

yes because your syntax is broke

near furnace
upper hazel
#

what best module system?

eternal oxide
#

doing the same check three times means only the first ever runs

pseudo hazel
#

looks like a basic java syntax error

upper hazel
pseudo hazel
#

if () return whater; is already the whole statement and result, you cant use {} after that

pseudo hazel
#

thats why I never type if statements all on a single line

#

its just confusing

quiet ice
#

Although the second approach might be more difficult to represent as a maven project, if not straight-up impossible

gleaming grove
stuck oar
#
            Player p = (Player) sender;
            PlayerLevelManager playerLevelManager = this.levelManagerHashMap.get(p.getUniqueId());
            int level = playerLevelManager.getLevel();
            Double moneyneeded = getConfig().getDouble("levels." + level + ".moneyreq");

            if (playerLevelManager.getXp() >= getConfig().getInt("levels." + level + ".xpneeded")) {
                if (econ.getBalance(p) >= moneyneeded) {
                    econ.withdrawPlayer(p, moneyneeded);
                    p.sendMessage("§d§l(!) §dYou just leveled up from §d§nLevel " + playerLevelManager.getLevel() + " §d to §d§nLevel " + (playerLevelManager.getLevel() + 1));
                    playerLevelManager.setLevel(playerLevelManager.getLevel() + 1);
                    playerLevelManager.setXp(0);
                    setscore(p, playerLevelManager.getLevel(), playerLevelManager.getXp());
                } else {
                    p.sendMessage("§c§l(!) §cYou don't have enough §c§lMoney§c to §c§lLevel Up");
                    p.sendMessage("§c§l* §7Level up Cost: §7§n$" + moneyneeded);
                    p.sendMessage("§c§l* §7Your Balance: §7§n$" + econ.getBalance(p));
                }
            }

        }```

anyone know why this isnt doing anything the command runs but doesnt do anything all i did was add the ```playerLevelManager.setXp(0);```
near furnace
#
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Plugin plugin = myplugin.getPlugin();

        if (args.length == 0 || args.length < 0) {

            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Incomplete Syntax: Choose true or false"));
            return true;

        }

        if (args.length > 1) {

            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Invalid Syntax: Choose true or false"));
            return true;

        }

        if (args[0].equals("true")) {

            plugin.getConfig().set("feed-player", true);
            sender.sendMessage(ChatColor.GREEN + "Set the value to true");
            plugin.saveConfig();

        } else if (args[0].equals("false")) {

            plugin.getConfig().set("feed-player", false);
            sender.sendMessage(ChatColor.GREEN + "Set the value to false");
            plugin.saveConfig();

        } else {

            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c" + "Please select either true or false"));
            return true;

        }

        return true;

    }```

YIPPEEEE!!, Thanks Steaf and all the others for helping me! This code functions just the way I want it to :)
tardy delta
#

now realize ChatColor.translateAlternateColorCodes can be a utility function

pseudo hazel
#

using translatealternatecolorcodes on your hardcoded strings is beyond criminal

#

i didnt even notice before

#

just use the chatcolor constants

#

like you are doing for green funnily enough

tardy delta
#

use a string processor šŸ¤“

pseudo hazel
#

nah write the string in a databse and then use an enum to get the hardcoded value anyways, but now from a database instead

quaint mantle
tardy delta
#

no

pseudo hazel
#

maybe add some prints or something

#

so you can see where it gets stuck

peak depot
#

why even bother doing ChatColor translate in hardcoded messages if you can simply use §

tardy delta
#

cuz i dont have that thing on my keyboard ;-;

peak depot
#

what keyboard lang you got

eternal oxide
#

UK/EU don't have that character on a key

peak depot
#

I got German layout and shift + 3 is it

eternal oxide
#

Ā£ is UK Shift + 3

#

its literally not on a UK keyboard

tardy delta
#

reminds me of one of those memes

eternal oxide
#

a Dvorak and QWERTZ key layout has it on Shift + 3

peak depot
#

Dvorak is the worst layout I ever saw

#

why did you make me google that

eternal oxide
#

oh no , its only QWERTZ

#

so German and Nordic

mild flume
#

Hey does anyone know how to install the latest build of ProtocolLib so I can use their APIs?

All they provide is a jar file but there's no instruction on how to use this API in my code and load it into my spigot server

peak depot
#

use maven or gradle i suppose

eternal oxide
#

oh German, Nordic and Swedish. I don;t see it on any other key layout

mild flume
peak depot
#

scroll the readme

mild flume
#

that's outdated for my version 1.20.6

mild flume
#

there is no repository after 5.1.0 sadly

peak depot
#

they got 5.2 in their releases on the github

mild flume
#

you can't just change that version to your pom.xml afaik

#

like if you enter <version>5.2.0</version> is errors out

#

they only provide a jar file

#

but im unsure how you would link that to your project

#

because i tried it locally and it gave the same error weirdly

peak depot
#

5.1 also throws an error so prob server issues

mild flume
#

ah alr, ill wait out and hope that's the case šŸ¤ž

#

thanks

#

a lot of people when searching the issue just said to update it from 5.1.0

#

but weird they don't have a server for that

peak depot
#

ĀÆ_(惄)_/ĀÆ

upper hazel
#

what is the best way to create package location in a module project?

  1. {group_id}.{global project name}.{project name}.
  2. {group_id}.{project name}
wintry dagger
#

best keyboard layout

eternal oxide
#

Most people don't live in Northern Europe/Germany

onyx fjord
#

Hey, I'm trying to make this system that serializes inventory as itemstack array in form of bytes to save it in database however there seems to be an EOFException happening and i have no idea what causes it.

My code: https://paste.md-5.net/otaxaronav.cs

tardy delta
#

no need to write bools

eternal oxide
#

you are writing a bool only when its null, but on read you always read a bool

tardy delta
#

he always writes bools

eternal oxide
#

ah yeah I didn;t see that

tardy delta
#

i dont get the decodeItem() , just call is.readObj

#

dunno why youre creating a new input stream on the existing byte array

quaint mantle
#

ahhhh the wiki on serialization doesnt cover sql yet

#

:(((

#

anyone know any good tuts on serializing itemstackz to sql

mossy flume
grim hound
#

can you open a url for a player in a gui for example?

#

so not in a chat message

tardy delta
#

im wondering if that conversion would use more bytes or less

quaint mantle
quaint mantle
tardy delta
#

paste site above ur head

grim hound
tardy delta
#

just write the size of the inventory and all items to the stream

#

dont bother using booleans

onyx fjord
#

i believe

onyx fjord
tardy delta
#

hmm?

grim hound
peak depot
grim hound
#

that's sad

#

thanks

quaint mantle
#

is storing vaults in yaml a dumb idea? like would that be excessively laggy?

quaint mantle
sullen wharf
#

How to properly colorize note particles?

quaint mantle
#

but each player might have like 10

peak depot
quaint mantle
hot walrus
#

Guys, not about this conversation, but is there a plugin + mod combo that allows sending client side code from the server to the client that the mod then runs to avoid latency?

peak depot
onyx fjord
#

if i dont save the null ones inventory slots are messed up

tardy delta
#

dataOut.writeObj(null)

onyx fjord
#

and inv must be a multiplir of 9

peak depot
#

but no clue how

hot walrus
#

But what im asking about is not like something widely known in the plugin community, right?

smoky anchor
#

Are you talking about arbitary code execution with code sent from the server to the client ?
Noone in their right mind would ever create that without ill intent or just plain stupidity.

mild flume
quaint mantle
tardy delta
#

i just told you what to do

quaint mantle
#

xD

onyx fjord
tardy delta
#

always worked for me, ig it just writes some placeholder

onyx fjord
#

ij tells me to write the itemstack, since it can be null anyway

#

so same thing

wet breach
hot walrus
# wet breach how would this avoid latency?

If you send over code that does for example a cool particle animation, that code could run on the client for multiple seconds and no lag because particles arent send over to the client

wet breach
quaint mantle
wet breach
#

now that we know that a packet can achieve the same result, the question is back at, where did it avoid latency?

hot walrus
#

sending packets takes 50 - 100ms based on serverlocation, but running the code on client could render the particles next tick

wet breach
hot walrus
#

at server join

onyx fjord
#

okay i fixed the issue now

wet breach
#

I am guessing you have shitty internet and this is why it is an issue for you?

onyx fjord
#

most likely this line

#

whatever, it works, im happy, and no booleans šŸ˜„

hot walrus
onyx fjord
#

yall know how big an SQLITE blob is?

quaint mantle
onyx fjord
#

or can be*

#

no im asking how big it can be

quaint mantle
#

oh

#

xD

hot walrus
wet breach
wet breach
smoky anchor
#

It could be done without RCE, just send "animation files" instead of code.
But I know of no mod that does this

hazy parrot
#

By default

hot walrus
wet breach
wet breach
smoky anchor
#

My guess is that this will become possible once we get custom entities with custom models.
But that can take anywhere from next monday snapshot to few years.
(in vanilla)

onyx fjord
#

a single item is 1kb

wet breach
#

so you want to use RCE which is notorious for being a security risk however there is ways to use such things in a safe manner that wouldn't compromise someones system. But RCE so far isn't needed to achieve what you are wanting.

onyx fjord
#

but thats with nulls included

wet breach
#

your excuse for wanting the mod, is because "reduce network load" Which is not even an issue unless you just have a shitty system and internet and shitty hosting provider

#

then I could see networking being an issue for you

hot walrus
wet breach
#

I am not about to take security advice from a random on discord

smoky anchor
#

This much complexity is not needed even if you have this "security"

wet breach
#

yes shitty internet

hot walrus
#

the things shown would not be very smooth even with good internet

wet breach
#

and your proof of that is?

quaint mantle
#

thanks for linking me to that vid @peak depot 🫔

hot walrus
#

and what do you if a server is in location like japan

wet breach
#

because I have plenty of experience that says otherwise

#

and plenty of games

hot walrus
wet breach
#

most of your latency isssue is with rendering and not networking

wet breach
#

also have to take into consideration that the vanilla client isn't super well made either

hot walrus
#

Also, with such a mod you can hotswap textures, you can technically implement some shader api for servers, you could do a lot

wet breach
#

you can do all that without RCE

eternal night
#

resource packs ✨

wet breach
#

there is a place for RCE but so far what you are wanting it for isn't a reason to use such things and would only compromise people's systems if anything else

hot walrus
eternal night
#

"certificate system" omegaroll

wet breach
#

not sure what you are talking about certificate system?

eternal night
#

lemme just have mojang review this plugin

peak depot
hot walrus
eternal night
#

"the mod"

hot walrus
#

the dev

wet breach
#

the client adds a certificate to a mod the client is going to run?

eternal night
#

what dev??

wet breach
#

so....how does the client know its good?

peak depot
#

let bro dream

hot walrus
#

the mod dev

#

stfu

eternal night
#

so the mod dev needs to review every consumer of their mod API

#

every single version release

hazy parrot
#

Seems okay to me

eternal night
#

sounds easy

wet breach
hot walrus
eternal night
#

what

#

"safe ways to make java scriptable" LOL

hazy parrot
#

You are trying to solve a problem which doesn't exist

wet breach
hot walrus
#

but i have ideas sometimes

eternal night
#

facts, scriptable java is just javascript

hot walrus
#

but you dont need to use java, just run lua an client

hazy parrot
#

Well I know java,I just need to learn the script part

quaint mantle
#

this entire conversation has gone completely over my head

eternal night
#

"just use lua"

hot walrus
eternal night
#

so now you also have to develop a minecraft modding api in lua

wet breach
hot walrus
eternal night
#

?

#

big apis are bad for security?

wet breach
hot walrus
eternal night
#

yea damn, spigot-api is ded

eternal night
onyx fjord
#

āŒ

hot walrus
#

lua goes fast af bro

onyx fjord
#

paper shill detected

peak depot
eternal night
#

what does speed have to do with security

onyx fjord
#

😠

wet breach
hot walrus
wet breach
eternal night
#

Well yea, but that is a general vibe, not specific to lua

wet breach
#

but you know gaining that extra 1kb/s isn't necessarily worth it either

rotund orchid
#

what?

wet breach
#

then you haven't experienced a decent server hardware it seems

#

or a decent pc

eternal night
#

I mean, the video of the spider you sent earlier is literally a spigot plugin omegaroll

wet breach
#

maybe bad internet too

hot walrus
#

rust goes brrrr

wet breach
#

I was wanting to see how long it would have gone on for before they noticed that XD

eternal night
#

literally a spigot plugin

hot walrus
#

thats spigot yeah

#

but thats also locally

#

i dont think that would be nearly as cool on a server

wet breach
#

ok, lets take a minute to process that

#

so....the server is running on the pc and the client is also running on the pc, two things that are notorious in needing resources

#

and they even recorded it at the same time in HD

hot walrus
wet breach
#

this is before any packets flying around the internet

#

packets are quicker then you think

hot walrus
eternal oxide
#

over 9000!

wet breach
#

as long as you have 100ms in average latency to the server you wouldn't notice any lag

hot walrus
#

Quick question, can you simulate latency on local server

wet breach
#

yes

eternal night
#

tc stonks

smoky anchor
#

@hot walrus Try joining Wynncraft.
They got shitload of custom mobs with animations like this.
It does not lag in the latency meaning.
(Any lag you would see is most likely a server dying due to new update and many players)

smoky anchor
#

šŸ¤¦ā€ā™‚ļø

wet breach
hot walrus
wet breach
#

not sure what that has to do with anything or why you believe I am interested in some random network

hot walrus
#

Ig what im asking for is a on server join modloader, with an api for the server

near furnace
eternal night
#

no that is a spigot plugin

near furnace
#

i refuse to believe this is a plugin, it has super cool custom models

#

Does he use a resourcepack?

pine crest
#

probably

eternal night
#

might just be block displays with a transformation?

pine crest
#

or that

near furnace
sly topaz
eternal oxide
#

whats equivalent to <scope>provided</scope> in gradle?

sly topaz
#

compileOnly

quaint mantle
blazing ocean
eternal oxide
#

thansk I thought so

sly topaz
#

ElgarL, just so you know, it is compileOnly

eternal oxide
#

are you sure šŸ˜„

sly topaz
#

100%, been there, done that

sand spire
#

Hey, I want to use this small library uploaded on https://jitpack.io.
But the problem is if it were to get deleted I would have no idea how to recreate it. Does it make sense for me to just copy the classes into my project or is it impossible for a library to get deleted?

grim hound
#

is bukkit yaw between 0 and 360?

shadow night
#

I thought it can be any number, just looping

eternal oxide
#

it is 0 to 360, but the sun is odd

#

Don't quote me but if I remoeber it was messed up when they changed the sun direction

pseudo hazel
#

🤔

eternal oxide
tardy delta
#

sun rises in the north? thats something new

eternal oxide
#

it used to

tardy delta
#

only read the "so notch changed it" when i hit enter

eternal oxide
#

Notch changed it and now its 90 degrees

dry hazel
#

you can just make a fork and use the coordinates of your fork if you're concerned about that

tidal narwhal
#

someone have shop gui

sleek island
#

wheres a good place to start a dev team

pseudo hazel
#

?services

undone axleBOT
earnest girder
#

if I need to store an int in an item's persistent data container to keep track of its ammo or whatever, but I am already storing an int for its custom item ID, should I just use doubles instead?

tardy delta
#

another int?

summer scroll
#

you can only store one data type per NamespacedKey

earnest girder
#

ah right

#

thanks

summer scroll
#

no problem!

onyx fjord
#

any way i could get the mob type based on the SPAWN_EGG material or the opposite?

grim ice
#

Illegal char <"> at index 0: "

#

what the hell does this mean?

#

Illegal char <"> at index 0: "C:\Users\domino\IdeaProjects\VoxelTeamsZ\target\VoxelTeamsZ-1.0.jar"

#

There is literally no illegal char

#

and that is not the path I'm using either

#

is intellij actually fucked?

tawdry echo
#

Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...

grim ice
#

That answers about 0% of what I asked

#

im doing the bad way, sure

#

it is still a way, there's no reason for why It's screaming at the air

#

Ok, now it's doing this even after I removed the dependency

#

I love Intellij.

eternal oxide
#

it loves its broken caches

grim ice
#

I invalidated caches and restarted multiple times, still is broken

#

bro...

eternal oxide
#

Have to reinstall OS then šŸ™‚

grim ice
#

lmao

#

OK so

#

I can legit

#

have an empty pom.xml

#

and it would still do this

near furnace
#

Is it possible to choose the order of the tab completion, like i wanna show true first then false? But in game it shows false first

#

do i use array? and add the array to the arraylist

blazing ocean
grim ice
#

im legit using the paid version

eternal oxide
grim ice
#

although for free since im a student

#

but if i paid $100 for this

#

I'd kms

#

um what?

#

it costs $600?

#

LOL

#

THIS SHIT COSTS 600???

eternal oxide
#

per year

eternal night
#

that is also the company plan

#

not the personal one

grim ice
#

oh true

#

it costs $170

#

for the individual plan

eternal night
#

in the first year

young knoll
#

Hey it gets cheaper in later years!

grim ice
#

which is still ridiculous

young knoll
#

Which is kinda weird

eternal night
#

if you were a student, you can insta skip the first two years iirc

eternal oxide
#

you can super charge it for an additional $200

young knoll
#

Normally it’s the opposite

eternal night
remote swallow
young knoll
#

Well for domains at least

eternal night
#

oh xD

remote swallow
#

you buy the more expensive ones then you cant ever leave because if you come back it means you have to pay it again

eternal night
#

I mean most subscriptions reward staying with them for long

young knoll
#

They offer you like 99Ā¢ the first year and then $20 after

eternal night
#

Yea because domains you cannot really afford to loose xD

grim ice
#

I can compile with maven

#

but intellij

#

cries about literally nothing

#

wth dude

#

this is taking too long

#

LOOOL

#

THE COMMUNITY EDITION WORKS

#

THATS RIDICULOUS BRO

near furnace
shadow night
#

I even have a method for that somewhere in my Util class

young knoll
#

StringUtil.copyPartialMatches

glass inlet
#

How to prevent LivingEntity from colliding with a player? The LivingEntity.setCollidable(false) doesn't work for me.

shadow night
glass inlet
#

Yeah did that

chrome beacon
shadow night
chrome beacon
#

Yes

#

That entity isn't colliding with the player

#

It's the other way around now

#

And is controlled by client as all player movement is

glass inlet
#
public void setNoCollision(Player player) {
    Scoreboard scoreboard = player.getScoreboard();
    String teamName = "noCollide_" + player.getName();
    Team team = scoreboard.getTeam(teamName);
    if (team == null) {
        team = scoreboard.registerNewTeam(teamName);
        team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
    }
    team.addEntry(player.getName());
}
chrome beacon
grim hound
#

I uh

#

would need some help with images

#

I'm trying to render an image bigger than 128x128

#

on 4 maps

#

and uh

#

and I'm not sure what I'm doing wrong

paper viper
#

You checked if the buffered image split works correctly right

#

When you get the sub images

#

Also don’t name your class Main

grim hound
grim hound
#

and somehow everything works now

#

I have no idea why

paper viper
grim hound
#

but I'm just gonna leave it at that

paper viper
#

?main

grim hound
#

I didn't pick up the name from anything

#

One big origin comes from those many horrible Spigot plugin tutorials on Youtube, where they do not explain anything and force new people to copy and paste code

grim hound
#

and got the naming from him

paper viper
#

Ok I don’t care just don’t do it

#

Anyways

grim hound
paper viper
#

Give me a second

grim hound
#

"Oh no, don't dooo itttt"

#

"It'll give you nightmaressss"

#

"And I said so"

paper viper
#

Idc, change it or not

#

Your choice

grim hound
#

is this nonsense

#

I swear some people are just real life twitter

#

just spread misinformation instead of cancelling people

#

it is, just for this particular framework

#

why would somebody think that?

quaint mantle
#

how are we spigot gang

grim hound
#

ain't nobody gonna be using my class

#

I have another main class that's of a different name

#

I use Main in the spigot boostrap because the name is short and perfect for debugging

grim hound
# grim hound

while if I tried to type this, then damn, would many Bukkit- classes be suggested

paper viper
#

It was just a suggestion but fine

#

You can choose what you want to do

grim hound
#

I'm explaining my reasoning

grim hound
paper viper
#

And I don’t care because many people do and I don’t wanna argue abt it the thousandth time

earnest girder
#

if I have a Vector that I want to apply to a player's launched projectile's direction (I want it to add a horizontal and vertical "recoil" to the projectile), how would I do that?

grim hound
#

like we ain't arguing about including underscores in class names

grim hound
paper viper
grim hound
quaint mantle
#

does anyone know good a good tutorial on use of .class in java?

grim hound
#

šŸ¤

quaint mantle
#

im trying to expand my tiny brian

grim hound
grim hound
#

.class is a compiled .java file

#

I think

quaint mantle
#

truer but like you know in code how sometimes there are references to class objects like ItemStack.class

#

or whatevers

grim hound
quaint mantle
#

whats that called

grim hound
#

so Class<ItemStack> clazz = ItemStack.class

quaint mantle
grim hound
quaint mantle
earnest girder
grim hound
quaint mantle
#

thanks!

earnest girder
grim hound
grim hound
grim hound
#

messed up the QR code

#

it's now invalid

#

xD

#

damn

#

wait no

#

it was background noise that made it invalid

covert ember
#

Hello, a friend of mine made this Plugin called "Commandbinder". There youcan bind Commands on a certain item. It's still pretty buggy and there are placeholders that should work but don't. The one I'd need is "%lookingAt%. It displays the coordinates of a block, that the player's looking at, that's not air, but it doesn't work. I have almost no idea how to code, sadly, so I'm asking you, to maybe tell me what the problem is.

      if (cmd.contains("%lookingAt%") && this.p.getEyeLocation().getBlock().getType() != Material.AIR) {
         Location loc = this.p.getTargetBlock((Set)null, 128).getLocation();
         cmd = cmd.replace("%lookingAt%", loc.getX() + " " + loc.getY() + " " + loc.getZ());
      }
young knoll
#

Why would you check if the block on the players eye location is not air

#

Unless they are suffocating in a wall it should always be air (or a liquid)

covert ember
young knoll
#

Then remove the air check and just use the getTargetBlock

covert ember
#

Wouldn't it be just air then?

young knoll
#

No

#

It looks for the first solid block the player is looking

#

Within range

covert ember
#

Ah okay thanks

earnest girder
#

how do servers have scoreboards without the red line numbers?

young knoll
#

It’s a new feature in 1.20.5 (iirc)

#

In older versions you could use shaders

earnest girder
#

what is the feature?

young knoll
#

It’s like objective number format or something

#

I don’t think the api pr for it ever got merged

earnest girder
#

so it isn't possible with spigot?

young knoll
#

Not without NMS

earnest girder
#

how can it be done with NMS?

#

I cant find anything online. everything just says it isnt possible

young knoll
#

Uhh

#

@worldly ingot you wrote the PR :)

slender elbow
#

it sure is possible

#

vanilla does it lol

pseudo hazel
#

I think paper also has it xD

earnest girder
#

is paper a different API?

#

like if Ive been coding a spigot plugin would switching to paper be a pain in the ass

#

or is it the same code?

slender elbow
#

it's a fork of spigot, meaning it has the same APIs and more

#

but if you use paper api in your plugin, it will not work on a spigot server

earnest girder
#

will I have to change anything in my code when I switch over?

#

if I plan on completely switching to paper?

carmine mica
#

generally the only methods which are API-incompatible are ones where Paper had a method named smth, and spigot later added a method that did smth else with a conflicting signature

#

there are lots of deprecations Paper adds for broken/outdated/legacy functionality that suggests alternatives to use

#

but the deprecated methods usually function the same as before

wraith delta
dark jolt
#

Whats the best way to write a file

wraith delta
dark jolt
wraith delta
dark jolt
wraith delta
#

Well then to save it like that you can do it with yaml, the line to write that is dataConfig.set("Regions." + region, name);

#
public String getName(String region) {
  return dataConfig.getString("Regions." + region);
}
```then grab it like this i believe
dark jolt
#

Is that just the reading part it seems?

wraith delta
#

which parts do you need? do you know how to have a custom config?

dark jolt
#

Yea I have that made already

wraith delta
#

ok ill write a little bigger example of just the set and get one sec

#
    public void saveDataConfig() {
        try {
            dataConfig.save(dataConfigFile);
        } catch (IOException e) { }
    }
    
    public void setRegionInfo(String region, String filename) {
        dataConfig.set("Regions." + region + ".filename", filename);
        saveDataConfig();
    }
    
    public String getRegionInfo(String region) {
        return dataConfig.getString("Regions." + region + ".filename");
    }
dark jolt
#

Ah alr

#

Easy enough

wraith delta
#

Right. String something = MainClass...getRegionInfo(region); then something like this would be used elsewhere you have the region name to request with

dark jolt
#

Ok

#

Thank you

quaint mantle
#

if (!event.getAddress().getHostAddress().equals(event.getRealAddress().getHostAddress())){} would something like this work in playerlogin event

river oracle
#

what are you checking for?

quaint mantle
#

to see if its a vpn

river oracle
#

lol yeah no that's not how that works

quaint mantle
#

yeah just making sure

#

cuz idrk what getrealaddres means

river oracle
#

found a forums post

#

Spigot spoofs the IP address when running under bungeecord mode; getAddress() should return the spoofed address (e.g. the clients IP address) if one has been set, while getRealAddress() in those instances should return the IP of the bungeecord instance

quaint mantle
#

ohh

#

if they arent using a spoofed ip would itstill work

#

for getrealadderess

river oracle
#

as far as blocking VPNs I thnk the best way to do that is dig up some way to find which IPs are associated with a specific service

#

you might need to pay for that

quaint mantle
river oracle
#

not really

quaint mantle
#

cuz i saw that while looking through playerlogineventr

river oracle
#

the client wouldn't know your real IP anyways if you were under a VPN

#

it would only know the VPN IP

river oracle
#

blocking VPNs is fairly hard

#

I'd say damn near impossible to be completely honest

quaint mantle
#

hey

viscid carbon
#

Hey @river oracle, Should i have stuff like setHome() in Playerdata or should i be doing all of this in playerDataManager?

#

and in playerData i should make methods like java public void setConfigurationSection(String name) { this.getFileHandler().getConfig().createSection(name); }
instead of calling the fileHandler

river oracle
#

idk if this is completely "ideal" but usually I'll have a setup like

public interface StorageHandle {
  // usually I abstract this for different databases and such but you really don't have to
}
public class PlayerData {
  public void save(StorageHandle handle)

  public static void load(UUID uuid, StorageHandle handle)
}
viscid carbon
#

Currently im doing it like this, and i dont feel like its the correct way. yK?

    public void setPlayerRank(String rank) {
        this.playerRank = rank;
        getFileHandler().getConfig().set("Settings.Rank", rank);
    }

    public void setHome(String name, Location location) {
        getFileHandler().getConfig().set(String.format("Homes.%s", name), location);
    }```
river oracle
#

I mean its not horrible, but at the same time its not great

#

Personally I think this structure is only fine because you're using configs

#

if this were a database or any other file type I'd say this structure would be unacceptable

#

however, because Configs are 100% in memory doing stuff like this really isn't an issue

echo tangle
#

thinking of making a website & plugin where, for example, clicking a button on the website runs a command in the game. what would be the best approach towards this? websockets with something like jetty?

river oracle
#

don't even need WebSockets if you're on the same server you could just use regular Sockets

#

really any communication protocol will work as long as youre comfortable with it

viscid carbon
#

Okay i see, so doing it the way im doing it is called structure.

echo tangle
viscid carbon
#

But would it be better if i just did something like

public void set(String path, String value) {
fileHandler().getConfig.set(path, value);
}```
instead of making multiple things to set?
river oracle
#

I doubt everyone would agree with such design, but to me its most clean and keeps saving and loading logic in one place

#

you could even dump the StorageHandler and just use whatever FileHandler you're using

#

there is no reason to make abstractions at that level unless you're planning to support like 5 different databases

viscid carbon
#

Yeah, i dont plan on that unless needed but YML files arent that big. it would be if there was 1k+ players but databases sound out of my reach atm lol.

river oracle
#

honestly for you my reccomendation
Detach the FileHandler object from the player and instead use it in save and load methods. That way each PlayerData object is blissfully unaware of its FileHandler, but when the server stops or the player leaves you can get then and run the according save method

#

that way if you ever add a database like SQLite it'll be much less time to add it in than if you were to do that now

viscid carbon
#

Okay, thank you for that and your time with teaching a newbie

#

ā¤ļø

river oracle
#

NP I was a newbie myself not to long ago

viscid carbon
#

I just dont wanna base everything off it again and it all be wrong like the first plugin xD

river oracle
echo tangle
river oracle
#

but you need to be careful

#

make sure there is proper auth in place

viscid carbon
#
public static void cSend(CommandSender sender, String string) {
sender.sendMessage(clr(string));
}```

is this just a newbie thing to do?
#

xD

wicked sinew
river oracle
#

but its personal opinion

wicked sinew
viscid carbon
#

Ik, its in your SimpleHoes xD you said ew

river oracle
#

My opinion have changed a lot in 3 years I guess

echo tangle
viscid carbon
#

A programmer is constantly changing the way they do stuff, a once wise one once told me šŸ˜‰

river oracle
echo tangle
#

i doubt i will

river oracle
#

to ensure your auth is great

#

wrong reply

river oracle
viscid carbon
#

I do it after a day xD

river oracle
#

if you look at the code you wrote 1 year ago and don't go what the fuck is this mess you are trash šŸ’Ŗ šŸ”„ šŸ’Æ

viscid carbon
#

i could make you throw up if you want xD

river oracle
#

I have a compiled jar of my oldest project ever still

#

it can't be much worse than that

echo tangle
viscid carbon
#

Idk take a gander

#

xD

river oracle
#

the out and .idea folders

#

great start

#

did you quit coding?

viscid carbon
#

Everything is static

#

life got busy

river oracle
#

makes sense

#

I started coding in 2020 I rage quit for nearly a year and a half with java

#

I'd code for a few weeks and go I fucking hate this why do I keep doing this

#

then come back after a few months

viscid carbon
#

never learned properly though, i had someone that knew a lot and he thought me the basics and then somebody that was in uni but he would just spoon feed certain problems. I made this plugin for his server.

viscid carbon
river oracle
#

he did not abandon me šŸ™ and was good

#

the one person I follow on github kekw

#

I'm better than him in java, but he's got my beat in pretty much every other department

viscid carbon
#

Lol these stories are nice to hear coming from somebody experienced. He never really abandoned me he kinda just got bored with java/minecraft and started learning py and other things lol

river oracle
#

first thing I ever wrote was AHK

#

idk if you've ever heard of that

urban escarp
#

Hello, im sorr but why event doesn't ececute when i eat food

humble tulip
#

Did you register your listener?

#

And what event are you listening to?

urban escarp
#
@EventHandler
    public void onEat(PlayerItemConsumeEvent e) {
        Player p = e.getPlayer();
        Material food = p.getInventory().getItemInMainHand().getType();
        p.sendMessage("§8(§c!§8)§7Tavoevent");

i cant get debug message

#

not sure if its right event anymore

viscid carbon
viscid carbon
#

make sure you're registering it in your main class

urban escarp
#

it just didn't compile somehow lmao, sorrry

viscid carbon
#

xD

#

okay

fading beacon
#

is there any event that listens for lighting levels when spawning hostile mobs?

humble tulip
#

You might be able to listen to entity spawn even and check the light level of the block where it's being spawned

tawdry stone
#

Is there a way to fade out a sound with a plugin (or mod)?

echo basalt
#

You could play it with an emitter entity and move it around

echo basalt
torn shuttle
#

or make a custom sound with a resource pack that fades natively

echo basalt
#

That can also work

#

Keep in mind sounds have to be in mono to have attenuation

tawdry stone
torn shuttle
#

yell hard at your mic, then fade to a softer voice, convert the audio file to ogg then put it into a valid resource pack format and call it using the normal play sound methods (or even commands, minecraft is even nice enough to autosuggest custom sound files from your resource pack)

tawdry stone
wraith delta
#

Q: Is it better to generate a new yaml file for each player uuid to save their data in. or is it better to make one data file and store each player in that one file with their data? yaml config

#

the concern is if one file would lag searching for the tree of data, but would it actually?

summer scroll
wraith delta
#

but, the other method would be to have 10k yaml files that were generated and each stores those ints

#

this is to store crate key amounts

summer scroll
#

Just save and load on server stop and server start.

wraith delta
summer scroll
#

You do the update there and only save on server stop

#

If you want to make the map size smaller, consider saving and loading on player quit and player join

wraith delta
summer scroll
wraith delta
#

possibly

#

just seems concerning for if the player client crashes or server crashes that it may not save

summer scroll