#help-development

1 messages · Page 621 of 1

umbral ridge
#

to build the jar

orchid trout
#

team prefix nametag color how

zenith gate
#

nope theres a little play button you can click.. and it does it all for you

zenith gate
#

youll have to create your maven configuration ofc. but thats all package mostly.

umbral ridge
#

i though you have to actually mess with the terminal

zenith gate
#

you can if you want. i dont because im lazy lol

umbral ridge
#

Nice nice

hybrid spoke
#

isnt it only in beta

zenith gate
zenith gate
#

yes techinally.

umbral ridge
zenith gate
#

Jet Brains is the best when iot comes to IDEs in my opinion. they always have everything even in this light weight environment.

umbral ridge
#

Yeah I like their modern UI design

zenith gate
#

yeah also their AI feature im excited for. I hope its better then copilot

umbral ridge
#

Eclipse is a bit outdated but it kinda works

#

if you tweak the theme settings

zenith gate
umbral ridge
#

lol

remote swallow
#

eclipse is blinding

#

very neon

umbral ridge
#

Here's how mine looks:

remote swallow
#

red eew

zenith gate
#

disgusting

remote swallow
#

having red in ur theme anywhere but errors is wrong

umbral ridge
#

I've only applied the custom font and a few theme tweaks

#

For me it works xD

#

There is almost no errors ever in my code though

orchid trout
#

how bad is it?

umbral ridge
#

if I see an error I fix it immidiately

remote swallow
#

i dont wanna ?main you but i just feel like i have to

zenith gate
orchid trout
#

is it better than eclipse

zenith gate
#

everything is better than eclipse in my opinion.

#

but its all personal preference.

remote swallow
zenith gate
#

i cant decide for you

orchid trout
#

intellij crashes my pc sometimes

zenith gate
#

so does mine

#

thats why I use fleet

umbral ridge
zenith gate
#

damn

remote swallow
#

fuckin nerd

zenith gate
#

fr lol

umbral ridge
#

But I'll be switching soon to something else

#

Not that anything is wrong with it

eternal oxide
#

Eclipse ❤️

umbral ridge
#

xD

zenith gate
#

are you sure he just isnt getting old?

umbral ridge
#

who

zenith gate
#

eclipse

remote swallow
#

elgarl and eclipse is fine

umbral ridge
#

They still update it sort of XD But I don't see any visual improvements

zenith gate
#

Keeping its old look haha

umbral ridge
#

It's written in an old framework I guess, can't do much

#

Eclipse has been around for a long time

brisk estuary
#

hey, does anybody know how items from the plugin AdvancedEnchancements are identified? I mean, how can I check if an item is from that plugin?

eternal oxide
#

I dislike visual changes so Eclipse is perfect for me. I still run Windows 7 🙂

zenith gate
#

2000 i think is when ecplise started

umbral ridge
#

I never had Windows 7 though

#

Only XP and then somehow I just switched to windows 10

zenith gate
#

thats impreisve.

umbral ridge
#

You run windows 7? what? i still run windows 2000 xD

zenith gate
#

i hate windows.

eternal oxide
#

I like it upto 7

#

well 3.11, 98, XP, 2000, 7

#

2000 was basically a friendlier version of NT

orchid trout
#

why do team prefix not work color

zenith gate
#

i would agree. windows 10 & 11 just have so many problems with them, and the bluescreens are insane.

#

thats why i switched to a mac, and a Linux server running a ubuntu 20 vm

maiden geode
#

@spiral light I just solved it that way:

public class PlayerExpChangeListener implements Listener {

    @EventHandler
    public void onPlayerExpChange(PlayerExpChangeEvent event) {
        Player player = event.getPlayer();
        Location location = player.getLocation();
        IslandManager islandManager = IslandCore.getInstance().getIslandManager();
        User user = User.getUser(player);

        if (!islandManager.isIslandWorld(location.getWorld())) {
            player.setExpCooldown(0);
            return;
        }
        Island island = islandManager.getIslandViaLocation(event.getPlayer().getLocation());

        if (player.hasPermission("islandcore.admin")) {
            player.setExpCooldown(0);
            return;
        }
        if (island == null) {
            if (islandManager.isIslandWorld(location.getWorld())) {
                player.setExpCooldown(-20);
                return;
            }
            player.setExpCooldown(0);
            return;
        }
        if (island.hasPermission(user, "pickupXp")) {
            player.setExpCooldown(0);
            return;
        }
        event.setAmount(0);
        player.setExpCooldown(40000000);
        player.sendMessage(ChatColor.RED + "You can't pickup any xp on this island.");
    }
    @EventHandler
    public void cooldownEvent(PlayerExpCooldownChangeEvent e) {
        User user = User.getUser(e.getPlayer());
        Island island = user.getIsland();
        if(island == null) {
            return;
        }
        if(!island.hasPermission(user, "pickupXp")) {
            return;
        }
        e.setNewCooldown(0);
    }
}
eternal oxide
#

I'll switch away from Windows when steam stops workign

zenith gate
#

you got time lol

maiden geode
spiral light
#

actually running win11 and have absolutly 0 problems since ~5 months

eternal oxide
#

Steam says it'll stop working in 169 days

zenith gate
spiral light
eternal oxide
#

yep I'll go to some version of linux

zenith gate
#

Redhat

eternal night
eternal oxide
spiral light
#

ahhh on win7 xD

eternal oxide
paper cosmos
#

Is there the sound for menu button click among sound effects?

spiral light
#

click ?

#

UI_BUTTON_CLICK

paper cosmos
#

oh thank you

maiden geode
nova notch
#

is using player.sendActionBar safe to use cus it says its deprecated but it seems like the easiest way and it still works

spiral light
#

what version do you use

nova notch
#

1.19.4 and probably will keep updating

spiral light
#

then you should use:
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§c§lThe coconut nut"));

eternal oxide
#

there are two actionbar methods

nova notch
#

why does it say all this is deprecated or is it just being dumb

eternal oxide
#

not deprecated in Spigot

spiral light
#

nvmd my mistake

nova notch
#

oh yeah i forgot im using paper maybe they have a different one

spiral light
#

then paper deprecated spigots methods

#

but should work

brisk estuary
#

Does anybody know what "internal" represents? This is a String that represents the Item Meta of an item from the plugin AE

spiral light
#

just "internal" ?

#

i think its from the Plugin to handle custom stuff

silent steeple
#

how do we create custom listeners

flint coyote
#

What do you mean by "custom listener"?

#

A listener listening to a custom event?

spiral light
flint coyote
#

