#help-development

1 messages · Page 522 of 1

karmic salmon
#

this

#

config files

#

you mean wiki?

tardy delta
#

thats what i meant

#

?jd-s are the docs

undone axleBOT
karmic salmon
#

eh

quaint mantle
#

Who know write mods?

chrome beacon
#

?ask

undone axleBOT
#

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

exotic zinc
#

catch (Exception e) {

#

oof

tardy delta
#

always

#

dont ask me how many times ive seen that in production code

exotic zinc
#

next time catch throwable

tardy delta
#

github doesnt quite like me

ionic thicket
#

can i create a new enchantment?

chrome beacon
#

Yes

ionic thicket
#

like a create an object?

river oracle
#

how do you get a component from legacy text with spigot

agile anvil
river oracle
#

nvm

agile anvil
hazy parrot
#

well, i told you the error

scenic onyx
#

i have this problem: "java: cannot access com.mojang.authlib.GameProfile
bad class file: /C:/Users/feder/.m2/repository/com/mojang/authlib/3.3.39/authlib-3.3.39.jar!/com/mojang/authlib/GameProfile.class
class file has wrong version 60.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath."

#

how i resolve this?

quiet ice
#

Install a java 17 jdk and compile with that one

#

But you compile it with a java 8 JDK at the moment

scenic onyx
quiet ice
#

You are talking to the wrong person mate

scenic onyx
#

i resolve

split gull
#

is there a way to make it so when a player joins the server the join message is only sent to set players?

split gull
scenic onyx
split gull
#

yoo me too

scenic onyx
split gull
#

uh

#

why dms

scenic onyx
split gull
#

bet

echo basalt
#

Alright it's about time you learn about epochs

tardy delta
#

save a long

echo basalt
#

So

#

An Instant is basically just a class that lets you easily work with epochs

quiet ice
#

You shortened the error too much

echo basalt
#

An epoch is just a long that defines the amount of seconds that have passed since a pre-defined date

quiet ice
#

Yes there is

echo basalt
#

that's like january 1st 1960 iirc

quiet ice
#

The actual exception is not shown

tardy delta
#

probably cannot serialize an instant

echo basalt
#

And it's basically a representation of a given time and date

quiet ice
#

LocalDateTime

echo basalt
#

You get the epoch of yesterday at 6pm

quiet ice
#

Always LocalDateTime

echo basalt
#

and you get the epoch of today

tardy delta
#

ah its a get, i read that as set 💀

echo basalt
#

compare

fallen pecan
#

Can I add weapons from the MmoItems to the ItemsAdder?

quiet ice
#

Instant is absolute garbage because it does NOT keep track of time zones

tardy delta
#

me who is just happy that i dont have to care about timezones :)

#

knowing my code will horribly fail

echo basalt
#

An epoch is a long

#

So yes

quiet ice
tardy delta
#

yah

echo basalt
#

play with it

quiet ice
echo basalt
tardy delta
#

basically System.currentTimeMillis()

echo basalt
quiet ice
#

There is the unix epoch, the AD & BC epoch and other stuff

echo basalt
#

Correct

quiet ice
#

LocalDateTime

echo basalt
#

So

#

That is one approach

quiet ice
#

Always LocalDateTime

echo basalt
#

or if you just want the mathemathical approach then fuckin

#

/ 60

fallen pecan
quiet ice
#

Touching Unix timestamps (THOSE ARE NOT EPOCHS OML) will be pain

echo basalt
quiet ice
#

Won't work anyways due to all the leap seconds and leap years

#

Well it would work, but it would have some inaccuracy

echo basalt
#

uhh

#

6ish years

#

I started in late 2016

#

but I did some coding back in like

#

2011ish

#

uhh

#

no

#

I'm only 18

#

closest thing to a real job was like

#

making plugins for a network part-time

#

for 15$/hr

quiet ice
#

But just as a tip if you want to work with date and time stuff in java without worrying about timezones always use LocalDateTime.
If you need to worry about timezones use DateTime.
If you want to work like you would in C world use Instant
If you like to see the world burn in the year 2038 use int

echo basalt
#

hmm what should I name this class

#

Basically each bedwars generator has tiers and each tier has a list of like

#

generation tasks

#

where lik

split gull
#

Is there a way to know which of these 2 the server will send?

echo basalt
#

offset, what items to drop and how often

echo basalt
#

actually no

#

uhh

#

bukkit has a players.json iirc

#

that had like names

#

and if the names dont match

split gull
#

you think that'll do it?

echo basalt
#

is that bukkit or bungee or what?

#

found it

split gull
#

what is it

echo basalt
quiet ice
#

Well for cooldowns you can be lazy and just use System#currentTimeMillis - but what is the fun in that?

echo basalt
#

and that's contained in the player's nbt tag

cunning shard
#

Anyone know how to move a piece of code that uses bookAPI to a universal config.yml or something similar to make it easily accessible?

#

will provide code that i want to move if needed, i just cant find an optimal way to do it

echo basalt
#

damn minecraft login code is ugly

#

why would you cast to an instant if you're storing an epoch long

quiet ice
#

Instant.now().plus(duration).EPOCH shouldn't your IDE complain about that? Because that is basically the equivalent of Instant.EPOCH

echo basalt
#

getEpochSecond most likely

#

I don't work with time that often

quiet ice
#

Eclipse for sure warns about that

scenic onyx
#

how do i pass a string from a listener to a commandExecutor?

quiet ice
#

You probably want

        LocalDateTime cooldown = LocalDateTime.parse("2007-12-03T10:15:30");
        if (cooldown.plus(24, ChronoUnit.HOURS).isBefore(LocalDateTime.now())) {
            
        }

though

scenic onyx
#

i have to pass the name of the object that clicked for a thing

quiet ice
#

And to get it back to a string you do LocalDateTime.now().toString()

scenic onyx
#

I did not understand

#

I want to switch dspn

#

ok

#

thank you

echo basalt
#

that's one of the 4 oop principles - Encapsulation

round finch
echo basalt
#
echo basalt
round finch
#

😮

#

cool

echo basalt
#

dude asked about where the join message when you change your username is sent

peak depot
#

Hey I want to save an Players inventory to a file called kits.yml how can I do that I can later get it from the fiel

echo basalt
#

either set / getItemStack or just converting it to base64

west oxide
#

hello, i know this is a spigot server, but can i ask something about mail forwarding with postfix here ?

chrome beacon
#

?ask

undone axleBOT
#

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

round finch
#

wtf you can acually save the whole inventory?

chrome beacon
#

Don't ask to ask

round finch
#

i used to loop through the inventory

echo basalt
#

so

round finch
echo basalt
#

no

#

base64 is just a string representation of binary data

west oxide
chrome beacon
west oxide
round finch
#

😯

opal juniper
#

its not a java thing lol

#

its a thing

chrome beacon
undone axleBOT
round finch
#

🤯

opal juniper
round finch
#

everyday on this discord it blows my mind

opal juniper
#

proxy it with CF

hazy parrot
#

It's not behind proxy anyway

west oxide
#

i might be saying something stupid am so clueless about this

opal juniper
#

why would it do that

#

unless you hardcoded that IP somewhere

west oxide
#

