#help-development

1 messages · Page 579 of 1

orchid trout
#

annoying?

#

i know theres supposed to be <build> </build>

somber scarab
#

okay. I hope someone else helps you.

orchid trout
#

but idk what to put in there

somber scarab
#

?paste

undone axleBOT
somber scarab
orchid trout
#

thank you

tender shard
#

the pom is correct

#

if the .jar is empty, you messed up your project structure

orchid trout
#

aa

tender shard
#

show a screenshot of your whole project structure

somber scarab
tardy delta
#

probably not the best place to ask for, but noone seems to know. does anyone knows how to work with junit5 @CsvFileSource, i set the file path relative to the current class but it keeps telling me org.junit.platform.commons.PreconditionViolationException: Classpath resource [../../../../resources/input.csv] does not exist, would i have to put my src/test/resources/input.csv on the runtime classpath or smth?

tender shard
#

it's supposed to look like this:

#

pom.xml in /
java code and packages in /src/main/java
plugin.yml in /src/main/resources

worldly ingot
#

So no need for ../../../../resources/

orchid trout
tender shard
tardy delta
#

been doing that too, it just says Classpath resource [input.csv] does not exist

orchid trout
#

lifecycle -> package

#

sorry

tender shard
#

is your project on github?

orchid trout
#

no

tender shard
#

if you upload it to github, I could check it out

worldly ingot
#

/input.csv

#

You may need the /

orchid trout
#

wait

tardy delta
#

intellij kept telling me some nonsense

worldly ingot
#

It do be like that sometimes

tardy delta
#

ty

orchid trout
#

when i compile it doesnt even give me a jar

#

putting on github now

orchid trout
#

i think the problem is with plugin.yml

#
        at org.bukkit.craftbukkit.v1_19_R3.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:319) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3763-Spigot-7d7b241-5a5e43e]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:141) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R3.CraftServer.loadPlugins(CraftServer.java:430) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3763-Spigot-7d7b241-5a5e43e]
        at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3763-Spigot-7d7b241-5a5e43e]
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3763-Spigot-7d7b241-5a5e43e]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3763-Spigot-7d7b241-5a5e43e]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]```
somber scarab
#

OH

#

look

#

you need to write '1.20'

orchid trout
#

thanks

#

i didnt see the error before

#

alr

worldly ingot
#

Well, Doc PR'd that, but we worked together on a fix, yeah

#

md approved it already, just waiting on a merge

somber scarab
#

choco

#

oh and Doc i guess

#

@wet breach

#

soo.... which license is open source?

worldly ingot
#

All of them

somber scarab
#

oh..........

worldly ingot
#

Wouldn't make much sense to have a proprietary license on an open source platform now would it? ;p

#

At least by default that is

wet breach
#

if you do care how they can use it, then select one of the other ones

wet breach
#

If I open source something, I just go with MIT

#

mainly because I can't be bothered to ensure the license is being followed XD

worldly ingot
#

It's well known as the "Do whatever the hell you want" license

young knoll
#

Don’t tell retrooper

#

He’ll hunt you down

somber scarab
#

how do I get rid of main on github

#

nvm found it

shadow night
#

Since there is no PDC in 1.8, what else can I use to store player data?

young knoll
#

Database

#

NBT

#

Files

shadow night
#

How safe to use is NBT?

vivid cave
#

What is EntityTrackerEntry for ?

#

(nms)

shadow night
young knoll
#

Sure

#

But you can do that with anything

flint coyote
#

System.out.println("break everything");

#

But as Coll said it's as safe as everything else. Use it correctly, have a testserver and you'll be fine

unique shuttle
#

it may not be possible to change the position of the axis for rotation from the quaternion and you should just use Translation 🥹

shadow night
#

Wtf

somber scarab
#

u can actually change the position of a player's body part???

shadow night
#

definition of "I lost my mind"

somber scarab
#

ima gine making like a zombie game where zombies lose their limbs

#

or players medival fighting

shadow night
#

That's scary

somber scarab
#

that's so cool

young knoll
#

Poor man lost his head

shadow night
#

Is it a man tho?

somber scarab
#

🤔

unique shuttle
#

Here I use Entity.Rotation but if I could do it with joml's Quaternionf it would help me a lot 🥹

shadow night
#

You can make the most beautiful cutscenes using that

somber scarab
#

player emotes without mods

young knoll
#

Gotta love display entities

flint coyote
#

I wanna make this region based. One wrong step and your head is gone - move back and it's back lol

#
ConfigurationSection ranksSection = config.getConfigurationSection("Ranks");

for (String rank : ranksSection.getKeys(false)) {
    String prefix = ranksSection.getString(rank + ".Prefix");
    String suffix = ranksSection.getString(rank + ".Suffix");
    
    // Do something with the prefix and suffix
}
#

No. "rank" is. "RankSection" is obviously the section

#

??? what name

#

The variable "rank" in the upper snippet is "Owner" etc.

zealous osprey
tardy delta
#

gruvbox material

shadow night
#

how do I stop all sounds for a player in 1.8.8? There isn't even player.stopSound(...) or something like that

tardy delta
#

might seem like a smart move to load all my unit tests from csv files lol, currently executing 500 tests with 8 lines of code

#

csv format is only a little bit meh with the separators

shadow night
young knoll
#

Stop using 1.8 is usually my go to

shadow night
#

I'm not able to do so

#

I would absolutely love but I can't switch to newer versions

flint coyote
#

well then deal with the limitation

#

Or make a modded server so the client supports it

shadow night
#

not something I can do either

flint coyote
#

In that case you are out of options

shadow night
#

I am

zealous osprey
#

Can't you use the itemmeta?

#

?paste could you show me your code?

undone axleBOT
zealous osprey
#

You want to create a new enchant?

young knoll
#

I think vanishable covers everything

zealous osprey
#

Check what the other enchant classes use

young knoll
#

¯_(ツ)_/¯

#

Idk what the target is even used for anyway

noble lantern
#

its what you want the enchantment to work on

#

IE EnchantmentTarget.ARMOR_TORSO

#

wait

young knoll
#

None of them

noble lantern
#

deprecated wtf

#

its changed sec

young knoll
#

Only ALL is deprecated

noble lantern
#

oh oop

#

ofc thats the one im looking at 🤣

young knoll
#

Like I said idk what the target is even used for when making a custom enchantment

#

So just set it as whatever

noble lantern
young knoll
#

Your custom enchant will not appear in the table

#

You have to do that yourself

noble lantern
#

will work for books though

river oracle
noble lantern
#

on any item?

zealous osprey
#

specifically just flint?
Well why not just make sure that when someone puts the book and a flint in an anvil that your forcefully apply it

noble lantern
#

youll have to just set that to whatever, and then manually handle adding the enchantment to the item yourself (IE Anvils)

#

then use the ARMOR enum lol

#

just ARMOR unless you rly do only want it on heads (again, only works on anvils not enchantment tables)

#

thats fine too, but im sure your gonna want to add vanilla ways to get em eventually, so keep those in mind ^

wet breach
#

not sure if that is their case or not

#

but if it is, they could just do that

noble lantern
#

oh shocking

#

wait

#

its a netherite helmet

#

but

river kernel
#

can anyone give me a link for a trade plugins for version 1.20.1

unique shuttle
vast ledge
#

You might be able to check if

PlayerItemConsumeEvent

Also says that Rightlicking armour consumes it

vast ledge
#

Ah, look under Inevntory events

#

theres a few

#

should help you

sage patio
vast ledge
#

what is args

sage patio
#

arguments in a command class

vast ledge
#

args[stringID]

sage patio
#

uh yea right

#

uh i just didn't coded for 3 or 4 days

vast ledge
#

xD

#

I know java of the top of my head, i can recite it onto paper for some reason

sage patio
#

lol

vast ledge
#

No to that

sage patio
#

for sure NETHERITE_HELMET is consumable

vast ledge
#

I dont think it will get triggered

#

use the Inventory Events

sage patio
#

for what

vast ledge
#

cant be bothered to crop it

#

You can probably find it under InventoryAction event

#

The InventoryClickEvent

#

You can read more on it on the Javadocs

young knoll
fallow latch
#

with this method that sets the damage:

private void setDamage(ItemStack item, double damage) {
    ItemMeta meta = item.getItemMeta();
    meta.addAttributeModifier(
            Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(
                    "generic.attackDamage", damage, AttributeModifier.Operation.ADD_NUMBER
            )
    );
    item.setItemMeta(meta);
}

in the attributes in the item description, it shows "When in Main Hand:" like it should, but also has "When on Feet", "When on Body", "When on Head" etc. I want to only keep "When in Main Hand", how can I do that

fallow latch
#

o thank you

worldly ingot
#

I wish that Minecraft would recognize those types of items as "When Equipped" instead of having 6 different subcategories lol

young knoll
#

But what if you equip boots in your helmet slot!11

worldly ingot
#

Then it's still equipped!

#

I just mean that if it doesn't specify a slot or specifies all the slots

ancient plank
#

Zo true

jolly forum
#

Hi, I'd like to make it so that when I click on a dice that you click on something in a gui it opens a person's inventory but it doesn't work (only when the value in Dig.startDig(player, target); the system works but then doesn't work).

Her is my code

#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event, Player target){
        Inventory inv = event.getInventory();
        Player player = (Player) event.getWhoClicked();
        ItemStack current = event.getCurrentItem();
        if(current == null) return;
        if(inv.getName().equalsIgnoreCase("§cDemande de fouille")){
            event.setCancelled(true);
            if(current.getType() == Material.GREEN_SHULKER_BOX){
                player.closeInventory();
                Fouille.startFouille(target, player);
            }
        }
    }```