I mean he asked about custom listeners, not custom events. Therefore I was confused

spiral light
#

i think thats what he is searching for

umbral ridge
spiral light
#

i never used it xD

umbral ridge
#

Oh xD

spiral light
#

you can always check in the EventListener if it is cancelled or not

flint coyote
umbral ridge
#

Yeah I guess so yeah

umbral ridge
spiral light
#

isnt "ignoreCancelled" by default to false ?

umbral ridge
#

Yeah

#

so ignoreCancelled reflects to event.setCencelled(). if you actually set it to cancel by yourself? or can server cancel the events too?

flint coyote
#

other plugins can

umbral ridge
#

Ohh I see

flint coyote
#

and yes on some rare circumstances the server fires a cancelled event

spiral light
umbral ridge
#

I didn't know about this thanks

#

I know about event priority but didn't know much about ignoreCancelled

river oracle
#

What is a good maximum length for characters on comments

spiral light
#

80

river oracle
#

dya know how to set it on IntelliJ

#

so autoformat formats it

spiral light
#

in PR creation notes they said 80 but i believe its more then that sometimes ^^

#

i dont know about autoformat but would be nice to have

silent steeple
#

whats the best way to store a claim, this is my claim

public class Claim {
    private final int x;
    private final int z;

    public Claim(int x, int z) {
        this.x = x;
        this.z = z;
    }
}

basically i need to first get every block from x to z and every block in the y coordinate between those and then i need to make it so that people cant break or interact in there

spiral light
#

is this in minecraft ?

silent steeple
#

yes

spiral light
#

then you would need 3D

silent steeple
eternal night
#

e.g. anything that the spigot item meta system does not parse

spiral light
flint coyote
spiral light
#

then 2D anyway

flint coyote
#

true

spiral light
#

at least 4 inputs an

#

from x to z is just wrong

silent steeple
spiral light
#

you want a rectanctle right ?

silent steeple
#

yeah

spiral light
#

from which x to what else x you wanne go ?

silent steeple
#

and that rectangle should also include every y block

spiral light
#

x and z are completly different axis

silent steeple
#

my bad

spiral light
#

just having x and z ist a single block in the world

silent steeple
#

yeah

#

this is my new class

#
public class Claim {
    private final Faction faction;
    private final int claimCorner1;
    private final int claimCorner2;
    private final ClaimType claimType;

    public Claim(Faction faction, int claimCorner1, int claimCorner2, ClaimType claimType) {
        this.faction = faction;
        this.claimCorner1 = xclaimCorner1;
        this.claimCorner2 = claimCorner2;
        this.claimType = claimType;
    }
}

Forget about faction and claimtype

#

i need to get every block in the rectangle

spiral light
#

...

#

you still have only 2 numbers

silent steeple
#

yeah

#

rectangle

flint coyote
#

is there an easy way to create a deepcopy of a ConfigurationSerializable? Or create a new instance?
I want to change a single value of it and verify it before storing it in the config. I can't change the original one because it is in use and would change the behavior.

I could set the value and could set it back in the same tick if the validation failed, however that would still cause problems if the values are ever used async. Any ideas?

worldly ingot
spiral light
#

you see why you need 4 coords right ?

silent steeple
#

no bruh

#

u see the 2 red points

#

on that picture

#

that makes a rectangle

spiral light
#

yes

#

2 points

silent steeple
#

yeah

#

2 points

spiral light
#

with each having 2 numbers

silent steeple
#

right

spiral light
#

you just have 2 numbers, so you have just 1 corner

silent steeple
#

didnt know what u meant

#
@Getter
@Setter
public class Claim {
    private final Faction faction;
    private final int claimCorner1x;
    private final int claimCorner1z;
    private final int claimCorner2x;
    private final int claimCorner2z;
    private final ClaimType claimType;

    public Claim(Faction faction, int claimCorner1x, int claimCorner1z, int claimCorner2x, int claimCorner2z ClaimType claimType) {
        this.faction = faction;
        this.claimCorner1x = claimCorner1x;
        this.claimCorner1z = claimCorner1z;
        this.claimCorner2x = claimCorner2x;
        this.claimCorner2z = claimCorner2z;
        this.claimType = claimType;
    }
}
#

now what

spiral light
#

what did you want to do ? xD

silent steeple
#

create a rectangle from those points

#

and then add every y cord

#

in that rectangle

#

and then find out the best way to save it

spiral light
silent steeple
#

what do i do for the y

spiral light
#

store your values (x1,y1,z1 and x2,y2,z2) into a BoundingBox, when saving you just safe the min-Values and how Big in each other direction

silent steeple
#

sounds good thx

spiral light
#

depends on what version but on the newest you can get the minY and maxY of a World from the World it self

#

but if your claim is always full height .... you can just ignore the y-coords

eternal night
silent steeple
#

performance fork

spiral light
#

i dont know ... so few features and performance in newer versions is not that worse

young knoll
#

“Performance”

silent steeple
spiral light
#

4k players on the same server ?

silent steeple
#

i dont even know what some stuff in the extremism-voltane-spigot.yml does

#

fork of voltane i believe

eternal night
#

the world of weird paid "performance" forks in 1.8 is rather funny 😂

drowsy helm
#

Especially on a fork

spiral light
#

the fps would drop xD

eternal night
#

I mean, you'd need network bandwith like CRAZY

#

The folia test ran a while ago was at 1k and was dying due to network kekw

silent steeple
drowsy helm
#

Folia uses server instancing

#

Not even one server

eternal night
#

what

silent steeple
#

i mean 1.7 is less demanding so maybe

eternal night
#

no

#

folia is a single server instance

#

you are thinking of multipaper

#

or whatever it is called

remote swallow
#

was about to say that

young knoll
#

I too can shove 4000 bots on a server in one spot and claim it can handle them

drowsy helm
#

Well either way it’s a complete rewrite

#

No way bukkit could handle that many

eternal night
#

it isn't either

silent steeple
drowsy helm
#

I am tripping

#

It is afork dang

quaint mantle
#

hello, i dont get a mail

#

for my account

worldly ingot
quaint mantle
worldly ingot
#

jfc dude

drowsy helm
#

Guess I know nothing abt folia

worldly ingot
#

Spigot's free, my guy

drowsy helm
#

2k?

remote swallow
eternal night
#

trolling

drowsy helm
#

😧

worldly ingot
#

Must be

silent steeple
#

trolling

silent steeple
#

it costed 75 tho but i think its worth it

worldly ingot
#

2k isn't beyond the realm of possibility. I've seen some absurdly expensive forks for no good reason

drowsy helm
#