i used thefoundrs.co in the nginx setup

opal juniper
#

yeah so not the IP

slim wigeon
#

How do I get a player using UUID?

west oxide
west oxide
slim wigeon
slim wigeon
slim wigeon
west oxide
#

o man

#

i tried to understand but i dont lol

#

other stuff is working well i just need postfix to work

slim wigeon
tardy delta
#

Bukkit.getPlayer(uuid)

#

look at the docs lol

slim wigeon
tardy delta
#

look at the javadocs

echo basalt
#

toLocalTime().toString

tardy delta
#

theres a format method

agile anvil
#

To format a LocalDateTime object to display only the hour, minute, and second in the format HH:MM:SS, you can use the DateTimeFormatter class from the java.time.format package. Here's an example:

LocalDateTime now = LocalDateTime.now();
        
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
String formattedDateTime = now.format(formatter);
hallow aurora
#

Hello, i have a problem, the after text provide me a idea for edit this list recipients, but, how??

getRecipients
@NotNull
public Set<Player> getRecipients()
Gets a set of recipients that this chat message will be displayed to.
The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.

Listeners should be aware that modifying the list may throw UnsupportedOperationException if the event caller provides an unmodifiable set.

Returns:
All Players who will see this chat message

agile anvil
#

When questions are obvious, I prefer copy pasting the message in it than typing "?google"

echo basalt
#

getRecipients.clear

#

type deal

hallow aurora
slim wigeon
#

I trying to get the player from Player valueworld:202:64:-123: Player: 0b605717-d3a0-4cd4-8b67-3af1eb6449ca Location: World: world X: 202 Y: 64 Z: -123 Options: BlockBreak: false AutoSell: false

#

Now it shows getOfflinePlayer is deprecated

wise mesa
#

yea you're not supposed to get offline player by name

slim wigeon
#

UUID

wise mesa
#

so convert it to a uuid

#

you're passing in a string if it says its deprecated

slim wigeon
#

[13:15:42] [Server thread/ERROR]: Error occurred while enabling MGN_Hopper v1.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is null
at java.util.UUID.fromString(UUID.java:237) ~[?:?]
at com.mrnategeek.hopper.Main.onEnable(Main.java:58) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugin(CraftServer.java:539) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.enablePlugins(CraftServer.java:453) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.reload(CraftServer.java:938) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.Bukkit.reload(Bukkit.java:802) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:847) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchServerCommand(CraftServer.java:832) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.dedicated.DedicatedServer.bg(DedicatedServer.java:413) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:389) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1201) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1017) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:301) ~[spigot-1.19.3-R0.1-SNAPSHOT.jar:3670-Spigot-454acb7-bd29f41]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

wise mesa
#

read the error please

#

its like right at the top too

#
java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is null
    at java.util.UUID.fromString(UUID.java:237) ~[?:?]
    at com.mrnategeek.hopper.Main.onEnable(Main.java:58) ~[?:?]
slim wigeon
wise mesa
#

name is the parameter to UUID.fromString

#

can you please look at the line its complaining about

#

Main.java:58

#

that's what name is

#

its whatever you pass in

west oxide
#

Player player = Bukkit.getPlayer(UUID.fromString(this.data.getString("Player")));

i think its this line

#

@slim wigeon

slim wigeon
#

That is the line, I was thinking I was converting the UUID to the right type

wise mesa
#

well its complaining that you're passing in null

#

which means whatever you're passing in is returning null

slim wigeon
#

So that UUID.fromString is not what I think it was?

wise mesa
#

it is what you think it is

#

what are you passing into .fromString

west oxide
wise mesa
#

the line of code

wise mesa
#

and then null is being passed into uuid.fromstring

slim wigeon
#
    UUID uuid = UUID. randomUUID();
    String uuidAsString = uuid. toString();
    UUID sameUuid = UUID. fromString(uuidAsString);
    assert sameUuid. equals(uuid);```It was, let me check something
fickle mortar
#

is it possible to create plugin in nodejs?

wise mesa
#

no

slim wigeon
wise mesa
#

well actually

#

there is some library to do it

#

idk what its called

slim wigeon
wise mesa
#

but it looks like it hasn't been updated in 3 years

pseudo hazel
#

and its also something you dont wanna do

slim wigeon
#

How do I convert Player to OfflinePlayer?

zealous osprey
slim wigeon
#

I got the player is null after I did that change then on changing getPlayer to getOfflinePlayer, I get a error because in my lib. OfflinePlayer does not exist in the contractor. That is why I need to convert Player to OfflinePlayer

hollow birch
#

im trying to figure out why some items i made wont stack
this is the code for creating it and any items made with this method will stack with eachother but if i call the method again to create them a second time the 2 groups of items wont stack with eachother

#

i thought it would be something with the persistant data but its giving them the same namespacekey and the same value so it should be the same

tardy delta
#

that looks like some misuse of an interface

#

but isnt it because of the pdc tag that items dont stack anymore?

quiet ice
#

LocalDateTime represents a point in time. You should not represent is a HH:MM:SS unless you want to write a message "The cooldown expires tomorrow, at 12:02:48". You probably want to represent a Duration this could be done via:

        LocalDateTime from = LocalDateTime.now();
        LocalDateTime now = LocalDateTime.now();
        Duration duration = Duration.between(from, now);
        System.out.println(duration.toHours() + ":" + (duration.toMinutes() % 60) + ":" + (duration.getSeconds() % 60));
tardy delta
#

Duration#toMinutesPart uwu

#

does the same thing as % 60

quiet ice
#

That is a post-Java 8 thing then

dense falcon
#
package fr.program.events;

import fr.program.Main;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class ModtEvents {
    public static void execute(Main plugin, PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();
        ItemMeta meta = item.getItemMeta();
        FileConfiguration config = plugin.getConfig();


        if (item.getType() == Material.IRON_HOE && meta.getDisplayName() == "§l§9Vanish") {
            vanish(plugin, player, action, item, config);
        }
    }

    private static void vanish(Main plugin, Player player, Action action, ItemStack item, FileConfiguration config) {
        String mode = config.getString("modt." + player.getUniqueId());
        if (action == Action.RIGHT_CLICK_AIR) {
            if (mode == "on") {
                player.hidePlayer(plugin, player);

                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant invisible.");
                player.sendMessage(String.valueOf(plugin.getServer().getHideOnlinePlayers()));
            } else {
                player.showPlayer(plugin, player);
                
                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant visible.");
            }
        }
    }
}

``` Why it does not executing the function vanish? 

ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);


ItemCustom class: https://sourceb.in/UbDeR1ENOg
#

It does not matter.

#

It's the same thing.

#

It's.

#

"==" -> to compare.
"equals" -> to compare.

undone axleBOT
karmic salmon
#

guys why this not working it not take from 13 letter to the last letter it just do nothing ;/ java String lineweeneed = readefileofplayerlol.readLine(); lineweeneed.substring(13);

dense falcon
#

It does not matter, why are you saying something, it's useless.

The problem come not from a condition bro.

karmic salmon
#

oh

#

so how fix this?

#

o

worldly ingot
karmic salmon
#

i see

worldly ingot
#

== is referential equality - checking if the objects are at the same memory address. .equals() is an overridable method that checks the contents of a String