#
    public static void startFouille(Player player, Player target){
        player.openInventory(target.getInventory());
    }
vast ledge
#

inv.getName()

#

is deprecated

#

dont use it

sage patio
#

how i can get pos1 & 2 selection of a player's worldedit selection and make a region of that?

#
public static void createRegion(Player player, String regionName) {
        com.sk89q.worldedit.entity.Player actor = BukkitAdapter.adapt(player);
        SessionManager sessionManager = WorldEdit.getInstance().getSessionManager();
        LocalSession localSession = sessionManager.get(actor);
        Region region;
        World world = localSession.getSelectionWorld();
        try {
            if (world == null) throw new IncompleteRegionException();
            region = localSession.getSelection(world);
        } catch (IncompleteRegionException exception) {
            return;
        }
        ProtectedRegion protectedRegion = new ProtectedCuboidRegion(regionName, region.getMinimumPoint(), region.getMaximumPoint());
    }
#

i've this code but i'm not sure if player has any selection or not

vast ledge
#

Ask on the WorldEdit APIS discord, they probably can help you more then us

vast ledge
sage patio
#

and if he has, create a region of that

vast ledge
#
if (localSession.getSelection() == null) return;
sage patio
#

hmm nice thanks

well this should do the job:

                LocalSession session = WorldEdit.getInstance().getSessionManager().get(BukkitAdapter.adapt(player));
                if (session == null) {
                    player.sendMessage(Utils.colorize("&cMake a selection first."));
                    return true;
                }
                Region region;
                try {
                    region = session.getSelection(session.getSelectionWorld());
                } catch (IncompleteRegionException e) {
                    throw new RuntimeException(e);
                }
                ProtectedRegion protectedRegion = new ProtectedCuboidRegion(args[1].toLowerCase(), region.getMinimumPoint(), region.getMaximumPoint());
vast ledge
#

Now to you @jolly forum

#

So you want tocheck if somebody clicks on a dice

#

then open a UI?

#

GUI**

jolly forum
vast ledge
#

then u open a UI?

