#help-development

1 messages · Page 315 of 1

slow arrow
#

it simply is

hybrid spoke
#

minecraft is a nice visualization of what youve just done

hasty prawn
#

I learned them at the same time simply because its easier to have ideas for making MC plugins

#

When you're doing basic Java you're kinda stuck with messing with the console or using Swing/JavaFX

remote swallow
#

i learnt both at the same time

hybrid spoke
#

you just shouldnt rely too much at the api itself

remote swallow
#

very much regret it

hybrid spoke
#

otherwise you cant think of something else than the api when you think of java

#

and once you have no api anymore, you wonder where the player go

#

and how to make a listener

#

"where's my onEnable?"

hasty prawn
#

Oh god

hybrid spoke
#

every selftaught spigotier once was at that point

keen mantle
#

Officialy spigotmc tuts are cringe?

hybrid spoke
#

they are just too bad to contribute to that

tender shard
#

well there is no official tutorial

#

everything on the spigot wiki was written by members

#

hence the name "wiki" lol

tardy delta
#

youtube 🙏

tender shard
#

I currently got this to parse an XML that looks like this:

public class ArchetypeMetadataParser {

    @Getter List<RequiredProperty> requiredProperties = new ArrayList<>();

    public ArchetypeMetadataParser(File archetypeMetadataFile) throws ParserConfigurationException, IOException, SAXException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document document = builder.parse(archetypeMetadataFile);

        NodeList propertiesNodeList = document.getElementsByTagName("requiredProperty");

        for(int i = 0; i < propertiesNodeList.getLength(); i++) {
            RequiredProperty property = RequiredProperty.fromNode(propertiesNodeList.item(i));
            if(property != null) {
                requiredProperties.add(property);
            }
        }
    }
}
#

I don't like this solution since my current code would also get <requiredProperty> tags from OUTSIDE of <requiredProperties>

#

Is there any way to get only the children of <requiredProperties> instead of from the whole document?

#

preferrably without XPath, but with the normal org.w3c.dom / javax.xml stuff?

#

basically, I only wanna get the green ones, not the red one

humble tulip
#

See if it's requiredProperties

#

@tender shard why don't you get requiredProperties and then get the children?

tender shard
#

Granted, that should never happen

humble tulip
#

Check that the length is 1

#

Else errorrrrr

tender shard
#

Yeah thats a good idea

keen mantle
#

Should I learn Kotlin or java for spigot dev?

remote swallow
#

java

primal goblet
#

how to teleport the player synchronously?

remote swallow
#

player.teleport?

keen mantle
hybrid spoke
#

kotlin sucks

#

be a cool kid, do java

tardy delta
#

cuz kotlin looks cursed

remote swallow
# keen mantle why

pretty much everyone here uses java, you would be able to get help a lot easier

primal goblet
humble tulip
#

?scheduling

undone axleBOT
humble tulip
#

@primal goblet

hybrid spoke
keen mantle
#

what, kotlin has no access modifier of function/method?

#

bruh

#

BRUH

tardy delta
#

its just fun myMethode

remote swallow
tardy delta
#

why would it need it

primal goblet
#

so i have to do

new BukkitRunnable(){
  run(){
    // teleportThePlayer?
  };
}.runTask();
``` ?
tardy delta
#

are you in an async context?

hybrid spoke
#

only if you arent already on the main thread

humble tulip
#

If you're already async

keen mantle
#

i seem kotlin is easier and sucker

#

xD

tardy delta
#

and for the sake of god dont create a bukkitrunnable but use the scheduler

humble tulip
#

If you're not async you can just do player.teleport

primal goblet
#

thats what the anticheat told me to do cuz when i use player#teleport it gives me false info so banned members for no reason

hybrid spoke
#

be a cool kid, use java

keen mantle
#

ok

hybrid spoke
humble tulip
#

kotlin is confusing

#

In java if you want something to be a certain way, you do it yourself

#

In kotlin, things are there by default and you need to disable it

#

Altho some things in kotlin are nice

#

Like null safety

hybrid spoke
#

optionals, defaults and placeholders goes brrr

tender shard
primal goblet
#

xd

tender shard
#

no

#

but it's an easy way to use async features on paper without breaking support for spigot

minor garnet
#

can someone tell me if it is possible to make the zombies not raise their hand when they see the player?

tender shard
#

then you need NMS and remove the "raise hands" goal, if there is any

#

if there is none, you gotta rewrite the attack goal and only remove the raise hands part

minor garnet
#

then you need NMS, do you mean make a custom entity?

tender shard
#

no

#

you can remove the "raise hands" goal from an existing entity

#

basically, you get the NMS entity like this:

#
((CraftZombie)zombie).getHandle()
#

and then you have an NMS zombie

#

that one has a public field "goalSelector"

remote swallow
#

we dont have any casting format

tender shard
#

and then you look for the raise hands goal and remove it

remote swallow
#

someone go email discord

minor garnet
remote swallow
#

thats java formatted codeblock

#

and discord dont format casts

tender shard
#

when they spawn

#

if you wanna permanently remove it

#

after server restart, it'll be back though

#

yeah then, listen to EntitySpawnEvent and remove it there

#

do you use mojang mappings?

#

because if not, you're gonna have a bad time

remote swallow
#

?nms a cough cough

keen mantle
#

?learnjava

undone axleBOT
keen mantle
#

?leanjava!

#

?learnjava

undone axleBOT
keen mantle
#

?learnjava!

undone axleBOT
remote swallow
#

why?

tender shard
#

and what is calling this method?

#

probably some ai goal

keen mantle
#

eclipse or intelij

remote swallow
topaz cape
#

didn't work out

formal jolt
#

Hello i'm trying to do some custom smithing recipe and i need to check inside PrepareSmithingEvent if my recipe is correct otherwise i can't get my item with custom name and AttributeModifier
In my recipe i use a custom item and i try to use isSimilar to compare the current itemStack in the inventory with an other ItemStack comming from an Enum but isSimilar return false.

Here it is what i get when i print the two ItemStack and the two itemMeta:

#

I dont understand why isSimilar is false

tender shard
formal jolt
#

I know but the result get his name and attribute erased cause smithing table take them from the source item

tender shard
#

oh huh, it always worked fine for me

minor garnet
formal jolt
#

Here some of my code:

public static void registerRecipe(){
        ShapedRecipe ChromatinScrapRecipe = new ShapedRecipe(new NamespacedKey(Main.instance,"chromatin_crap"), CUSTOM_ITEMS.CHROMATIN_SCRAP.getItem());
        ChromatinScrapRecipe.shape(" X ","YZY"," X ");
        ChromatinScrapRecipe.setIngredient('X', Material.IRON_BLOCK);
        ChromatinScrapRecipe.setIngredient('Y', Material.DIAMOND_BLOCK);
        ChromatinScrapRecipe.setIngredient('Z', Material.NETHERITE_INGOT);
        Bukkit.addRecipe(ChromatinScrapRecipe);

        ShapedRecipe ChromatinShardRecipe = new ShapedRecipe(new NamespacedKey(Main.instance,"chromatin_shard"), CUSTOM_ITEMS.CHROMATIN_SHARD.getItem());
        ChromatinShardRecipe.shape(" X ","XYX"," X ");
        ChromatinShardRecipe.setIngredient('X', new RecipeChoice.ExactChoice(CUSTOM_ITEMS.CHROMATIN_SCRAP.getItem()));
        ChromatinShardRecipe.setIngredient('Y', Material.AMETHYST_SHARD);
        Bukkit.addRecipe(ChromatinShardRecipe);

        SmithingRecipe ChromatinSwordRecipe = new SmithingRecipe(new NamespacedKey(Main.instance, "chromatin_sword"), CUSTOM_ITEMS.CHROMATIN_SWORD.getItem(), new RecipeChoice.MaterialChoice(Material.NETHERITE_SWORD), new RecipeChoice.ExactChoice(CUSTOM_ITEMS.CHROMATIN_SHARD.getItem()));
        Bukkit.addRecipe(ChromatinSwordRecipe);
    }
#
public enum CUSTOM_ITEMS {

    CHROMATIN_SCRAP(() -> new ItemBuilder(Material.PAPER, false).addName("§rChromatin Scrap").construct()),
    CHROMATIN_SHARD(() -> new ItemBuilder(Material.PAPER, false).addName("§rChromatin Shard").construct()),

    CHROMATIN_SWORD(() -> new ItemBuilder(Material.NETHERITE_SWORD).addName("§rChromatin Sword")
            .addAttribute(Attribute.GENERIC_ATTACK_DAMAGE, AttributeModifier.Operation.ADD_NUMBER,8, EquipmentSlot.HAND)
            .addAttribute(Attribute.GENERIC_ATTACK_SPEED, AttributeModifier.Operation.ADD_NUMBER,-2.4, EquipmentSlot.HAND)
            .addItemFlag(ItemFlag.HIDE_ATTRIBUTES)
            .addBonusDurability(500)
            .addLore("","§fWhen in Main Hand:"," §29 Attack Damage"," §21.6 Attack Speed","§fBonus Durability: 500")
            .construct()),

    private Supplier<CustomItemStack> item;

    CUSTOM_ITEMS(Supplier<CustomItemStack> item){
        this.item = item;
    }

    public CustomItemStack getItem(){
        return item.get();
    }
}```

