#help-development

1 messages · Page 1240 of 1

blazing ocean
#

You can

cinder abyss
#

okay thanks

blazing ocean
#

just get the minecraft version property in your buildscript and depend on NMS with that version

cinder abyss
#

yeah that's what I'm doing, combined with patrick's remapper

cinder abyss
#

I put my code in the main ? not subfolders ?

blazing ocean
#

yes

cinder abyss
#

why can't I use CB ?

blazing ocean
#

you haven't shown any part of your buildscript so, how would I know

thorn isle
#

why does this need nms?

cinder abyss
#

but I prefer working with nms instead of reflection

thorn isle
#

but like what are you doing

cinder abyss
cinder abyss
#

and then use text display to do Falling leaves

#

but on spigot

cinder abyss
thorn isle
#

i'd probably just bundle the default color palette and the humidity/temperature function used to access it in the plugin

#

if it's a training wheel project for leaning nms, sure

#

but for an actual project project it's needlessly fragile for what little it achieves in my opinion

cinder abyss
thorn isle
#

pretty sure the whole color map doesn't even get used, each biome has its own flat color from the map and iirc the rgb values for those are even on the wiki

cinder abyss
#

almost all the code is done, I just want to put it on gradle

cinder abyss
#

and also for training

cinder abyss
#

did you find rad ?

thorn isle
#

you can get humidity and temperature directly from Block

#

so if you already have those and the function to get the colormap coordinates from them and the colormap... that's basically all of it; what need for nms?

cinder abyss
#

it's done

blazing ocean
cinder abyss
#

Can we return to how to use multi module project to support multiple nms versions ?

blazing ocean
#

you can, it's just more work

#

well, try running the remap task

cinder abyss
#

But idk why I can't use CB on the project

cinder abyss
thorn isle
cinder abyss
cinder abyss
blazing ocean
#

and are you sure you have run BT

cinder abyss
#

My code is 1 year old lol

cinder abyss
#

but

#

CB is just working for the vcs version

#

but looks like it overrides other CB versions or idk

#

never used stonecutter before

#

maybe you know rad ?

blazing ocean
#

I mean, check what the current stonecutter version is

cinder abyss
blazing ocean
#

well, the Minecraft version

cinder abyss
#

Oh

cinder abyss
blazing ocean
#

so why would the remapper be spewing out 1.20.4 then

#

instead of .5

glossy laurel
#

huys

#

guys

#

how do I change the prefix in commands (/<prefix>:<command>)

chrome beacon
#

You really shouldn't

#

It's the name of your plugin

blazing ocean
#

what if I name my plugin minecraft

glossy laurel
white crescent
#

Is there any way to add two lines into action bar? I have power bar and 2 abilities and I want to make the abilities on top of the power bar

blazing ocean
#

plugin.yml

glossy laurel
#

is it "name" in plugin.yml

#

alr

blazing ocean
white crescent
#

I have resource pack with the bar and abilities but I don't think so I have negative spaces

blazing ocean
white crescent
#

I have like empty space for spacing something foward

cinder abyss
blazing ocean
#

well me neither

cinder abyss
#

humm is there a multi module nms example for gradle ?

#

anyone ?

blazing ocean
#

I mean all you need to do is set up multiple modules

#

not that hard

cinder abyss
#

the problem is the java version to compile

blazing ocean
#

you need to compile to the lowest version you want to target iirc

cinder abyss
#

but it doesn't want to resolve spigot jar if it's using java 17

eternal night
cinder abyss
#

lol

eternal night
#

I didn't link it so you can look at paperweight

cinder abyss
#

(no I joke)

eternal night
#

I linked it so you can look at the gradle module setup typing

cinder abyss
#