What sort of server you hosting that needs that many players on one instance anyway

worldly ingot
#

inb4 factions

silent steeple
#

cuz i have a <200 player server and my tps never goes below 19.5

drowsy helm
#

10 second hit registration

silent steeple
#

custom kb profiles too

#

async pots

spiral light
#

custom knockback ?

silent steeple
#

yh

spiral light
#

thats a "cool" feature ? i think its possible in spigot too

drowsy helm
#

Cpu

young knoll
#

Anything’s possible with enough effort

spiral light
#

:D

silent steeple
silent steeple
#

kb is a big part of pvp

#

so

spiral light
#

why (if not already) is there no event for knockback while fighting ?

drowsy helm
spiral light
#

How not

drowsy helm
#

Theres a hit event which knocks the player back

#

Knockback itself is a value not an event

spiral light
#

what i think is that onDmg there will a velocity applied to the player

#

that velocity gets catched -> event -> cancel or modified -> passed to player

#

i dont see a big problem

young knoll
#

It would be nice to be able to cancel knockback in the damage event

#

Or modify it

spiral light
#

i think knockback could be after damage event and other stuff calculation and thats why it is not in dmg event

#

but if dmg event is canceled there is no dmg too

#

there is no kb too *

young knoll
#

Yes but I meant separately

scenic valve
#

Anyone familiar with InventoryClickEvents?
I have this weird thing where my code works like 95% of the time, but there is a small chance that a player without the appropriate permission can equip my custom armour.

umbral ridge
#

You've checked for it?

scenic valve
#

Ah, didn't think of that

#

Let me try that quickly

umbral ridge
#

Also BlockDispenseArmorEvent... if in any case you need it..

#

Basically when dispencer throws an armor to player and is auto equipped

scenic valve
#

Got that one covered

drowsy helm
#

You dont need to check Instanceof player

scenic valve
#

Why? I assume it's just unneccesary?

drowsy helm
#

It’s always true

scenic valve
#

Yeah, figured

drowsy helm
#

Also I find it easy to make your own ArmorEquipEvent and listen to all the necessary events

#

Can centralise it to one thing

scenic valve
#

Absolutely, I got all the other ways to equip armour covered, it's just this little thing thats bugging me

young knoll
#

Or just use a lib :p

carmine mica
harsh ember
#

concentrador 154.52.42.104:25570

#

19:58:57 [INFO] [luen30] disconnected with: Could not connect to a default or fallback server. Incorrectly configured address/port/firewall? io.netty.channel.ConnectTimeoutException

#

help me

carmine mica
scenic valve
#

Of course, but all I need to check in this case is the basic stuff, it's just for a survival thingy

silent steeple
#

can someone explain what is the point of configurationseriazable

umbral ridge
silent steeple
#

what is the reason to di t

#

do it

harsh ember
#

container@pterodactyl~ Error Event [33e176f1-431d-4936-8754-52c9dbda6687]: another power action is currently being processed for this server, please try again later

#

20:19:49 [SEVERE] java.lang.IllegalArgumentException: Server lobby (priority 0) is not defined

silent steeple
#

how does pterodactyl have anything to do with spigot

#

the first error

hazy parrot
scenic valve
umbral ridge
pseudo hazel
#

is there a way for me to know if the server disabled advancements and statistics?

#

right now I just get npe when trying to get advancements

#

I eman I could just check for that

#

but I would rather also up front like to know if advancements are disabled or not

#

same with statistics

hybrid spoke
lost schooner
#

Plugin idea: command scripts that you can write, save, and edit through a book GUI
Is this something that already exists? Would I be wasting my time?

hybrid spoke
#

who would like to script inside a book

#

if they can just do that in an ide

lost schooner
#

I could also make it save them in some format that's editable through an IDE. It just makes it easier to slap scripts together on the fly without needing FTP uploads

#

the book wouldn't be saved in your inventory it would just be the way you could edit in-game

scenic valve
lost schooner
#

The script would be saved under an ID

#

You'd be using /script edit remove_trees or something

hybrid spoke
#

have fun to write the interpreter

lost schooner
#

Hmm. Why would that be difficult? What sort of pitfalls would you expect

hybrid spoke
#

depends on what you want to support

silent steeple
#

yeah idea sounds fun until the interpreter

lost schooner
#

Basically just a way to input args at first

hybrid spoke
#

and all those args would have to be converted

chilly hearth
#

How can we change range of the mobs like they can detect players from far

next zinc
#

Is there a limit to switch statements in spigot or something?

lost schooner
#

Yep, which should be as easy as a few stdlib calls generally right?

chilly hearth
lost schooner
#

(Unless it was an enum or specific string value requirement)

chilly hearth
#

You*

next zinc
#

It's so strange cause I simply added a few more methods and then called them via my switch statement which worked perfectly before but now is broken for the new method calls

hybrid spoke
#

never wrote an interpreter myself, for what lol. but i can imagine that you will stumble across a few things that will fuck with your nerves

next zinc
#

There is no errors or anything either

hybrid spoke
#

but i think it shouldnt be too complex actually since you are only translating to java right

lost schooner
#

Oh I think you might be overestimating how complex this would be

#

I'm talking about scripts for in-game commands

#

I'm having a hard time thinking of an example off the top of my head but think powertools with arguments and that can execute more than one command

chilly hearth
hybrid spoke
#

yeah i got that, but you still would need to translate them

hybrid spoke
#

otherwise, how would you execute them

#

á parsing them

lost schooner
#

Is there no way to just send a command to the server as a string?

chilly hearth
#

If"

next zinc
hybrid spoke
next zinc
#

np

#

If statements should be the same output though just uglier and more text

#

Like currently I'm doing