jolly forum
#

As soon as I click on the shulker, it executes the startDig function.

ocean hollow
#

how can I convert string to int?

vast ledge
#

cus right now ur only checking the name of an inventory, then cancelling the event then checking the type of the block that was clicked

vast ledge
#

or smth like that

#

nor

#

Integer.parse

young knoll
#

Integer#parseInt

vast ledge
#

yea

#

that

ocean hollow
#

and it will take into account the signs +, -, *?

vast ledge
#

no

#

an int

#

is a number

#

not a sign

#

it will throw an exception

#

if you try converting the entire string

ocean hollow
#

and how can I then convert the formula in string form to working in numbers

young knoll
#

You’ll need a library that can parse equations

pseudo hazel
#

or parse it yourself 🤷‍♂️

#

but its way easier to just get a library lol

ocean hollow
#

can i use it?

young knoll
#

You could

#

It’s slower but that doesn’t matter if you aren’t doing it often

ocean hollow
#

what is better to get a variable through a getter? Or contact directly?

young knoll
#

Getter

ocean hollow
#

why?

kind hatch
#

Encapsulation

ocean hollow
#

ok

#

thanks

cinder abyss
#

Hello, can I set two shape on the same ShapedRecipe ?

young knoll
#

No

cinder abyss
#

okay thanks

icy beacon
#

i haven't yet looked deep into CompletableFutures and what other ways of asynchronous calls there are in kotlin, but i was able to cook this, please tell me if this looks fine to you or if i have made a grave mistake

  fun findDocuments(filter: Bson): List<Document> {
    val future = CompletableFuture.supplyAsync {
      return@supplyAsync collection.find(filter).toList()
    }

    future.exceptionally {
      return@exceptionally emptyList()
    }

    return future.get()
  }
green prism
#

Hi there,
How can I implement a restriction to prevent a specific item from being dragged into other inventories such as chests or shulkers?

vast ledge
#

You can check if the moved item should be blacklisted

#

and check the recieving inventory

#

etc..

green prism
#

hmh

vast ledge
icy beacon
#

alrighty, when I'll get to testing I'll see

#

i heard there were coroutines in kotlin but i haven't got to studying those just yet

green prism
vast ledge
#

gimme sec, ill write smth up for u

green prism
#

Thank you so much

icy beacon
#

event.setCancelled(CrownUtil.isCrown(event.getCurrentItem()))

worldly ingot
#

pls no

icy beacon
#

why not

worldly ingot
#

You're going to setCancelled(false) some other listener

icy beacon
#

?

green prism
#

oh wow, he's right

worldly ingot
#

Other plugins can listen to events too so if they want to cancel it, if they're clicking something that isn't your crown, you're going to uncancel the event and cause that plugin to break

quaint mantle
#

If im creating a LevelChunkSection how can I get an instance of a nms Level

vast ledge
#

this is correct

#

u just gotta find out which getInventory returns the inventory the player is placing the item into

#

cus i forgor which one it is

#

@green prism

#

@worldly ingot My class is lovely, you cant change my mind

#

so are you trying to create a new ServerJar?

quaint mantle
#

you already asked in the paper discord bruh

vast ledge
#

xD

quaint mantle
#

they gave u a answer

#

💀

vast ledge
#

@quaint mantle You cannot hide packages

#

You could only make the functions blocked by using protected void function()

#

but that aint helpful

#

and why r u trying to hide it anyway?

green prism
# vast ledge <@244539607125852161> My class is lovely, you cant change my mind

Thank you for generously dedicating your time

Regarding the prevention of players dragging items to non-PlayerInventory, what do you think of the following code snippet:


if (!(event.getClickedInventory() instanceof PlayerInventory)) {
    return;
}```

This code effectively ensures that players are unable to drag items to any inventory other than a PlayerInventory... _right_?
vast ledge
#

This would block you of dragging anything at all

#

You are asking if the clicked inventory is a playerinventory

#

so if you click on an item in player inventory

#

it wont move

green prism
#

Uh, thank you!

#
        if(!(event.getInventory() instanceof PlayerInventory)) return;
vast ledge
#

If you want to prevent dragging to other inventories, you can use

if(event.getInventory() instanceof ShulkerInventory) event.setCancelled();
#

event.getClickedInventory();

vast ledge
#

it should already prevent taht

vast ledge
#

I made a mistake in the screenshot

#

you have to invert the last if statment

cinder abyss
#

Hello, how can I set the maximum durability of an item ?

snow walrus
#

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftIronBars cannot be cast to class org.bukkit.block.data.type.GlassPane (org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftIronBars and org.bukkit.block.data.type.GlassPane are in unnamed module of loader java.net.URLClassLoader @18769467)

snow walrus
cinder abyss
snow walrus
#

It's not creating an iron bar anywhere

cinder abyss
#

check if your BlockData is an instance of GlassPane before doing this

cinder abyss
snow walrus
#

the block data is being created right on the top

#

and the type is GLASS_PANE

cinder abyss
snow walrus
#

You have it in the image

#

stack.getType().createBlockData()

cinder abyss
snow walrus
#

stack.getType() == GLASS_PANE

#

Doesn't matter, you know the type as it enters the if

cinder abyss
snow walrus
#

I am going to print what material the block data is getting created with

#

Now it makes less sense xD

#

it prints GLASS_PANE, it crashes tho right at the carst

#

cast*

cinder abyss
echo basalt
#

You're calling future.get which is a blocking method

snow walrus
echo basalt
#

You should instead just return the future itself and use the futures in context

#

like

#
getDocument("Joe").thenAccept(doc -> {
  ...
});
snow walrus
torn shuttle
#

alright it's happening, my free minecraft models plugin is finally getting worked on

cinder abyss
torn shuttle
#

I just need to remember how I had this working in the first place

snow walrus
#

I am using that, it prints GLASS_PANE

cinder abyss
#

maybe shrug

#

but if I can't see what is stack, I can't do something more

snow walrus
#

sure

echo basalt
snow walrus
#

It's already set to api-version: '1.20'

#

Same error

#

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftIronBars cannot be cast to class org.bukkit.block.data.type.GlassPane (org.bukkit.craftbukkit.v1_20_R1.block.impl.CraftIronBars and org.bukkit.block.data.type.GlassPane are in unnamed module of loader java.net.URLClassLoader @18769467)

river oracle
#

you are having a class cast exception because GlassPane does not work with BlockData of type GlassPane rather you should be using BlockData of type Fence

snow walrus
#

🤣 Okay, let me try

#

I don't understand why org.bukkit.block.data.type.GlassPane is even a thing

river oracle
#

colored glass has type of GlassPane

#

GlassPane BlockData also has different methods

quartz panther
#

I have quite a problem. I have a bungeecord lobby server and for example a survival server. I am modifying the ServerSelectorX plugin and want to add permissions checking to it. On the bungee server I have luckpermsBungee and there I add all the permissions such as ssx.permission.survival for example and I stopped at checking those permissions. ChatGPT was not able to help either.

snow walrus
#

It fixed

cinder abyss
#

Hello, how can I set the maximum durability of an item ?

river oracle
#

?jd-s

undone axleBOT
quartz panther
cinder abyss
river oracle
#

ahhh

tidal anchor
#

I am creating a plug-in and I have this item and I want to use that item in a recipe. I have already tried creating a new recipe choice

young knoll
#

RecipeChoice.ExactChoice

river oracle
cinder abyss
river oracle
cinder abyss
#

thanks

lament swallow
#

Hey I hardcoded some permissions for my commands in plugin.yml but that causes the console to not have permissions so use them. Is there any fix to this?

tidal anchor
quaint mantle
#
Is there a wrapper method for sending the packet ClientboundLevelChunkWithLightPacket class

river oracle
#

highly doubt it

vast ledge
vast ledge
#

Are you still having it?

lament swallow
vast ledge
#

wdym

#

Oh

lament swallow
#

the command doesn't appear in tabcomplete

vast ledge
#

you added it in the config.yml

#

plugin.yml**

lament swallow
#

yeah

vast ledge
#

Why not just check the perm on execute?

lament swallow
#

it makes the command visible to players that don't have the permission to use it

vast ledge
#

Why is that so bad?

lament swallow
#

cause players can see what commands staff can use etc

#

but that's besides the point rly

vast ledge
#

In General hardcoding permissions is a no no

lament swallow
#

ah

#

why

vast ledge
#

If you implement a Permission Manager at somepoint

#

Or if you plan on allowing this project

#

to be a "master" for others

#

It would be best to check for entire "groups" of permissions

#

I mean i cant really say much on the matter, i dont use the default command registery

#

I use AIKAR

#

(ACF)

lament swallow
#

okok

vast ledge
#

I sadly havent made any guides on that yet, but if your looking for a MongoGuide lemme know

cinder abyss
#

Hello, how can I consume durability of a bow ? (like when someone is shooting with it), I want to consider that the bow may have unbreaking

vast ledge
#

How you can remove durability?

cinder abyss
vast ledge
#

Yea, you have the function what else do you need?

flint coyote
#

A random int function I suppose

vast ledge
#

Theres an example

#

i dont know why you have to change the damage

flint coyote
#

He said he wants to consider unbreaking. And he never said he wants to do it inside the damage event

#

More like "right click -> damage" without actually firing

vast ledge
#

What does he want to do tho?

#

that

#

oh

#

that just cancle the event

#

and get the damage it would have done to the bow

#

by doing event.getDamage();

flint coyote
#

well if you just click it for a split second it won't be called since the bow will not take damage and not fire an arrow

#

Consider the bow a special activatable item. Like right clicking with a special dirt block

vast ledge
#

If he wants that he can use a playerInteract even

flint coyote
#

I suppose that's what he wants

vast ledge
#

Yea

#

he was rather vague

flint coyote
#

true

vast ledge
flint coyote
#

is there a problem with it or do you just want a code review?

vast ledge
#

No problem

#

i sent it in code review

cinder abyss
#

Hello, why it doesn't apply damages to the bow ?```java
ItemMeta meta = e.getBow().getItemMeta();
if (meta instanceof Damageable) {
Damageable damageable = (Damageable) meta;

int currentDurability = damageable.getDamage();
int newDurability = (int) (currentDurability - 1);

if (newDurability < 0) {
newDurability = 0;
}

damageable.setDamage(newDurability);
e.getBow().setItemMeta(meta);
if(e.getEntity() instanceof Player) ((Player) e.getEntity()).updateInventory();
}```

vast ledge
#

damageable.setDurability()

flint coyote
vast ledge
#

on the end of getString or getDouble=

fervent gate
#

I'm using Jeffs CustomBlockData class and I'm encountering the following error: Unsupported class file major version 60

Anyone know anything about this?

subtle folio
#

== for enum right

vast ledge
#

Enum?

flint coyote
#

All of them. But ye numbers would then be strings, true

cinder abyss
subtle folio
subtle folio
fervent gate
subtle folio
#

enum

hybrid spoke
fervent gate
#

don't remember how to change it but ima look it up

subtle folio
#

kk

vast ledge
#

You dont know what an enum is?

subtle folio
#

you don’t..

vast ledge
#

@hybrid spoke

hybrid spoke
#

who is that

subtle folio
#

never heard of them

vast ledge
#

Its a Java

subtle folio
#

Java?

vast ledge
#

yes

#

english

#

a Java

subtle folio
#

dafuq is that

hybrid spoke
#

so a cup=

flint coyote
# vast ledge Where

You can however just put it using #put(). I suppose org.json has a type matching internally already

vast ledge
#

I can try

#

Would it work with an Array tho?

#

i mean it takes a Object

#

so it should be fine

flint coyote
#

I suppose it would work with arrays, too

vast ledge
#

so i could just do

JSONObject toSave = new JSONObject();
        for (String s : defaults.keySet()) {
            Object o = defaults.get(s);
            toSave.put(s, s);
            if (o instanceof String) toSave.put(s, getString(s));
            if (o instanceof Double) toSave.put(s, getDouble(s));
            if (o instanceof Integer) toSave.put(s, getInteger(s));
            if (o instanceof JSONObject) toSave.put(s, getObject(s));
            if (o instanceof JSONArray) toSave.put(s, getArray(s));
        }
//instead do

JSONObject toSave = new JSONObject();
        for (String s : defaults.keySet()) {
            Object o = defaults.get(s);
            toSave.put(s, s);
        }
#

no i couldnt

#

just saw it

flint coyote
#

uhm no and the code before is questionable aswell

vast ledge
#

id still have to use getString()

flint coyote
#

why would you do s, s

#

you need s, o

vast ledge
#

i just noticed

#

yea

sharp heart
#

cc zz

#

cc zz

#

cc zz

vast ledge
#

stop spamming

#

haha get blocked by the bot xD

flint coyote
vast ledge
#

This is updated

#

fixed

flint coyote
#

yes

vast ledge
#

ty 😄

#
//Instead of using this
    public String getRawData(String key) {
        if (!json.containsKey(key)) return "";
        return String.valueOf(defaults.get(key));
    }
// I can use this
    public String getRawData(String key) {
        return json.containsKey(key) ? String.valueOf(defaults.get(key)) : "";
    }
flint coyote
#

yes that's the same

vast ledge
#

Ik

#

it look nicer tho

cinder abyss
#

Hello, why my bow's durability isn't set to 1 ?java e.getBow().setDurability((short) 1); if(e.getEntity() instanceof Player) ((Player) e.getEntity()).updateInventory();

vast ledge
fringe yew
#

does .getMessage() on a command event return the comamnd with or without the slash and does it include args?

vast ledge
#

good question

#

Test it

#

no damage in doing so

fringe yew
#

that's gonna take two minutes i can't afford to waste smh

vast ledge
#

Bruh

#

you took the time to write a message in discord, you couldve just tested it urself by now

fringe yew
#

it takes so long to build on windows

#

no

vast ledge
hybrid spoke
undone axleBOT
fringe yew
#

but

#

it doesn't specify whether it includes args

hybrid spoke
flint coyote
hybrid spoke
#

"message the player is attempting to send"

#

which includes args

#

since its the message

#

the whole

fringe yew
#

and slash?

hybrid spoke
#

without the prefix

glad prawn
fringe yew
#

okay

hybrid spoke
#

everything stands there

fringe yew
#

thanks

flint coyote
fringe yew
#

so everything excluding the / (i.e. "/help" = "help")

vast ledge
#

@fringe yew

fringe yew
vast ledge
fringe yew
#

MY QUESTION IS WHETHER IT INCLUDES THE SLASH

#

it's a yes or no question

vast ledge
#

TEST IT

#

YOUVE SPENT MORE TIMEHERE

fringe yew
#

JUST TELL ME YES OR NO

vast ledge
#

THEN YOU WOULD VE TESTING

fringe yew
#

just forget it

vast ledge
#

Okay

fringe yew
#

if all you're going to do is argue with me

#

it takes too long to build on windowss

vast ledge
#

Its been 3min

#

It doesnt take 3min to build

#

even with maven

fringe yew
#

and?

flint coyote
#

Why do you require a sorted json?
Json is usually not meant to be used as userfriendly output.

If you really require sorting you are doing fine though

fringe yew
#

if you would have gave me a yes or no answer

#

it would have taken 3 seconds

#

rather than the 5-10 minutes i'd need to set up everything

vast ledge
young knoll
#

Have you considered that we don’t know?

vast ledge
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous names and nicknames of a member.
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

fervent gate
#

I'm using Jeffs CustomBlockData class and I'm getting a classnotfound error.

Caused by: java.lang.NoClassDefFoundError: com/jeff_media/customblockdata/CustomBlockData
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more
Caused by: java.lang.ClassNotFoundException: com.jeff_media.customblockdata.CustomBlockData
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
vast ledge
#

?shouldiask

vast ledge
#

Its not a command 😦

fervent gate
fringe yew
#

maven shading is weird

fervent gate
#

Want me to send my POM?

fringe yew
#

never works

flint coyote
flint coyote
#

if it's for machines only it doesn't matter anyway

vast ledge
#

If its used only for machines, it automatically binary

#

binary is smaller

#

and easier

flint coyote
#

Well you might want someone to be able to check if there's any issue. Idk what you are using it for

#

You should however use try with resources for your file writer. Saves you the close

#

Here's an example if you never heard of it

vast ledge
#

It giving me and Autoclosable error

flint coyote
#

The file writer has to be inside the try, not the string

vast ledge
#

oh

#

ty

#

Like this?

flint coyote
#

yes

fervent gate
#

I'm using Jeffs CustomBlockData class and I'm getting a classnotfound error. I have shaded already and here is my pom.xml: https://paste.md-5.net/lehukinaco.xml

Caused by: java.lang.NoClassDefFoundError: com/jeff_media/customblockdata/CustomBlockData
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more
Caused by: java.lang.ClassNotFoundException: com.jeff_media.customblockdata.CustomBlockData
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
zealous osprey
fresh timber
#

how would I create a recipe for my server that is sorta shapeless, sorta shaped... here's an example, the recipe for sticks in default minecraft. You are able to put the 2 planks ontop of eachother anywhere in the crafting table but they do have to be on top of eachother. How can I do this for 1 recipe orrrrr do I have to make like 6 different shaped recipes for all of them if I wanted to make the stick recipe?

young knoll
#

Only include two values in the shape

#

It should handle the rest

#

Ie “X”,
“X”

vast ledge
covert nest
#

are plugins that kick people for interacting with blocks as a joke allowed, if i specifically say they are a joke?

fresh timber
zealous osprey
vast ledge
#

Wait lemme screenshot

zealous osprey
#

<3

young knoll
fresh timber
#

yea i see now

#

thx

vast ledge
#

then

covert nest
#

:(

vast ledge
#

Your plugin has to state an actuall use case

covert nest
#

to troll players

flint coyote
covert nest
#

not to troll admins

vast ledge
#

You can always try, but it will probably get denied

flint coyote
#

then people can configure it to kick people

vast ledge
#

Yea

#

i guess

covert nest
#

cba

#

gn then

vast ledge
zealous osprey
#

I saw, going through the themes, thanka <3

cinder abyss
#

Hello, why can't I do this ?java Damageable damageable = (Damageable) e.getBow().getItemMeta(); damageable.setDamage(damageable.getDamage() - 5); e.getBow().setItemMeta(damageable);

Required type: ItemMeta
Provided: Damageable```I think if I cast Damageable to ItemMeta It'll don't set the durability
young knoll
#