(I'm not funny)

eternal night
#

😅 my bad then, went over my head

cinder abyss
blazing ocean
lavish wing
#

Hello everyone!
Guys, tell me pls, how can I get src's of Spigot 1.6.4?
BuildTools support 1.8 - 1.21.4 😔

umbral ridge
#

is that text and red color set by client?

#

can it be changed so it doesnt show an error

#

just a plain white string, like it used to be?

sullen marlin
#

Maybe with a resource pack

#

Definitely not with the server

blazing ocean
#

maybe with a shader, you'd have to isolate the chat text though

cinder abyss
#

(learnt some new useful things for gradle with this too)

#

huh paper feel so heavy

blazing ocean
#

wait till you make your own extensions in conventions, that's when shit gets fun

cinder abyss
#

and @DEPRECATED AAAAH

cinder abyss
#

(french word btw)

blazing ocean
#

then you can just ```kt
axi {
paper {
internals()
}
}

![yippee](https://cdn.discordapp.com/emojis/1124707213815070782.webp?size=128 "yippee")
cinder abyss
#

but I don't like paper

#

when it works for spigot it works for paper

#

so I'll use spigot, because paper is trash for "simple" dev imo

blazing ocean
#

well this isn't something paper specific, it just happens that that project uses paper

cinder abyss
#

(pro-spigot guy)

cinder abyss
#

I watch you

#

IF YOU PREFER PAPER TO SPIGOT

blazing ocean
cinder abyss
#

you'll be left like Jeanne D'Arc

#

Jean Bow

cinder abyss
blazing ocean
#

I just know some gradle basics that's it

cinder abyss
#

looks like that's already a lot

#

can I learn from you master ?

blazing ocean
#

please do not call me master

cinder abyss
#

can I learn from you dev branch ?

jade oasis
#

does anyone know how i can perfect combine to codes for 2 different plugins into 1 or am i better off having them seperate

chrome beacon
#

Just keep them separate

eternal night
mortal hare
#

what's your guys opinion on font ligatures

#

like it? not like it?

blazing ocean
#

love them

eternal night
#

i like them for anything that isn't javascript

#

=== and == is too close for me

blazing ocean
mortal hare
eternal night
#

I mean, in java it is perfectly fine

#

mostly because java isn't operator spamming

#

(like other languages kotlin)

blazing ocean
#

keeping this framed on my wall

eternal night
#

@young knoll pls ban

#

they are using my own words against me

blazing ocean
young knoll
#

Lynx is purposefully going to break comparability with all spigot plugins tomorrow

eternal night
cinder abyss
#

ain't no way

#

@cedar saffron

#

love you

cedar saffron
#

i love you too bro

cinder abyss
#

my bad I'm just dumb

#

I'm not

#

or maybe not

#
* What went wrong:
Execution failed for task ':nms_1_21_4:remap'.
> Could not resolve all files for configuration ':nms_1_21_4:detachedConfiguration1'.
   > Cannot resolve external dependency org.spigotmc:minecraft-server:1.21.4-R0.1-SNAPSHOT because no repositories are defined.
     Required by:
         project :nms_1_21_4```

huumm
#

even when specifying all repositories for all projects, it keeps saying that

chrome beacon
#

Did you build 1.21.4 with build tools

cinder abyss
chrome beacon
#

also is mavenLocal defined as a repo

cinder abyss
#

yeah using repositories {... mavenLocal() ...}

cinder abyss
chrome beacon
#

yeah idk it seems to be complaining about missing repo

cinder abyss
#

yeah that's what I though

#

but still complaining when I give him the repo lol

lavish wing
chrome beacon
#

No

lavish wing
#

(((

fickle spindle
#

OfflinePlayer target = Bukkit.getOfflinePlayer(arg[0]); <- the getOfflinePlayer for the user Name is deprecated how can i use the Uuid in a command like /ban mattyu <- if i do with the method i said before it's deprecated i should use the uuid of the player but if i can't catch the player how can i get the uuid?

chrome beacon
#

If you use the name as a command argument getting the offline player by name is fine

#

Do note that it can do a blocking network request

thorn isle
#

getofflineplayer itself won't iirc, but if you call getName or something on it it will if it's not in the usercache

ivory sleet
#

pretty sure it will?

chrome beacon
#

^^

ivory sleet
#

on spigot at least

chrome beacon
#

It will work just fine

fickle spindle
ivory sleet
#

if i remember correctly

thorn isle
#

oh yeah getting by name

#

nevermind

#

that'll be a network request if it's not in the usercache

#

because it kinda implies getName

#

getting by uuid won't fire a request

fickle spindle
iron glade
#

Would it be possible to force a custom resource pack on a player, play a custom sound from that pack and remove the resource pack again? As a way to play custom sounds?

wet breach
iron glade
#

does it force that loading screen when changing resource pack or is there a way to do that sneaky?

kind hatch
#

It'll force the loading screen

#

There's no avoiding that one.

thorn isle
#

and it will force the player to reload all assets

#

not just your custom sound

#

on a low end machine this may take 10+ seconds

#

not something you want to do to fire an one-off sound

pliant topaz
#

i would just leave the resourcepack on

#

no need to remove it afterwards, even if it doesnt serve any function after the one sound

outer tendon
#

I keep getting a ticking block entity issue now that I've made changes to the populate method in my BlockPopulator, but I don't really understand what that means. Everything online about it pretty much says it has to do with mods, and that I need to restore an older version of the server or whatever, but I can't figure out what is causing it.

Here's my crash report: https://paste.md-5.net/pohupuwuru.pl
And here's my BlockPopulator code: https://paste.md-5.net/ohagiyumib.cs

mortal vortex
#

does spigot have tags like Forge does? like instead of specifying accepted items using the Materials enum, like:
if(item == Material.DIAMOND_ORE || item == Material.IRON_ORE), is there some global tag for "ores"?

buoyant viper
#

Tags @mortal vortex

mortal vortex
buoyant viper
#

thats the class name i think

#

Tags

#

?jd-s

undone axleBOT
buoyant viper
#

nvm just Tag

#

no s at the end

outer tendon
#

You can also check if the block's BlockData#requiresCorrectToolForDrops() returns true, which should narrow it down,

#

Looks like there are STONE_ORE_REPLACEABLES and DEEP_SLATE_REPLACEABLES tags

#

Idk if those apply here though

undone axleBOT
outer tendon
quaint mantle
#

can i hide or block recipe popups?

sullen marlin
#

Thanks

short pilot
#

hello im trying to make my custom mob target players not matching an assigned faction ID of said mob

I am not sure how to make this TargetGoal properly though, here is what I have so far

public class TargetNonFactionPlayersGoal extends TargetGoal {

    private final CustomWitherSkeleton customWitherSkeleton;
    private final UUID factionId;

    public TargetNonFactionPlayersGoal(CustomWitherSkeleton mob, UUID factionId) {
        super(mob, false);
        this.customWitherSkeleton = mob;
        this.factionId = factionId;
        this.setFlags(EnumSet.of(Flag.TARGET)); // Set the goal flag
    }

    private boolean isPlayerInFaction(Player player) {
        KingdomManager kingdomManager = KingdomManager.getInstance();
        Kingdom playerKingdom = kingdomManager.getPlayerKingdom(player.getUUID());
        return playerKingdom != null && playerKingdom.getID().equals(factionId);
    }

#
public class CustomWitherSkeleton extends WitherSkeleton {

    private final UUID factionId;

    public CustomWitherSkeleton(Level world, UUID factionId) {
        super(EntityType.WITHER_SKELETON, world);
        this.factionId = factionId;
        this.collides = false;
        this.expToDrop = 0;
        this.goalSelector = new GoalSelector(world.getProfilerSupplier());
        this.targetSelector = new GoalSelector(world.getProfilerSupplier());
        this.setInvulnerable(true);
        this.setCanPickUpLoot(false);
        this.setAggressive(false);
        this.setCustomNameVisible(true);
        this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, true));
        this.targetSelector.addGoal(1, new TargetNonFactionPlayersGoal(this, factionId)); 
    }

    public UUID getFactionId() {
        return factionId;
    }
}

This is my custom wither skeleton

quaint mantle
#

hi guys how can i motionless particle?
when i do this my particle is flying

world.spawnParticle(Particle.CLOUD, player.getLocation().add(0,1,0), 1,0,0,0);

fallow saffron
#

Anyone know why this makes entity's "jump"?:

this.locY += this.motY;

I know it's not Spigot API related but don't know where to ask

smoky anchor
fallow saffron
#

Water particles don't seem to have motion I think

#

Not splash, the ones you see when in the water, or perhaps they're only client

eternal oxide
#

use the spawnParticle method with more variables

#

add a zero to the end of yours

quaint mantle
young knoll
#

Doesn’t using hidePlayer stop you from hitting them

quaint mantle
#

im looking hideplayer method now

#

mb

#

ty

quaint mantle
#

why setPlayerListName deprecated?

chrome beacon
quaint mantle
#

ah i was looking wrong doc

white crescent
#

Is there any way to add two lines into action bar? I have power bar and 2 abilities and I want to make the abilities on top of the power bar

blazing ocean
#

i already told you yesterday

#

you need to use a custom font with an ascent / shift

white crescent
#

so to this make ascent like -5

#

or smth

blazing ocean
#

oh do you want to move those above that bar there

white crescent
#

yes

blazing ocean
#

just the negative space font then

white crescent
blazing ocean
#

why would you

white crescent
#

oh I see

#

sorry

fair rock
#

@short pilot

You could use

       public CustomWitherSkeleton(Level world, UUID factionId) {
        super(EntityType.WITHER_SKELETON, world);
        this.factionId = factionId;
        this.collides = false;
        this.expToDrop = 0;
        this.goalSelector = new GoalSelector(world.getProfilerSupplier());
        this.targetSelector = new GoalSelector(world.getProfilerSupplier());
        this.setInvulnerable(true);
        this.setCanPickUpLoot(false);
        this.setAggressive(false);
        this.setCustomNameVisible(true);
        this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0D, true));
        
      
        // Nearest Attackable Player
       this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (target1, world) -> {
            // Check if player is from faction?
            // Yes -> Return false
            // No -> Return true

            return true;
        }));
    }