switch (itemName) {
            case "aircore":
                giveItem(targetPlayer, itemDictionary.getAirCore(), amount);
                break;

which works fine but then randomly some just don't work

#

i do have a default case just not shown

hybrid spoke
#

create a thread when answering @lost schooner

#

we are mixing convos

next zinc
#

sorry about that

lost schooner
#

Scripting plugin

chilly hearth
next zinc
#

yeah ill post the whole statement

#

?paste

undone axleBOT
next zinc
#

Everything works up until flightShard

hybrid spoke
#

on the first guess i would say your code is case sensitive

next zinc
#

Wish that was the case but i'm checking equalsIgnoreCase

hybrid spoke
#

paste your code

next zinc
#

alr 1 sec

#

?paste

undone axleBOT
next zinc
lilac dagger
#

how do i hide this error?

#

none of the vulnerabilities are important to me

chilly hearth
next zinc
#

Ik

#

Thats why I'm so confused

#

No errors in IDE or in game, it just keeps giving the default case

hybrid spoke
#

debug it

remote swallow
#

ignore it

lilac dagger
#

i wanna support all the versions from there onward

chilly hearth
remote swallow
#

ignore the error

lilac dagger
#

i thought there was some ide supress function for poms

remote swallow
#

check the more actions tab

#

on the error

#

normally has a hide button

hybrid spoke
chilly hearth
#

Btw

#

?javadocs

hybrid spoke
#

?jd-s

undone axleBOT
chilly hearth
#

Wow

hybrid spoke
#

close enough

chilly hearth
#

Thos cafebabe isn't my babe ig

next zinc
#

All of the shard/cores code is just an itemstack method that creates an item with customlore, sets it, then returns it

hybrid spoke
#

you just dont know her well enough

next zinc
#

Same as the ones that do work

chilly hearth
next zinc
#

My only guess is that its possibly not compiling correctly

remote swallow
#

run a clean build

chilly hearth
#

Did debuged it?

hybrid spoke
#

btw

chilly hearth
#

?

hybrid spoke
#

itemName = args[0].toLowerCase(); you are lowercasing it

#

and a switch case is case sensitive

#

so floraShard cant work

#

since its always florashard

next zinc
#

oh shoot

#

lemme see if that works

#

I completely glossed over that

chilly hearth
#

Xd

next zinc
#

if thats the issue imma be so pissed lmao

chilly hearth
#

Xd

next zinc
#

Whelp

#

I am 100% pissed but also grateful

#

ty airforce and godcipher for the help

maiden geode
#

Any ideas how I can prevent players from throwing eggs? I've tried using the code below but it doesn't work if the player is right-clicking the air (if it's the block, then it'll cancel the event) ```java
if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
ItemStack item = player.getInventory().getItemInMainHand();
if (item.getType() == Material.EGG) {
event.setCancelled(true);
}
}

chilly hearth
#

Np

#

What event u using?

maiden geode
#

PlayerInteractEvent

hybrid spoke
#

try to use ProjectileLaunchEvent

chilly hearth
#

That isn't the right event

chilly hearth
#

?jd-s

undone axleBOT
hybrid spoke
#

?jd-s ProjectileLaunchEvent

undone axleBOT
hybrid spoke
#

sad

remote swallow
#

we no have tat

#

that

hybrid spoke
#

noticed

#

we should have that

remote swallow
#

yeah

#

no good bot exists for it tho

hybrid spoke
#

@worldly ingot do some magic

hybrid spoke
remote swallow
#

the one md looked at required the javadocs to be in a mysql or mongo db

remote swallow
#

get to it

#

write it in jda

hybrid spoke
#

rather patch it into cafebabe

remote swallow
#

cant

hybrid spoke
#

or is it just a custom command

remote swallow
#

cafebabe is made in like d.py 3 and i doubt the custom cmds regex is very good

#

bc it would ned to find the exact class and then get its link

opal juniper
#

i did it with dpy before

chilly hearth
#

Assume I have spawned an entity

remote swallow
#

would need more than red bots custom commands

opal juniper
#

just get docdex

chilly hearth
#

Andi have created. An bossbar

#

How would I add the entity health into the bossbar

hybrid spoke
#

keep track of the entity

chilly hearth
#

I never understand these boss bars

hybrid spoke
#

run a scheduler

#

update the bossbar

remote swallow
opal juniper
#

maybe but you don’t have to add them manually

maiden geode
# hybrid spoke try to use ProjectileLaunchEvent
@EventHandler
    public void onProjectileLaunchEvent(ProjectileLaunchEvent e) {
        if(!((e.getEntity().getShooter()) instanceof Player player)) {
            return;
        }
        if(e.getEntity() instanceof Egg) {
            e.setCancelled(true);
        }
    }```
Works, thank you! 🙂
chilly hearth
#

And how to assign the entity health to the boss bar

hybrid spoke
#

depends on what you want

chilly hearth
#

ent.getbossbar?

chilly hearth
#

Like this

hybrid spoke
chilly hearth
#

WitherSkeleton ent = Bukkit.getworld("world").spawn(p.getlocation , either skeleton.class);

#

Can't we add the bossbar to that?

onyx fjord
maiden geode
# onyx fjord no need to initialize player when its unused
@EventHandler
    public void onProjectileLaunchEvent(ProjectileLaunchEvent e) {
        if(!((e.getEntity().getShooter()) instanceof Player player)) {
            return;
        }
        if(!(e.getEntity() instanceof Egg)) {
            return;
        }
        if(player.hasPermission("islandcore.admin")) {
            return;
        }
        User user = User.getUser(player);
        IslandManager islandManager = IslandCore.getInstance().getIslandManager();
        if(!islandManager.isIslandWorld(player.getWorld())) {
            return;
        }
        Island island = islandManager.getIslandViaLocation(player.getLocation());
        if(island == null) {
            e.setCancelled(true);
            return;
        }
        if(island.hasPermission(user, "throwEggs")) {
            return;
        }
        e.setCancelled(true);
    }
hybrid spoke
#

you would have to keep track of both and manage them in a scheduler

chilly hearth
remote swallow
#

add a boss bar to entities that wont see it?

hybrid spoke
#

he means like with a wither

proper imp
#

why when i do /mrl pos1 it say
an internal error occured while attempting to perform this command

hybrid spoke
#

if so check the console

#

nah either way check the console

remote swallow
#

mine reset lite be like

#

kacper doesnt like that plugin

chilly hearth
#

Xd

proper imp
#

is it bc im 1.19.4?

chilly hearth
hybrid spoke
chilly hearth
proper imp
#

why?

chilly hearth
#

That's easier better

#

And won't give u errors

proper imp
#

u sure?

chilly hearth
chilly hearth
proper imp
#

it not a prison what i wanna do

chilly hearth
#

What are u trying to do?

proper imp
#

box

chilly hearth
#

It will work for bospvp as well

#

Box*

proper imp
#

kk

#

ill try ig

quaint mantle
#

@eternal oxide hi bro sorry for ping but i need ask a question to u
i wanna integrate discord accounts to minecraft accounts and i think this
send command in game like this /discord "discorduserid" after this command my bot send message to discord user to privatechannel
but i think this minecraft players can abuse this spam or some discord users don't wanna get pm from bot
do u have any idea for this ?

hybrid spoke
#

?ask

undone axleBOT
#

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

quaint mantle
#

elgar knows me

hybrid spoke
#

alright, so i wont answer you then

quaint mantle
hybrid spoke
#

yeah. you can map the discords user id and the minecraft uuid.
for the spam problem just make a cooldown or check if the user has already got a message.
if they dont want to get a pm then they cant get verified. tell it to them

remote swallow
#

send them a code, save said code in a map to uuid and get them to dm the bot

#

eg /discord-link, "Please dm YOURBOT 25353 on discord to link account"

chilly hearth
#

Wow

remote swallow
#

no i totally didnt steal that off discordsrv

#

shh

chilly hearth
#

xD

#

Epic how longu have been coding in java?

hybrid spoke
#

oh true you couldve just spammed other people

#

that wouldve been fun

remote swallow
#

about this long

#

the time is like 80% accurate

chilly hearth
#

...

#

Can u guess how long I have been coding in java?

hybrid spoke
#

2 weeks

remote swallow
#

month

chilly hearth
#

Me nub at java

hybrid spoke
#

same

chilly hearth
#

Dayam

drowsy heath
#

I have an aternos server and I wanna have anti cheat and anti xray
aternos stops flying but thats about it
Can someone help me?

pure dagger
#

is there any way to detect or check the progress of these advancements of a player?

drowsy heath
pure dagger
#

ur fast

hybrid spoke
#

hey my girlfriend said the same

#

damn

eternal oxide
#

she said that to me too!

opal juniper
#

nice self roast

lost schooner
#

How do I make a user open a book interface upon running a command, then read what they wrote into a string?

lost schooner
#

It feels like I'm having a stroke reading it

brazen violet
#

i accidently deleted my commands folder in intellij how can i undo this?

chrome beacon
#

Check your recycle bin

brazen violet
#

on my computer or does inetllij has one

chrome beacon
#

Or just ctrl z

brazen violet
#

i tried it before i asked

chrome beacon
#

What happens when you try

brazen violet
#

nothing

chrome beacon
#

Well something will happen

quaint mantle
#

Is there a way to specifiy what repo a depenmdency should use in gradle? I'm getting a 403 from a repo that, that the dependency doesn't use.

chrome beacon
#

Make sure to select the files so it doesn't try to undo things in the code

chrome beacon
brazen violet
#

and thanks for the help

quaint mantle
#

It shouldnt be using that repo but it is

#

but I still need that repo for other stuff

chrome beacon
#

Are you sure you have the correct repo in your build file

#

If so change the order of the repos so the correct one takes priority

pure dagger
chilly hearth
#

?spoon

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.

eternal oxide
#

lol, that told you alex

chilly hearth
#

Ok u mean cafebabe

#

Elgarl ma bestie

drowsy heath
#

?suicide dont commit suicide

chilly hearth
#

: )