Did you import the right damageable

cinder abyss
young knoll
#

Should be, yes

cinder abyss
cinder abyss
fervent gate
#

I'm using Jeffs CustomBlockData class and I'm getting a classnotfound error. I have shaded already and here is my pom.xml: https://paste.md-5.net/lehukinaco.xml

Caused by: java.lang.NoClassDefFoundError: com/jeff_media/customblockdata/CustomBlockData
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more
Caused by: java.lang.ClassNotFoundException: com.jeff_media.customblockdata.CustomBlockData
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.initializeFirstLever(DungeonRoom1.java:31) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.manager.dungeon.DungeonRoom1.<init>(DungeonRoom1.java:23) ~[stonedzonedmain-1.0-remapped.jar:?]
        at me.cosmic.stonedzonemain.commands.generaldungeoncommands.StartDungeon.onCommand(StartDungeon.java:53) ~[stonedzonedmain-1.0-remapped.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
fervent gate
river oracle
#

maybe relocation didn't work correctly

jagged sky
#

That's one of the things I always hated around Maven, it maybe works and it maybe doesn't with the exact same config

river oracle
#

are you compiling with mvn package

jagged sky
#

Try to switch to Gradle, idk

river oracle
#

^ no gradle doesn't work with NMS

fervent gate
jagged sky
#

Oh really? I thought it basically did the same thing, just different syntax

river oracle
#

so the mappings can't be remapped

jagged sky
#

But can't you just use reflections? That shouldn't give an error, no?

river oracle
#

you could use reflection, but that's so much more work

#

it also doesn't let you extend NMS classes

fervent gate
#

Is there another way to use PDC in blocks?

river oracle
#

no, there's something up with your pom.xml

#

I'm looking at it rn

#
                    <source>8</source>
                    <target>8</target>
#

targeting java 8 with 1.17+ is a no go

fervent gate
river oracle
#

its cuz jeflib targets 8 damn

#

you should probably ask alex

fervent gate
#

@tender shard

river oracle
#

join his discord

#

and ask in a support channel

fervent gate
#

okay, thx

young knoll
#

You should be fine using 8

river oracle
#

maybe shade plugins out of date then?

#

its so unclear cuz it looks like configuration is correct

young knoll
#

Idk I’m not much a maven guy :p

quaint mantle
#
for(int index = t.indexOf("/%{2}COLOR_[A-Z]+%{2}/g"); index >= 0; index = t.indexOf("/%{2}COLOR_[A-Z]+%{2}/g", index + 1)) {
            int lastIndex = t.lastIndexOf("%{2}COLOR_[A-Z]+%{2}", index);
            String subString = t.substring(index, lastIndex);
            System.out.println(subString);
        }
#

sohuld this work

#

i have never used regex in my life

#

trying to get every instance of %%COLOR_WHATEVER%% in a string

glad prawn
#

Try it and

quaint mantle
#

well it does not

#

wait

#

nvm it doesnt

young knoll
#

Use Pattern.compile and Pattern#matcher

cinder abyss
#

Hello, how can I use an item with specific metadata in a ShapedRecipe ?

young knoll
#

RecipeChoice.ExactChoice

cinder abyss
quaint mantle
#

is this valid regex btw?

#

should be

young knoll
#

You can always check with regex101

cinder abyss
#

if it's what you want shrug

#

(I almost understand regex, but it's a little rough...)

quaint mantle
quaint mantle
#

but getting nothing here

glad prawn
#

Why not ^%%COLOR_[A-Z]+%%

quaint mantle
#

same output

#

nothin

glad prawn
#

Try remove /

quaint mantle
glad prawn
#

and /gm

quaint mantle
#

this works

glad prawn
#

k

quaint mantle
#

but then how do i get all instances in a string of that

young knoll
#

You can do while (matcher.find)

#

In fact there are a bunch of methods in matcher you can use

#

I suggest you look at the javadocs

green plaza
young knoll
#
  1. Yes
  2. You don’t have to use remapped, but you should
river oracle
#

I'm pretty sure you need NMS for pathfinding goals yeah but I think a better guide is alex's post tbh

#

?nms

quaint mantle
green plaza
young knoll
#

Oof

#

Why tf did you not use remapped

green plaza
river oracle
#

you can look them up :P

young knoll
#

It’s worth it to change

#

It’s so much easier to read and update

quaint mantle
#

yall ever like have code that works then u change something, change it back and it doesnt work

river oracle
#

Time to use the good ol FileHistory feature :P

quaint mantle
#

ohhh i see the problem

green plaza
noble lantern
#

sitting and crying about it normally fixes that for me

quaint mantle
noble lantern
river oracle
quaint mantle
#

patterns are weird

#

if i have anything else except the %%COLOR%% thing, it just doesnt work

river oracle
#

what's your regex

quaint mantle
#

%%COLOR_[A-Z]+%%

river oracle
#

looks good to me

quaint mantle
#

yea looks good to me there aswell

#

but my java is like: no

green plaza
#

I have one more question about this remapped. If i am using obfuscated spigot and then i use remapped version in my pom.xml will it colide with each other?

opal depot
green plaza
river oracle
#

good abstraction I suppose

#

otherwise you don't

quaint mantle
opal depot
#

matches() will only say true if the full string matches

quaint mantle
#

alright it works

#

now im guessing i use indexof or smt

opal depot
green plaza
quaint mantle
#

gimme a sec

rapid garden
#

Hey, new to plugin development (and JAVA in general). I was wondering if there are any good videos to get me started apart from WOK and Kody Simpson's playlist.

I also got a pressing issue. How exactly do I set the output/result of an anvil? I wanna mix two echanted books together (Fortune III + Silk Touch - just for testing purposes). I can't seem to find any AnvilInventory.setResult()

river oracle
#

follow this guide

#

it shows you how to setup remapped

#

do not use separate dependencies

#

you only need 1

#

spigot-api is no longer needed after you add the spigot dependency

opal depot
quaint mantle
#

idk why

opal depot
#

use the adventure text api

#

then you can do magical stuff like this

quaint mantle
#

but like, i like making my own shit

#

its good practice

opal depot
#

its a waste of time

#

it isnt good practice at all

ancient plank
opal depot
#

unless youre doing it as a learning experience

opal depot
ancient plank
#

They're saying good practice as a learning experience, not it being good practice

green plaza
# river oracle follow this guide

I have done this guide

            <plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.19.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>

And now i can not use nms classes

river oracle
#

you can just not the same ones

#

the class names change

#

refer to the site for all changes

green plaza
#

Oh okay

#

Thanks ❤️ didnt expect that

quaint mantle
glad prawn
#

🤔

quaint mantle
#

this seems to work ig

hard socket
#

is this a good way to make a custom enchant system?

river oracle
#

id?

opal depot
opal depot
#

please tell me youre not using indexof

noble lantern
#

for skins right

quaint mantle
#

yea i am not

#

idk why i said that lmao

opal depot
#

thank god lol

noble lantern
#

?paste

undone axleBOT
quaint mantle
opal depot
quaint mantle
#

prob not most efficient way but it works

 public static String TranslateStringWithColor(String t) {

        Pattern pt = Pattern.compile("%%COLOR_[_A-Z]+%%");
        Matcher mt = pt.matcher(t);

        while(mt.find()) {
            String str = mt.group();

            String color = str.replace("COLOR_", "");
            color = color.replaceAll("%%", "");


            t = t.replace(str, ColorCode() + Colors.valueOf(color).t);
        }

        return t;
    }
noble lantern
#

Use

young knoll
#

Keep it in a static constant

quaint mantle
#

oh yea thats a thing

noble lantern
#

sec for this site it looks changed for some reason

opal depot
#

i think that should give you just the color name

timid hedge
quaint mantle
#

nah uh

noble lantern
opal depot
#

idk in regex it would be $1

quaint mantle
noble lantern
#

should work on 1.17ish+ i know it was annoying as to figure out how to get those working on newer version

young knoll
#

I think it was 1.18

#

Idk

chrome beacon
#

Alex has a guide for that

young knoll
#

It’s basically the same

chrome beacon
#

And yes I believe it was 1.18.2 or smth

quaint mantle
#

and then this

noble lantern
#

oof legacy

#

ggs good luck

young knoll
#

Heh

#

Have fun with AuthLib

timid hedge
quaint mantle
#

what version u on

noble lantern
quaint mantle
#

are u in luck i got smt for u

#
public static ItemStack createSkull(String texture) {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
        SkullMeta headMeta = (SkullMeta) head.getItemMeta();
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);
        profile.getProperties().put("textures", new Property("textures", texture));
        try {
            Field profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }

        head.setItemMeta(headMeta);
        return head;
    }

    public static ItemStack playerSkull(Player player) {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
        SkullMeta headMeta = (SkullMeta) head.getItemMeta();

        headMeta.setOwner(player.getName());

        head.setItemMeta(headMeta);
        return head;
    }
quaint mantle
#

not the minecraft url

noble lantern
#

i copies the value by default

#

it doesnt copy url

quaint mantle
#

okay nms for 1.20 time

#

gonna set up mappings instantly

opal depot
chrome beacon
#

You can easily convert between the two

opal depot
#

:)