dense falcon
worldly ingot
#

Strings will never be at the same memory address unless they're from the internalized string pool

dense falcon
#

And the goal is to make it readable.

worldly ingot
#

Which they won't be

#

You can make your code readable if you want, but if you want it to work, you need to use .equals() to compare

#

== will not work for Strings in 99.999999% of scenarios

dense falcon
#

It works always for me but ok and I have still the problem lol :>.

worldly ingot
#

That's literally not possible 😛

#

You can verify this rather easily by doing System.out.println("Hello" == "Hello");
EDIT: Not true, same string pool

dense falcon
#
public class ModtEvents {
    public static void execute(Main plugin, PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();
        FileConfiguration config = plugin.getConfig();
        if (item != null && item.getType() == Material.IRON_HOE && item.getItemMeta() != null && item.getItemMeta().getDisplayName().equals("§l§9Vanish")) {
            vanish(plugin, player, action, item, config);
        }
    }

    private static void vanish(Main plugin, Player player, Action action, ItemStack item, FileConfiguration config) {
        System.out.println("cc");
        String mode = config.getString("modt." + player.getUniqueId());
        if (action == Action.RIGHT_CLICK_AIR && mode != null && mode.equals("on")) {
            player.hidePlayer(plugin, player);

            player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                    + "Vous êtes maintenant invisible.");
            player.sendMessage(String.valueOf(plugin.getServer().getHideOnlinePlayers()));
        } else {
            player.showPlayer(plugin, player);

            player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                    + "Vous êtes maintenant visible.");
        }
    }
}

karmic salmon
#

this destorying my 2 last brian cells

worldly ingot
#

I promise you, that will output false

dense falcon
#

No error.

worldly ingot
#

(actually technically it will return true lol - same string pool)

karmic salmon
dense falcon
karmic salmon
dense falcon
#

Nothing in my output.

karmic salmon
#

what does break; do

dense falcon
#

It works but it's the name I gave to my item.

dense falcon
#

1.19.3

#

Ah ok.

#

I used it before but I did not know it was necessary.

#

Alr thx.

#
public class EventsListeners implements Listener {
    private final Main plugin;
    public EventsListeners(Main main) {
        this.plugin = main;
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();
        FileConfiguration config = this.plugin.getConfig();

        if (item != null && item.getItemMeta() != null) {
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer container = meta.getPersistentDataContainer();
            NamespacedKey key = new NamespacedKey(this.plugin, meta.getDisplayName());

            if (item.getType() == Material.IRON_HOE && container.has(key, PersistentDataType.DOUBLE)) {
                vanish(this.plugin, player, action, config);
            }
        }
    }

    private static void vanish(Main plugin, Player player, Action action, FileConfiguration config) {
        String mode = config.getString("modt." + player.getUniqueId());
        if (action == Action.RIGHT_CLICK_AIR && mode != null) {
            if (mode.equals("on")) {
                player.hidePlayer(plugin, player);

                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant invisible.");
            } else {
                player.showPlayer(plugin, player);

                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant visible.");
            }
        }
    }
}

Why I have this error :

https://sourceb.in/guumqcg8qn

quaint mantle
#

someone tell me why this doesnt work

buoyant viper
echo basalt
#

2 - your second constructor doesn't initialize the var

dense falcon
#
                    ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);
                    vanish.addKey(this.plugin);
    public ItemCustom(String name, Material mat, int amount, boolean hideAtttributes) {
        super(mat, amount);
        setDisplayName(name);
        if (hideAtttributes) {
            disableAttributes();
        } else {
            enableAttributes();
        }
    }

    public void addKey(Main plugin) {
        ItemMeta meta = this.getItemMeta();
        if (meta != null) {
            NamespacedKey key = new NamespacedKey(plugin, meta.getDisplayName());
            meta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
            this.setItemMeta(meta);
        }
    }

    public void setDisplayName(String name) {
        ItemMeta meta = this.getItemMeta();
        meta.setDisplayName(name);
        this.setItemMeta(meta);
    }

    public void disableAttributes() {
        ItemMeta meta = this.getItemMeta();
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
        this.setItemMeta(meta);
    }

Uh what, why ?

#

With Capital letters ? Or it's useless?