white crescent
#

It now showing this but if I put into jsonlint json is correct, files too

#

oh the resource pack isn´t working 💀

echo basalt
#

L

#

reminds me of what I'm doin at work

polar forge
#

Hey guys

#

so i made long ago a ban plugin

#

but i today coded the pardon command but it doesnt seem to work

#

if i do /pardon the console reminds me of the usage of the command

#

^ PardonCommand.java

#

^ BanCommand.java

#

^ plugin.yml

#

^ Main Class

#

Could anyone tell me where the problem is?

worthy yarrow
#

Errors? We’d rather not look through code we don’t have to kek

polar forge
#

sure ill send them now

worthy yarrow
polar forge
#

Hi kat

blazing ocean
worthy yarrow
#

Feel like an old ass man

blazing ocean
#

you're 19 now aren't you

kind hatch
worthy yarrow
polar forge
blazing ocean
worthy yarrow
#

I guess you can psh

kind hatch
# polar forge wdym

Look at your length check. You don’t return after you send them the usage message.

white crescent
#

Can I put here resource pack and can someone look at it? it says "Resource reload failed"

blazing ocean
#

check your console

white crescent
blazing ocean
#

well, there you go

white crescent
#

it isn´t working in singleplayer either

blazing ocean
#

if it failed to load it, there will ALWAYS be something in the logs

polar forge
#

why do i get a Forbidden error html stuff if i try to do /ban SalC1

#

"Got an error with a html body connecting to Minecraft Api"

blazing ocean
#

mojank's API does that sometimes

polar forge
#

so is it something it will be fixed alone

#

or do i need to do something

blazing ocean
#

no

white crescent
#

It says I don´t have metadata

#

but I have it

blazing ocean
#

unless you show me the actual error I literally cannot help you lol

white crescent
blazing ocean
#

that is not an error

#

and still not your full log

white crescent
blazing ocean
#
java.io.FileNotFoundException: minecraft:textures/font/splitter
    at knot/net.minecraft.class_5912.method_43043(class_5912.java:23) ~[client-intermediary.jar:?]
    at java.base/java.util.Optional.orElseThrow(Unknown Source) ~[?:?]
    at knot/net.minecraft.class_5912.getResourceOrThrow(class_5912.java:23) ~[client-intermediary.jar:?]
    at knot/net.minecraft.class_5912.open(class_5912.java:27) ~[client-intermediary.jar:?]
    at knot/net.minecraft.class_386$class_387.method_2039(class_386.java:131) ~[client-intermediary.jar:?]
    at knot/net.minecraft.class_378.method_51616(class_378.java:207) ~[client-intermediary.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) [?:?]
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(Unknown Source) [?:?]
    at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:?]
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source) [?:?]
    at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source) [?:?]
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:?]
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:?]
#

please learn to read full logs

white crescent
#

I fixed it, thank you

polar forge
#

ok so i fixed a bunch of things but

#

I banned /ban salc1 in my server

#

but when i do /pardon salc1 it tells me that he isnt banned

#

^ PardonCommand

#

I want to precise that in the config there is only his UUID and not his username

#

Is it a problem of paths?

fair rock
#

