#help-development

1 messages · Page 597 of 1

drowsy helm
#

Serialize it

#

Then deserialize when you need it

lost schooner
#

Yikes

sullen marlin
#

It's just an array

#

I think it's all copied

#

So just store and setContents later

lost schooner
#

Man I really wish I had my beautiful Rust .clone()

lost schooner
#

Another question.

public class PlayerDeathListener implements Listener {
    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent e) {
        // Save the player's inventory
        Player player = e.getEntity();
        ItemStack[] beforeDeathInventory = player.getInventory().getContents();

        e.setDeathMessage("You died lmao");

        // Wait 5 seconds
        new BukkitRunnable() {
            @Override
            public void run() {
                System.out.println("Restoring inventory of player " + player.getName());

                // Restore the player's inventory
                player.getInventory().setContents(beforeDeathInventory);
            }
        }.runTaskLater(player.getServer().getPluginManager().getPlugin("FirstSpigotPlugin"), 100L);
    }
}

the .runTaskLater(player.getServer().getPluginManager().getPlugin("FirstSpigotPlugin"), 100L); feels like a workaround to me. How can a listener from a different class have access to the top level Plugin?

#

I can of course just throw this into the Plugin class, but I want to be able to separate them

#

It seems odd that I would need to put everything into my main file just because I want a timer

remote swallow
#

Di or singleton

#

?di

undone axleBOT
drowsy helm
#

pass it in the constructor

#

you can also just use PlayerDeathEvent#setKeepInventory(true)

lost schooner
drowsy helm
#

gotcha

#

getContents doesnt include armour btw

lost schooner
#

If I want to modify the behavior of a station - such as setting a cap for level cost on an anvil - what part of the API do I use?

drowsy helm
#

youll also need to do getArmorContents

lost schooner
#

Like events work for reactive stuff but what would it be for interactive stuff

lost schooner
drowsy helm
#

one sec

#

wdym interactive stuff?

lost schooner
#

I want to make a plugin which both caps the levels on anvils and also allows for the plugin user to specify enchant max levels

#

For instance you could enchant to Sharpness X in an anvil etc

lost schooner
#

Modifying behavior of interactable blocks and menus

drowsy helm
#

yeah it wll still be through events

lost schooner
#

Oh that's odd

#

Do I have to do a lot of it manually or is there a built-in feature for setting max enchant levels

drowsy helm
#

yeah itll be mostly manual but its not a huge amount of stuff to implement

lost schooner
#

Will it be like (pseudocode)

On player puts two items in anvil
  For each duplicate enchant
    If levels are same && levels + 1 < max enchant level
      Add enchant with level + 1 to result item
    Else
      Add highest level enchant to result item
  For each other enchant
    Add enchant to result item
drowsy helm
#

yeah smth like that

lost schooner
#

So I'm sort of reimplementing an anvil

drowsy helm
#

yeah exactly

#

afaik theres no way to extend the existing system

lost schooner
#

How do I keep some of its features to prevent having to rewrite the whole pricing system and stuff

#

Oh so I legit just cannot

#

🪦

drowsy helm
#

yeah trying to extend existing minecraft systems is a bit fucky lol

lost schooner
#

I can see how that would become very difficult with more complex systems than anvils

#

i.e. enchanting tables

drowsy helm
#

yeah thats why people usually make their own inventories when making custom enchant systems

lost schooner
#

Inventories for what? The enchanting table?

drowsy helm
#

like instead of reusing the mincraft one

#

yeah

lost schooner
#

Yeah that's sad

#

Kind of limiting

#

I guess tis the nature of plugin

drowsy helm
#

like hypixel's crafting table

#

is just a regular inventory

lost schooner
#

Yeah I've always found those types of interfaces to be very cringe

#

I typically avoid them (when choosing plugins for servers)

drowsy helm
#

anvil should be pretty straight forward tho

#

you're not really changing the functioanlity of it

lost schooner
#

Wait do I have to reimplement its actual menu too?

drowsy helm
#

nah you shouldnt have to

#

just listen to the prepare event and set the result accordingly

lost schooner
#

Why do enchanted books not show up as enchanted using ItemStack.getEnchantments()

sullen marlin
#

They're enchantmentstoragemeta

#

Difference between enchanted book and book storing enchants

quaint mantle
#

Anyone know how to set the variable to true? DEFINE PUBLIC STATIC Z isThere as right now its false I thought ICONST_1 was true but apparently it's not. This is editing with assembler

sullen marlin
#

?

quaint mantle
#

what?

sullen marlin
#

Static finals will be inlined

#

But

#

?xy

undone axleBOT
quaint mantle
#

I said I tried ICONST_1 because usually that's true but its not at this moment

lost schooner
#

Like it can have both?

sullen marlin
#

Yes

lost schooner
#
        Inventory inventory = e.getInventory();
        ItemStack leftItem = inventory.getItem(0);
        ItemStack rightItem = inventory.getItem(1);

        if (leftItem != null && rightItem != null) {
            // Get the enchantments on both items
            Map<Enchantment, Integer> leftEnchantments = leftItem.getEnchantments();
            Map<Enchantment, Integer> rightEnchantments = rightItem.getEnchantments();
            Map<Enchantment, Integer> resultEnchantments = new HashMap<>();

            // If the item is an enchanted book, additional enchantments must be determined using the item meta,
            // rather than ItemStack.getEnchantments()
            if (rightItem.getType() == Material.ENCHANTED_BOOK && rightItem.hasItemMeta()) {
                ItemMeta meta = rightItem.getItemMeta();
                if (meta instanceof EnchantmentStorageMeta) {
                    EnchantmentStorageMeta enchantmentMeta = (EnchantmentStorageMeta) meta;
                    Map<Enchantment, Integer> rightMetaEnchants = enchantmentMeta.getEnchants();
                    rightEnchantments.putAll(rightMetaEnchants);
                }
            }

            // Calculate the level of each enchantment
            for (Map.Entry<Enchantment, Integer> entry : rightEnchantments.entrySet()) {
                System.out.println("Evaluating right enchantment: " + entry.getKey() + ", level: " + entry.getValue());

                Enchantment enchantment = entry.getKey();
                int level = entry.getValue();

                resultEnchantments.put(enchantment, level);
            }

            ItemStack resultItem = leftItem.clone();

            // Add the enchantments to the resulting item
            resultItem.addUnsafeEnchantments(resultEnchantments);

            e.setResult(resultItem);
        }
lost schooner
#

It works somehow tho lol

#
Caused by: java.lang.UnsupportedOperationException
    at com.google.common.collect.ImmutableMap.putAll(ImmutableMap.java:890) ~[guava-31.1-jre.jar:?]
    at com.lthoerner.firstspigotplugin.FirstSpigotPlugin.onAnvilPrepare(FirstSpigotPlugin.java:56) ~[?:?]
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
quaint mantle
#

Its unchangable map

lost schooner
#

Ok, I have another related question because I'm confused

unborn sable
#

I’m making a simple silk touch spawners plugin and have run into a problem. Is there a way to set the spawner type in the ItemStack ItemMeta or do I have to manually handle block placements to place the spawner and set the type from PDC