worldly ingot
#
    public ItemCustom(String name, Material mat, int amount, boolean hideAtttributes) {
        super(mat, amount);

ItemMeta meta = this.getItemMeta();

#

You're not extending ItemStack are you?

worldly ingot
#

That won't work either

dense falcon
worldly ingot
#

Most types in Bukkit, unless explicitly stated otherwise, are not extendable

echo basalt
#

can we just make the ItemStack class final or something?

worldly ingot
#

Can't. CraftItemStack exists

#

ItemStack should honestly be an interface

buoyant viper
#

curse u, server side implementation!

buoyant viper
worldly ingot
#

I think we've got enough backwards incompatible changes for 1.20 PES_BlushGiggle

buoyant viper
#

so what im hearing is take Components out of .Spigot?

#

no more raw strings!

worldly ingot
#

Not an option because we don't want to add getNameComponent() or some stupid bullshit like that

buoyant viper
#

simple, remove strings leleDemon

worldly ingot
#

just delete all instances of String

#

Everywhere

buoyant viper
#

precisely, take them out of the JRE

echo basalt
#

use asm to finalize all strings upon creation

dense falcon
#

I added this to the "key" in the tool and in the condition but it did not fix :(.

    public void addKey(Main plugin, String keyName) {
        ItemMeta meta = this.getItemMeta();
        if (meta != null) {
            NamespacedKey key = new NamespacedKey(plugin, keyName);
            meta.getPersistentDataContainer().set(key, PersistentDataType.DOUBLE, Math.PI);
            this.setItemMeta(meta);
        }
    }
                    ItemCustom vanish = new ItemCustom("§l§9Vanish", Material.IRON_HOE, 1, true);
                    vanish.addKey(this.plugin, "vanish");
```https://sourceb.in/gnijb8NGWW
undone axleBOT
echo basalt
#

or javassist or some bytecode manipulation trickery

buoyant viper
#

Javassist is just ASM under the hood iirc

quaint mantle
dense falcon
echo basalt
#

why is you method static?

#

.

dense falcon
#

It does not work else.

buoyant viper
#

i was about to ask if its really still necessary to check command name, forgetting how the executors actually work, lol

echo basalt
#

static is a java thing and not plugin specific

wet breach
#

you can use label, but label isn't the same as command name is all

buoyant viper
#

i just have a separate executor for each command lol

dense falcon
echo basalt
#

EventListeners.vanish

dense falcon
#

Idk why it's, I writed the func and it paste it.

#

Fixed btw.

wet breach
#

its been there for a long time lol

dense falcon
#

Did you find something :(?

wet breach
quiet ice
#

Uh, that shouldn't be the case

dense falcon
#

?

#

mode ?

#

Or for each if ?

wet breach
quiet ice
#

Like

        LocalDateTime from = LocalDateTime.now().plus(28, ChronoUnit.HOURS);
        LocalDateTime now = LocalDateTime.now();
        Duration duration = Duration.between(from, now);
        System.out.println(duration.toHours() + ":" + (duration.toMinutes() % 60) + ":" + (duration.getSeconds() % 60));   

prints -28:0:0. Which would be just about correct

dense falcon
#
public class EventsListeners implements Listener {
    private final Main plugin;
    public EventsListeners(Main main) {
        this.plugin = main;
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();
        FileConfiguration config = this.plugin.getConfig();

        if (item != null && item.getItemMeta() != null) {
            System.out.println(1);
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer container = meta.getPersistentDataContainer();
            NamespacedKey key = new NamespacedKey(this.plugin, "vanish");
            System.out.println(2);

            if (item.getType() == Material.IRON_HOE && container.has(key, PersistentDataType.DOUBLE)) {
                System.out.println(3);
                vanish(this.plugin, player, action, config);
            }
        }
    }

    private void vanish(Main plugin, Player player, Action action, FileConfiguration config) {
        System.out.println(4);
        String mode = config.getString("modt." + player.getUniqueId());
        if (action == Action.RIGHT_CLICK_AIR && mode != null) {
            System.out.println(5);
            if (mode.equals("on")) {
                System.out.println(6);
                player.hidePlayer(plugin, player);

                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant invisible.");
            } else {
                System.out.println(7);
                player.showPlayer(plugin, player);

                player.sendMessage("[" + ChatColor.GOLD + "ModUtils" + ChatColor.WHITE + "]"
                        + "Vous êtes maintenant visible.");
            }
        }
    }
}

[21:37:14] [Server thread/INFO]: 1
[21:37:14] [Server thread/INFO]: 2

dense falcon
undone axleBOT
quiet ice
#

Make sure it's java.time.Duration and not some other Duration class

worldly ingot
echo basalt
#

you can omit the Main plugin, argument as it's already defined

dense falcon
echo basalt
#

I swear the code I'm seeing over the days is more and more exotic

worldly ingot
#

Add it to an inventory, take it back out, and you will not get an instance of your CustomItem back

#

You're far better off making some static utility methods or something

#

Or an ItemBuilder - there are hundreds of those on the forums

wet breach
young knoll
#

We love a good item builder

wet breach
#

since they chose to ignore you

echo basalt
#

pdc bad

young knoll
#

Man is upset he has to specify the type

echo basalt
#

it's so annoying having to go through the meta and all of that

wet breach
#

then just don't use it

echo basalt
#

I just want to abstract away the process of having to get the meta, modify and re-save

#

but I want to ensure bukkit compatibility with no external deps

#

so I just

wet breach
wet breach
echo basalt
#
ItemStack item = ...;
PDCWrapper pdc = new PDCWrapper(plugin, item);

pdc.setBoolean("unobtainable", true);

item = pdc.getModifiedItem();
dense falcon
#

[21:44:57] [Server thread/INFO]: 1
[21:44:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@3
[21:44:57] [Server thread/INFO]: IRON_HOE
[21:44:57] [Server thread/INFO]: 2

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

wet breach
#

and then use some memory mapping

dense falcon
wet breach
#

then, make your constructor for the class require itemstack

#

make a method that spits out your itemstack with stuff added to it

#

make the rest of the methods modify said itemstack

#

and then you are good

echo basalt
#

or I can just do this

wet breach
#

Not only does extending not work, but you are also not really doing anything custom either

young knoll
echo basalt
young knoll
#

You only need to call it once

echo basalt
#

well

#

still looks long

dense falcon
echo basalt
#

I'll make a modifyPDC utility method that just does stuff

dense falcon
#
    private final ItemStack item;

    public ItemCustom(ItemStack i) {
        this.item = i;
    }
#

That?

tardy delta
#

👋

dense falcon
#

?

bitter dove
#

can Block#getBlockData be casted to Openable?

echo basalt
#
ItemStack item = ...;

PDCWrapper.modifyItem(plugin, item, pdc -> {
  pdc.setString("joe", "mama");
  pdc.setBoolean("disappointment", true)
});
#

ther

dense falcon
#

I fixed my code and I think now it works :).

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

[21:51:57] [Server thread/INFO]: 1
[21:51:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@9886fd88
[21:51:57] [Server thread/INFO]: IRON_HOE
[21:51:57] [Server thread/INFO]: 2
[21:51:57] [Server thread/INFO]: 3
[21:51:57] [Server thread/INFO]: 4
[21:51:57] [Server thread/INFO]: 5
[21:51:57] [Server thread/INFO]: 6
[21:51:57] [Server thread/INFO]: 1
[21:51:57] [Server thread/INFO]: EVENT: org.bukkit.craftbukkit.v1_19_R2.persistence.CraftPersistentDataContainer@9886fd88
[21:51:57] [Server thread/INFO]: IRON_HOE
[21:51:57] [Server thread/INFO]: 2
[21:51:57] [Server thread/INFO]: 3
[21:51:57] [Server thread/INFO]: 4
[21:51:57] [Server thread/INFO]: 5
[21:51:57] [Server thread/INFO]: 6

Thanks :).

bitter dove
#

Trying to check if it is a door or a trapdoor, and then use .setOpen to open or close it

agile anvil
#

Check if state is instance of Openable, if yes cast it and use setOpen

bitter dove
#

k. thanks

#

so if (block.getBlockData() instanceof Openable) is good enough?

young knoll
#

Openable is a state iirc

#

Not data

agile anvil
#

?jd-s

undone axleBOT
agile anvil
#

That's right

#

TrapDoor and Door implements Openable

#

So you'll have to :
manually check if it's wether a door or trapdoor and act,
or (bad way) use reflection to determine if the class implements Openable x)

quiet ice
#

And it does not work?

worldly ingot
#

Well, no, it's just a BlockData lol. The other one is MaterialData but we don't talk about those

young knoll
#

Oh

#

Man why spigot confusin

flint coyote
young knoll
#

“Do you have the right structure import”

#

“No the other one”

warped gazelle
#

is there a way to sort tablist by placeholders?

young knoll
#

“No the other other one”

warped gazelle
#

for example for a prison rank

austere totem
#

how can i get 1.19.4 nms mojang remapped

young knoll
#

?nms

scenic onyx
#

line 29 does not work

wet breach
tall saffron
#

?paste

undone axleBOT
tall saffron
scenic onyx
tardy delta
#

define not working

austere totem
#

i tried getting the mojang remap for 1.19.4 nms and im getting this error when i try to reload maven with the mojang-remapped classifier:

Could not find artifact org.spigotmc:spigot🫙remapped-mojang:1.19.4-R0.1-SNAPSHOT in spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

Try to run Maven import with -U flag (force update snapshots)

I did run buildtools with the -remapped ending

scenic onyx
#

@tardy delta

tardy delta
#

no /

#

if you only looked at the docs

tranquil prairie
#

Hey guys. How should I make my plugin handle a situation where 20+ SQL queries need to be ran at once. Will implementing HikariCP fix this? OR do I need to make a job/queue system

wet breach
#

second, it is recommended to either use async tasks or what is better is to implement your own thread for running queries so its not done on the main thread

quaint mantle
#

how can you do this where it displays a text when i hover it

buoyant viper
#

Player.Spigot#sendMessage(BaseComponent...)

quaint mantle
#

thanks u

buoyant viper
#

and if it says sendMessage is deprecated -- ur using Paper API >:( , but Adventure has its equivalents

#

?jd-bcc

buoyant viper
#

spigot components example

player.spigot().sendMessage(new ComponentBuilder("This is gold text")
.color(ChatColor.GOLD)
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(new ComponentBuilder("This is green hover text")
.color(ChatColor.GREEN)
.create()))
.create());```
#

that should work at least, im on my phone lol @quaint mantle

fading carbon
#

Is there an example anywhere to using BungeeCord's dependency downloader?

buoyant viper
#

the what

#

r u talking about spigots library loader?

#

or does bungee have one also

fading carbon
#

I swear Bungee got added too

quaint mantle
#

cause im on 1.8

buoyant viper
#

the bungeecord chat api is bundled with spigot api

#

also i have no clue about legacy versions

#

i develop for latest

quaint mantle
#

cause this doesnt exists in my version of spigot

buoyant viper
#

yeah idk what the legacy version of that stuff is

quaint mantle
#

aight still thx tho

tranquil prairie
#

Hey I get Operation not allowed after ResultSet closed error on this method

private ResultSet executeQuery(String SQL) {
        try (Connection connection = dataSource.getConnection();
             Statement statement = connection.createStatement()) {
            return statement.executeQuery(SQL);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }```
#

Not sure how to fix it

young knoll
#

You shouldn't be returning ResultSets

#

Check out CachedRowSet

#

Or make your own container class

#

(Your try with resources closes the connection, which also closes the ResultSet

tranquil prairie
round finch
#

component and link?

#

curious

tranquil prairie
round finch
#

scroll up

#

that what i'm talking about

tranquil prairie
round finch
#

I'm curious how would that look?

#

the code

#

or what elements is needed

young knoll
#

.event with a ClickEvent

round finch
#

😮 thank you

#

for letting me know ❤️

tranquil prairie
#

Hey whats the best way to make sure an arrow isnt in a specific location? Idk how to check it efficiently as it would check a lot of times and prob cause lag

livid dove
#

So I know the adventure API is pretty much a done deal for paper, but what about using it in spigot?

young knoll
#

You can use it with their bukkit platform

#

But it only has stuff for sending messages to players

compact haven
livid dove
# young knoll But it only has stuff for sending messages to players

God what a crappy trade off.

Cause essentially me and my team are building our core libraries. And on the one hand paper makes things so much easier. On the other hand selling premium plugins for paper is more difficult (we are building big ass libraries, unfortunatly money does come into it lol) along with the fact quotes from customers might be more limited if our libraries only fully function in paper :S

round finch
#

i'm hooked
i need to know this stuff too
blocking entity movement without making check every 1 sec

#

World related right?

compact haven
#

what

orchid gazelle
round finch
#

yeah

#

but just for entity in general

young knoll
#

You can always just turn their AI off

#

If you don't want them to move at all

orchid gazelle
#

You may check every tick in most cases

compact haven
#

too little*

round finch
compact haven
#

well

#

I guess I can’t even correct you since neither are really sensible (I hate too much vs too little grammatically in this case)

round finch
#

there must be some legit spigot / bukkit way

orchid gazelle
#

I don't think so

compact haven
orchid gazelle
#

He means checking

#

Not disabling

young knoll
#

Then you check every tick

compact haven
#

I mean maybe you can override their path finder and prevent them from moving into a “blocked zone”

young knoll
#

That's what minecraft does

compact haven
#

or yeah just check every tick, honestly not that bad

orchid gazelle
#

They want an easier Bukkity way to check without looping every tick

#

Which does not exist I think

round finch
#

i thought what if someone dropped an item entity into unwanted area

compact haven
#

there’s an event for that

orchid gazelle
#

Its a really heavy mess

compact haven
#

lmfao

young knoll
#

Shoutout to load balancing

orchid gazelle
#

Well couldn't I just use TickEvents?

round finch
#

i have so much to learn about minecraft and spigot

livid dove
tranquil prairie
round finch
young knoll
#

Use the drop item event

orchid gazelle
livid dove
young knoll
#

Tf is tick events

tranquil prairie
orchid gazelle
#

Isn't there an event for ticks? Idk?

compact haven
#

no

tranquil prairie
#

nah lmao

orchid gazelle
#

I always use schedulers anyways

young knoll
#

nop

compact haven
#

in Forge there’s a game tick event pretty sure

round finch
orchid gazelle
#

Ohh then thats what I just confused it with

#

I just had a slight memory of some kind of tickevent in my had

compact haven
#

that’s like asking how you drive a car without a steering wheel and pedals

orchid gazelle
#

Something like PostTickEvent or something

round finch
#

Event and ticks?

compact haven
#

you don’t just get to remove parts of your toolkit because your example is bad

young knoll
#

How do you expect to prevent them from dropping an item in an area without cancelling the event?

#

I mean you can just kill the item, but I don't think they would be happy about that

round finch
#

i mean cancel the item movement

compact haven
#

???

orchid gazelle
#

Set item velocity to make it bounce away magically

young knoll
#

And check regularly

#

There is no event for non-players moving

round finch
#

just thought of plotme function

orchid gazelle
#

I mean, you gotta do a bukkit scheduler for() all entities right?

#

Is it really that fine to do it often

round finch
#

ok tick and vector

compact haven
#

I mean patching the server to call your code on entity movement is more performant than that, but no one is going to do that

round finch
#

i see

young knoll
#

Sure

#

But plugins can’t patch the server :p

compact haven
#

Mixins uwu?

young knoll
#

Well I guess they could with a bunch of ASM

orchid gazelle
young knoll
#

But I’ll pass on that

round finch
#

wait you can get item movement?

orchid gazelle
#

Yeah, mixins uwu

#

#TeamMixins

round finch
#

sounds hacky

young knoll
#

Can’t run mixins without a bootstrapper

orchid gazelle
#

You can.

young knoll
#

Which means more things people have to install

compact haven
#

can you even reload the class definition since it was loaded already?

#

like I don’t know how rewriting it with ASM live would work

young knoll
#

Not easily

orchid gazelle
young knoll
#

But yes you can use an agent

compact haven
#

gotcha

#

I think Optic would flag my program as a virus though if k started patching the server software with a plug-in

orchid gazelle
#

And with some REALLY hacky stuff you can set up your JavaAgent in mid-runtime, mixin into the class and then trigger reload

young knoll
#

I’ve done it with bytebuddy

#

But not mixins

#

Mixins require a bunch of extra stuff to load

compact haven
#

what is bytebuddy

orchid gazelle
#

Something like mixins

young knoll
#

It’s an ASM wrapper library

orchid gazelle
#

But different

#

Lol

young knoll
#

It also has a built in runtime attachable agent

#

Which is nice

compact haven
#

ClassVisiter moment

orchid gazelle
#

So yeah, TL;DR time

compact haven
#

I don’t know how ASM is wrapped though ngl

young knoll
#

I’ve thought about some kind of api for hooking into the ticking methods of entities

orchid gazelle
#

I could ASM my shit into the server at mid-runtime and save some performance

compact haven
#

seems like the goal is to be low level and that’s what it achieves

young knoll
#

Idk if it would really fit spigot though

orchid gazelle
round finch
#

this stuff is beyond my understanding

orchid gazelle
#

But maybe I'll just cba and just make custom nms entities with changed ticking

compact haven
#

entity tick handlers? 🤔

round finch
#

😱

young knoll
#

Something simple like Entity.addTickConsumer(Consumer<Entity>)

compact haven
#

could be implemented easily, probably

compact haven
#

they’ll want an interface like Listener I bet

orchid gazelle
#

I have never understood consumers

young knoll
#

I mean sure

orchid gazelle
young knoll
#

Could do an interface too

compact haven
#

if it’s an interface I believe you can still invoke it with an anonymous lambda like it was a Consumer as well which is a bonus

orchid gazelle
#

Isn't that the only way to modify player ticking? To ASM the living shit out of the player ticking method in mid-runtime plugin?

young knoll
#

I mean

#

You could just use the scheduler if you want to add something

#

If you want to remove stuff then probably

compact haven
#

the API probably has to be more powerful ngl

orchid gazelle
#

Well but you could save a lot of performance if you do not need some logic

young knoll
#

That’s when you make a fork

compact haven
#

it would probably need the ability to cancel and invoke miscellaneous ticking things

orchid gazelle
young knoll
#

Or use minestorm

orchid gazelle
#

That means rip compatibility

young knoll
#

The ability to remove or manually invoke existing stuff is certainly possible

#

But that would make a lot of painfully large diffs

orchid gazelle
young knoll
#

A way to hold a method that takes a single parameter as an object

orchid gazelle
#

Are they just... methods in reverse?

#

So basicly listeners in reverse

young knoll
#

There’s also suppliers, which hold a method that returns a single object

#

And Functions, which take a single parameter and return a single object

orchid gazelle
#

I register my consumer to a listener, and the listener calls my consumer which is basicly just calling a method from a listener with an arg

young knoll
#

Pretty much

#

Bukkit uses them a bit, like in World#spawn

#

But most of bukkits api was made before they existed

orchid gazelle
#

So in this case, I would make a consumer for lets say I wanna run heal entity every tick. I register my consumer to the Listener, which then has something like run(Entity entity)

#

And then can just run what I want in the run method?

quaint mantle
#

does the PlayerLevelChange event also take in account experient point changes or just whole levels

orchid gazelle
# young knoll Pretty much

So consumers are basicly like listening to an event, but with another object that replaces the lets say PlayerJoinEvent

young knoll
#

Try PlayerExpChangeEvent

orchid gazelle
#

So, that would be:
public void entityTickEvent(Entity entity) { }

#

Thats how they work?

young knoll
#

Yes that is a valid consumer

quaint mantle
orchid gazelle
#

So, TL;DR:
Registering a Consumer is just like telling some other Object to call my method when xy happens

#

And give me some Object to it

quaint mantle
#

this msg good or should i change it

young knoll
#

Consumers are great

#

I use them in my GUI library

orchid gazelle
#

Alright thank you, I know understand what a Consumer is lol. I kinda feel dumb that I had not known that one before

remote swallow
young knoll
#

You do too

#

Mostly because you just yoinked my library

#

Nerd

remote swallow
#

No

#

If i wrote it myself im a nerd, just stealing the code isnt nerd

visual laurel
#

Hiya, i have set my items MetaData to 1 but when trying to use a resource pack with that it just becomes this:

this is my netherite_sword.json file:

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/netherite_sword"
    },
    "overrides": [
        { "predicate": { "custom_model_data": 1 }, "model": "item/calioknifesmall" }
    ]
}

And this is what im using to create the item:

        ItemStack T1item = new ItemStack(Material.NETHERITE_SWORD);
        ItemMeta T1itemMeta = T1item.getItemMeta();
        List<String> lore = new ArrayList<String>();
        lore.add(ChatColor.WHITE + "Use this item in a");
        lore.add(ChatColor.RED + "Smithing Table " + ChatColor.WHITE + "to");
        lore.add(ChatColor.WHITE + "upgrade your weapon.");
        T1itemMeta.setCustomModelData(1);
        T1itemMeta.setLore(lore);
        T1itemMeta.setDisplayName(ChatColor.WHITE + "Tier 1 Upgrade");
        T1item.setItemMeta(T1itemMeta);
quaint mantle
#

anyone got a nice arrow i can use in minecraft

young knoll
#

Is the model json in the right spot

#

And does said model json point to the correct texture

visual laurel
#

File Structure:

models
item
-netherite_sword.json
textures
item
-calioknifesmall.png

livid dove
# tranquil prairie Because I need to prevent players from shooting arrows that land outside a wg re...

Oh wow this is one of those rare incidents where ya'll gonna be glad the aerospace engineer decided to learn java for his side hobby xD

define the region in terms of its corners (E.g: x1,z1, x2 and z2)

Calculate the time it'd take to hit one of those edges by utilising the velocity property

x1 - startPosX /Vx
y1 - startPosY/Vy
x2 - startPosX /Vx
y2 - startPosY/Vy

You will get 4 time values. Whichever is the lowest that isnt below 0, start counting your ticks as a scheduled task with a delay of around 85% of the way to that minimum time. Boom, you've just saved ur self a hell of a lot of ticked loops.

Bonus points if you guestimate when it'll hit the ground and, if its like half the time before ur lowest t, you can just fob the loop off all together

young knoll
#

Where is calioknifesmall.json

visual laurel
#

does that need to be a file?

young knoll
#

Yes

young knoll
#

Then that file points to the png

visual laurel
#

ah, yeah im dumb

#

thanks that fixed it

livid dove
#

i.e. "Why in the ever living Newton would you check if an arrow has left the boundaries, if you know that, in an ideal world, it isnt even gonna reach the boundary till 4 seconds in?!?"

#

Lets say you had an arrow that was 6 seconds away from the closest edge based on the qwik math.

Thats 100 ticks worth of loops saved :L

#

ish

#

xD

young knoll
#

Only downfall is if the velocity ever changes mid flight

livid dove
#

The goal isnt to be accurate

#

its to save ticks

#

name a way the x or z velocity INCREASES during flight :L

#

Cause thats the only way this gonna fuck up

#

Get a nice, quick and cheap guestimate of how long, then start the loops 10-20% of the time before the guestimate calculated best case scenario

young knoll
#

TnT

livid dove
#

You will never over estimate the time taken unless ur already doing some wacky minecraft physics

#

Hmmm... scan the average velocity for the first second of flight, then do funni calc and delayed task

#

And even then TnT is a hecka edge case :L

#

plus isnt an arrow an entity so gets an "onHit" event from tnt or something? (never really looked into entity based events withTnT damage"

#

This sounds like the making of a useful library ngl xD

#

"The TRazjectory Library"

young knoll
#

Arrows don’t have health so they don’t trigger damage events

livid dove
#

Can TnT deflect already in flight arrows?

young knoll
#

Afaik anyway

young knoll
livid dove
#

Huh... itd be some weird as hell edge case for the arrow to fly PAST the TnT and speed up from the explosion ngl.

#

This could make for an interesting side project.

#

Though ngl, im torn between creating an anti duping inventory cache library and creating an archiving file format for CoreProtect logs that'd take the size of the logs down by 10x

buoyant viper
#

factions players make cannons like that all the time i think

quaint mantle
#

why doesnt this permission thingy work i used it a million times before and not it doesnt work

#

nvm.

livid dove
#

Erm sanity check...
New file format for storing player logs like you do in core protect's SQL

-Set it up all the way down from region, Chunk, Chunk Section.

Each chunk section has a "time section" of 1 hour per time section.
Each time section has:
-A timestamp of when it started
-A "player pallete" (palette of player ID's (based on a typical Id table like SQL) of what order the players popped up in terms of actions
-An "action pallete" (Same as player palette but for actions)
each log is reduced to a 64 bit log.

player id (localised to the player packet, i.e. an id of 1 is the first player in the player palette for this time section)
timestampdifferential (the difference between the timestamp of this log, and that of the previous log in this time section (0 if there isnt one))
action id (same as player id)
coordinates (the cordinates within the 16,16,16 grid of the action).

Boom. We've just managed to squeeze a single log into a 64 bit long :L

#

The quick math says that if you can fit 1 log into 8 bytes (lets make it 12 bytes for good measure due to the palletes) ...

thats over 80 million logs in a gigabyte...

#

The current number is around 8 million...

#

So we'd be taking 10GB files and turning em into like 1GB files...

#

And thats the Conservative estimate

#

best case scenario> you are looking at like 0.7GB

#

It sounds too good to be true...

#

Have i missed something?

hazy parrot
#

Bitmask new format prayge

echo basalt
#

well

#

player ids are 2 longs

#

but yeah palettes are cool

livid dove
#

and each chunk section would just have a ref to the specific long value in that palette, within its own paltte

#

I guese my question is, why the ever living shit has noone done this?

#

We've got most log databases working on like 10GB after 2 months

young knoll
#

Because storage is cheap

#

cheaper than developer time :p

livid dove
#

Ngl I may be a rare in this, but the idea of making this is exciting to me

buoyant viper
#

the time it would take to fix ChatGPTs inherent errors would make up for standard development time

livid dove
#

Is this it? The solution is "Lets get ChatGPT to make the bastard and fix the bugs"

#

Is this how the intelligence explosion happens?

#

xD

buoyant viper
#

idk, i havent used chatgpt yet

young knoll
#

I just use it to generate ideas

#

Or boring code that even a potato couldn’t fuck up

atomic swift
#

InventoryClickEvent#getCurrentItem() gets the ItemStack currently in the clicked slot but is that before the click or after

livid dove
# buoyant viper idk, i havent used chatgpt yet

Ive used it mainly for sanity checks and essentially crap i'd of googled.

E.g: "What is a good practice when making an abstract for a button in Java"
"Is there anything in this package structure i've missed?"
"My general format for this package is this, this and this. Is there anything in here that seems like extra chaff thats not needed"

#

Never get it to write ur code (bad fucking ju ju unless its simple stupid)

buoyant viper
#

sadly i have some kinda complex (stubbornness) that makes me rawdog life and not look for help

#

just me, my mind, and JetBrains' IntelliJ IDEA

#

my phone is on 3% pls type fast

young knoll
#

Just use power slower

livid dove
#

Weirdest one i gave it was "Imagine there was a medium to light and michelson and morley got it wrong" and its response was basically "The medium would have to get denser near an object of mass, the medium would have to move rotationally and linearly with the bodies of mass like the earth and it must cause light to bend around stars" and i was like "A TO THE FUCKING YO, THATS GRAVITY".

Tl;dr: It can do some of the most compicated genius level plays, but only because its a language model designed to get better as it fucks up.

Which, to be blunt, is exactly what the human race does for science. Takes the simple shit and runs with it in stupid ways.

Take mohrs circle for example. This absoloute chad MAD LAD decided "Hey you know thsoe really complicated equations for stress elements around a material? It sorta kinda maybe looks like a circle... LETS FORCE IT INTO ONE!"

And now we have a method to do the most complicated stress related math... with a protractor and compass...

young knoll
#

Smh

livid dove
#

ChatGPT and AI in general bumbles around with the collective assembled masses of knowledge and pisses around with it in hopes of finding the answer you want.

Which is beautiful... and I can explain why in a single quote I found a few days ago which, as of now, is my all time faviroute.

"In the cascade of cherished wisdom, we find our place..."

#

Which is even more beautiful when i tell you, no lie, ChatGPT came up with that when we were discussing art concepts, and ive scoured the internet, it is not a quote from literally anywhere ❤️

#

Its why I sorta have fallen in love with the concept of AI.

It doesnt need to be some genius god-tier thinking machine.

Its just we finally did the impossible. We took the purest form of the scientific philosophy (let alone method) and objectified it for a machine to do.

livid dove
# livid dove ChatGPT and AI in general bumbles around with the collective assembled masses of...

Like to deromantisise science a bit here.

Calculus = Newton literally spent a year pissing around with the straight line equation until something worked

Mohrs Circle = What I described above

Archemidies Screw = Took humans 2000 frigging years to think "huh... lets try spinning the cyliner and keeping the screw still"...

Everything we do, everything we've made, from Java to the first Fire, all came about from a slightly above average Ape banging rocks together or something else equally stupid.

#

ChatGPT is just that... but erm... automated?

#

I mean case and point.

Completely idiotic idea.

Anti Dupes to prevent duping are not the play

Do the stupid thing

Scan player inventories after / during certain actions and compare the current state to the previous state.

I.e. dont prevent the dupe, look for its aftermath.

#

Its stupid, brute force and comes with its own sway of problems to solve.

But ngl the more I think about it, the more it seems like a legit good idea

young knoll
#

That’s what hypixel skyblock does

#

It just looks for items with the same unique id when you change servers

livid dove
#

Every inventory open, every trade , every dc . If you have been scanned for X reason, you'll be god damn scanned again xD

#

Would it work? Would it be a process powerhouse?

#

Probably

#

Still , gonna be funny to try it and see

tall saffron
#

Is there a way i can test if the bstats is working, as it seems to work but it isnt showing on the page, i am self hosting

#

does it take some time to load?

flint coyote
#

it's not updated instantly

young knoll
#

It only queries the server like

#

1-2 times an hour

tall saffron
#

Oh okay i guess i will wait so i can confirm, thanks

quaint mantle
#

how can i have one of my other plugins communicate with another?

flint coyote
#

Make one depend on the other and call a function of the other plugin by adding it as a dependency

young knoll
#

You can get fancy and make a nice public api

#

Or you can just grab an instance of it with PluginManager.getPlugin(name)

flint coyote
#

Definitly the first option

quaint mantle
#

what do you think is the most usefull in my case? Im making a custom achievement plugin that is supposed to get triggert from all kinds of things from many other plugins

#

all of those are mine

livid dove
#

Please

#

for the love of christ xD

#

We need more APIs

young knoll
#

I mean

livid dove
#

It still hurts my soul that CoreProtect doesnt have lookups for commands in tis API xD

young knoll
#

Depends if it’s even a public plugin

quaint mantle
#

well im strongly disbelieve anyone would like to use my api

quaint mantle
livid dove
#

Then again i am an IRL lectuerr

#

so im a bit biased

#

xD

livid dove
# young knoll Depends if it’s even a public plugin

Nah... this one command in coreprotect proves folk seriously need to get practice in making public friendly code xD https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/command/LookupCommand.java

GitHub

CoreProtect is a blazing fast data logging and anti-griefing tool for Minecraft servers. - CoreProtect/LookupCommand.java at master · PlayPro/CoreProtect

young knoll
#

I don’t think that’s even a case of public friendly code

#

More of a case of just good code full stop

livid dove
#

XD

#

Dont know what u mean

#

totally exemplary code

#

utterly fantastic

#

10/10

#

god I hope intelli doesnt see this 🙏

#

Not to pick it apart ong, but to point out the smallest insignifcant pet gripe i have with this :

#

Its not the barage of if statements

#

its not the roughly same stuff happening with different checks....

#

Its that motherfuckin Color.DARK_AQUA

young knoll
#

I quite like dark aqua

livid dove
#

I do too

#

Too bad...

#

THAT ISNT FUCKING DARK AQUA!

#

The mad lad (or one of the many who worked on CP) OVERRODE THE COLOR

#

And replaced it with a damn hex color

remote swallow
#

As they should

young knoll
#

Oh yeah that’s not ChatColor

livid dove
#

xD

#

See its the small stuff that grinds my gears

#

Like Offline Player and Player are moronic names

#

It should be :

Player and OnlinePlayer

#

As you can get an exception if you try to get an offline player with Player...

#

But can get an Online player with OfflinePlayer

#

Has anyone suggested changing the name?

#

LIKE HELL HAVE THEY

#

xD

flint coyote
#

Changing that will break all plugins for no real benefit. Not gonna happen

wary topaz
#

I just want to know, how is the spigot forms area coded? Is it public ?

river oracle
livid dove
#

Im just saying, whoever initially coded it needs a solid slap in the face

wary topaz
#

alr ty

young knoll
#

Don’t slap dinnerbone

#

That’s mean

livid dove
#

I would like to think anyone who has had an exception gbecause they added a "get player" method into their plugins but forgot offline players can happen

#

can relate to my pain lol

wary topaz
#

damn thats expensive

viscid ginkgo
#

any reason "{" wont work in a split?

#

its red in a text lmao

atomic swift
#

im starting to hate spigot

livid dove
atomic swift
#

event.getAction() == InventoryAction.SWAP_WITH_CURSOR is false

livid dove
#

🥳

atomic swift
#

Main.getInstance().getConfig().getString("config.binding.style").toLowerCase() == "drag-drop") is false

dusk flicker
#

congrats

#

welcome to java & spigot

atomic swift
dusk flicker
#

?main

atomic swift
dusk flicker
#

obligatory

atomic swift
#

its easy

young knoll
#

You can’t compare strings with ==

#

Silly

atomic swift
#

FINE ill change it

atomic swift
young knoll
#

Well

viscid ginkgo
#

wack

young knoll
#

Is InventoryAction an enum

atomic swift
#

and

flint coyote
livid dove
#

in the console

#

brute force the fucker

wary topaz
#

lfmaooo

dusk flicker
#

too much work

#

make it a sysout

atomic swift
wary topaz
#

imagine System.out.println

#

totally couldnt be me

young knoll
#

Swap only works if the cursor already has an item

livid dove
young knoll
#

If the cursor is empty it’s probably PickupAll

dusk flicker
#

every time I start up a server I get that stupid nagging thing about telling the authors to use the logger cause I never do lol

wary topaz
#

exception.printshittrace

static ingot
#

too much work
i sympathize with the consumers who must bug test your product

livid dove
atomic swift
#

bro its PLACE_ALL

wary topaz
#

idk lol

livid dove
young knoll
#

Yeah sysout works fine

atomic swift
young knoll
#

Paper will yell at you though

atomic swift
#

its always place all

livid dove
#

ILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigotILoveSpiggotILoveSpigot

wary topaz
atomic swift
#

i right click with a stack and its PLACE_ALL

livid dove
wary topaz
#

GUYS gUESS WHAT!!! ||chicken butt||

atomic swift
young knoll
#

Place all means the cursor has items and the clicked slot is empty

atomic swift
#

and im only moving 1

wary topaz
#

does anybody have more messages than me?

#

(coll over here with 90k)

livid dove
#

Thats fuckin funny

dusk flicker
#

sad im only at 33k

livid dove
#

That sounds like a solid spiggot L
]

atomic swift
#

im gonna die

wary topaz
#

it took me 3 minutes to read that

livid dove
undone axleBOT
wary topaz
#

?jd-m

#

?jd-b

atomic swift
#

even if i pickup

wary topaz
#

;-;

dusk flicker
#

?jd

wary topaz
#

o

dusk flicker
#

only options

wary topaz
#

bungeecodchat?

#

cord*

#

they mean like plugin messaging?

young knoll
#

?jd-s

undone axleBOT
young knoll
#

?jd-bc

young knoll
#

?jd-bcc

wary topaz
#

it needed its own docs it was so big

young knoll
#

Bungecord chat is the component api

#

And is also available in spigot

wary topaz
#

ohh

#

well i know that

#

also what is the difference between a humanentity and a player?

livid dove
#

Oh my fucking god

#

I know what your problem is

livid dove
#

Everyone

young knoll
#

Well you see

livid dove
#

get ready to do a thunderous slow clap

wary topaz
#

uh oh

livid dove
#

@atomic swift im psychic

#

U ready?

atomic swift
#

ig

young knoll
#

Player and HumanEntity are basically the same atm

wary topaz
#

damn

livid dove
#

***I predict you are in C R E A T I V E M O D E ***

wary topaz
#

oh my god why didnt we think that

atomic swift
young knoll
#

The abstraction exists only because it exists in mojangs code too

wary topaz
#

ohhh

#

how come its only in some events than?

young knoll
#

For most events spigot actually just casts it to a player

#

:p

atomic swift
#

🤦‍♂️

wary topaz
#

mk

#

👏 👏 👏 👏

atomic swift
young knoll
#

In older events it’s still HumanEntity

atomic swift
#

i dont like seeing this in my code

wary topaz
#

also I have an advanced question, yall know the plugin protolize?

#

bungeecoord

#

it can make inventorys from bungeecoord

#

without any other plugins on the spigot

livid dove
#

Very rare i do a voice recording reply

#

xD

dusk flicker
livid dove
#

But this one required the personal touch

static ingot
wary topaz
#

no im asking how the plugin works

#

it doesnt make sense

#

packets

#

and stuff

young knoll
#

It’s all packet based

wary topaz
#

what kind of packets?

dusk flicker
#

all of them

wary topaz
#

is there like a list of packets somewhere? 🤓

young knoll
wary topaz
#

which sub catagory?

chrome beacon
#

Protocol

young knoll
#

Protocol specification iirc

wary topaz
#

ty

livid dove
#

xD

young knoll
#

Creative mode is janky

#

Thanks Mojang

#

:(

static ingot
#

creative inventory specifically, lol

#

majority of it is handled client-side so the server just has to do what it can

livid dove
#

When we have a really stupid fucking problem, googling it or all in all being a moron is not shameful, but actively encouraged as it usually gets you an answer qucker is the correct answer

dusk flicker
#

obviously dont google it

#

bing it