quaint mantle
#

lovely

glad prawn
#

xd

quaint mantle
#
 public static String TranslateStringWithColor(String t) {
        Matcher mt = pattern.matcher(t);

        while(mt.find()) {
            String fullstring = mt.group();
            String colorString = mt.group(1);

            t = t.replace(fullstring, ColorCode() + Colors.valueOf(colorString).t);
        }

        return t;
    }
#

thats better

timid hedge
chrome beacon
#

You need to import auth lib

opal depot
timid hedge
quaint mantle
chrome beacon
#

?google

undone axleBOT
opal depot
#

cmon its a challenge

quaint mantle
#

its already gonna be a challange to import nms with breaking everything

chrome beacon
#

You know you could just use Adventure and MiniMessage

quaint mantle
#

ill do that first

opal depot
#

hes doing it as a learning experience

buoyant viper
young knoll
#

MiniMessage screams at you if you have any legacy color codes

#

It’s very annoying

buoyant viper
#

(unless u want actually good useful components)

#

jk

young knoll
#

Honestly spigot and adventure components aren’t even that different

#

Aside from MiniMessage that is

buoyant viper
# opal depot real

i mean i use Spigot components for my code, i dont feel like im lacking anything with them

quaint mantle
#

lemme check

#

all the imports i use:

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;