lost schooner
lost schooner
#
    @EventHandler
    public void onAnvilPrepare(PrepareAnvilEvent e) {
        Inventory inventory = e.getInventory();
        ItemStack leftItem = inventory.getItem(0);
        ItemStack rightItem = inventory.getItem(1);

        if (leftItem != null && rightItem != null) {
            // Get the enchantments on both items
            Map<Enchantment, Integer> leftEnchantments = leftItem.getEnchantments();
            Map<Enchantment, Integer> rightStandardEnchantments = rightItem.getEnchantments();
            Map<Enchantment, Integer> rightMetaEnchantments = new HashMap<>();
            Map<Enchantment, Integer> rightAllEnchantments = new HashMap<>();
            Map<Enchantment, Integer> resultEnchantments = new HashMap<>();

            // If the item is an enchanted book, additional enchantments must be determined using the item meta,
            // rather than ItemStack.getEnchantments()
            if (rightItem.getType() == Material.ENCHANTED_BOOK && rightItem.hasItemMeta()) {
                ItemMeta meta = rightItem.getItemMeta();
                if (meta instanceof EnchantmentStorageMeta) {
                    EnchantmentStorageMeta enchantmentMeta = (EnchantmentStorageMeta) meta;
                    rightMetaEnchantments.putAll(enchantmentMeta.getEnchants());
                    for (Map.Entry<Enchantment, Integer> entry : rightMetaEnchantments.entrySet()) {
                        System.out.println("Identified meta enchantment on right item: " + entry.getKey() + ", level: " + entry.getValue());
                    }
                }
            }

            // Combine the standard and meta enchantments together
            rightAllEnchantments.putAll(rightStandardEnchantments);
            rightAllEnchantments.putAll(rightMetaEnchantments);

            // Calculate the level of each enchantment
            for (Map.Entry<Enchantment, Integer> entry : rightAllEnchantments.entrySet()) {
                System.out.println("Evaluating right enchantment: " + entry.getKey() + ", level: " + entry.getValue());

                Enchantment enchantment = entry.getKey();
                int level = entry.getValue();

                resultEnchantments.put(enchantment, level);
            }

            ItemStack resultItem = leftItem.clone();

            // Add the enchantments to the resulting item
            resultItem.addUnsafeEnchantments(resultEnchantments);

            e.setResult(resultItem);
        }
    }
unborn sable
lost schooner
#

So this seems like it should work but it doesn't seem to be identifying meta enchants at all anymore

#
            // If the item is an enchanted book, additional enchantments must be determined using the item meta,
            // rather than ItemStack.getEnchantments()
            if (rightItem.getType() == Material.ENCHANTED_BOOK && rightItem.hasItemMeta()) {
                ItemMeta meta = rightItem.getItemMeta();
                if (meta instanceof EnchantmentStorageMeta) {
                    EnchantmentStorageMeta enchantmentMeta = (EnchantmentStorageMeta) meta;
                    rightMetaEnchantments.putAll(enchantmentMeta.getEnchants());
                    for (Map.Entry<Enchantment, Integer> entry : rightMetaEnchantments.entrySet()) {
                        System.out.println("Identified meta enchantment on right item: " + entry.getKey() + ", level: " + entry.getValue());
                    }
                }
            }
#

In particular, this part

lost schooner
#

But it's not identifying them anymore

quaint mantle
#

how can I get the rotation of a Material.PLAYER_HEAD?

#

Do I need to cast it to a Skull?

lost schooner
#
    public static Map<Enchantment, Integer> getAllEnchantments(ItemStack item) {
        if (item == null) {
            return null;
        }

        // Get the "standard enchantments" of the item
        Map<Enchantment, Integer> enchantments = new HashMap<>(item.getEnchantments());

        // Get the "meta enchantments" of the item, which are usually only present with enchanted books
        ItemMeta meta = item.getItemMeta();
        if (meta instanceof EnchantmentStorageMeta) {
            EnchantmentStorageMeta enchantmentMeta = (EnchantmentStorageMeta) meta;
            enchantments.putAll(enchantmentMeta.getEnchants());
        }

        return enchantments;
    }

Ok I came up with this

#

But it still does not work lol

#

It seems that the meta enchantments are being identified, but not actually saved/stored

#

Oh, apparently you have to use .getStoredEnchants() on the meta

cobalt dust
#

gun recoil

quaint mantle
#

On place/break block wait one tick then do things.

unborn sable
#

How do I drop the spawner and keep the data though

#

I don't want to save it in PDC

distant wave
#

is it possible to make 3d textures/models for armor?

quaint mantle
tribal valve
unborn sable
#

How can I place a block with the plugin?

#
CreatureSpawner spawner = (CreatureSpawner) block;

I want the plugin to place this block where the player wanted.

quaint mantle
icy beacon
#

is there a list for all the inventory slots in 1.19 for player inventory? for example, which slots are hotbar, which are armor, etc

icy beacon
#

why is this now randomly existing

#

i don't remember it just randomly spawning in my ide yesterday

vivid cave
#

Hello, can someone help me with attribute modifiers ?
I'm trying to copy all the attribute modifiers from an armor to another armor, especially the ones that mention "+8 Armor, +1 Knowback Resistance", like the very default ones for vanilla armor.

Here's my old code, which is still working, using NMS:

ItemStack newArmor = initialArmor.clone();
net.minecraft.world.item.ItemStack nmsInitial = CraftItemStack.asNMSCopy(initialArmor);
net.minecraft.world.item.ItemStack nmsNew = CraftItemStack.asNMSCopy(newArmor);

for (net.minecraft.world.entity.EquipmentSlot slot:net.minecraft.world.entity.EquipmentSlot.values()){
    Map<net.minecraft.world.entity.ai.attributes.Attribute,Collection<AttributeModifier>> all = nmsInitial.getAttributeModifiers(slot).asMap();
    for (net.minecraft.world.entity.ai.attributes.Attribute attr:nmsInitial.getAttributeModifiers(slot).keySet()){
        for (AttributeModifier mod:all.get(attr)){
            nmsNew.addAttributeModifier(attr, mod, slot);
        }
    }
}
newArmor = CraftItemStack.asBukkitCopy(nmsNew);

Here is my new code, using bukkit api, but isn't working (at least not for the very basic attributes)

newArmor.setAttributeModifiers(initialArmor.getAttributeModifiers());
jolly forum
#

Hello, how can I use the SkinsRestorer api to apply a skin that is redirected by a url?

vivid cave
# sullen marlin Do you call setItemMeta

nope, this isn't in the item meta tho (but in itemstack)

  • Should I do this in ItemMeta instead ?
  • Or are you making sure that I'm not overwriting the item with a different meta afterwards ?
vivid cave
# sullen marlin Do you call setItemMeta

oh and hear this:
it works for custom attributes (like if i give myself an item with weird attributes it works)
it just doesn't work for the most basic ones like the ones we find on default diamond armor, etc

sullen marlin
#

Sorry not sure

#

Check getAttributeMosifiers is returning what you want

vivid cave
#

yeah seems pretty much what i want
i also noticed there was getAttributeModifiers(equipmentSlot)
But after checking the source code, I realised that getAttributeModifiers(equipmentSlot) is included in getAttributeModifiers()
So it shouldn't be the issue

sullen marlin
#

Sounds like it might not include default modifiers though?

vivid cave
#

yeah

#

i mean i havent checked ALL the source code

#

so i still don't know where/how it retrieves all the attribute modifiers

sullen marlin
#

You can check if it's giving the ones you expect though

vivid cave
#

oki i'll try to debug that

trim lintel
#

bump

icy beacon
#

?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.

icy beacon
#

also please use english if you want us to understand what you mean

jolly forum
#

Hello, how can I use the SkinsRestorer api to apply a skin that is redirected by a url?

icy beacon
jolly forum
#

Nice

drowsy helm
#

hard to tell anything form that video

tribal valve
#

I think it's when he first mined, it mined really fast and second time its good

icy beacon
#

if i disable the player's ability to drop items, is there any other way that they can get rid of them?

#

i'm making a market system and i want to prevent dupes when the selling GUI is open

#

so the player chooses what item from their inventory they want to sell and the GUI is open where they select the amount of the item