And the result in game:
sterile token
formal jolt
#

As you can see my Item dont have his custome name, ...

tender shard
serene egret
#

how can i set a new direction to a sign?

twin elbow
#

how would I create a hittable NPC ?

formal jolt
remote swallow
#

the colours changed recently

chrome beacon
#

^

tender shard
#

log4j sucks

tender shard
#

intellij's code completion is objectively better than eclipse's

#

and I also find it way easier to use

formal jolt
#

So yeah the only difference in my print are the itemStack size, the doc say :

This method is the same as equals, but does not consider stack size (amount).
Params:
stack – the item stack to compare to
Returns:
true if the two stacks are equal, ignoring the amount```
And i get a false result i dont undersant what is the issue
tender shard
#

yeah

twin elbow
#

How would I create a hittable NPC?

formal jolt
#

Hello i m trying to do some custom

undone axleBOT
sterile token
#

Is slot 40 from player inventory, OFF HAND one cuz i have been testing a plugin and looks like its not being cancelled

#

oh, lmao

#

But bukkit right? Because NMS is diff

mighty aurora
#

Anyone here know how to use a HexCode to name items that are given via a plugin?

chrome beacon
#

for #ffffff

#

Spigot doesn't have component api for items names

#

Paper does though if you're using that

mighty aurora
#

My plugin relies on spigot but the server I use is paper😆

chrome beacon
#

If it's a private plugin you can just switch to the paper api

sterile token
#

Where i am momment

broken lynx
#

how can i stop players from using color codes

chrome beacon
broken lynx
#

in chat

#

Wdym where

chrome beacon
#

For example, signs or chat

#

If you're making a plugin you can just strip all color codes from the chat message

quaint mantle
#

Is it possible to update a menu title without reopening a menu

chrome beacon
#

Sort of

#

You can use the open window packet with another title but the same inventory id

broken lynx
#

Just chat, i am not making a plugin i just want to disable it from players cause we have ezcolors for chat colors

sterile token
quaint mantle
#

Assuming not since it needs a rerender client side

sterile token
#

🤔

quaint mantle
sterile token
#

Because each page its a diff inventory

quaint mantle
sterile token
#

I didnt understand

quaint mantle
#

Never mind I gotta head to class 👋👋

sterile token
#

oh ok

#

Cyao

chrome beacon
topaz cape
#

bump

chrome beacon
#

To prevent problems with the cursor don't call the inventory close method

sterile token
chrome beacon
#

All you need to do is open a new inventory

#

It will replace the old one without moving the cursor

sterile token
#

oh ok

#

I didnt know that the menu#open() will override the other inventory

pseudo hazel
#

if it was just a menu with like clickable options you can just replace the inventory contents with the new contents

sterile token
pseudo hazel
#

why not

sterile token
pseudo hazel
#

wdym

#

you will have to do that at some point anyways

#

at some point you need to to have logic for what items to show at what time in what inventory

sterile token
#

oh ok

tawdry parcel
#

what is the best way to change a name of a player? Because I think ```java
player.setDisplayName(nickname);
player.setCustomName(nickname);
player.setPlayerListName(nickname);

chrome beacon
#

If you're new to Java I don't recommend using that

#

Just use the api methods

tawdry parcel
tawdry parcel
#

do you mean I should use an external api?

chrome beacon
chrome beacon
sterile token
tawdry parcel
#

how is that possible?

undone axleBOT
sterile token
#

You can read the javadocs, to see everything from an api, what methods its contains, what params needs, etc

tender shard
#

best GUI ever

sterile token
#

And i actually agree hahaha, looks that gui tho

granite pilot
# tawdry parcel but with them it doesnt change the name above the player

Learning to read the docs will be invaluable, i promise. A quick search can get you this straight from the docs:

void setDisplayName(@Nullable
String name)
Sets the "friendly" name to display of this player. This may include color.