import java.lang.reflect.Field;
import java.util.UUID;
buoyant viper
opal depot
chrome beacon
#

Again you need to import auth lib

quaint mantle
#

bro cannot resolve mojang thats not a good sign

opal depot
#

you need to add the mojang authlib library to your dependencies

noble lantern
#

i support the idea of winnimessage

quaint mantle
#

but yea get autlib

opal depot
#

are you using maven or gradle

buoyant viper
#

parsing text is NOT my specialty

noble lantern
#

thats how you get good at it

#

by practicing :p

buoyant viper
quaint mantle
#

i love installing buildtools

opal depot
#

answer my question then i can help lol

quaint mantle
#

doesnt take ages at all

opal depot
buoyant viper
quaint mantle
#

i mean atleast ill be able to watch a progress bar instead of 99999 lines of text

buoyant viper
#

shameless self promo

quaint mantle
#

woooo i got scheduled in for one more half hour of work next week

young knoll
#

Banned

quaint mantle
#

thats improvement

young knoll
#

It’s way faster after the first install

buoyant viper
opal depot
#
<dependency>
    <groupId>com.mojang</groupId>
    <artifactId>authlib</artifactId>
    <version>3.17.30</version>
    <scope>provided</scope>
</dependency>
young knoll
#

Since it only has to pull changes