#

of course i want to prevent the player from dropping the item because it's still in their inventory

drowsy helm
#

death

icy beacon
#

it was my second thought, but in that case the inventory will be closed and the sale will be aborted so it's fine

vivid cave
icy beacon
#

but not a sword i don't think, how would a sword be broken while the player is in a gui

tribal valve
#

Oh, okay

torn shuttle
#

real quick what's the plugin size limit on spigot again?

icy beacon
#

4mb

shadow night
#

Wait, plugins have a size limit?

torn shuttle
#

damn

#

guess I'll host on github for the dl link then

icy beacon
#

i host my 4mb+ on github as well

shadow night
#

Makes sense ig

torn shuttle
#

yeah I do that for some of my other plugins

drowsy helm
#

is your tower defense plugin coming out

torn shuttle
#

that's what I'm working on

#

the models alone are 5.5mb

#

hence me checking

icy beacon
#

ah alrighty

shadow night
#

Tbh it looks in a way bedrock-styled, because java servers usually don't bother making custom models

torn shuttle
#

I didn't just bother to make models, I bothered to make a whole plugin that manages models in spigot

icy beacon
#

yeah that's not a step ahead, that a storey ahead

shadow night
urban mauve
#

HangingBreakEvent.RemoveCause: what type of cause is responsible for a torn leash from distance of more than 10m?

torn shuttle
#

not officially released on spigot yet as I am wrapping up some testing

#

but it seems to be working just fine

icy beacon
torn shuttle
#

this was fully generated using the plugin

shadow night
icy beacon
#

not yet i think

torn shuttle
#

yes but this is not the best way of doing blocks specifically

#

there's three main ways of making models

#

one is using noteblocks

shadow night
#

Idk if there is some kind of blocky custom model data or somethung

torn shuttle
#

one is using item frames

#

and one is using armor stands

#

I'm using armor stands exclusively right now but I plan to probably add compatibility for the other two methods in the future

#

noteblocks are better because there's a real block you can hook up to

shadow night
#

Actually, why wouldn't mojang add like block custom model data?

torn shuttle
#

hahahahaha

#

funny

icy beacon
#

why are you using armor stands if noteblocks are better? are they easier to work with?

torn shuttle
#

notblocks are only good for making blocks

#

I don't currently give a shit about making blocks

icy beacon
#

fair

shadow night
#

I wonder if I can make multiblock machinery like immersive engineering (I think it was that) using that plugin

torn shuttle
#

ideally I'd like for FMM to become an easy way for other devs to implement their own custom models into their plugins

#

you can raydan, it would just be a bunch of work

shadow night
torn shuttle
#

once you have a way to display the models everything else is just a function of your patience in developing a system

shadow night
#

And since we already got a pretty interesting concept for tech mods with energy that could be implemented in a good way

#

I need to stop thinking of that shit, because I try to do what I say I'm going to do and that is gonna take me multiple nights to get it working

icy beacon
#

hey magma

#

maybe you'll like a super tiny contribution lol

#
public static double decimalPlaces(double value, int places) {
        final double number = Math.pow(10, places) * 1.0;
        return Math.round(value * number) / number;
    }

    public static double fourDecimalPlaces(double value) {
        return decimalPlaces(value, 4);
    }

    public static double twoDecimalPlaces(double value) {
        return decimalPlaces(value, 2);
    }
#

for your Round class

#

tested

torn shuttle
#

oh no they're reading my utility classes

icy beacon
#

😄

torn shuttle
#

I don't even use two decimal places lol I only copied the class from one of my other plugins

#

but sure PR it

icy beacon
#

haha

#

alright one min

frigid rock
#

yo could be a dumb question but what should "key" be when creating a new NameSpaceKey?

hybrid spoke
frigid rock
#

okay thanks

tender shard
#

the plugin name is already part of the key

icy beacon
#

turns out i don't know shit about git command line

#

how do i pr from there???

#

in intellij

urban mauve
#

is there any way to increase "durability" of lead? i wanna increase it torn distance from 10 to, for example, 45
only NMS?

tribal valve
#

So I want to make a discord-minecraft verification by storing a key that player must enter in the server in the database and checking whole database for the key but now I'm thinking about storing the keys in hashmap in my plugin and just adding them to it when discord command is sent, which one is better to use

#

Also I don't know how to do the second one

#

(receiving the key from discord bot)

icy beacon
#

well merge your plugin and discord bot into one plugin

#

i did that

static cave
#

Hey, i am trying to "change" the recipients of a message however there is no setter for that in the PlayerChatEvent. i was thinking of just calling a new PlayerChatEvent with the updated recipients however that would just create a loop anyone have an idea how i could make that work?

icy beacon
#

then you can easily sync data between them

urban mauve
tribal valve
eternal oxide
urban mauve
icy beacon
#

so when a command like "/verify" is ran in minecraft, you store the key and uuid in the hashmap and your discord bot can work with that
(or the opposite, the command can be ran in discord, but the point stays)

static cave
eternal oxide
#

you don;t use a setter

#

it's a mutable list

static cave
#

if i use .getRecipients it just returns a copy of the list

icy beacon
eternal oxide
#

its not a copy

static cave
#

hmmm alright let me try it

eternal oxide
#

Sorry I don;t use IJ

icy beacon
#

what about cli

eternal oxide
#

I do it all in Eclipse

icy beacon
#

ah kk

icy beacon
tribal valve
#

How to receive discord bot events in plugin

eternal oxide
#

If you clone a repo you make yoru changes push back to your cloned repo, then on Github create a PR to upstream

tribal valve
#

Like if discord user used a command, I receive the event inside my plugin

icy beacon
#

not separately

static cave
tribal valve
#

I'm not into that, if my server would stop, the discord bot would stop

#

And I want to make server shut down info

icy beacon
#

i'm pretty sure i'm working directly with the fmm repo

urban mauve
eternal oxide
#

you need to clone it not just import from git

tribal valve
urban mauve
tribal valve
#

Yea

#

They would just stop working when server is down

urban mauve
tribal valve
#

I'm not asking that

urban mauve
icy beacon
tribal valve
icy beacon
urban mauve
icy beacon
#

but did i

#

i am confused

vivid cave
#

are horse armor meta instance of ArmorMeta ?

eternal oxide
#

you need to clone, import your cloned repo, not original, make changes, push changes, then create pr

icy beacon
#

i am doing something wrong

#

i tried cloning from cli git clone url, opened the directory in intellij, made my changes and tried to commit&push, but it wouldn't allow to push. why????

sturdy reef
#

how do i set the format of a ChatEvent to a textcomponent

#

i want it to be hoverable

jolly forum
#

Hi, what event can be called dice when a player connects in a bungeeCord plugin?

urban mauve
#

if there any way to listen for torn lead? (a leash being torn)

quaint mantle
# sturdy reef how do i set the format of a ChatEvent to a textcomponent
public static void sendHoverableChatEvent(Player player) {
        TextComponent messageComponent = new TextComponent("Hoverable Text");
        messageComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("This is a hoverable text").create()));
        
        Player.Spigot spigot = player.spigot();
        spigot.sendMessage(messageComponent);
}

is what i use

sturdy reef
#

ok so i cancel the event and do this instead?

quaint mantle
#

cancel what event

sturdy reef
#

chatevent

icy beacon
#

how are you listening to chatevent

#

why not asyncplayerchatevent

sturdy reef
#

but i don't want to type it all in

#

im just referring to the event

icy beacon
sturdy reef
#

ye

icy beacon
#

asyncplayerchatevent is not deprecated in spigot

#

?whereami

quaint mantle
#

we dont use the word paper around here