#

?learnjava

undone axleBOT
chilly hearth
#

Bro iam mad

hybrid spoke
#

?learnjava!

undone axleBOT
chilly hearth
#

YAS

#

The gif is alive

drowsy heath
#

java = nah

#

c++ = speed

hybrid spoke
#

?suicide @drowsy heath

chilly hearth
#

Lol

dull goblet
#

Hello, I am trying to utilize PlayerSwapHandItemsEvent, which works if not in an inventory, but as soon as I am in an inventory and I swap the Items in my hand, this event does not get called. Any idea how to detect this? Is there a reason it is that way?

eternal oxide
#

Java smexy

chilly hearth
#

Ikr

chilly hearth
#

Tf*

dull goblet
#

But then how do you know if they are swapping items instead of just clicking?

chilly hearth
#

Cafebabe Ur such a queue(T)

dull goblet
#

You swap items by pressing default f key

eternal oxide
#

you have to check which slots they are clicking on, or what hotkeys

chilly hearth
#

Thos algarl nub

hybrid spoke
eternal oxide
#

does f still work with an inventory open?

chilly hearth
#

Bro algarl he's asking for swap hands buddy

chilly hearth
eternal oxide
#

yes and he says it doesn't work with an inventory open

chilly hearth
#

Welp u already don't believe it's possible

hybrid spoke
#

not if you're not storing it somewhere

chilly hearth
#

SQL?

eternal oxide
#

not if there is no Player online

chilly hearth
#

😎😎😎

eternal oxide
#

you can have an OfflinePlayer if they are offline or online

chilly hearth
lilac dagger
#

how to format a class' code in intellij?

chilly hearth
undone axleBOT
kind hatch
eternal oxide
#

you didn't mention /ip 😉

chilly hearth
#

Wow algarl pwo

#

?learnjava!

undone axleBOT
hybrid spoke
#

you dont have the license to troll yet

#

step down

chilly hearth
#

Wow

#

Ok

lilac dagger
hybrid spoke
#

you can adjust that

#

when it should do it etc.

lilac dagger
#

by hand?

hybrid spoke
#

not sure where but its possible

#

otherwise eclipse formatter plugin is very useful

chilly hearth
hybrid spoke
#

what

chilly hearth
#

Bro there is a tab in intellj to format it I forgot it's name

chilly hearth
lilac dagger
#

you know when you can't see a line without scrolling?

#

yeah i want to make it in 3 lines so it's always visible

hybrid spoke
# kind hatch Wdym by this?

ExampleObject thisIsMyExampleObjectWhichIsWayTooLongToReadProperlyAndDestroysMyFancyClass = new ExampleObject("cool little name, which is totally just an example", List.of("hey", "cool", "fuck", "you"), 1, 2, 4, 14, 0, 1, (byte) 4);

kind hatch
#

Ohh, 1 sec

#

File > Settings > Editor > Code Style > Java > Wrapping and Braces > Hard wrap at > set it to 120 or 140

#

Once that's set, you should be able to format code again and it'll adjust everything.

lilac dagger
#

by default is 120

hybrid spoke
#

i only program in html

lost schooner
#

Is it a BookMeta method?

lost schooner
hybrid spoke
#

i doubt that this is possible

#

the book is totally clientside

lost schooner
#

Goddammit

hybrid spoke
#

so you only have a chance when they save it

#

or make a custom client

lost schooner
#

Yeah that's not happening

#

So would I have to give them a book to write in and then listen for the save event?

#

That's kind of shitty imo

hybrid spoke
#

thats what i would think

#

never did things with a book

lost schooner
#

What is the best way to offer text editing in the game then

hybrid spoke
#

everything has to be saved so the server can register it

lost schooner
#

Can you register a listener temporarily?

#

So I can only have the listener start listening once the player runs a command to get the book

hybrid spoke
#

but not sure if its being updated while the player is having the book open

#

or if its afterwards

#

probably latter since you can cancel the event

lost schooner
#
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
*** Server will start in 20 seconds ***