Note that this name will not be displayed in game, only in chat and places defined by plugins.```
tender shard
sterile token
#

But still java guis horrible

tender shard
#

GUIs always suck, no matter the language tbh

sterile token
#

Html + Sass guis >>>

tender shard
#

ugh I spent 20 minutes debugging

#

until I noticed I just forget to pass the GridBagConstraints to Container#add

tardy delta
#

only 20 🙏

tender shard
#

now I can automatically generate GUIs from archetype metadata xml files

sterile token
#

How does that work

#

Oh its a maven plugin

quiet ice
tender shard
#

it's a standalone app that reads an archetypes archetype-metadata.xml file, turns it into a GUI, lets you fill in the values (automatically inserts the default values) and then you can use it to generate a maven project from it

#

41 is not offhand

#

also why dont you use getEquipment().getItemInOffHand()

#

using slot numbers is nasty and not needed

sterile token
tender shard
#

that's possible since at least 8 years

sterile token
quaint mantle
#

How to create working scoreboard (1.16.5) , because my code is not working

undone axleBOT
#

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

tardy delta
#

still not fixed your region stuff?

#

is it already on gh?

quaint mantle
#

Events.java:

package pl.playgroundhc.playgroundhc;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.scoreboard.Scoreboard;

public class events implements Listener {
    Scoreboard s;
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        //brodecast - global
        s.createScoreboard(event.getPlayer());
        Bukkit.broadcastMessage(ChatColor.AQUA + "[PlaygroundHC.pl]" + ChatColor.WHITE + " Użytkownik " + event.getPlayer().getDisplayName() + " dołączył do gry");
    }

}```
eternal oxide
#

s is null

tardy delta
#

where is your access modifier

#

😬

sterile token
quaint mantle
#

Scoreboard.java


import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.*;