quaint mantle
sturdy reef
#
@EventHandler
    public void onChat(AsyncPlayerChatEvent event) {
        event.setCancelled(true);
        Player player = event.getPlayer();
        TextComponent format = new TextComponent();
        player.spigot().sendMessage(format);
    }```
icy beacon
icy beacon
#

torn

quaint mantle
#

lead is an entity right

#

cuz if it is then you can do it

urban mauve
quaint mantle
#

PlayerInteractEntityEvent probably

urban mauve
quaint mantle
#

ill give it a try

#

let me load mc

urban mauve
quaint mantle
#

i think it will work

urban mauve
quaint mantle
#

how do leads even work

urban mauve
urban mauve
# quaint mantle how do leads even work

i do listen for PlayerInteractAtEntityEvent, then when it already leashed at entity, leash will become an entity in HangingBreakByEntityEvent/PlayerInteractAtEntityEvent/PlayerLeashEntityEvent
but still i need know how to listen for this

quaint mantle
#

hm i have an idea

urban mauve
quaint mantle
#

nvm

urban mauve
quaint mantle
#

i tried it it didnt work

#

lol

urban mauve
quaint mantle
#

it was a pof thing

#

cuz even if it worked the server would have terrible performance

quaint mantle
#

check if the Entity interface has the isLeashed boolean

#

cuz im currently on legacy

quaint mantle
#

it might

#

🤷🏿‍♂️

#

hold up

#

this might work

#

@urban mauve i found out the event for when a leash is broken of a fence

#

but not i f the player runs too far

quaint mantle
#

what do u neeed

urban mauve
quaint mantle
#

ok

#

there is no event for it but it is possible

urban mauve
tribal valve
#

Let's say I have two java files with their own servers and one of them is a spigot server and one of them is a discord bot, I can't connect those two into one, and i somehow need to execute a function when the event is executed on the other java
So when event on java 1
Execute function on java 2

quaint mantle
#

put it in the same jar

tribal valve
#

I said "I cant connect those two into one"

quaint mantle
#

got it @urban mauve

#

i know how to do it

sullen marlin
#

Put the discord bot in the spigot plugin

urban mauve
urban mauve
tribal valve
urban mauve
sullen marlin
#

?

urban mauve
tribal valve
quaint mantle
quaint mantle
urban mauve
tribal valve
#

If you have a discord bot, you need to host it on discord bot option not Minecraft option

urban mauve
urban mauve
quaint mantle
urban mauve
urban mauve
sage dragon
#

Is there some guide to adding structures with custom loot tables?

tender shard
#

you can easily run a discord bot through a minecraft plugin. just use JDA and shade it into the plugin, then create your JDA instance in onEnable() or whatever

#

or Discord4J but i dont like it

gusty lake
#

Hi guys, I'm getting into developing custom world generations in the new versions of minecraft. Documentation is unfortunately limited, can anyone help me get started the right way?

urban mauve
quiet ice
quaint mantle
#

@urban mauve

urban mauve
quaint mantle
#

lol bro

#

im deleting the code ur not seeing it anymore

tribal valve
urban mauve
tribal valve
#

Player must verify on mc server to gain access to discord server

icy beacon
eternal oxide
#

you clone it on github

#

import your cloned repo from git

#

make changes, push back

icy beacon
eternal oxide
#

then PR on github

#

yes

icy beacon
#

alright let me try this now

tribal valve
#

How i can connect to database and get every value from the table

icy beacon
eternal oxide
#

on github there will be a pr to upstream somewhere

icy beacon
#

oh yeah

#

yep it worked

#

thanks a bunch elgar

vivid cave
#
public static boolean isCompatible(Material material){
    String materialName = MulticolorArmor.getMaterialName(material);
    return (materialName.equals("wooden") || materialName.equals("stone") || materialName.equals("leather") || materialName.equals("iron") || materialName.equals("golden") || materialName.equals("diamond") || materialName.equals("netherite"));
}```

have i forgotten any ? (for any kind of tools/armors)
icy beacon
#

material name will never equal wooden though

#

did you mean to use startsWith()?

#

chainmail btw

vivid cave
icy beacon
#

and it's lowercase all the time, right?

vivid cave
#

ye

icy beacon
#

kk then

icy beacon
vivid cave
#

i use my first function for other stuff too thats why i didn't use startswith

vivid cave
#

i knew i forgot something haha

icy beacon
#

also, turtle helmet?

vivid cave
#

ooo

#

yes

#

ty!

#

i have to add it too yes

icy beacon
#

and elytra if we're talking all the equipment

vivid cave
#

nah not elytra

icy beacon
#

kk

vivid cave
#

ty ty

sturdy reef
#

TextComponent is messing up my hex color codes

#

what do i do?

#
    @EventHandler
    public void onChat(AsyncPlayerChatEvent event){
        event.setCancelled(true);
        Player player = event.getPlayer();
        String prefix = TextHelper.format(translateHexColorCodes(PlaceholderAPI.setPlaceholders(player,"%luckperms_prefix%")));
        player.sendMessage(prefix);
        TextComponent format = new TextComponent(prefix);
        player.spigot().sendMessage(format);```
#

result:

sage dragon
#

How do I properly calculate the position of chunk coordinates again?

Was this enough?

chunk.getX() >> 16
quaint mantle
#

i think its 4

sage dragon
#

Yeee, it's 4, my mistake

vivid cave
#

is there a function to paginate a string into book pages ?

#

so they don't get truncated or smth

flint coyote
#

I made one myself - it ain't perfect though. Also since a texturepack changes the text size and books are entirely clientside it only works with the default font

#

So no, there ain't one in spigot

vivid cave
#

okioki

flint coyote
vivid cave
#

yeah ofc

#

i think i'll give up the idea its not that important anyway

flint coyote
#

If you would want to make one (for the default font) the size of the letters is on the wiki

jagged quail
#

hggghhhf

trim lintel
# drowsy helm what is the bug?

Client side bug, after setType of this block to bedrock and again diamond_ore my pickaxe with dig speed 30 act like a normal safe dig speed 5

flint coyote
trim lintel
#
@EventHandler
    public void blockBreak(BlockBreakEvent event) {
        Block block = event.getBlock();
        if (block.getType() != Material.DIAMOND_ORE) {
            return;
        }
        event.setCancelled(true);
        lifeBlockGame.removeHP(1);
        if (lifeBlockGame.getHp() > 0) {
            block.setType(Material.DIAMOND_ORE);
        } else {
            block.setType(Material.BEDROCK);
        }
    }```
simple listener 

and replace from bedrock method

private void addHP(int hp) {
int newHP = this.hp + hp;
if(this.hp <= 0 && newHP > 0){
this.getBlockLocation().getBlock().setType(Material.DIAMOND_ORE);
}
this.hp = this.hp + hp;
}

flint coyote
#

?paste

undone axleBOT
onyx fjord
#

is there an event that runs when new day starts?

flint coyote
frigid rock
#

are H2 databases good? should i use something else? (i just gotta store to some player UUID an id and a balance)

vivid cave
icy beacon
flint coyote
sterile breach
#

Hi, caffeine is good for caching ans database optimisations ?

ivory sleet
#

Yeah

#

Using it professionally atm

sterile breach
#

I come back yesterday where I was looking for a way to optimize my results, I finally turned to caching, when a player connects, I recover his data and the stock in cash with caffeine, and when the player disconnects I send them to the database. Also I would like to add a system that automatically sends data to the database every 15/20 minutes, so with a dozen players connected, this would involve a dozen requests to the database in a short time, its risk generate lag or is it nothing? (Or else send them gradually?)

eternal night
#

as long as you are off the main server thread you are good

sterile breach
#

How to know?

ivory sleet
#

That’s a good question

sterile breach
#

And my my methode using cafeine is good ?

ivory sleet
#

Usually you’d use java std classes to deal with concurrency

#

I mean caffeine is just really nice for soft, weak and expiring caches

#

if u just need a data sync buffer u dont need caffeine

sterile breach
#

you mean caffeine is only good for storing little things?

quaint mantle
#

If you have a lot of connections modifying data, you may gonna have a problem.

sterile breach
icy beacon
#

we all need a little EUFUP in our life

orchid gazelle
#

or USP

icy beacon
#

d?

orchid gazelle
#

User Stupidity Protection

icy beacon
#

yep usp it is

orchid gazelle
#

or UDNP for User Dumbness Protection

#

Dumbness sounds funnier

icy beacon
#

why not just udp?

orchid gazelle
#

well that short already exists lol

icy beacon
#

fair enough

orchid gazelle
#

thats a protocol

icy beacon
#

oh ye

orchid gazelle
#

coffeine always good

ivory sleet
#

If u just wanna sync ur data with ur db every x period

#

Then u dont need caffeine

#

As said

torn shuttle
#

man

ivory sleet
#

If u have data that should be removed automatically after a while then go with caffeine

orchid gazelle
#

woman

torn shuttle
#

I just had a great idea that I don't have time to make

#

server LOD

icy beacon
#

look of disapproval?

torn shuttle
#

load in chunks beyond a certain threshold as hollow, culling anything that is not the outermost block that might be visible

quaint mantle
ivory sleet
#

What?

#

Are we talking about the same caffeine?

quaint mantle
#

My autocorrector💀

vivid cave
#

i'm talking about cocaine bro

haughty pewter
#

Hi, is it possible to make script so in specific season the leaves and grass color changes?

young knoll
#

Yes but you’ll need NMS

sterile breach
# ivory sleet Then u dont need caffeine

i need it to get some info about the user when he logs in, the problem is that i need info from each user every time a chat is sent so dealing with direct requests is really not optimizes but otherwise I could have just made a hashmao where I store the player and the data but doing with caffeine is always better I imagine?

orchid trout
#

is it possible to remove that box? it really throws me off

quaint mantle
orchid trout
haughty pewter
quaint mantle
#

Hmm

young knoll
haughty pewter
#

ok now i cnow why there almost no season plugins :)