if (section.equals(target.getUniqueId())) {

String Object not equals UUID Object

try:
if (section.equals(target.getUniqueId().toString())) {

But your code gave me anxiety

fair rock
#

Apple is not a Banana

#

Or do you mean your code?

polar forge
polar forge
fair rock
#
  if (cmd.getName().equalsIgnoreCase("pardon")) { 
  // Unnecessary, if you register your command with "pardon", you dont have to check the command name.

            if (args.length == 0) {
                sender.sendMessage(ChatColor.RED + "Please Specify A Player");
                return true;
            }

            OfflinePlayer target = Bukkit.getOfflinePlayer(args[0]);
            target.getUniqueId(); // What the hell?

            if (sender.isOp()) { // Do Guard clauses instead of pyramids
                if (plugin.getConfig().getConfigurationSection("banned_players") != null) {
                    for (String section : plugin.getConfig().getConfigurationSection("banned_players").getKeys(false)) { 
                    // When you have more than one person banned you get spammed with "Is Not 
                        if (section.equals(target.getUniqueId())) {
                            plugin.getConfig().set("banned_players." + target.getUniqueId(), null);
                            sender.sendMessage(ChatColor.YELLOW + target.getName() + ChatColor.GREEN + " Has Been Pardoned From The Server");
                            Bukkit.broadcastMessage(ChatColor.GREEN + " Has Been Pardoned By " + sender);
                        } else {
                            sender.sendMessage(ChatColor.YELLOW + target.getName() + ChatColor.GREEN + " Is Not Banned From The Server, Or Inexistent");
                        }
                    }

                }

            }
        }
        return true;
thorn isle
#

("banned_players").get(target.getUniqueId().toString())

#

maps are convenient

#

and a configuration section is essentially a map

misty garden
#

Hi do you have an idea how I can start an anti cheat plugins ?

dire marsh
#

Don’t

thorn isle
#

my first advice is to give up

fair rock
#

First: Get a therapist to cry about packets

#

Second: Cancel your plans for happiness

misty garden
#

Okay, on second thought, I'll let it go.

dire marsh
#

Bro just saved themselves years of pain

polar forge
thorn isle
#

you're looping over the entire list of banned players

misty garden
polar forge
#

"Is not"

thorn isle
#

if you have 100 banned players, it will print "x is not banned" 100 times

polar forge
thorn isle
#

or 99, if x is among banned players

polar forge
thorn isle
#

so what you want to do instead is to check whether the set of banned players contains the to-be-pardoned player uuid

#

so what you do is you get the configuration section "banned_players"

polar forge
#

how can i fix it

thorn isle
#

this will return null if the configuration doesn't contain a mapping with that key

polar forge
#

well i did that

thorn isle
#

let's see that code

polar forge
#

will it now do the 100 times thing?

#

updated pardon code

fair rock
#

💀

#

Replace the for loop

thorn isle
#

no

#

you are still looping over the entire set

polar forge
#

wdym

thorn isle
#

for (String section : plugin.getConfig().getConfigurationSection("banned_players").getKeys(false)) {

#

bad

fair rock
#

for -> for everything in the list -> do that

polar forge
#

should i just remove the for loop then?

fair rock
#

YES

#

100 points for Gryffindor

polar forge
fair rock
#

german

polar forge
#

nice

#

why do i get an error at section?>

thorn isle
#

what's the error

fair rock
#

Nah bro

thorn isle
#

the crystal ball's in the repair shop

polar forge
#

cannot resolve symbol section

thorn isle
#

okay, where did you declare the variable named symbol?

#

this isn't python; you have to declare your variables before using them

polar forge
#

u mean section

thorn isle
#

yeah section

polar forge
#

well i did in the for loop

thorn isle
#

that's right

#

and now the for loop isn't there anymore

#

so you have to do something else

polar forge
#

yes

thorn isle
#

when thinking about what code to write and how to write it, it's a good practice to go through what it is that you're trying to achieve in your head

#

what are you trying to do?

#

specifically in this piece of code

polar forge
#

Trying to check if a player is banned or not

thorn isle
#

right

polar forge
#

by looking through the config.yml

thorn isle
#

and how are we storing that information?

polar forge
#

in a .yml file called config

thorn isle
#

yes, more specifically, we are storing the set of banned players' UUIDs in a configuration section named banned_players

#

are you familiar with sets, maps, or dictionaries?

polar forge
#

HashMaps yes

thorn isle
#

how do we check whether a hashmap contains a specific key?

polar forge
#

containsKey?

thorn isle
#

that's right

#

now, something to note is that a configuration section is basically a hashmap

#

the method names are slightly different, but the principle is the same

#

there are keys and each key maps to a value

#

how could we make use of this knowledge to check whether the banned_players configuration section contains a specific key?

eternal oxide
#

You are only storing a UUID as a String so it will be a List, which uses .contains(

twin venture
#

Hi uhh i need help with mongodb .. idk why i have been trying for serval hours and no success to connect to it

#

iam using ubuntu 24.04 , the auth info is correct the service is up and working

#

iam trying to connect from my pc to the vps mongodb

fair rock
#

Try it

#

Wait what

thorn isle
#

warmer, but not exactly right

fair rock
#

Nvm

#

My brain added some code in that line 💀

thorn isle
#

this is in principle correct, but you are calling the wrong method on the wrong object

#

remember that we want to check the banned_players configuration section

#

you are currently checking the config's root instead

#

so throw in a plugin.getConfig().getConfigurationSection("banned_players") there

polar forge
#

well then everything i wrote + getConfigurationSection

eternal oxide
#

use getList as thats what it is expected to be

thorn isle
#

the other problem is that although i said it is basically a hashmap, the method names are slightly different

eternal oxide
#

if (plugin.getConfig().getList("banned_players").contains(target.getUniqueID().toString))

thorn isle
#

pretty sure it's a section

#

though i haven't seen the code that writes to it so i wouldn't know

eternal oxide
#

the config is a section already

fair rock
#

Its a section

eternal oxide
#

his banned players "should" be a List/Set of Strings

thorn isle
#

yeah it's a section

#

it should but we are doing baby steps here

#

shoo

eternal oxide
#

shooing away

polar forge
#

baby steps

#

yes

#

ok so i wrote the code

#

should i send it?

thorn isle
#

sure

#

the other problem with the code is that although i said it's basically a hashmap, the method names are slightly different; specifically, the method to check whether there is a key isn't containsKey, but just contains

fair rock
thorn isle
#

wh0t

fair rock
#

vcs = vsc

thorn isle
#

version control software

fair rock
#

Oh you are sexy git

polar forge
#

should i remove the != null?

thorn isle
#

contains returns a boolean which cannot be null

#

but let's see the code first so we know what you're talking about

polar forge
#
if (sender.isOp()) {
                if (plugin.getConfig().getConfigurationSection("banned_players").contains(target.getUniqueId().toString())) {
                            plugin.getConfig().set("banned_players." + target.getUniqueId(), null);
                            sender.sendMessage(ChatColor.YELLOW + target.getName() + ChatColor.GREEN + " Has Been Pardoned From The Server");
                            Bukkit.broadcastMessage(ChatColor.YELLOW + target.getName() + ChatColor.GREEN + " Has Been Unbanned By " + sender.getName());
                        } else {
                            sender.sendMessage(ChatColor.YELLOW + target.getName() + ChatColor.GREEN + " Is Not Banned From The Server, Or Inexistent");
                        }
                    }```
thorn isle
#

apart from the messed up indentation that looks about right

polar forge
#

So is it cool rn?

fair rock
#

Wanna talk about guard clauses?

polar forge
#

which guard clauses

fair rock
#

if(sender.isOp())

polar forge
#

well

#

whats wrong with that

fair rock
#

Nothing but you are creating pyramid if you do guards like that

polar forge
#

a lot of if's u mean

fair rock
#

Pyramid:
if(a) {
if(b) {
if(c) {
// do
} else {
// do
}
} else {
// do
}
} else {
// do
}

#

But Guard Clauses is

if(!a) {
// do
return;
}
if(!b) {
// do
return;
}
if(!c) {
// do
return;
}

// Do your main stuff

polar forge
#

oh

fair rock
#

If you can avoid pyramids, avoid them. You cant avoid them everytime and anywhere. But if its easy and possible do it.

#

Your code gets more readable.

polar forge
#

indeed ure right

#

I also have a problem with another plugin

#

should i share the problem?

fair rock
#

Sure

polar forge
#

im looking at the code rn

#

and i immediately spot the error

#

it has the same structures with the ban plugin lol

#

thats why i had 3 times the same message when i sent the command

fair rock
#

👏 You learned today

orchid brook
#

I want to add a feature to my custom chest that allows it to pick up items above it, similar to a hopper. Would an asynchronous task that runs every second, checks for items above all loaded chest (so all chests inside loadeds chuncks), removes them, and places them inside the chest be a good approach?

polar forge
#
                for (String section : plugin.getConfig().getConfigurationSection("join_date_players").getKeys(false)) {
                    if (section.equals(target.getName())) {
                        sender.sendMessage(ChatColor.WHITE + target.getName() + ChatColor.GREEN + " Was First Seen On " + plugin.getConfig().getString("join_date_players." + target.getName() + ".first_seen"));
                    } else {
                        sender.sendMessage(ChatColor.WHITE + target.getName() + ChatColor.RED + " Was Never Seen On This Server");
                    }

                }
            }````
fair rock
#

You know how to fix it now yourself! c:

thorn isle
#

this is also called "early return" and there are pros and cons to it; on one hand it's easier to read and the indentation is nicer, reading much like a checklist where you bailout immediately if any check fails

#

the opposing design is "single return" where all flow control is managed by if-elses and there is only one return statement at the very end

#

this has its benefits as well, specifically that it's much easier to reason about and be assured that code at the end runs

fair rock
thorn isle
#

as with all things it's mix-and-match and you should use what works out best; in this case early return is better

orchid brook
#

But i mean i dont know what is better an async task every x second or use EntityMoveEvent since i have a map of all loadedchest with Location

thorn isle
#

something to remember that getting entities in a location is orders of magnitude more expensive than getting the block in a location

#

this is because blocks are voxels and only one can occupy a location at once; it's a simple map query working in O(1), essentially

fair rock
#

EntityMoveEvent only calles for LivingEntity or not? So that event wouldnt fire for dropped items?=

thorn isle
#

conversely, getting the entities in an area (e.g. on top of a hopper) involves iterating over the entire entity list of that chunk section, which could be tens or hundreds of entities, and checking whether they are in that block one by one

#

i don't know if this is in vanilla/spigot yet, but this is why paper switched it around such that hoppers don't look for items, but items look for hoppers

orchid brook
thorn isle
#

getting all of the entities in a world to iterate over is a bit expensive as well and iirc isn't thread safe either

#

if you don't have many chests, i would probably just search for nearby items on a timer for each chest

orchid brook
#

and what about getWorld().getNearbyEntities() ? Maybe i can just check entity nearby the chest (so above it) every x time instead of getting all entity in chunk and check if there are near the chest

thorn isle
#

that works under the hood by iterating over all entities in the chunk section and checking if they're in the range specified

orchid brook
#

oh yep nvm

thorn isle
#

how many chests are we talking?

orchid brook
#

i dont realy know its for a customer maybe 10, maybe 500 depends on players

chrome beacon
#

You can work distro the checks

#

So they don't all check at once

orchid brook
#

yeah

chrome beacon
#

?workdistro

thorn isle
#

are you relying on a pdc to identify the chests or do you have e.g. a block -> chest map in memory for them?

orchid brook
#

private Map<Location, LuHopper> customChests;

thorn isle
#

just doing getNearbyEntities on a timer (and maybe staggering the calls like noted above) would probably be good enough

#

if it isn't, you can look into batching the checks

orchid brook
#

okay

thorn isle
#

that is, group all chests within a chunk section into a batch, then get all the items in the section, then map the items to the chests below them

#

this will improve the performance of chests placed close together

#

and if you really want to go into clown territory, you can offload this entirely from the main thread by maintaining your own entity list to iterate over; add to it in EntityAddedToWorldEvent and remove from it in entity remove event

#

then you can iterate over the set on a separate thread and map the items to the chests below them using that location -> chest map

#

but this is 🤡 and unless you have a ridiculous number of chests and items you definitely shouldn't need to do this

orchid brook
#

yeap i think getNearbyEntities on a timer will be enough and i can batchhh

#

Another question—I'm not going to do it anyway since it's unnecessary given the number of chests.

But could NMS help with this kind of feature? I heard that WildsChest has this feature and implements it using NMS.

thorn isle
#

yeah, you can hook into the entity list of the chunk slice

#

iterating over it isn't exactly thread safe but the worst that'll happen is that you get a CME and have to try iterating again; it's not going to corrupt the chunk or anything

#

another way would maybe be to shove extra logic into the dropped item ticking method that'd look for your custom chests but that's not doable without patching the server i don't think

#

you could uh replace your chests with hopper block entities in the block entity tick list 🤡

orchid brook
#

Okay, I'll keep this solution in mind as the most optimal in case the number of chests increases and I need to revisit it. For now, I'll stick with getNearbyEntities.

thorn isle
orchid brook
#

I can definitely use a hopper instead of a chest as well, lol, and use InventoryPickupItem but its more fun when its harder 💀

#

Anyway thank you guys For the help. ❤️

pure dagger
#

when i put item in anvil it gets called (the event) 4 times, what does that mean, do i ignore it?

thorn isle
#

you fiddle with it until it works right

fickle spindle
#

it's required to do this -> Objects.requireNonNull(getServer().getPluginCommand("test")).setExecutor(new testcmd());

eternal oxide
#

That will still blow up with an error, it only silences your IDE from complaining

#

an assert would do the same job

#

or just turn the warning off in IJ

fair rock
#

I saw the code from getCommand looks like it only would blow an error if you register your command twice or not?

thorn isle
#

it'll return null if it isn't listed in plugin.yml

eternal oxide
#

if its missing from the plugin.yml

fickle spindle
#

and how can i turn off this warning?

fickle spindle
#

ty

#

guys i should make:

  1. 1 class for all the inventories
  2. 1 class for each inventory
  3. 1 class for each group of inventory (Example: for the shop all the shop guis in just one class)
eternal oxide
#

?guis

undone axleBOT
eternal oxide
#

I could have sworn alex did a GUI page

#

alex or smile

eternal oxide
#

yeah thats it

fickle spindle
#

ty

fair rock
pseudo hazel
#

the answer is probably to make clases for all 3

fickle spindle
pseudo hazel
#

manager for inventories, single inventory wrappers and common base classes for similar inventories

fickle spindle
inner mulch
misty garden
#

Hi, please tell me how I can spawn mobs in a zone.

fair rock
#

We are not chatgpt. A bit more independence for researching and coding would be good ^

manic delta
slow island
#

does anyone know why i cant import org.bukkit.GameMode into one of my commands? i used minecraft preset on intellij

chrome beacon
slow island
chrome beacon
fickle spindle
#

how can i put the lapis in the enchanting table if the enchanting has the number 1 how the player inventory does?

fair rock
#

If the enchantment table is open the players inventory dont start at 0 its 2

#

0 = Tool slot
1 = Lapis
2+ = Player

young knoll
#

Wat

#

I figured the table would be its own inventory

fair rock
#

Depends

Example:
InventoryClickEvent#getSlot = Inventory specific slot (Slot id is not unique, player & other start at 0)
InventoryClickEvent#getRawSlot = 0 & 1 is enchantment table, 2+ is player (Slot id is unique)

umbral ridge
#

why is display text in GUI items by default italic

blazing ocean
#

ask mojank

fair rock
#

Mojunk

umbral ridge
#

😿

#

how do you un-italic it

#

XD

#

whatever i set it stays italic

blazing ocean
#

idk legacy chat

#

probably ChatColor.RESET

umbral ridge
#

does not work

fair rock
#

Wanna show what you are doing?

umbral ridge
#
ItemMeta balanceItemMeta = balanceItem.getItemMeta();
balanceItemMeta.setDisplayName(ChatColor.RESET + "test");
balanceItem.setItemMeta(balanceItemMeta);

config:
....

balance-slot:
  slot: 13
  material: GREEN_STAINED_GLASS_PANE
  enchanted: true
  text: "test" # <-- value
#
  • why is it colored in AQUA by default
  • why it defaults to italic
#

??

fair rock
#

I just read "§f" so ChatColor.WHITE

#

wanna try?

umbral ridge
umbral ridge
#

hmm

quaint mantle
#

I mean ""

fair rock
#

How would you check that?

quaint mantle
#

What I meant was

#

Try setting the display name to ""

umbral ridge
fair rock
#

Is it italic?

#

xd

umbral ridge
#

i dont know lol

quaint mantle
#

Oh, you want the name to be something?

umbral ridge
#

yea

#

a balance text

quaint mantle
#

Oh wait

umbral ridge
#

fixed it

fair rock
#

How

#

Removing the item from inventory (obv joke)

quaint mantle
#

Just make it have a name with a color?

#

I found this lol

young knoll
#

Hey look it’s me

fair rock
#

"Matata" my head just read first "MetaData"... I should shutdown my pc for today

young knoll
#

I am MetaData

fair rock
#

Everytime someone interacts with you, you cloning yourself?

quaint mantle
#

Yeah

#

They are actually 7 Jishuna's

fickle spindle
#

for put a specific potion in a gui how can i do? (Speed for 8 min) <- Example

fair rock
#

Something like

ItemStack a = new ItemStack(Material.Potion);

PotionMeta meta = (PotionMeta) a.getItemMeta();

// set potion
a.setItemMeta(meta);

#

(Im on smartphone so i wrote that with my hands could be wrong)

blazing ocean
thorn isle
echo basalt
#

how the fuck am I getting an AIOOBE on List.copyOf

#

null hashmap elements maybe?

worldly ingot
#

Multi threaded access to the list you're copying?

#

If you're removing elements from another thread then your list size is gonna be smaller I guess

thorn isle
#

do we have a stack trace

#

copyOf is one of those factory methods that delegates the actual construction to one of like 25 different impls depending on the class and size of the passed list

echo basalt
#

was copying a map's values

#

changed it to a ConcurrentHashMap and it's gucci now

#

crazy

thorn isle
#

at a glance the only place where i could see that happening is in the toArray method of the collection you're passing it to

#

kinda uh sounds like concurrent modification yeah

echo basalt
#

except instead of a comod it's an aioobe

thorn isle
#

cme's aren't guaranteed, null pointer exceptions and array out of bounds are

#

in most collections it's just a non-volatile modcount check

#

specifically it looks like your map might be growing while list.copyof is copying it

#

since toArray typically allocates an array of the collection's current size and then iterates over the collection's elements, writing to each index

#

i can see that easily exceeding the allocated array's length

slender elbow
#

muutability bad

rotund ravine
#

@slender elbow u more functional?

slender elbow
#

somewhere between functional and the more classic oop

worldly ingot
#

So you're at like a Kotlin then

kindred quest
#

When I'm inside a player and shoot with a bow, the other player doesn't get any kb . How do I fix this? I forgot how xdd

jade oasis
#

anyone know how to fix these errors and warnings in a code ?

compact haven
#

Add @NotNull to the two parameters in the method implemented on line 165 of punishmentgui.java

#

and you'll need an instance of whatever class getOffenseCount is declared in to use it on line 268

mortal vortex
#

bro wtf, I woulda asked this guy to send his code. GGs for doing it just from the error msg

compact haven
compact haven
waxen ledge
#

a java course for beginners

compact haven
jagged thicket
undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

waxen ledge
jagged thicket
#

who tf is that

fickle spindle
#

How can I use a Statistic placeholder for do something in my plugin ? Like I want to do playtime rewards can I take the playtime from Minecraft/Statistic placeholder and use it ?

glossy laurel
#

Guys, do I understand it correctly that if you need nms you need to switch your whole project to use mojang mappings? Or can you just use it to get some additional methods on top of spigot api?

rough drift
#

2nd

#

?nms

glossy laurel
#

Right

glossy laurel
glossy laurel
#

Sorry for the reply

outer tendon
#

I didn't know about that

chrome beacon
#

but yes it's possible if you wanted to

glossy laurel
chrome beacon
#

fair enough ig

#

getting the player by uuid should avoid that lookup

fickle spindle
vast ledge
smoky anchor
#
  1. read the docs, they tell you
  2. read the docs, they tell you
vast ledge
#

Pass that into getStatistic

#

But yeah, read the docs

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

blazing ocean
#

Bukkit#getPlayer(UUID) doesn't do a network request

glossy laurel
#

right?

blazing ocean
#

yes

chrome beacon
#

getOfflinePlayer has a uuid method as well

glossy laurel
#

But that makes a request

chrome beacon
#

It does not

glossy laurel
#

Or doesnt it

glossy laurel
#

What if the player has never joined the server

chrome beacon
#

Then the name will be null

glossy laurel
#

Interesting

quaint mantle
#

how can i add empty tabslot?

fickle spindle
#

in a gui how can i get if the player click left click, right click or q?

pseudo hazel
#

use the clicktype from the click event

fickle spindle
pseudo hazel
#

what does that even do

#

drop the item?

fickle spindle
#

no in the gui i want that the player get a stuff if he right click, another if he left click and another if he q click (it's a shop different amount of items)

pseudo hazel
#

its an enum value

#

use getClickType() == ClickType.DROP or whatever

fickle spindle
#

ty

#

there is a method or something for check if the inventory has a slot empty? (Aka not full)

pseudo hazel
#

check if its null or air

#

oh wait

#

to see if it has no empty slots just use firstEmpty() == -1

fickle spindle
#

oh okay

#

and why not 0?

compact haven
#

0 is a slot

#

-1 in Java as an index means not found

fickle spindle
#

oh okay ty

#

sorry

compact haven
#

Though if you’re attempting to prevent an item getting lost when you add it to a full inventory, the method (I forgot what it is called) returns a HashMap of items that couldn’t be added.

fickle spindle
#

nono i will do a check if the player doesn't have an empty slot he can't get the item, wait if the player already have the item in his inventory the firstEmpty will count or not?

compact haven
#

Correct that’s why I’m suggesting this way instead, it’s better

compact haven
#

If they have an inventory with one stick in each slot then first empty will say they have no empty slots but if you give them a stick they can take it

fickle spindle
#

yeye

compact haven
#

So call #addItem like normal then iterate through the HashMap and drop it in the World where they stand

#

“It is known that in some implementations this method will also set the inputted argument amount to the number of that item not placed in slots.”

? I mean seriously? What is this documentation

blazing ocean
#

that's bukkit for ya

compact haven
#

So does “spigot” not provide that implementation? 😅

blazing ocean
#

I mean most of the API is still derived from bukkit

#

idk about specific ones but that probably is

compact haven
#

Yeah okay the hell was being thought here

#

if a partial is added indeed it doesn’t go into the map

blazing ocean
compact haven
#

perfect reason to git shame lmao

#

oh actually

#

I’m wrong

blazing ocean
#

git blame

#

smh

compact haven
#

git shame fr

#

anyways it’s implemented how it says ‘some implementations’ are

#

so it’s safe to use the returned Map and drop the items

#

my brain just didn’t process the while true at the top

glad prawn
#

What will Block.getDrops(ItemStack) return if ItemStack is null
Empty collection?

thorn isle
#

it used to return the drops when mined with the "optimal" tool

#

i think now it returns the drops when mined by hand

shadow night
thorn isle
#

i remember this causing butthurt because at the time there was no way to check what the drops with the "optimal" tool would have been, or to get what the optimal tool even was, so you were just kind of fucked

hollow warren
#

Hi, is there any way to make the sounds work on versions 1.21? My plugin is using the 1.21.4 API, but they don't work and it throws an error 😦 I got a bit lost.

twin venture
#

Hi i have a problem with gradle

#

this mode is not recommended for production use .. (in red)

blazing ocean
#

impossible to help without the full error nor build scripts

blazing ocean
#

?whereami

remote swallow
#

use the 1.21 api

hollow warren
#

ok thx

timber basalt
#

How would I go about storing data on certain blocks that I need to access the data of every 1-3 seconds? I was originally going for PDC, but I found out that doesnt work for blocks.

chrome beacon
#

?blockpdc

undone axleBOT
timber basalt
#

Thx

chrome beacon
#

But if you need to access the data that often you might want to consider storing them somewhere else as well for faster access

neon storm
#

Is there any way to know when a boss bar appears for a player? I can't find any event for it.

timber basalt
#

So basically the database is only for the data to persist over restarts

pseudo hazel
#

pdc and database are not the same

#

olivo is just talking about caching im pretty sure

#

which seems like what you are already doing

thorn isle
#

i'd make that a Map<UUID, Set<Block>> (with a linked hash set) and pair it with a Map<Block, UUID> or that customblockdata thing that was linked, so removing/adding blocks to the cache remains O(1)

#

also, since you're using a concurrent map, make sure that you also synchronize on the value (the set/list) correctly; just putting the thing in a concurrent map doesn't make access to it thread safe

#

the only thing that concurrent map provides guarantees for are happens-before relations of get/put and atomicity of computeX calls

glossy laurel
#

how do I set respawn location after death event?

chrome beacon
glossy laurel
chrome beacon
#

You can see in the event if the respawn was caused by a death

thorn isle
#

remember that unless you force instant respawning, the player might not respawn before the server restarts (or possibly ever), so don't expect any values you read from the death event to be available during respawn unless you go out of your way to persist them to disk

pure dagger
#

i dont really know how it works...
here's the code, can anyone explain?
(i cant take the diamond block and when i change the title it disappears)

ItemStack item1 = event.getInventory().getItem(0);
        ItemStack item2 = event.getInventory().getItem(1);
        if (item1 == null || item2 == null) return;
        if (item1.getType() != Material.STONE || item2.getType() != Material.DIRT) return;
        event.setResult(new ItemStack(Material.DIAMOND_BLOCK));
thorn isle
#

seems like that should work, i have something principally similar but a bit more complicated in a plugin somewhere

#

but i'm on paper, maybe the event behaves differently there

pure dagger
#

uhh

#

how to do this please..

jade oasis
#

Does anyone know everything I need for a plugin to work using litebans tryna make it so when clicking wool for example that says

Cheating
1st offence: 30 day ban
2nd offence: 90 days ban
3rd offence: perm ban

In that order but need it to run the litebans command to ban try a figure out how I can implant that if you need my code lmk

jade oasis
dawn flower
#

how do i cancel knockback in a damage event

ivory sleet
#

btw cant u use ban templates?

#

or whatever litebans calls it

fickle spindle
#

how can i return 4 strings from a method? because for making lore of item in a gui i'm using this way

        ItemMeta meta = item.getItemMeta();
        if (meta != null) {
            meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name));

            List<String> lores = new ArrayList<>();
            for (String s : lore) {
                lores.add(ChatColor.translateAlternateColorCodes('&', s));
            }
            meta.setLore(lores);

            item.setItemMeta(meta);
        }
        return item;
    }```
i need to do a lot of lores one equal to the other with only some values that change ->
    public static ArrayList description(String material, int price, String type) {
        if (type.equalsIgnoreCase("single")) {
            ArrayList<String> description = new ArrayList<>();
            description.add(Utils.color("&7test"));
            description.add(Utils.color("&7test " + price + " &7dd"));
return description;
        } else {
            ArrayList<String> description = new ArrayList<>();
            description.add(Utils.color("&7test"));
            description.add(Utils.color("&71x " + price + " &7[r]"));
            description.add(Utils.color("&716x " + price * 16 + " &7[l]"));
            description.add(Utils.color("&732x " + price * 32 + " &7[ǫ]"));
return description;
        }
    }
here i can't make the return of the array because in the function for create items it want more strings
#

i fixed everything with List<String> 🙂

slender storm
#

Hi i got the TAB Plugin but idk how i replace the Ping next to the Player Name with their deathcount

pure dagger
#

umm

#

what

#

im a woman

sharp elm
#

Is It ur code ?

plush tree
#

Does anyone know how to import net.minecraft.entity.player.EntityPlayerMP into the spigot plugin?

warm mica
#

It not updating could be some quirk of the anvil gui, but i may be wrong

plush tree
warm mica
#

net.minecraft.server.level.EntityPlayer exists

warm mica
eternal oxide
#

isn't that a client class?

plush tree
#

this error

#

how to fix?

eternal oxide
#

so not the class you posted 😦

#

?nms

warm mica
#

That won't work. You could try that fork that combines spigot and forge, however thats called

plush tree
chrome beacon
#

?mappings

undone axleBOT
pure dagger
#

what do i do ?

#

maybe ill just give up with that :(

thorn isle
#

from what i skimmed from your conversation, it looks like changing the inventory title re-opens the gui without firing the prepare event

#

you could try copying your logic into InventoryOpenEvent to catch that perhaps?

pure dagger
#

idk, why cant i take the item though

thorn isle
#

idk
tryitandsee

pure dagger
mighty jasper
#

hey people!

#

I'm currently working on Empire Forge, a Minecraft Kingdoms server that brings strategic wars, economy, and unique gameplay to the community. We're in the final stages of development, and with my exams coming up, I could really use some extra hands to help push things forward.

If you're passionate about Minecraft servers, plugins, or general development and would like to contribute, I'd be truly grateful for any help. Tasks include plugin setup, configurations, testing, and balancing—nothing too complex, and I’ll guide where needed.

I completely understand that time is valuable, so this is purely voluntary, but you’d be a part of something exciting and get credit for your work. If you're interested or have any questions, feel free to DM me.

remote swallow
#

?services

undone axleBOT
mighty jasper
#

not offering services.

remote swallow
#

you are requesting services

mighty jasper
#

sorry

mighty jasper
#

not here?

remote swallow
#

yeah, or find people offering services and dm them abou tit

#

damn did helpchat lose that

mighty jasper
remote swallow
ivory sleet
#

They didnt

warm mica
minor otter
#

Plugin setup can be vaguely tied to plugin dev

mighty jasper
warm mica
warm mica
mighty jasper
#

Ive organized way to let my team complete tasks,which many lack.

warm mica
low wagon
mighty jasper
mighty jasper
low wagon
minor otter
low wagon
#

yes is my plugin, is the first

smoky anchor
low wagon
smoky anchor
#

But reading "executes command from console" I'd be worried that a player can create a voucher with "ban <username>" and it would work

minor otter
#

That would be interesting

pseudo hazel
#

"op myName"

minor otter
#

execute as @e at @s run summon tnt

smoky anchor
#

decompiled for fun, your package is "org.example"
That is bad..

pseudo hazel
#

I assume by players that you mean server admins and not all players, that can create the vouchers

smoky anchor
#

it checks for permission "vouchplugin.create" which I don't see documented

#

Stores the command on lore only...

minor otter
#

Are there comments in the code with emojis in them

smoky anchor
#

Can't see comments ofc, but it does have emoij :D

minor otter
#

I just appreciate some good emoji use

pseudo hazel
#

yes this will def work on my terminal

smoky anchor
#

Are you using config file as logs ?
I can't see any good reason for storing the created vouchers
And I don't think you ever clear them so over time you'll just run out of memory (ofc this would require thousands of vouchers)- wait, <UUID, String> map, it just stores last created vouchers. Why..
(you actually just don't use the config nor the map, I read this hastily but still, useless dead code)
But it does do Bukkit.dispatchCommand(Bukkit.getConsoleSender(), cmd.substring(1)); So if someone has the permission to create a voucher, they can run any command (with length less than 256 or whatever the chat limit is ig)
Overall probably like 1/5, has severe security vulnerability
@low wagon

warm pine
#

Massive security risk

quaint mantle
#

Low Taper Fade

warm pine
warm pine
blazing ocean
#

please get that off my screen

warm pine
#

LMFAOO

tranquil pecan
#

oh boy

blazing ocean
#

now it's off the screen

warm pine
#

If you want I can send it again :3

blazing ocean
#

I think this is why the block button exists

upper hazel
#

this is normal??

#

i dont think so

#

this call virus i gess?

#

or smth like it

blazing ocean
#

that's metrics

upper hazel
#

port from server metrics too?

#

lol

fallow violet
#

how to get axis of nether portal block?

slender elbow
#

its BlockData is Orientable

polar forge
#

Hey guys

#

I have a question

#

So im doing this plugin, First Seen plugin

#

But i need to register a PlaceHolder

#

But when i do it i receive an error

fallow violet
#

and what error? lol

#

and what code?

polar forge
#

^ Placeholder class

#

^ Main class

#

it cant resolve the method register

#

in the main class

fallow violet
#

what...

#

error...

polar forge
#

?

fallow violet
#

send the error

#

that tells the most

polar forge
#

I told u

fallow violet
#

u sent the code but not the error

polar forge
fallow violet
#

oh you mean this

polar forge
fallow violet
#

i cant see the method in your class

polar forge
#

well how do i do it

remote swallow
#

its a method thats on placeholder expansion

fallow violet
#

does it resolve PlaceholderExpansion ?

polar forge
#

well yes bc in the Placeholder class it extenns PlaceholderExpension

fallow violet
#

yes but it could be that it doesnt so you dont have the resolve method yk

remote swallow
#

looking at your screenshot, you have errors in the placeholder class

#

fix them first

polar forge
#

Thats the point

#

How do i fix it

remote swallow
#

what are the errors inside of placeholder.java

fallow violet
#

what errors do you have in PlaceHolder

polar forge
#

They are related to this

fallow violet
#

bruh

remote swallow
#

show them

polar forge
fallow violet
#

I KNEW IT

#

good luck epicebic

remote swallow
#

did you add placeholder api to your build.gradle

polar forge
#

No

polar forge
remote swallow
#

do you think it might help to do so

polar forge
#

Well duh yes

#

how do i do it

remote swallow
#

do you wanna go read the docs

polar forge
#

obv

#

thx

remote swallow
#

i love being google

polar forge
#

And i love being helped by human beings

blazing ocean
#

also my ethernet broke on arch

remote swallow
#

ratio

polar forge
#

where s the build.gradle

blazing ocean
polar forge
#

Gracias

#

why do i have the same problem tho

#

i placed

#
    maven {
        url = 'https://repo.extendedclip.com/releases/'
    }
}

dependencies {
    compileOnly 'me.clip:placeholderapi:2.11.6'
}```
blazing ocean
#

and have you reloaded gradle

polar forge
#

no

#

how do i do it

remote swallow
#

did you add them in the correct place or did you blindly copy and paste it first

polar forge
#

I indeed did the last one

remote swallow
#

because i have a feeling you already have a repositories and a dependencies block

polar forge
#

yes i do

blazing ocean
remote swallow
#

so copy the entries into the existing blocks first

remote swallow
rough drift
polar forge
rough drift
blazing ocean
#

axi kotlin symbol processing

rough drift
#

smh

blazing ocean
blazing ocean
remote swallow
#

nuhuh

rough drift
#

implementation("universe") { exclude("ebic") }

#

I don't know all that much about gradle

blazing ocean
#

that is valid gradle yes

#

just that universe is not a valid GAV

rough drift
#

it's a special symbol trust

remote swallow
#

how about project("universe")

blazing ocean
#

nah

#

projects.universe

rough drift
#

project("insecurities")

blazing ocean
#

typesafe project accessors are cool as shit

polar forge
#

Why do i receive a "is it up to date" error

#

how would i fix it

blazing ocean
#

cannot help without any actual error lol

polar forge
#

And the error u will get

blazing ocean
#

and the error I will get...?

polar forge
blazing ocean
#

?nocode

undone axleBOT
#

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

polar forge
#

Bro

#

the code is actually here above our heads

#

just scroll above

blazing ocean
#

well make sure the command is in your plugin.yml

polar forge
#

A stupid question maybe

#

but if i have api-version set to "1.21"

#

will this casue the error

chrome beacon
#

no

polar forge
#

then whats causing the problem

polar forge
#

Fixed

thorn crypt
#

Hey, how to set the maturation of a seed to a certain age in 1.21.4 ?