opal depot
#

add that to your dependencies

young knoll
#

And not download portable git

buoyant viper
young knoll
#

Skill issue idk

buoyant viper
young knoll
#

I use windows

#

Works fine

buoyant viper
#

do u use git bash

young knoll
#

No

buoyant viper
#

hmm

young knoll
#

I use powershell XD

kind hatch
#

I got away with normal command prompt. :p

quaint mantle
#

can i use both paper and nms or does that like not work

buoyant viper
quaint mantle
#

or.. i dont use paper

buoyant viper
#

since to use NMS u need to import org.spigotmc:spigot

#

which also imports spigot-api

quaint mantle
#

ill just not use paper easy fix

opal depot
#

do you know how to add a repository?

buoyant viper
#

that is a good idea

#

reject Fork, embrace tradition

#

only Bukkit

opal depot
#
<repository>
  <id>lumine</id>
  <url>https://mvn.lumine.io/repository/maven-public/</url>
</repository>
#

try adding this one

#

i (think) it should be hosting authlib

chrome beacon
#

Just use the official repo??

quaint mantle
#

if my plugin still works after just putting in random stuff (nms) and removing other stuff id be suprised cus thats a first

opal depot
#

thats the one thats listed on mvnrepository

chrome beacon
#

Yeah the one that the game downloads it from

young knoll
#

Yes

opal depot
quaint mantle
#

oh my god i can use strings instead of components

opal depot
#

i cant understand you

chrome beacon
opal depot
#

ok

quaint mantle
#

theres no placeblock event right? just right click on block

timid hedge
#

But still dosent work
I cant still use GameProfile and the others

undone axleBOT
young knoll
opal depot
quaint mantle
young knoll
#

It 103% does

chrome beacon
#

It does

#

There's no reason for them to remove that

quaint mantle
opal depot
opal depot
quaint mantle
chrome beacon
young knoll
quaint mantle
#

i love this kinda stuff, less effort

young knoll
#

ClassesFromFodler

#

Fodler

quaint mantle
#

ignore that

opal depot
#

change https://mvn.lumine.io/repository/maven-public/ to https://libraries.minecraft.net/
and change 3.17.30 to 2.1.28

#

and see if that works

quaint mantle
#

what do u mean fodler

opal depot
#

whyyyyyyyyyy

pseudo hazel
#

to annoy you

#

and it worked

quaint mantle
#

^

opal depot
#

also ClassesFromFodler

quaint mantle
#

now imma change them all back

young knoll
#

Wtf is this C#

opal depot
#

lmfao

opal depot
quaint mantle
#

tbh im used to c# a bit

#

unity corrupted me okay

opal depot
#

in the dependency

#

not the repositories

quaint mantle
#

i usually capitalise my voids and not the ones that return something

#

is that fine?

opal depot
quaint mantle
#

okay fine

opal depot
#

so its basically the same but adds a little overhead for unboxing

quaint mantle
#

thats not what i meant

opal depot
#

from what you posted your repositories are fine

quaint mantle
#

idk what im thinking

#

its 12 am ok

young knoll
#

If you capitalize any function you will be sent to hell

#

Sorry I don’t make the rules

opal depot
quaint mantle
#

i changed it its fine dw

opal depot
#

the same thing you had before but with the version changed to what i told you to change it to

chrome beacon
opal depot
#

why do all spigot devs use maven

young knoll
#

Because spigot uses maven

quaint mantle
#

imma make some people trip with this

young knoll
#

And special source is for maven

#

That being said I use gradle

opal depot
#

noooooo

#

change your spigot api version back to what it was

chrome beacon
#

I haven't had a single useful error message when writing my gradle files

opal depot
#

but with the different version

young knoll
#

Damn spigot 2.1.28

#

I gotta see what sick api that has

opal depot
quaint mantle
#

i need to buy an alt to test things but i just bought smt for 1200 bucks so im broke

opal depot
#

ive been using for like a year now prob and most of the time i instantly know every error that pops up

young knoll
#

Just use offline mode to test things

noble lantern
#

^

opal depot
#

dood

#

change 3.17.30 to 2.1.28

#

like i said

young knoll
#

Probably

noble lantern
#

alternatively he can always just update to modern mc CH_Kek

chrome beacon
#

You probably didn't reload your pom

quaint mantle
chrome beacon
#

Use a launcher like Prism

quaint mantle
#

are you using intellij

#

CTRL + SHIFT + O

quaint mantle
opal depot
#

google "spigot how to add authlib dependency to maven" i need to go to sleep

chrome beacon
quaint mantle
opal depot
#

or ask someone else how to import nms using buildtools or whatever idk i dont use maven

quaint mantle
#

most java errors you have to scrool

#

should be fineeeee