young knoll
#

It’s actually fairly easy to make if you know your way around NMS and packets

haughty pewter
#

"easy to make if you know" :)

orchid trout
#

lt?

haughty pewter
#

mm

#

jo

orchid trout
#

cepelinas

haughty pewter
#

? :D

green plaza
#

?paste

undone axleBOT
tribal valve
#

How i can give player an item when user used a discord bot command

green plaza
#

Nevermind tho

tribal valve
#

How to connect jda with spigot without breaking the plugin

icy beacon
#

waht's the problem

#

it shouldn't break

tribal valve
#

Yea just asking how to connect it, like how to initialize discord bot

icy beacon
#

like how to init jda?

tribal valve
#

But like where? To onEnable?

icy beacon
#

i mean yeah you want your bot to enable when your plugin does right???

tribal valve
#

Yea

#

And also how to add it to the plugin? Cuz like with the build? Or what

icy beacon
#

it's just a maven dependency

#

it's not that deep

tribal valve
#

I don't use maven

#

I will

young knoll
#

You can shade it or libraries feature it

icy beacon
#

or gradle

#

it's a gradle dep for you then

#

doesn't matter

tribal valve
#

But like how to add it to the plugin? So like it's full in one plugin??

spare hazel
#

why am i dividing by zero here? Math.max(((double) woodcutting.getXp()) / (woodcutting.getStarterXp() * woodcutting.getLevel()), 1.0)

skill abstract:

public abstract class Skill {
    private static int STARTER_XP;

    private int level;
    private int xp;

    private static double damageRewards;
    private static double healthRewards;
    private static double defenseRewards;
    private static double moneyRewards;

    public boolean calculateLevelUp(){
        if(xp > (STARTER_XP * level)){
            xp = xp - (STARTER_XP * level) ;
            level++;
            return true;
        }
        return false;
    }

    public int getStarterXp() {
        return STARTER_XP;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getXp() {
        return xp;
    }

    public void setXp(int xp) {
        this.xp = xp;
    }

    public double getDamageRewards() {
        ...
    }

    public double getHealthRewards() {
        ...
    }

    public double getDefenseRewards() {
        ...
    }

    public double getMoneyRewards() {
        ...
    }

    public Map<String, Object> serialize(){
        return Map.of(
                "level",level,
                "xp",xp
        );
    }

}

a skill class for refrence:

public class Woodcutting extends Skill implements ConfigurationSerializable {
    public static int STARTER_XP = 50;

    private int level = 1;
    private int xp = 0;

    private static double damageRewards = 0;
    private static double healthRewards = 1;
    private static double defenseRewards = 0.1;
    private static double moneyRewards = 100;

    public Woodcutting deserialize(Map<String, Object> m){
        return new Woodcutting(m);
    }

    public Woodcutting(Map<String, Object> m){
        xp = (Integer) m.get("xp");
        level = (Integer) m.get("level");
    }