public class scoreboard {
    public static void createScoreboard(Player p) {
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        org.bukkit.scoreboard.Scoreboard board = manager.getNewScoreboard();
        Objective objective = board.registerNewObjective("Stats", "dummy");
        objective.setDisplayName(ChatColor.YELLOW + "PlaygroundHC");
        objective.setDisplaySlot(DisplaySlot.SIDEBAR);

        Score score = objective.getScore(ChatColor.GRAY + "Gracze online " + ChatColor.WHITE + Bukkit.getOnlinePlayers().size());
        score.setScore(3);
        Score score1 = objective.getScore(ChatColor.WHITE + "www.playgroundhc.pl");
        score1.setScore(1);
        Score score2 = objective.getScore(" ");
        score2.setScore(2);
        Score score3 = objective.getScore(ChatColor.GRAY + "Twój nick " + ChatColor.WHITE);
        score3.setScore(5);
        Score score4 = objective.getScore(" ");
        score4.setScore(4);
        p.setScoreboard(board);
    }
    public static void updateScoreboard() {
        for(Player player : Bukkit.getOnlinePlayers()) {


            createScoreboard(player);
        }
    }```
#

Can you correct my code?

tardy delta
#

why creating an instance if youre going to static abuse it anyways

sterile token
#

?paste

undone axleBOT
sterile token
#

Also read about conventions

tardy delta
#

verano answer to what i said

sterile token
tardy delta
sterile token
#

😂

#

More than 1y working on it

tardy delta
#

so no t on gh?

sterile token
#

no i dont have a base code for publishing it

tardy delta
#

lol

quaint mantle
sterile token
#

Oh sorry i forget i had cups enabled

tardy delta
#

your s is null as ElgarL said

#

never seen a stacktrace but i assume you get a npe

sterile token
#

Neither using field modifiers nor following conventions, seems coding without first learning Java

tardy delta
quaint mantle
#

Ok

#

And, what's about my code?

tardy delta
#

we told you

quaint mantle
tardy delta
#

s is null

quaint mantle
#

And it's all of errors?

tardy delta
#

idk what error you get

quaint mantle
#

I get non specified error

tardy delta
#

and whats a non specified error?

sterile token
grim oak
#

Hi i have the following code and for some reason when the if (event.getSlot() != 40) if statement runs, it sends the message to the player saying "You should not have this" but it doesn't delete the item, anyone konw why this may happen.

@EventHandler
    public void onMoveItem(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if(event.getClickedInventory() == null)
            return;
        if (/* Validation */)
            return;

        if (event.getSlot() != 40) {
            ItemStack item = event.getCurrentItem();
            item.setAmount(0);
            player.sendMessage(ChatColor.RED + "You should not have this!");
        } else {
            event.setCancelled(true);
            player.sendMessage(ChatColor.RED + "You cannot move this item!");
        }
    } ```
rotund ravine
#

setting amount to 0 does not remove it

sullen marlin
#

Set to air

grim oak
#

ill set it to air and see if it fixes it

tender shard
sterile token
grim oak
sterile token
grim oak
#

yes

#

and it doesnt cancel the event when i try it

sterile token
#

What your fianl goal?

grim oak
#

if the clicked item is not in the offhand slot remove the item

sterile token
#

What i having issues too

grim oak
#

no, theres a validation block above, so its only for certain items

tender shard
#

why dont you ijust do Inventory#setItem(40,null) ?

grim oak
#

ill do that

sterile token
tardy delta
#

itemstack air with amount 10 hehe

sterile token
grim oak
#

wait

#

doesnt matter thats not even what im trying to do

sterile token
tender shard
#

then use whatever slot number you wanna "reset"

grim oak
#

set the clicked item to 0 not the item in the slot

sterile token
rotund ravine
grim oak
#

or remove it i mean

rotund ravine
grim oak
#

@EventHandler
    public void onMoveItem(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if(event.getClickedInventory() == null)
            return;
        if (Validation)
            return;

        if (event.getSlot() != 40) {
            ItemStack item = event.getCurrentItem();
            item.setType(Material.AIR);
            player.sendMessage(ChatColor.RED + "You should not have this!");
        } else {
            event.setCancelled(true);
            player.sendMessage(ChatColor.RED + "You cannot move this sword!");
        }
    }```
#

The "You should not have this" is being run just fine but it doesnt remove the item

rotund ravine
#

Is it the one in the cursor or in the slot you are trying to remove

sterile token
grim oak
#

The one that is being clicked

#

its a click event

rotund ravine
#

being clicked on

#

or with

grim oak
#

clicked on

grim oak
#
@EventHandler
    public void onMoveItem(InventoryClickEvent event) {
        Player player = (Player) event.getWhoClicked();

        if(event.getClickedInventory() == null)
            return;
        if ()
            return;

        if (event.getSlot() != 40) {
            event.setCurrentItem(new ItemStack(Material.AIR));
            player.sendMessage(ChatColor.RED + "You should not have this!");
        } else {
            event.setCancelled(true);
            player.sendMessage(ChatColor.RED + "You cannot move this sword!");
        }
    }```
#

still no

sterile token
#

If not its really diff to code

quaint mantle
#

Can you recommend any channel to learn java?

chrome beacon
#

?learnjava

undone axleBOT
rotund ravine
sterile token
rotund ravine
sterile token
#

Well in my case im still having issues while cancelling OFF HAND

#

Lmao cancelling putting items via off hand slot its really painful

#

cuz i already cancelled putting items via keyword F, but cannot find via the slot itself on the player inventory

grim oak
#

its slot 40

tender shard
grim oak
#

nice

tardy delta
#

and it has dark mode!!!

tender shard
#

windows 11

tender shard
#

swing

sterile token
quiet ice
#

Interesting.

sterile token
quiet ice
#

Nah lol

tardy delta
#

💀

quiet ice
#

javax.swing is the GUI lib

sterile token
#

my bad its called Swagger

quiet ice
#

Well java.awt is the og GUI lib, but javax.swing is ontop of it

atomic swift
#

what is a Conversation

quiet ice
#

It's always a high-maintainance project and usually has little benefits

tender shard
#

idk it's the only thing where I found something like a table that supports sth like html's "colspawn"

#

GridBagLayout

compact haven
#

Are there any tools to parse ItemStacks from config with support for enchants and potion effects, other than the default ConfigurationSerializable

#
potion:
  ==: org.bukkit.inventory.ItemStack
  v: 3218
  type: POTION
  meta:
    ==: ItemMeta
    meta-type: POTION
    custom-effects:
    - ==: PotionEffect
      effect: 5
      duration: 60
      amplifier: 3
      ambient: false
      has-particles: false
      has-icon: false

I can't expect someone to actually type/know what the different meta types are and everything ;c

grim oak
orchid gazelle
#

hello, I got some performance issue with my Plugin. Whenever im shooting with my gun, there is a path(superfast bullet) getting traced for a far distance. Now, the issue is that this takes insane amounts of performance since it has to load about 65 Chunks for each trace to get the range fully

tender shard
compact haven
rotund ravine
remote swallow
#

i am

compact haven
#

I wonder how far along he is

#

hey Epic

#

how is it so far

tender shard
#

and JeffLib got something similar but it doesnt support attributes and stuff

rotund ravine
#

creative menu is so different than survival that it has it's own event

remote swallow
#

or attributes iirc

#

its been like 2 days since i wokred on it

compact haven
#

is it public atm?

sterile token
quiet ice
remote swallow
grim oak
compact haven
#

I can do that, ty mate I'll check it out

rotund ravine
compact haven
#

(or really jitpack would work)

remote swallow
#

fuck jitpack

sterile token
remote swallow
#

ive got an account on alex's community reppo

sterile token
remote swallow
#

give me like 2 min

rotund ravine
remote swallow
#

cant host it 24/7

quiet ice
#

If it is maven I can just publish it to my ftp repo

compact haven
#

u are all good, I got a reposilite instance that I use

grim oak
sterile token
remote swallow
compact haven
rotund ravine
atomic swift
remote swallow
rotund ravine
compact haven
#

like do you just push everything as 1.0.0 or do you increment as necessary xd

remote swallow
#

@tender shard whats the url i set, is it just https://hub.jeff-media.com/nexus/#browse/browse:jeff-media-community or am i not braining

sterile token
remote swallow
rotund ravine
tender shard
rotund ravine
#

Creative is weird, don't try to do anythign with it.

tender shard
#

change public to community

sterile token
tender shard
#

basically oyu can get the URL from here

remote swallow
#

ohhhh

sterile token
tender shard
sterile token
#

oh ok

remote swallow
#

okay i think its setup

#

lets test

#

Received status code 400 from server: Repository version policy: RELEASE does not allow metadata in path: me/epic/BetterItemConfig/1.0.0-SNAPSHOT/maven-metadata.xml @tender shard

#

very confused

tender shard
#

oh seems like it only allows released

#

one sec I'll change it to snapshots

#

or wait

remote swallow
#

thanks

tender shard
#

try to change version to 0.0.1

#

just for test

#

without -SNAPSHOT

remote swallow
#

no errors

#

and its on the community page

tender shard
#

yep works

#

I'll change it to snapshot

remote swallow
#

how do i remove that old version lol

#

so people dont accidentally use it

rotund ravine
#

never tihihihih

sterile token
tender shard
remote swallow
#

thanks

sterile token
#

mfalex, is you repo free to publish artifacts?

#

Or only private usage

tender shard
#

for everyone who asks me for an account

rotund ravine
#

time to do a 19tb plugin

#

with all the dependencies

sterile token
tender shard
remote swallow
#

stil getting the error

tender shard
#

hm okay then I gotta change it to SNAPSHOT

#

will do that later

remote swallow
#

okay

#

ill just release this as a full version for now

#

so @compact haven can use it

#

you use gradle or maven?

compact haven
#

bae

#

maven

#

well I use both, the current project is in maven

remote swallow
#
<dependency>
  <groupId>me.epic</groupId>
  <artifactId>BetterItemConfig</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</dependency>
<repository>
  <id>jeff-media-community</id>
  <url>https://hub.jeff-media.com/nexus/repository/jeff-media-community/</url>
<repository>
#

hope thats correct

tender shard
#

wait

#

epic

#

upload again, snapshot should work now

#

I recreated the repo so 1.0.0 is gone

remote swallow
#

ah ok

#

Could not GET 'https://hub.jeff-media.com/nexus/repository/jeff-media-community/me/epic/BetterItemConfig/1.0.0-SNAPSHOT/maven-metadata.xml'. Received status code 403 from server: Forbidden

tender shard
#

uugh ok wait

#

ah I see, it removed the perms from the role

#

try again

#

I'll have to check which permissions I need to give

remote swallow
#

same error

tender shard
#

now?

sterile token
#

You should give admin to that repo?

tender shard
#

lol no?

#

why would I give admin

river oracle
#

gross why would you ever do that

tender shard
#

do you also run your MC server as root? lol

remote swallow
#

one sec im gonna restart my ij

sterile token
tender shard
#

yikes

remote swallow
#

my brain barely works on a good day, i wouldnt even give myself admin

#

i would probably fuck something up

sterile token
#

My staging severs locally runs processes as root

#

Even more i have seen a bot nets where their machines runs as root

#

💀

remote swallow
#

yeah even after restart nothing

tender shard
#

can you publish now?

remote swallow
#

still no

#

im very confused lol

tender shard
#

actually this SHOULD be enough I hope

remote swallow
#

nothing, just restarted ij again

tender shard
#

did you change your password?

remote swallow
#

i did not

#

i logged in with it like 5 min ago

tender shard
#

okay so you now have all permissions except delete

#

try again

#

oh wait

#

1.0.0-SNAPSHOT is there

remote swallow
#

just went throug

tender shard
#

22:06:51

#

so like 1 minute ago

remote swallow
tender shard
#

upload again, let's see if it keeps both versions

#

yep works

remote swallow
#

published

compact haven
#

alex, small additional problem

#

guests don't have read permissions to the artifacts, it would seem

tender shard
#

yes that's because I just recreated that repo

#

1 sec

compact haven
#

o

remote swallow
tender shard
#

should work now

#

yeah looks good, I can see the artifats in porn mode

compact haven
#

yipee

remote swallow
#

ill add attributes or that if i havent already tomorrow and then we play the painful game of trying to serialize the json from book pages

compact haven
#

wdym attributes

#

oh like

#

speed

remote swallow
#

yeah

#

ive gotta figure out how i want to format it still

final monolith
#

Guys this works? (plugin.yml and maven)

tender shard
#

yes

#

if you enable resource filtering

final monolith
tender shard
final monolith
#

oh thanks :))