Any way to suppress this?

remote swallow
#

yeah

novel kite
#

Whats the best method for checking if a class is present on the server your plugin is installed on?

eternal oxide
#

depends

#

you could Class.forName

#

or version check

remote swallow
#

method that returns a boolean, using class.forname return true in the try and false in the catch

#

public static boolean doesClassExist(String classAndPackage) {
      try {
          Class.forName(classAndPackage);
          return true;
      } catch (ClassNotFoundException ignored) {
          return false;
      }
}
#

(dont quote me on the ex)

novel kite
#

Gotcha, thank you both
I'll test out Class.forName

tender shard
#

and if you need that often, cache the existing class names

novel kite
tender shard
#

then do it like this

#

otherwise as said, I'd cache it

public class ClassUtils {

    private static final Map<String,Boolean> CLASS_NAMES = new HashMap();

    public static boolean doesClassExist(String clazzName) {
        return CLASS_NAMES.computeIfAbsent(clazzName, __ -> {
            try {
                Class.forName(clazzName);
                return true;
            } catch (ClassNotFoundException e) {
                return false;
            }
        });
    }
}
tranquil prairie
#

Why does cancel(); not cancel this? It prints cancelled once and then keeps printing TRIED TO CANCEL even though it should of been cancelled already

@Override
            public void run() {
                long secondsBeen = (System.currentTimeMillis()-startTime)/1000;
                if(secondsBeen > seconds) {
                    try {
                        System.out.println("CANCELLED");
                        cancel();
                    }catch (IllegalStateException e) {
                        System.out.println("TRIED TO CANCEL");
                    }
                    isBeingOpened = false;
                    return;
                }```
vocal cloud
#

Is this scheduled to repeat?

tranquil prairie
#

Yes its a syncRepeatingTask

tender shard
#

why are you not printing out the exception

tranquil prairie
#

i was before

tender shard
#

and what did it say?

tranquil prairie
#

also i realized it keeps printing CANCELLED then TRIED TO CANCEL over and over not just TRIED TO CANCEl

tranquil prairie
# tender shard and what did it say?
java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]:        at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]:        at java.lang.Thread.run(Unknown Source)```
tender shard
#

show the full code where you are scheduling that runnable

tranquil prairie
#

?paste

undone axleBOT
tranquil prairie
#

this makes no sense

inner mulch
#

hello

#

can does somebody know if i can register new teams other than with player.getscoreboard.registernewteam?

zenith gate
#

like making your own team manager and not using minecrafts?

inner mulch
#

I am using minecrafts but i think its the cause of some problems with ranks on my server

zenith gate
#

I don't really understand what you're asking.

inner mulch
#

i want to have ranks on a server step 1

#

i have geysermc step 2

#

once i use a custom scoreboard my ranks break(BEDROCK PLAYERs only) step3

#

@zenith gate did you give up on me :(

zenith gate
#

No, I'm doing some research. Geyser is a packet translator, lots of things can cause issues with it. if your ranks are only breaking for bedrock players, im assuming it has to deal with geyser.

#

what plugin do you use for your ranks?

inner mulch
#

self written

#

you might be right that it is on geysers site, but im using the spigot api to create a scoreboard and then create teams with hte mineraft api which might be the reason, after all it only breaks after i turn on the scoreboard

zenith gate
#

Does everything break for bedrock? or only just the ranks?

inner mulch
#

it works fine, the ranks are even acknowledged in the chat, but the displayname + prefix is the normal miencraft name

#

just the normal minecraft name

zenith gate
#

hmm. I'd suggest looking through here https://github.com/GeyserMC/Geyser/issues Create a bug report. I am not sure what specificly could be causing it. but im pretty sure its something withy geyser. Perhaps someone else could better assist you there.

edgy crystal
#

is there any chance i can connect my spigot servers & my bungeecord so i can get my bungeecord playerdata on my spigot server, like an API?

inner mulch
#

dont you think it has something to do with the different apis? (spigot for scoreboards, minecraft for teams) teams and scoreboards are pretty close together

zenith gate
#

Well you're saying it breaks only for bedrock players. Geyser is the middle man. I do not think its because you are using the Spigot API and Minecraft. Do your ranks show up on the Java scoreboard?

inner mulch
#

they arent on the scoreboard

eternal oxide
#

if you are using scoreboards for prefix etc you should use teams

zenith gate
#

he is using teams.

eternal oxide
#

if you send teams using MC packets you are going to have a hard time

safe coral
#

Hey I have a little queston

inner mulch
zenith gate
undone axleBOT
#

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

safe coral
#

yes

eternal oxide
safe coral
# safe coral

I wish, when I want to rankup, that it takes me a certain amount of item. How can I do this?

eternal oxide
#

Bedrock is breaking when you enable the scoreboard

inner mulch
#

yes, im not sure what you mean by protocol, but i do not manually create the teams

#

i have a self written plugin

eternal oxide
#

If thats the case, when you enable the scoreboard it's likely causing a new Teams meta packet to be sent

inner mulch
#

what does this mean and what happens when it does happen?

#

maybe i can apply it to my issue

#

i did some testing

eternal oxide
#

how are you creating your teams?

zenith gate
inner mulch
safe coral
eternal oxide
safe coral
#

I'm terrible in English and I can't explain even in my own language, it's going to be complicated 😦

inner mulch
#

@eternal oxide should i dm you my scoreboardbuilder ?

zenith gate
tranquil prairie
#

I keep getting this error with the code https://paste.md-5.net/ubetavuvac.cs

java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]:        at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]:        at java.lang.Thread.run(Unknown Source)```
eternal oxide
#

I don;t do dm's

#

?paste

undone axleBOT
inner mulch
#

its quit big

#

quite

zenith gate
#

yes...

inner mulch
eternal oxide
#

don;t paste in channel

#

?paste

undone axleBOT
eternal oxide
#

use the paste site

inner mulch
#

ok

safe coral
inner mulch
zenith gate
eternal oxide
#

click save then copy the link here

zenith gate
inner mulch
safe coral
eternal oxide
#

you are creating a scoreboard for every player it seems

safe coral
#

I want to add a price, which will be 64 emeralds.

inner mulch
#

yes, i want it to display the name, rank and money of the individual player

eternal oxide
#

ok

#

there is no team info anywhere there

inner mulch
#

do i need to create the teams in there?

#

i have a seperate class for this

eternal oxide
#

teams are attached to a scoreboard

#

and they only relate to that scoreboard

inner mulch
#

oh

#

but why does it work for java players

eternal oxide
#

Java is better 😛

inner mulch
#

yeah, ik

eternal oxide
#

however it does sound like Toast was correct. you are seeing somethign odd with geyser

inner mulch
#

yes

#

so

zenith gate
#

Especially with scoreboards. bedrock is weird.

inner mulch
#

do i need to implement my ranks into this class

eternal oxide
#

you can keep them seperate as I assume you are adding the team to the players scoreboard

safe coral
#

A idea for add price with item?

eternal oxide
#

So long as you access the correct scoreboard instance you are fine

inner mulch
eternal oxide
#

yep, that will return a team on the correct scoreboard

zenith gate
# safe coral

I don't know how to help you, I don't know what this is. i'm sorry.

eternal oxide
zenith gate
#

idk what plugin then.

eternal oxide
#

make sure he's in teh correct channel

safe coral
#

all right thanks

zenith gate
eternal oxide
#

🙂

eternal oxide
inner mulch
# eternal oxide 🙂

elgar do you think it has something to do that other players cant see other playersteam, if so how could i turn it on (if its off on default)

safe coral
inner mulch
#

because they dont share the same scoreboard

eternal oxide
#

but if they cna cross interface there is a setting you can apply

#

one sec, opening ide

tranquil prairie
#

I keep getting this error with the code https://paste.md-5.net/ubetavuvac.cs

java.lang.IllegalStateException: Not scheduled yet
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134)
[20:10:32 WARN]:        at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
[20:10:32 WARN]:        at dev.blackgate.cases.Case$1.run(Case.java:104)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
[20:10:32 WARN]:        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[20:10:32 WARN]:        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[20:10:32 WARN]:        at java.lang.Thread.run(Unknown Source)```
eternal oxide
#