    public Woodcutting(){}

}
undone axleBOT
icy beacon
#

use this please

icy beacon
#

just add it as a dependency in your dependency manager

#

and work with it

spare hazel
#

that website doesnt work for me

icy beacon
#

then pastebin

#

or a thread

#

but not a text wall

spare hazel
#

why am i dividing by zero here ```Math

icy beacon
#

oh my fucking god this does not help at all but ok that's effort

tribal valve
#

To the project

icy beacon
#

dude

#

what dependency manager are you using

tribal valve
#

Maven

icy beacon
#

so just

young knoll
#

Use the maven shade plugin

icy beacon
#

add it

#

as a

#

dependency

tribal valve
#

But you have to download the jar right?

icy beacon
#

no

tribal valve
#

Just the dependency? Maven already has it??

icy beacon
#

maven will download it to your local repository when you first prompt it

#

after that, this version of this dependency will stay present in your local repo until you delete it

tribal valve
#

Okay, and it will add to my jar?

icy beacon
#

no it will actually delete your system files

tribal valve
#

Damn

#

Then no

#

I'm gonna just remove the plugin

rough ibex
#

what

icy beacon
#

??????????

#

i'm fucking sobbing throw the whole discord server away

tribal valve
#

You're right

sleek estuary
tribal valve
#

If you did, it would probably drop or go into inventory

#

But idk

echo basalt
icy beacon
#

most likely slot 0 won't work

echo basalt
#

and InventoryClickEvents

icy beacon
#

1-4 probably too

sleek estuary
echo basalt
#

on bukkit, 0-9 is hotbar

icy beacon
#

what about armor and offhand item?

sleek estuary
echo basalt
#

second hand is 40

icy beacon
#

so armor 41-44?

echo basalt
#

armor is 36 - 39

icy beacon
#

oh

#

oh wait

echo basalt
#

helm is 39 pretty sure

icy beacon
#

yeah makes sense

#

alr tyty

#

good thing i didn't test my code yet

sleek estuary
#

i want set items or if a player join (i think that is impossible) or if a player open the inventory

icy beacon
#

because i use these slots too lol

echo basalt
#

This is the slot map for Inventory#setItem / Inventory#setContents

icy beacon
#

oo

echo basalt
#

41-45 is the crafting grid but it's icky

icy beacon
#

so crafting is out of the question

echo basalt
#

This is somewhere on the protocol

#

and bukkit does conversion in the middle at some point

#

I don't remember where

#

when storing to nbt they set the slot as something stupid as well

#

just a shitshow

#

mhm who the fuck wrote this

sleek estuary
#

😂

icy beacon
#

?arrowcode for them

undone axleBOT
icy beacon
#

actually

#

even better

sleek estuary
#

@echo basalt Any suggestions?

#

I'm using Bukkit 1.8.8

icy beacon
#

oh

#

?1.8

undone axleBOT
icy beacon
#

i love 1.8.8 as a playing version

#

but its api is a shithole

sleek estuary
tribal valve
echo basalt
icy beacon
#

i used to code in 1.8.8 when i just started

echo basalt
#

me when 1.8

icy beacon
#

and i probably will to do it again

#

but i won't enjoy it

echo basalt
#

haven't touched 1.8 in a long while and I'm so happy

icy beacon
#

yeah it feels good to have an actually usable api

sleek estuary
#

but my server has to be for 1.8 xd

icy beacon
#

i understand you and i'm sorry for you

ancient plank
#

I started with 1.16.5 but the first server I worked with was 1.12.1 so I was using that for a bit, and just recently the server I now work with updated to 1.18 very epic

sleek estuary
#

Rust no longer has an audience in Minecraft, imagine if it is not 1.8 haha

ancient plank
#

I can finally use higher java versions

icy beacon
#

why arbitrarily 1.12.1? thought 1.12.2 was the standard for 1.12.* versions 😄

quaint mantle
#

I have permissions Vagt but why dosent the menu open? because if i have permission * it opens fine

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can do this");
            return false;
        }
        Player player = (Player) sender;


        if(player.hasPermission("vagt")) {
            if(player.getWorld().getName().equalsIgnoreCase("A")){
                new VagtshopA().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("B")){
                new VagtshopB().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("C")){
                new VagtshopC().open(player);
        }else{
                sender.sendMessage("You dont have permission for this.");
            }
        }

        return true;
    }
}
icy beacon
#

indent your code correctly

echo basalt
#

wait wha

icy beacon
#

yeah

#

you're confuseD? i am confused

echo basalt
#

where did that } come from

#

Ctrl + Alt + L

icy beacon
#

or hold ctrl alt i

#

to just fix indents

#

i'm curious

ancient plank
icy beacon
ancient plank
#

That weren't there in 12.1

icy beacon
#

is this clear now 00000000000000000?

#

what is your world name?

spare hazel
#
HypixelSkillCore-1.0.jar, MorePersistentDataTypes-2.3.1.jar define 1 overlapping resource: 
  - META-INF/MANIFEST.MF
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
```this doesnt break anything but its annoying me. any way to fix it?
mortal hare
#

Man its so annoying

#

i have person

#

who rejects my changes

#

of a product in development

#

because it alters the previous code

#

LIKE wtf

#

we are developing

#

not releasing shit yet lmao

#

why bother making backwards compatibility to the broken code

#

ffs

icy beacon
#

i just made an entire commission worth 3 Word pages without testing anything, place your bets whether it will even launch lmao

#

ok it didn't compile

#

one sec

#

there we go

quaint mantle
#

I have permissions Vagt but why dosent the menu open? because if i have permission * it opens fine

public class VagtshopCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can do this");
            return false;
        }
        Player player = (Player) sender;


        if(player.hasPermission("vagt")) {
            if(player.getWorld().getName().equalsIgnoreCase("A")){
                new VagtshopA().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("B")){
                new VagtshopB().open(player);
            } else if(player.getWorld().getName().equalsIgnoreCase("C")){
                new VagtshopC().open(player);
        }else{
                sender.sendMessage("You dont have permission for this.");
            }
        }

        return true;
    }
}
icy beacon
#

read above dude

icy beacon
#

instead of spamming create a discord thread or a spigot thread

quaint mantle
#

I dont get any of these errors?

icy beacon
#

the errors don't have to do anything 😭

#

look carefully at the if-statement

#

very carefully

quaint mantle
#

Its because your is red so i though it was errors

icy beacon
#

i am not talking about the errors

quaint mantle
#

Okay sorry

worldly ingot
#

You're missing a closing bracket

#

Or, rather, your indentation is wrong so you're failing to see that your else is on the wrong if/elseif chain

icy beacon
#

^

#

this is why early returns are a good practice

#

?arrowcode

undone axleBOT
worldly ingot
#