tender shard
#

np!

#

guess I did something wrong

remote swallow
#

thats funny

final monolith
#

what is that gray color? like intellij theme

quiet ice
#

Possibly system theme

final monolith
#

Guys, using the getDataFolder().getParent() has supposed to return me the plugins/ folder, right?

humble tulip
#

Yes

fathom carbon
#

how can i modify how much an item is damaged?

final monolith
fathom carbon
#

Isnt that deprecated?

#

But seems like i already found out a way

#

thanks anyway

tender shard
final monolith
tender shard
#

yeah it's awesome

loud narwhal
remote swallow
#

?paste full file

undone axleBOT
loud narwhal
tardy delta
#

isnt repo down?

loud narwhal
#

no

tardy delta
#

sk.. whatever repo

tender shard
#

yeah but that's enginehub

#

that's the correct repo, and it also has version 7.0.7-SNAPSHOT

#

should work

loud narwhal
tender shard
#

6.2 is for mc 1.12 and older

#

the latest version should be 7.1.0-SNAPSHOT

loud narwhal
#

yea, but why would it only bring that up? Shouldn't it bring all the world guards up

remote swallow
#

its jank sometimes

tender shard
#

it probably only shows what's already in your local repo

remote swallow
#

yeah

tender shard
#

did you maybe enable gradle offline mode?

loud narwhal
#

No, How would I download worldguard to my local repo and tell it to use that instead?

tender shard
#

if you got maven installed, you could easily do it with mvn dependency:get

#
mvn dependency:get -DartifactId=worldguard-bukkit -Dversion=7.0.7-SNAPSHOT -DgroupId=com.sk89q.worldguard -DrepoUrl=https://maven.enginehub.org/repo
#

this would get worldguard 7.0.7 and install it to your local repo

hidden patio
#

Hello! Is anyone here familiar with towny?

remote swallow
tender shard
#

why do people always ask for plugin help in help-dev

livid dove
#

Hello is anyone here familiar with my plugin?

#

😉

#

😇

remote swallow
#

i think you maybe

livid dove
#

lmao

tender shard
#

is anyone here familar with any of my 21 spigotmc resources?

hidden patio
remote swallow
livid dove
#

Just a bit of fun

#

But yeah towny discord is the place to go my friend

remote swallow
#

ive studied the entire code base for 3 weeks

livid dove
#

hell depending on how based it is

#

the devs might even be avaialble

hidden patio
#

Oh sick, thank you

livid dove
#

I know several plugins where the devs themselves are actually just huge nerds who love talking about their shit

hidden patio
#

Do you happen to have a link?

remote swallow
#

if elgarl was online, i would ping hi,

livid dove
remote swallow
#

judging the fact he used to be the dev for it

livid dove
#

IMO btw Advanced portals plugin Dev is a really cool dude. Very happy to always support

#

Even gave me free reign to edit the plugin in anyway I wanted and actively helped me out adding an XP cost per distance between portals system

#

For a portals plugin that includes bungeee capability + a load of other cool stuff, very very unprecendentally cool of em

loud narwhal
#

THANKS @tender shard That fixed it

tender shard
compact haven
#

im getting mad

#

wtf

#

I add the repository and dependency to pom.xml

#

and after repair ide, invalidate caches, etc

#

I still can't import BetterItemConfig

humble tulip
#

Show

#

@compact haven

remote swallow
#

did i break something

compact haven
#

nah its not you

#

I even went and downloaded the jar from nexus and decompiled

#

my IDE is just bricked, I fixed it

tender shard
#

anyone know how I can pack() a JTable?

#

so that e.g. the checkbox column isn't unnecessarily wide by default

#

I tried to set the column's width to getPreferredWidth() but that didnt change anything

remote swallow
#

oh @compact haven to make sure it works BetterItemConfig.init(useMiniMessage)

#

just remembered about that

humble tulip
#

@tender shard can u also add an option in the archetype to have an api module. That wpuld give them a an api module, build module and the implementation module. Ofc if they want nms, those will also be included in the build module

compact haven
#

well that'd be false by default im guessing

#

so I don't believe I need to call it 🤷‍♂️

#

(am looking at src atm)

humble tulip
#

Well maybe it does other things

#

Than setMiniMessage

compact haven
#

well no im looking at src xd

#
    @Getter
    public static boolean useMiniMessage;

    /**
     * Initialize the library
     *
     * @param useMiniMessage decides if to use minimessage support, you must provide the library
     */
    public static void init(boolean useMiniMessage) {
        BetterItemConfig.useMiniMessage = useMiniMessage;
    }

humble tulip
#

Wtf why's it called init then

#

Hm wtf

remote swallow
#

ive got a lot to fix

humble tulip
#

@remote swallow is betteritemconfig urs?

remote swallow
#

it is

humble tulip
#

Oo

humble tulip
remote swallow
#

idc

#

judge me

humble tulip
#

But it should be renamed😂

remote swallow
#

tell me anything that should be changed/add/removed

humble tulip
#

Add setMiniMessage, deprecate init

#

Remove init in a few versions

remote swallow
#

theres 1 person that uses it

#

i can probably just remove it

#

i shouldnt even say "uses"

#

might use

humble tulip
#

🤣Life of a small dev

remote swallow
#

it will most likely just be used by me or alex

compact haven
#