team.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.ALWAYS);

safe coral
#

people know plugin for Rankup with required items

inner mulch
eternal oxide
safe coral
#

okay ty !

eternal oxide
tranquil prairie
eternal oxide
#

ok you do know that event fires twice? So you could be starting two runnables

#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
tranquil prairie
eternal oxide
#

ah ok

tranquil prairie
#

and the Opening case... message is only sent once

eternal oxide
#

in that case there is no logical reason your runnable is not canceling

#

are you 100% running a version of spigot and not a fork?

tranquil prairie
#

very confused as ive never had this problem for any of my other plugins

eternal oxide
#

The message says its nto scheduled yet so unless you are calling the run method of your runnable somewhere I've no clue

tranquil prairie
#

All the code i sent is the only code that is related

#

i mean unless u want see the event but thats pointless i imagine

zenith gate
#

do you have other runnables? do they work fine?

tranquil prairie
#

No I dont

#

I can add one and if see i can cancel it

mortal hare
#

quick question

zenith gate
mortal hare
#

does onCommand args[] array return the args only

#

or label too

#

in cmd line applications char* args return args + commandName

#

so im asking it

young knoll
#

Only the args

mortal hare
#

ok

#

thanks

inner mulch
#

@eternal oxide are you still here?

eternal oxide
#

yes

inner mulch
#

sadly my problem didnt resolve so far, but i noticed that if i remove this line from the scoreboardbuilder, everything works again.

if(player.getScoreboard().equals(Bukkit.getScoreboardManager().getMainScoreboard())) {
player.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
}

#

do you know why that is?

tranquil prairie
# zenith gate wouldnt hurt to try.

nope not even this works in my on enable

Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new BukkitRunnable() {
            int ticks = 0;
            @Override
            public void run() {
                if(ticks > 20) {
                    System.out.println("Cancelled");
                    cancel();
                }
                ticks++;
                System.out.println("Ran");
            }
        }, 1, 1);```
#

im going to try this on a diff test server i have this is so weird

eternal oxide
tranquil prairie
#

this is making absolutely no sense

inner mulch
eternal oxide
#

possibly

zenith gate
eternal oxide
#

looking again its unlikely as its annotated not null

inner mulch
# eternal oxide possibly

it didnt work, but i think it has something to do with the difference between a mainscoreboard and a newscoreboard

eternal oxide
#

all your players want a new scoreboard anyway

inner mulch
eternal oxide
#

you mean it works if they are on teh main scoreboard?

inner mulch
#

yes

#

if they all share the same

#

but once it is a scoreboard per player is breaks

eternal oxide
#

I guess its a difference between Java and Bedrock

#

report it to geyser and see what they say

inner mulch
#

ok

eternal oxide
#

worst they can say is, you are crazy

tranquil prairie
zenith gate
#

Hahahaha you're welcome.

edgy crystal
#

I have coded an Plugin called "ServerUtils" which has functions like "useLocation", ... and i wanna implement this single plugin in every plugin i have, how do i do this? (i have coded it to not code it ever again & dont need to copy paste it, so if i update it updates itself)

zenith gate
#

I didnt think it was anything, thought i was wrong lol, glad to see im not.

edgy crystal
zenith gate
#

I'd honestly prefer if the javadocs got a nice face lift. the white background hurt me eyes, and could use a little more flare.

eternal oxide
#

I use DarkReader plugin in my browser

young knoll
#

Anyone happen to know the max translation for display entities?

eternal oxide
fervent robin
#

ooh that looks nice

zenith gate
#

does look better, but i dont really use browser extensions/plugins. got a fear of mine haha.

safe coral
#

Do you know how to get the console to take items from an inventory, please?

fervent robin
#

a fear of browser extensions?

zenith gate
#

yes.. they can do some pretty nasty things if you were an idiot as a child like me.

zenith gate
#

I've never trusted my self with them again.

fervent robin
#

i only use adblock and a theme

safe coral
mortal hare
#

why tf does intellij suggest enhanced for loops everywhere

#

like iterators cost

zenith gate
mortal hare
#

and im iterating a fucking array

zenith gate
young knoll
#

Are you looping by index?

fervent robin
#

also what % does spigot take from your premium plugins?

#

I just finished meeting the requirements for it

young knoll
#

0

fervent robin
#

wtf

#

surprising

zenith gate
#

thought it would be like steam? lol

fervent robin
#

lmao yeah

#

easy way to cover bills for website

young knoll
#

Anyway, looping by index is gross

zenith gate
#

I would like to publish my plugin. but its no where near ready yet. still so many problems.

young knoll
#

Don’t do it unless you need to :p

mortal hare
#

how is that gross

#

iterators literally fill the gc

young knoll
#

It gets compiled into a for loop with index

mortal hare
#

not always

fervent robin
#

im mainly only doing freelance but im happy with that atm

#

freelance > public plugins by far

young knoll
#

If it’s an array it will compile into a for loop with index

zenith gate
#

Hahaha yeah, I've been working on my plugin for about a year now. year and 2 days actually. I've restarted a lot, as i've learned and realized that ive done a lot wrong hahaha.

fervent robin
#

oh wow what is it?

zenith gate
#

I am bringing an RPG stye gameplay into minecraft.

#

Testing is a pain tho as sometimes i need more than just my self to make sure things work well.

worldly ingot
#

You're fine

young knoll
#

That’s very much a micro optimization

#

In the case of iteratable objects, in the case of arrays it’s literally nothing

edgy crystal
# tranquil prairie https://bukkit.org/threads/tutorial-easy-creating-an-api-for-your-plugin.225773/

thank you first.


import de.polo.serverutils.Utils.LocationManager;
import org.bukkit.entity.Player;

public class ServerAPI {
    public interface Location {
        static boolean useLocation(Player player, String location, String gamemode) {
            return LocationManager.useLocation(player, location, gamemode);
        }
    }
}```