In your IDE you should be able to auto indent (in Eclipse it's Ctrl + I I believe, but there may be a Shift in there too) which would pretty easily identify the problem

keen birch
worldly ingot
#

Probably not. I'm not super familiar with BC

icy beacon
#

anybody knows free postgresql hostings? need one for testing

#

i've never done postgre before 😄

#

ok i think i found one question mark

mortal hare
#

cmoonnn

#

why liquibase i so annoying

sleek estuary
icy beacon
sleek estuary
#

ok

icy beacon
#

then try 36-39??

sleek estuary
icy beacon
#

look like it is not possible then

sleek estuary
#

but it has servers with it

#

player.getOpenInventory().setItem(0, new ItemStack(Material.DIAMOND));

so it "works", but the code is only called if you open an inventory and then open another inventory through the open inventory.

icy beacon
#

oh my fucking god does anybody know a free postgresql hosting imma go insane soon

hazy parrot
#

why not host it locally

icy beacon
#

i am using a very cheap minecraft hosting

#

not vps

#

unfortunately

#

i tried elephantsql but it for some reason wouldn't load, heroku wouldn't let me sign up and threw errors at me, aws doesn't support accounts from russia

#

what the fuck do i do

frigid rock
#

should i use pdc instead of a db?

icy beacon
#

depends

#

what are you doing

frigid rock
#

storing a balance, discord id, skill level etc...

icy beacon
#

if you don't want to account for potential multiserver support you can use pdc

hazy parrot
#

do you need to access those data if player is offline ?

icy beacon
#

oh right

frigid rock
#

oh actually yeah i forgot

icy beacon
#

tbh just use a db, cache everything you can and you should be ok

#

fuck it i'm hosting postgresql locally

#

my pc will die after i exhaust all the ram

#

but it's ok

#

stuff dies

frigid rock
#

i'm probs gonna use H2

quaint mantle
#

the launch screen:

#
  • looks good, seems pretty up to date
#

and then u get this ui

#

what the hell is this

icy beacon
#

lmaoo

#

ikrrr

frigid rock
#

LOL

quaint mantle
#

bro it looks like im using windows 1 paint or smt

icy beacon
#

nice summary of eclipse

#

intellij idea launch screen:

#
  • seems good, very professional
#

and then you get this

quaint mantle
quaint mantle
icy beacon
#

it's idling

mortal hare
icy beacon
#

😭

#

it's FUCKING IDLING!!!!!!!

shadow night
quaint mantle
mortal hare
#

that's cyrillic lol

shadow night
#

no, not alphabet

#

font

tacit drift
frigid rock
#

yo guys do u think that contabo is good for a small community server?

tacit drift
#

👹👹

shadow night
#

there is a difference between a font and an alphabet

icy beacon
#

i changed it with winaero

#

a couple years ago

shadow night
#

okay

mortal hare
#

oh i thought that's default one

tacit drift
icy beacon
quaint mantle
#

i like the new look of the intellij UI tho, looks clean

shadow night
#

I can read cyrillic so I must know that that is cyrillic lol

quaint mantle
frigid rock
mortal hare
#

i like new intellij design too

#

sure hamburger menu is annoying

tacit drift
#

Yeah there is a free oracle cloud compute instance that's pretty capable

mortal hare
#

but hey everything is where you expect it to be

echo basalt
#

oracle cloud is pretty much free

quaint mantle
#

me instantly when i download a new intellij version:

echo basalt
#

I use it for reposilite

quaint mantle
#

bro when are they adding plugins to fleet??? i want that shit, looks like vs code but then i can still use my github student license

#

that theme sucks

#

but its from the website

icy beacon
#

this looks fancy

#

fleet

#

is that an ide?

quaint mantle
icy beacon
#

never heard of it

#

o

quaint mantle
mortal hare
icy beacon
#

oooo

mortal hare
#

im hyped for it

icy beacon
#

i'm interested

mortal hare
#

its AIO IDE

#

basically

quaint mantle
#

just once they add plugins imma use it

frigid rock
#

ayo that looks fancy

mortal hare
#

but tbh idk how they would market this

echo basalt
#

yeah fleet has no copilot

icy beacon
mortal hare
#

it would prob be very expensive

echo basalt
#

they market it as a vs code killer

mortal hare
#

anything without electron for me is vs code killer

quaint mantle
#

it sucks rn, but plugins would make it alot better

mortal hare
#

Sublime text gang

frigid rock
quaint mantle
#

oh shit i have to leave for work in 10 minutes

#

i needa get dressed

mortal hare
#

nice example liquibase

echo basalt
#

imagine needing to get dressed for work

#

Well I am dressed for my job

mortal hare
#

when correct example is

echo basalt
#

using my minecraft tshirt atm

icy beacon
#

fancy

#

show us

quaint mantle
#

fancy

mortal hare
#

i wear creeper shirt btw

echo basalt
#

wither

#

I also have a creeper tshirt that idk where I put

icy beacon
#

incredibly fancy

#

do you have a diamond sword?

echo basalt
#

uhh

#

don't think so

icy beacon
#

😦

quaint mantle
echo basalt
#

gotta shave it's a bit too big

#

but yes I'm not a toddler anymore

#

I got stuff just not a sword

icy beacon
#

damn

quaint mantle
#

light the tnt no balls

icy beacon
#

TRUE

quaint mantle
#

he got the minecraft sky phone/tablet

glad prawn
#

xd

young knoll
#

Only 3?

cinder abyss
#

Hello, I have a spigot maven multi-modules project, how can I make a jar of the modules, including other modules ?

#

look like this : (alot is the where my plugin is, I want api and nms_v16 to be included in alot's jar)

glad prawn
cinder abyss
#

okay thanks

icy beacon
#

wow turns out debugging is actually fun when the server doesn't take 50 seconds to boot up

shadow night
#

kinda true

#

can still be pain

icy beacon
#

it is

#

but less

shadow night
#

yeah

#

my servers take from 10 to 30 seconds to boot up

#

idk how to fix that, 1.8 booted up from 5 to 15 seconds

echo basalt
#

get a better cpu and put less plugins on it

#

less bloat = faster

eternal oxide
#

and HD speed

shadow night
eternal oxide
#

disable nether and End

shadow night
#

already

eternal oxide
#

don;t keep spawn in memory

echo basalt
#

try to see what's stalling the process

#

I've had plugins hang startup for 3 minutes straight

#

optimized it a little and took maybe 3ms to load

shadow night
#

my server has only 3 plugins and they all take like no time to load

#

and it's a testing server anyways

upper hazel
#

hi

shadow night
#

hi

upper hazel
#

what this - placeholders?

#

in bukkit ap

#

i

glad prawn
#

wat

upper hazel
#

guys who knows if it is possible to make the commands of other plugins (including vanilla commands) multi-server. That is, I wrote a command on 1 server and it was executed on all

drowsy helm
#

It’s definitely possible

#

Just use channel messaging

upper hazel
#

bungee?

drowsy helm
#

Yeah

upper hazel
#

how much can such a plugin cost to order, where absolutely all the commands that you want can be run for a multi-server

drowsy helm
#

Ask on ?services

#

Cant imagine it being more than 30usd

upper hazel
#

У меня есть рубли, что представляют собой эти 30 долларов? Что для вас якобы чашка кофе равна стоимости потребления?

#

I have rubles how do these 30 dollars represent? For you, what is supposedly a cup of coffee equal to the cost of consumption?

#

give an example of not money pls

tender shard
upper hazel
#

give an example on the amount of bread, how much bread can you buy for 30 dollars?))

shadow night
#

Uhmm

drowsy helm
#

Just use a currency converter

shadow night
#

Idk how much bread you get for 30 usd

upper hazel
#

oh my god 2 k

#

this math

#

or not

#

hmm

#

i think this small

#

maybe 50 dollars

#

))))

zealous osprey
worldly ingot
#

Also depends on the type of bread, its quality, and where you buy it KEKW

#

OR if you buy the ingredients yourself and make dozens of loafs of bread!

shadow night
#

How much is a dozen? Forgot

upper hazel
#

lol

worldly ingot
#

12

shadow night
#

Hmm

#

Like french douze?

worldly ingot
#

Yes

zealous osprey
#

Bakers dozen is 6; I thaught

worldly ingot
#

Just to throw a wrench in your logic, a baker's dozen is 13

zealous osprey
#

.-.

shadow night
#

What

zealous osprey
worldly ingot
#

Old timey reasoning lol

eternal oxide
#

A bakers dozen is 13 because they would always bake one extra to test

worldly ingot
#

Mhmm

#

Snack for the chef

orchid gazelle
#

a dozen is 12

worldly ingot
#

Man there's an echo in this Discord. Weird

orchid gazelle
#

Hi Choco

river oracle
upper hazel
#

guys, I don’t understand one person, he ordered a plugin for a horse and wants the horse to have a menu that displays the characteristics of the horse, but he wants to do it through the deluxe menu, he thinks that my plugin can be connected to his plugin through placeholders, I don’t understand what he wants to do

hazy parrot
#

i would advise you to ask your customer for clarification

#

but ig placeholder api

worldly ingot
#

That, yeah, but they're probably just wanting PlaceholderAPI support

echo basalt
#

I remember having a commission like that a couple years back

#

but the dude was such a simp that the moment his gf tried to "prove me wrong" he just blocked me

#

(she was having internet issues)

pseudo hazel
#

can you put tab completion in the same class as the command executor?

worldly ingot
#

Yes

zealous osprey
#

implements TabExecutor

worldly ingot
#

There's actually a convenience interface, TabExecutor, which is just both a TabCompleter and CommandExecutor

zealous osprey
#

^

worldly ingot
#

¯_(ツ)_/¯

pseudo hazel
#

oh

#

awesome thanks

upper hazel
#

look, there is a horse with properties from my plugin, for example, it can swim, etc. but he also wants a menu for the horse, but he wants to make this menu I quote - "through my placeholders" so he will link the menu from the deluxe menu to my plugin but I don't understand how he the horse itself will receive

#

end what he want wth

fluid river
#

cringe

tender shard
#

yes

fluid river
#

sheiiit

tender shard
#

it's just interface TabExecutor extends CommandExecutor, TabCompletor

fluid river
#

yeah i just found it on javadocs

worldly ingot
fluid river
#

which version added this feature?

worldly ingot
#

It's been around for a while

upper hazel
#

clas

#

s

worldly ingot
#

2013 if you want specifics

fluid river
worldly ingot
#

Oh, prior actually

#

2012

tender shard
#

everything before 1.8 may officially be called "was there since forever"

fluid river
#

true

upper hazel
#

i would advise you to ask your customer for clarification
but ig placeholder api" - i dont undestand how he will bind my plugin to deluxMenu without using deluxMenu api on my end

hazy parrot
#

you would be using PAPI and deluxmenu also uses PAPI

scenic onyx
#