@remote swallow I might even PR this, but perhaps refactor the thing and separate it into an instance of ItemConfigFactory or something, then BetterItemConfig would just have a default Factory with minimessage false. If you do that, then you can separate all of your ItemMeta handlers into separate classes (could be an inner class, doesn't matter) and register that as a processing part of the Factory

remote swallow
#

you have way more brain cells tha nme

#

i was probably gonna end up fixing stuff

compact haven
#

well considering I have a grand total of about 8 or 9

remote swallow
#

refactoring stuff

#

ect

#

once i got it finished

#

and hopefull working with every possible item that could exist

compact haven
#

would be neat

tender shard
remote swallow
#

what would you say is the better way to fix the effect stuff, make an enum that converts it to its correct type that would break on new potions or do i leave it as it is

tender shard
humble tulip
#

Ya np

#

Open an issue with both suggestions?

compact haven
#

i.e.

ItemConfigFactory factory = new ItemConfigFactory<ItemStack, ConfigurationSection>()
  .setComponentProcessing(new MiniMessageProcessor())
  .setBaseProcessor(new BaseItemStackProcessor()) // Will turn ConfigurationSection -> ItemStack (type & amount)
  .addHandler(new AttributeHandler())
  .addMetaHandler(new PotionMetaHandler())
  .build();

ItemStack item = factory.from(configurationSection);
ConfigurationSection section = factory.to(item);

--- 
public class PotionMetaHandler extends MetaHandler<PotionMeta> {
  public boolean doProcessing(Material material) {
    return material == Material.POTION;
  }

  public PotionMeta read(PotionMeta meta, ConfigurationSection source) {
    potion.addCustomEffect ..
    return meta;
  }
}

public class AttributeHandler extends ItemStackHandler {
  public boolean doProcessing(Material material) {
    return true;
  }

  public ItemStack read(ItemStack item, ConfigurationSection source) {
    item.addAtrribute ... source.getSection ...
    return item;
  }

  public ConfigurationSection write(ItemStack item, ConfigurationSection target) {
    return target ... set String ;
  }
}
#

that's what I was thinking of

#

definitely an overcomplication for a simple utility, but if it organizes & you like it 🤷‍♂️

#

(would also debate just removing doProcessing altogether, an early return in read/write would work fine)

remote swallow
#

ive got no idea what that does

remote swallow
#

also if your questioning the reason i convert the config section on fromConfig to a Map<String, Object> its mainly for the .containsKey

tender shard
#

lol I just thought "yaaay it's basically done!" Then I realized, there's no "Start" button lmao

remote swallow
#

@compact haven if you wanna pr anything go ahea, ill probably attempt to fix and organize that more tomorrow probably

#

ive been putting off having to deal with json stuff

hazy parrot
#

Also it's weird that factory has some state

#

Assuming it's some kind of factory pattern

formal jolt
#

Hello is it possible to edit an item before pickUp ? I have try that, i know the function "editItemsAttribute" work well cause i use it at other time and everything seem fine but it seem i still get the origin item

    @EventHandler
    private void onGetItem(EntityPickupItemEvent event){
        if(!(event.getEntity() instanceof Player)) return;

        ItemStack[] itemStacks = new ItemStack[1];
        itemStacks[0] = event.getItem().getItemStack();

        editItemsAttribute(itemStacks, event.getItem().getWorld());

        event.getItem().setItemStack(itemStacks[0]);
    }```
hasty prawn
#

Why the array

tardy delta
#

dunno if it returns a copy or what

formal jolt
#

Cause my function take an array for other usage

tardy delta
#

just do ItemStack[] stacks = { event.getItem().getItemStack() } then

hasty prawn
#

is it actually modifying the 0 ith element?

hazy parrot
#

...smth

formal jolt
#

Still yes it's strange to make an array of 1 element but it's not what i'm trying to understand here

formal jolt
#
@EventHandler
    private void onGetItem(EntityPickupItemEvent event){
        if(!(event.getEntity() instanceof Player)) return;

        Player player = (Player) event.getEntity();

        ItemStack[] itemStacks = new ItemStack[1];
        itemStacks[0] = event.getItem().getItemStack();

        editItemsAttribute(itemStacks, event.getItem().getWorld());

        player.getInventory().addItem(itemStacks[0]);
        event.getItem().remove();

        event.setCancelled(true);
    }```

This work, so yes element 0 is edited.

Just dont know why the element on the ground seem not take the changes, so add manually the item to the inventory and remove the item from the world seem to fix the issue
tardy delta
#

just show the editItemsAttribute method

worldly ingot
#

asCraftCopy() returns a copy

#

Things like player.getInventory().getItemInMainHand().setType(Material.POTATO); for instance just works

#

Internally it returns a mirror

tardy delta
#

so a mutable view, ok

worldly ingot
#

Basically, yeah

rotund ravine
#

Instead he just removed the itemstack and added it to the inventory himself.

sterile token
#

🤔

tardy delta
#

what

worldly ingot
#

I agree. What?

rotund ravine
#

He's talking about creative inventories

tardy delta
#

uh oh

rotund ravine
#

I told him it's difficult to do just about anything with them.

sterile token
#

Yeah Jan told us that is really diff to cancel putting items in OFF_HAND via inventory slot

#

That why i asked you that question

rotund ravine
#

Verano

#

You need to give people contexts before asking a question

#

?askgoodquestion

undone axleBOT
sterile token
#

Lmao i really explained what i need

#

I just need to cancel putting items on OFF_HAND via inventory slot, its not so diff to understand

#

🤔

kind hatch
#

Most people would assume the normal inventories given that sentence alone. Not a creative inventory.

rotund ravine
#

You need to give proper context, letting them know it's a creative inventory for example would be useful context.

sterile token
#

oh ok

#

My bad so, i didnt thought it was really important

kind hatch
#

Context is key.

sterile token
#

Now i have been some hours trying to solve it

#

Im currently writting j-unit code because i must fix this issue for the next week. Cuz i need to continues working on my others projects haha

#

I think that jUnit will make me lost less time

#

Lmao definitly its something weird, the logs messages are not apearing

rotund ravine
#

Fairly sure that the issue actually lies down in client -> server interaction, the client isn't really nice in playing with the server when you're in creative in to how much it sends to the server, as well as the nms code for handing such stuff not really playing too nicely either as the server doesn't really care too much about what a creative person does... (hence why all the creative mode hacks exist...)

#

From MD5 below

#

In creative the client just sets slots, it doesn't actually click or anything.

#

As I aaid, you can't cancel creative clicks because the client controls creative. Its not server side

sterile token
#

okay, to conclude that definitly wont be posible

rotund ravine
#

Not with events, you can probably just make a scheduler that clears everyones offhand slot, but seems suboptimal.

hasty prawn
#

Suboptimal and working is better than not working at all

kind hatch
#

The obvious solution is to not put them in creative mode in the first place. Is it absolutely necessary in this case?

sterile token
#

That why its put the player in creative, that the reason of putting in creative

tender shard
#

how can I align the contents of this jpanel to the top of the tabbedpane D:

sterile token
#

Yo mean the big spaces right?

#

You should padding, but take care you will have to care on each parent nodes

#

Atleast in version 5

rotund ravine
#

Version 5 of what

sterile token
rotund ravine
#

This is swing.

sterile token
#

doesnt swing use Html?

#

I thought that swing was a tool for creating a panels based on html components

#

Totally diff from C# interfaces, where they use directly html 5

rotund ravine
#

Swing can do some html stuff, but no.

sterile token
#

Yeah C# interfaces are mainly html components, like androin does for example

rotund ravine
#

No they're xml components

sterile token
#

I have seen some apk, that contain a resource.jar which inside contain a MVC (View Model Controller)

gleaming grove
#

Maybe you refers to blazor?

sterile token
#

Oh yes, exactly

#

I thought Swing worked similar to it

gleaming grove
#

Swing is more like C# Forms library

sterile token
#

Oh right, now i understand, thanks for being pacient and explaint it

#

Any another will going to quit me alone 😂

humble tulip
tender shard
#

and it doesnt do anything

humble tulip
#

oh u mean u wanna move it up

tender shard
#

note that the contents are a GridBagLayout

tender shard
#

at least that's the case in a gridbaglayout

#

hm I'll try x align

#

but where? on the tabbedpane, or the inner jframe?

humble tulip
sterile token
#

Why dont you just use Flexbox, its better than grid layout

kind hatch
#

Cause this isn't css. xd

sterile token
humble tulip
sterile token
#

isnt just a view design?

tender shard
tender shard
tender shard
tender shard
hasty prawn
#

I like your commit messages

tender shard
#

lol

#

I always commit before I try sth new that might break stuff

hasty prawn
#

"updated" OMEGALUL

tender shard
#

as if I'd remember what I added half an hour ago

#

it's true, though

#

usually I commit "."

#

if it's only stuff for myself

hasty prawn
#

Ah well there you go you've grown a little then

#

I guess KEKW

sterile token
#

Why many ppl dont follow, conventional commits

hasty prawn
#

Because thats a lot of effort

sterile token
#

I think that repo will look better using them

hasty prawn
#

Especially if it's a private repo

sterile token
#

Weird me that work with clients i use them always, just for private project too

#

Because its really useful to guide your self

hasty prawn
#

I mean yeah but it's just preference

tender shard
sterile token
#

But I do not criticize obviously, there are colors for every taste.

tender shard
#

so I commit when I think "hm maybe I need to go back to this state"

worldly ingot
#

You should be able to anchor your gridbag layout, alex

#

It may be center by default

sterile token
#

Sorry for asking this, but is spigot stash public software?

worldly ingot
#

PAGE_START should be top middle, although I don't know what GUI framework you're using

tender shard
#

what's it called?

worldly ingot
#

Mmmm, maybe I'm thinking of constraints

#

Yeah, it's constraints. Disregard

#

Alternative would be to wrap your gridbag in an anchor pane

#

Does swing even have anchor panes? Surely it does

#

I'm more of a JFX kinda guy

hasty prawn
#

Isn't swing obsolete because of JFX?

tender shard
#

hm AnchorPane doesn't have any add(Component) method

#

and the constructor also doesnt take a Container

tender shard
rotund ravine
#

They're useful for different things.

kind hatch
#

Pretty sure tons of projects still rely on spring anyways.

rotund ravine
#

swing with a theme can look just as good as javafx

hasty prawn
#

Yeah that looks far better than the default lol

#

Not that looking better than the default swing theme is a challenging task

tender shard
#

I just always use whatever shows up first on google when I google gui stuff

rotund ravine
gleaming grove
tender shard
#

the .form file is useless

#

it's not used

#

the actual gui is in the Dialog class

atomic violet
#

I have a plugin saving a bunch of data to a config when it disables so that my data isnt lost from the plugin if the server shuts down: ```world: []

hashmap:
advancementNumber: 0
worldborderSize: 8
playerNumber: 1
netherBoolean: false
strongholdLocation:
==: org.bukkit.Location
world: world
x: 7.154603860631729
y: -27.88128824248659
z: -49.485469014625224
pitch: 0.0
yaw: 0.0

array:
players:

  • !!java.util.UUID '7231340b-015c-4b08-b539-8c126a90fcd0'
    advancementName: []
    its giving me a constructor exception on this line: - !!java.util.UUID '7231340b-015c-4b08-b539-8c126a90fcd0'saying this in the server console:org.yaml.snakeyaml.constructor.ConstructorException: could not determine a constructor for the tag tag:yaml.org,2002:java.util.UUID``` it starts up fine the first time but after disabling the plugin, if it saves a player uuid at all, it does this and isnt able to enable the plugin, is there a way to make it not do this?
rotund ravine
#

Just save the uuid as a string.

atomic violet
atomic violet
rotund ravine
#

ye

atomic violet
#

why does it do that when i save the uuid?

rotund ravine
#

Cause UUID is not serialized properly.

atomic violet
#

oh alr thanks

remote swallow
#

yo @compact haven you working on a pr atm? just wondering before i do anything just to get a new pr when i finish

gleaming grove
#

almost works

rotund ravine
#

align it to the left

gleaming grove
#

how

remote swallow
#

has alex became jacek

gleaming grove
#

setAlignmentX does not works

compact haven
remote swallow
#

okay

#

im bored so im gonna start refactoring and moving stuff

compact haven
#

alright, have fun with it

remote swallow
#

i wont

#

i wonder if i should add atribute stuff and fix book pages now

#

or do that after

tender shard
#

GUIs are a pain

remote swallow
#

yes

buoyant viper
tender shard
remote swallow
#

darfrick?

atomic violet
#
  players:
  - - 7231340b-015c-4b08-b539-8c126a90fcd0
  - 7231340b-015c-4b08-b539-8c126a90fcd0``` when i reload the stop the server after joining the game a few times, the config saves the uuids as this, its pulling the whole line when i get the uuid string for some reason, how do i remove the - from the string or just stop it from saving like this entirely?
tender shard
tender shard
atomic violet
# tender shard what's your code to save the UUIDs?
    public void onDisable() {
        getConfig().set("hashmap.advancementNumber", advancementNumber.get("advancementNumber"));
        getConfig().set("hashmap.worldborderSize", worldborderSize.get("worldborderSize"));
        getConfig().set("hashmap.playerNumber", playerNumber.get("playerNumber"));
        getConfig().set("hashmap.strongholdLocation", strongholdLocation.get("strongholdLocation"));
        getConfig().set("hashmap.fortressLocation", fortressLocation.get("fortressLocation"));
        getConfig().set("hashmap.netherBoolean", netherBoolean.get("nether"));
        getConfig().set("array.players", players);
        getConfig().set("array.advancementName", advancementName);
        saveConfig();
    }```
#

idk if theres a more efficient way to do it or not

tender shard
#

what is "players"? a string list?

atomic violet
#

yeah

#

it was originally a uuid list but

tender shard
#

then you must have added a string that starts with "- "

#

how do you load the UUID list?

atomic violet
#

everytime a player joins, i run this in my player join event CaptiveMC.players.add(join.getPlayer().getUniqueId().toString());

tender shard
#

that should work fine

atomic violet
#

and before i run that, i check if their uuid is on the list

tender shard
#

I'd load save a UUID list like this:

// save
getConfig().set("array.players", uuids.stream().map(UUID::toString).collect(Collectors.toList()));
        
// load
List<UUID> uuids = getConfig().getStringList("array.players").stream().map(UUID::fromString).collect(Collectors.toList());
atomic violet
#

so i kinda need the list

#

i save the uuids to an array cause i want all players who have ever joined the server

tender shard
#

why do you use an array if you already got a list though

atomic violet
tender shard
#

to get the UUIDs of everyone who has ever joined, you can use Bukkit.getOffilnePlayers

atomic violet
#

oh yeah i forgot that was a thing

atomic violet
#

it doesnt let me save uuids for some reason

#

altho your method might work cause i just saved the array of uuids i saved before

frail gazelle
#
          List<String> items = RoleplayItems.getPlugin().getConfig().getStringList("items");
                for (String i : items) {
                    Bukkit.getLogger().info("Printed " + i);
items:
  - DIAMOND_SWORD
  - NETHERITE_SWORD
  - STONE_SWORD

any reason why this only gets diamond_sword and nothing else?

tender shard
tender shard
frail gazelle
#

.jar file

tender shard
#

then you probably have a config in your data folder that only contains diamond sword

frail gazelle
#
items:
  - DIAMOND_SWORD
  - NETHERITE_SWORD
  - GOLDEN_SWORD
  - STONE_SWORD

this is the one in my data folder

#

and it still only prints out diamond_sword

buoyant viper
#

wack

atomic violet
#

for some reason i just assumed that it gets the offline players rather than online players

atomic violet
tender shard
#

map basically turns an object into another

#

in this case, an offilne player into their UUID

buoyant viper
#

map converts to stream from OfflinePlayer to UUID, collect collects them into a List<UUID> for u

atomic violet
#

oh thats neat

buoyant viper
#

Stream API 👍

atomic violet
#

so in this case i would do uuids.map and uuids.collect for these?

buoyant viper
#

wasnt there someone in this discord that hated streams? was it imajin?

tender shard
#

for example:

String[] names = new String[] {"mfnalex", "jesus"}
List<String> UPPERCASE_NAMES = Arrays.stream(names).map(String::toUpperCase).collect(Collectors.toList());
#

map now turns the string into an uppercase string

#

and collect(Collectors.toList()) turns the Stream<String> into a List<String>

tender shard
atomic violet
#

okay ill try this and then save my config a few times to see if i clone myself in the plugin again brb

frail gazelle
sterile token
#

Copílot be like

frail gazelle
#

inside the for loop there is an if statement that checks if the item specified in the argument is listed in the config file

sterile token
#

i just understand you have a command which takes an argument

frail gazelle
#

i want the command to check if the argument inputted is listed within a config file

sterile token
#

Your input will be a string?

#

If yes, you can use Config#getStringList("path") and check if List#contains(input)

frail gazelle
#

yes

#

can i not just use a for loop

#

or does that type of stuff not work

sterile token
#

List already have the posibility of doing List#contains() for checking if something is inside of it, rather than looping over it

hazy parrot
#

Contains do same for loop internal anyway

sterile token
frail gazelle
sterile token
hazy parrot
#

Make your own loop and use .equalsIgnoreCase

sterile token
hazy parrot
#

I would assume "how do I not check for case sensitivity" means check with case insensitive

sterile token
#

So let say:

input is "hello"
List is: "Hello"
if you do List#contains("hello") will return false, because it just will check if any of the properties equals to your input

quaint mantle
#

Gettomg the name of an inventory in 1.19?

#
player.openInventory.topInventory.title
``` isnt a thing
remote swallow
#

to me

#

that looks like paper api

quaint mantle
#

Inventory#title isnt a thing

#

I dont think paper edited that part

#

I can check

eternal oxide
#

name is in the view

remote swallow
#

.title is paper

#

it would be getTitle on spigot

quaint mantle
tender shard
#

from there you can get the title

quaint mantle
#

or does Player#openInventory only return an open chest inventory

tender shard
#

player.getOpenInventory().getTitle()

#

openInventory(Inventory) also returns the newly created InventoryView

quaint mantle
#

Also is there a way to compare a component and string

tender shard
#

a bungee component?

#

or a paper one?

remote swallow
#

adventure probably

#

that is paper

#

wrong place to ask

atomic violet
#

is there a way of giving an advancement without using Bukkit.dispatchCommand(player, command)

sterile token
tender shard
#

get the player's AdvancementProgress, then get the remaining criteria and award those

atomic violet
atomic violet
tender shard
#
    {
        Player player = null;
        Advancement advancement = null;
        AdvancementProgress progress = player.getAdvancementProgress(advancement);
        progress.getRemainingCriteria().forEach(progress::awardCriteria);
    }
atomic violet
#

also is the criteria the "minecraft:story.root" stuff or is that the advancement

tender shard
#

or with a normal loop:

        AdvancementProgress progress = player.getAdvancementProgress(advancement);
        for(String remainingCriterium : progress.getRemainingCriteria()) {
            progress.awardCriteria(remainingCriterium);
        }
atomic violet
#

oh wait that just awards it without getting the criteria

#

so i dont need to list the criteria i want awarded?

sterile token
#

How would i cancel opening inventories, which are not player inventory? Because i have cancelled the menu open but when you open chest it still makes the sound*

tender shard
atomic violet
tender shard
sterile token
#

Because i simply need to cancel any way of putting/taking items from any inventory, which is not the player one

atomic violet
tender shard
atomic violet
tender shard
#

story/follow_ender_eye

atomic violet
#

so ik theres minecraft:story/follow_ender_eye

tender shard
#

one sec

atomic violet
#

alright

tender shard
#
Bukkit.getAdvancement(NamespacedKey.minecraft("story/follow_ender_eye"))
#

that should do it

atomic violet
#

alright ill try it

#

hehe it works, that was the last thing i needed to fix in my plugin

#

i now have a working beatable plugin version of the captive minecraft map from like 1.12 i think

tender shard
#

I dont get it, why is this still empty

#

It should have at least a few labels inside

sterile token
#

Is posible to execute code when you clikc a component? Instead of running a command

tender shard
#

just create a command executor and then make that one do your stuff

humble tulip
#

@tender shard found a bug

humble tulip
#

let is run a command that is like /<uuidhere>

#

or /safkjgenw <uuid here>

tender shard
#

fixed

humble tulip
#

then use the command pre process event to intercept the command, parse the uuid and then you know what to run

humble tulip
humble tulip
humble tulip
#

gonna double check

tender shard
humble tulip
#

ok

#

i know i didnt set it to true

tender shard
#

it's the only thing true by default, since the default maven archetype also generates unittests

buoyant viper
atomic swift
#

what is a Conversion

humble tulip
tender shard
atomic swift
#

that

tender shard
#

that post explains it perfectly

#

one of the most underrated api features ever

atomic swift
#

ik i just found the method yday

humble tulip
#

ohh conversation

atomic swift
#

it's just a normal chat?

#

or a dialog bog

tender shard
#

it's done using the chat

atomic swift
#

and it's like /msg

tender shard
#

No

atomic swift
#

where you reply

tender shard
#

it has nothing to do with normal messages