this is it (for now), but how do i implement it in my other IntelliJ projects? so i dont have to update it everytime i update the import
young knoll
#

Choco can you PR registry freezing out of spigot

#

10/10 idea trust

river oracle
#

Is there a nice way to convert bungeeChat Component to an NMS component

worldly ingot
#

Serialize and deserialize

river oracle
#

Sob okay

worldly ingot
#

iirc CraftChatMessage.fromJSON(ComponentSerializer.toJSON(baseComponentArray))

#

Or something to that effect

#

Might be parse, might be serialize

river oracle
worldly ingot
#

Yeah that

#

I was close

river oracle
#

:D thanks

#

I just want your PR to be merged lol

#

then I wouldn't need NMS at all

worldly ingot
#

Me too 🙂

river oracle
#

I have a question though when modifying an NMS item do I need to modify the CraftItemStack as well

worldly ingot
#

It depends on how you're getting your stacks

young knoll
#

Depends if it’s a copy or a mirror

worldly ingot
#

Idk the context

river oracle
# worldly ingot It depends on how you're getting your stacks
    @Override
    public void setDisplayName(@NotNull ItemStack itemStack, @NotNull BaseComponent[] name) {
        CraftItemStack craftItemStack = (CraftItemStack) itemStack;
        craftItemStack.handle.setHoverName(CraftChatMessage.fromJSON(ComponentSerializer.toString(name)));
     }```
worldly ingot
#

No guarantee it's a CraftItemStack

river oracle
#

really

#

oh dear

worldly ingot
#

Yeah, what if new ItemStack()?

river oracle
#

true

#

hmmm need to think this through more then

#

I wonder if I'm better off using some form of Builder like methods in this

young knoll
#

There’s a bunch of conversion methods in CraftItemStack

#

On todays episode of Mojank, why are slimes not a PathfinderMob

edgy crystal
worldly ingot
#
    @Override
    public ItemStack setDisplayName(@NotNull ItemStack itemStack, @NotNull BaseComponent[] name) {
        if (itemStack instanceof CraftItemStack craftItemStack) {
            craftItemStack.handle.setHoverName(CraftChatMessage.fromJSON(ComponentSerializer.toString(name)));
            return itemStack;
        } else {
            return setDisplayName(CraftItemStack.asCraftCopy(itemStack));
        }
     }```
#

Maybe something like this. Not ideal, but you'll have to update the item in the inventory

river oracle
#

I mean I always wrap inventories to begin with so its not a huge deal

worldly ingot
#

Yeah, actually because that method there would NPE for Bukkit ItemStacks

young knoll
safe coral
#

I've created a special item. How can I use it for a shop without people using the normal item?

#

style, how do you get your id?

river oracle
young knoll
#

It should be merged before 1.21

#

… probably

river oracle
#

... hopefully

worldly ingot
river oracle
#

@worldly ingot does lore suppport components? I'm looking at nms it looks like you can only access lore through NBT to I just serialize the component to string than put it in the NBT?

worldly ingot
#

Lore is components, yes

river oracle
worldly ingot
#

Lore is a bit complicated in item meta

#

Adding to NBT directly would probably work fine

quaint mantle
#

Is there a good way to make an armorstand float up and down smoothly?

young knoll
#

Armorstands are living entities

#

So technically you should be able to give them levitation and slow fall

nova notch
#

for some reason this if statement is acting differently when i rejoin the server and i have absolutely no idea why

p.sendMessage(event.getItem().getOwner().toString());
        p.sendMessage(p.getUniqueId().toString());
        p.sendMessage(String.valueOf(event.getItem().getOwner() != null));
        p.sendMessage(String.valueOf(event.getItem().getOwner() != p.getUniqueId()));
        if (event.getItem().getOwner() != null && event.getItem().getOwner() != p.getUniqueId()) {
            event.setCancelled(true);
            return;
        }```
when its normally working (first image) vs when i rejoin the server
young knoll
#

.equals

river oracle
nova notch
#

well both ifs are still true but it somehow works???

#

thanks i guess

worldly ingot
#

Probably the type of the contents

#

CraftMagicNumbers.NBT has some constants

river oracle
worldly ingot
#

Lore is a list, yes

worldly ingot
#

When your Player leaves, even though the UUID is the same, the UUID instance is different

river oracle
#

atleast for going back I can reference how CraftBukkit does it

worldly ingot
#

It should just be a NBTTagList of strings

#

It's not a list of objects

river oracle
#

or NMS then BungeChat

worldly ingot
#

Correct

nova notch
fiery storm
#

Yo, is there someone I can trust that can help me with something?

#

I prefer to do it in DMS

river oracle
# worldly ingot Correct

this was terrible. it may only be five lines of code, but it was horrible

        final CompoundTag tag = item.handle.getTag();
        final CompoundTag display = tag.getCompound(net.minecraft.world.item.ItemStack.TAG_DISPLAY);
        if (display.contains(net.minecraft.world.item.ItemStack.TAG_DISPLAY)) {
            ListTag loreTag = display.getList(net.minecraft.world.item.ItemStack.TAG_LORE, CraftMagicNumbers.NBT.TAG_LIST);
            List<BaseComponent[]> lore = loreTag.stream()
                    .map((t) -> ComponentSerializer.parse(t.getAsString()))
                    .toList();
        }```
worldly ingot
#

I don't think your if statement is right

river oracle
#

if it doesn't exist there is no reason to proceed no?

worldly ingot
#

Well, you're already getting it

#

Your if should be if (display != null && display.contains(net.minecraft.world.item.ItemStack.TAG_LORE))

#

Note the null check and different constant