UUID uuid = player.getUniqueId();
String playerName = player.getName();
WrappedGameProfile gameProfile = new WrappedGameProfile(uuid, playerName);
gameProfile.getProperties().put("textures", new WrappedGameProfile.Property(
"textures",
"eyJ0aW1lc3RhbXAiOjE1MTMyMDI4NjkwMjIsInByb2ZpbGVJZCI6ImJmOGU0ZDFlZDU1YzRjMGE4YzYwZDhmZTg2ODlhZmM1IiwicHJvZmlsZU5hbWUiOiJBbGV4Iiwic2lnbmF0dXJlUGF0aCI6IjE0NjI4YTJjNDkzOTY2ZmJhYmU0ZThkY2JhOTU0ZDU3IiwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vMTIzNDU2Nzg5MDEyMzQ1Njc4OS5yZWZlcnJlc2guY29tL3V0aWxpdHkvdGV4dHVyZXMvZTM0MDkwMzY3ZTIyM2MxNjFjYmRjNDdjYWI2MTM0OTFkY2Q5Zjc5Mjk2MzFmMjk2ZjE3NzllZmJiOTRkODNjMyJ9fX0=",
"LdxfyGxK/x4FfFkoH3BcsurGsbI0nX3EBLOByZcT0nkgW3InJttwUJBoQelY0hyCj8AbhhTPZ5AdLlJ/K2FqEsA04wB9nggKmraN/J7wyi5wMg9J1Nj7TnF6BK+g7w2+2G1/3iavzkT2oDPQPN2cJPXVi6XJ7XnbPqxqR0jVd5eXnKlgJ0v/3zkWamXU99KdXZP66B37qQQ5eH0w/tvmyxdAb9wEgfFppldSHtUD/MTffO7rKUMVnQgXZGeBClN6izcBb+xkoo8zC5jN3m6g/YQyObuH+7b0Dw8umMrHbckYmXWx01+0hC9iNwz/wFZ3HJFgLH1rVh8sWxOMzgOaXjLgdWhnIW6xLhkvOcUAKyhuDyUqzeH/QbZJh8noLkLqz7gPip7YRzB3UEixtv20fWqZ5Q7OlT33FLd9oCK8Cx2op7rWsYp/bhYXfCZLMCHyffsOadYTVhcyLJyL+D0eUuU9h1LJW3bLs4OnLQrPGkmTF9U0QxkIfFhDItjjrXeQWYP5Wgl0eJeK8hK0pAj8lUSojdZGLnnJ+5MdIQi+grIKO79n3ZDtbdt8uU2/3RO+7lPbCWhPShRuzVBhT3W8aD3ec5DFk8DQ4InnM8xGcxr6vWxvHnA5whUPXrjNTsxvKuLxZ6X5Pi9ITs1M+3iBmVY="
));
get errorProperty! Cannot resolve symbol 'Property'

eternal oxide
#

lowercase p

scenic onyx
eternal oxide
#

actually does it even need the WrappedGameProfile?

#

I thought it just took two strings

scenic onyx
#

i resolve

#

i use skin restore

pseudo hazel
#

its difficult

#

idk if skript is open source but thats probably close to what you want

#

wdym by with a command

#

well thats easy

#

just make a custom command

open lily
river oracle
#

Papapapapapa paper!!!!!

#

I wish I could read this on phone

river oracle
fluid river
#

make config value a boolean and check if else 🙂

spare hazel
#
[22:12:31] [Server thread/INFO]: xX_Laya_Xx issued server command: /skt
[22:12:31] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'skt' in plugin HypixelSkillCore v1.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:790) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1141) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.util.thread.IAsyncTaskHandler.executeAll(SourceFile:110) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1124) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1054) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.TreeMap.floorKey(Object)" is null
        at com.amirparsa.hypixelskillcore.Utils.RomanNumber.toRoman(RomanNumber.java:31) ~[?:?]
        at com.amirparsa.hypixelskillcore.Commands.SkillsTextCommand.onCommand(SkillsTextCommand.java:21) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[server.jar:3284a-Spigot-3892929-0ab8487]
        ... 19 more
[22:13:11] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 5172ms or 103 ticks behind

any pieces of code that is needed to fix this will be provided

kind hatch
#

Yea, a null check.

spare hazel
alpine urchin
#

tf

echo basalt
eternal night
#

retrooper confirmed propaganda spreader

open lily
#

but Y2K_ helped me already with this issue

spare hazel
open lily
#

Provide SkillsTextCommand code

spare hazel
#

it is disgustin but ok

#
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
        if(!(sender instanceof Player)) return true;

        HypixelPlayer playerAccount = HypixelSkillCore.getInstance().getPlayer(((Player) sender).getUniqueId());

        sender.sendMessage(ChatColor.YELLOW + "" + ChatColor.BOLD + "Farming " + ChatColor.AQUA + RomanNumber.toRoman(playerAccount.getFarming().getLevel()) + ChatColor.DARK_GRAY + " " + playerAccount.getFarming().getXp() + "/" + (playerAccount.getFarming().getStarterXp() * playerAccount.getFarming().getLevel()));
        sender.sendMessage(ChatColor.GRAY + "" + ChatColor.BOLD + "Mining " + ChatColor.AQUA + RomanNumber.toRoman(playerAccount.getMining().getLevel()) + ChatColor.DARK_GRAY + " " + playerAccount.getMining().getXp() + "/" + (playerAccount.getMining().getStarterXp() * playerAccount.getMining().getLevel()));
        sender.sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD + "Woodcutting " + ChatColor.AQUA + RomanNumber.toRoman(playerAccount.getWoodcutting().getLevel()) + ChatColor.DARK_GRAY + " " + playerAccount.getWoodcutting().getXp() + "/" + (playerAccount.getWoodcutting().getStarterXp() * playerAccount.getWoodcutting().getLevel()));
        sender.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Combat " + ChatColor.AQUA + RomanNumber.toRoman(playerAccount.getCombat().getLevel()) + ChatColor.DARK_GRAY + " " + playerAccount.getCombat().getXp() + "/" + (playerAccount.getCombat().getStarterXp() * playerAccount.getCombat().getLevel()));
        //sender.sendMessage(ChatColor.BLUE + "" + ChatColor.BOLD + "Fishing " + ChatColor.AQUA + RomanNumber.toRoman(playerAccount.getFishing().getLevel()) + ChatColor.DARK_GRAY + " " + playerAccount.getFishing().getXp() + "/" + (playerAccount.getFishing().getStarterXp() * playerAccount.getFishing().getLevel()));


        return true;
    }
open lily
#

Can you show the RomanNumber#toRoman stuff?

spare hazel
#
/*
Copied from Stackoverflow
*/

public class RomanNumber {

    private final static TreeMap<Integer, String> map = new TreeMap<Integer, String>();

    static {

        map.put(1000, "M");
        map.put(900, "CM");
        map.put(500, "D");
        map.put(400, "CD");
        map.put(100, "C");
        map.put(90, "XC");
        map.put(50, "L");
        map.put(40, "XL");
        map.put(10, "X");
        map.put(9, "IX");
        map.put(5, "V");
        map.put(4, "IV");
        map.put(1, "I");

    }

    public static String toRoman(int number) {
        int l =  map.floorKey(number);
        if ( number == l ) {
            return map.get(number);
        }
        return map.get(l) + toRoman(number-l);
    }

}
fluid river
#

general-2 first visitor in last 2 years

fluid river
#

show your project structure and full error log

vivid cave
#

yo gamers, is there an event for "on player swap hand out of inventory"

spare hazel
quaint mantle
spare hazel
#

/*
Copied from Stackoverflow
*/

quaint mantle
#

yes thats why i said it

open lily
fluid river
#

cuz floorKey