#help-development

1 messages · Page 1989 of 1

chrome beacon
#

.

next stratus
#

you only gave it an hour

chrome beacon
#

Someone did

raw ibex
#

I said what's config

#

they haven't replied

raw ibex
sonic goblet
#

Your config.yml file

#

For your plugin

raw ibex
#

i don't have a config.yml

#

only a plugin.yml

sonic goblet
#

Then just use a Boolean

next stratus
raw ibex
raw ibex
chrome beacon
#

In your listener

next stratus
#

We're not being paid to help you, we're only doing it in our spare time so don't expect instant replies

raw ibex
#

I'm not complaining

next stratus
#

You seem to be

raw ibex
#

I'm not

next stratus
#

Yes that's what normally happens

raw ibex
#

Just that my question was bumped up

next stratus
#

Seems like you're complaining you didn't get a response quick enough

raw ibex
#

I wasn't

#

Let's not argue

next stratus
#

Oh I'm not arguing I'm stating a fact

visual tide
#

make a getter & setter

chrome beacon
#

?learnjava I feel like you need to learn Java from one of these

undone axleBOT
sleek pond
#

Lmaoo

#

Was about to do that

next stratus
#

lol

#

get learn java'd

tardy delta
#

is he trying to register and unregister an eventhandler with a command?

#

👀

sonic goblet
#

Ya I think that was his goal

tardy delta
#

how do i only make an event handler happen when i do a command, and make it stop when i do another command

#

ah

raw ibex
#

WHAT AH

lilac dagger
#

eventhandlers usually trigger from bukkit

#

do you wanna call them yourself?

tardy delta
#

just use Bukkit.getPluginManager().registerEvents(listener, plugin) and HanderList.unRegisterAll(listener) to register and unregister a listener

#

i guess you're trying to stop listening for certain events when you run your command

#

and start it again when running the command again

#

otherwise your question would make sense as events are just fired and dont "stay" for a while

#

👀

#

chat ded

#

kekw

#

uwu thats the spiwit

#

YEA LIKE THAT

spare prism
#
17:06:39 [INFO] 1: [md.mirrerror.cloudbans.units.punishments.TempBanPunishment@7ef35e8a]
17:06:39 [INFO] before: [md.mirrerror.cloudbans.units.punishments.TempBanPunishment@7ef35e8a]
17:06:39 [INFO] after: []
17:06:39 [INFO] 2: [md.mirrerror.cloudbans.units.punishments.TempBanPunishment@7ef35e8a]
        ProxiedPlayer proxiedPlayer = event.getPlayer();
        CloudPlayer cloudPlayer = new CloudPlayer(proxiedPlayer);

        String playerIp = proxiedPlayer.getAddress().getHostName();

        cloudPlayer.setLastJoinDate(LocalDateTime.now());
        cloudPlayer.setLastIp(playerIp);

        System.out.println("1: " + cloudPlayer.getPunishments());

        for (Punishment punishment : cloudPlayer.getPunishments()) {
            if (punishment instanceof TemporaryPunishment) {
                TemporaryPunishment temporaryPunishment = (TemporaryPunishment) punishment;
                if (temporaryPunishment.getEndTime().isBefore(LocalDateTime.now())) temporaryPunishment.remove();
            }
        }

        System.out.println("2: " + cloudPlayer.getPunishments());
        System.out.println("before: " + punishments);
        punishments.removeIf(entry -> entry.getId().equals(punishment.getId()));
        System.out.println("after: " + punishments);

Why isn't the cloudPlayer.getPunishments() list empty in the second case?

#

@ancient plank

ancient plank
#

don't ping staff for server or development help

spare prism
brave sparrow
#

you haven't sent enough code for us to tell

unreal quartz
next stratus
spare prism
brave sparrow
#

probably the entire the TemporaryPunishment remove method

#

if not more

spare prism
#
    @Override
    public void remove() {
        ProxiedPlayer proxiedTarget = ProxyServer.getInstance().getPlayer(target);

        if(proxiedTarget != null) {
            CloudPlayer cloudPlayer = new CloudPlayer(proxiedTarget);
            cloudPlayer.removePunishment(this);
        } else {
            OfflineCloudPlayer offlineCloudPlayer = new OfflineCloudPlayer(target);
            offlineCloudPlayer.removePunishment(this);
        }
    }
brave sparrow
#

that would be why then

#

you're making a new CloudPlayer in the remove

#

so the original CloudPlayer isn't being modified

#

so it doesn't know a punishment has been removed

worldly ingot
#

If you really want to implement that, I would opt to accept a CloudPlayer instance to that method

#
    @Override
    public void remove(CloudPlayer player) {
        player.removePunishment(this);
    }```
#

Though that just becomes a convenience method

#

Eh, I guess your punishment contains a target. Yeah. You should have some sort of internal Map/cache of UUID -> CloudPlayer instances

misty ingot
wet carbon
#

?help

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

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

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

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

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

**__ModLog:__**

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

**__Permissions:__**

permissions Command permission management tools.

rough drift
#

Strings are immutable

misty ingot
#

could you elaborate

rough drift
#

your original string won't change

#

iirc it just makes a new string

#

and colors that

#

?learnjava

undone axleBOT
misty ingot
#

?database

rough drift
#

should be added

#

okay

#

then.... why'd you ask?

#

also not

#

note

#

color codes don't get removed

#

it just converts it to the actual char

#

no

#

it translates alternate color codes

#

as the name suggests

#

idk how to type the char

#

but if you put "&" in there it converts it to another char

#

doesn't delete

hasty prawn
#

It's the section character, §

rough drift
#

i feel like thats only a character in the english keyboard

hasty prawn
#

It's not lol

brave sparrow
#

it's not on our keyboard

hasty prawn
#

I had to google it and copy paste

brave sparrow
#

it's alt 12

rough drift
#

wdym

#

the & just gets relpaced

tardy delta
brave sparrow
#

no, it will only replace the ones before a valid color code

rough drift
#

yeah

torn badge
#

Hey guys, got a small mathematical question:
Let's say I draw a line with particles in the middle of a block. How would I rotate it so it's on another block but 90 degrees rotated?

misty ingot
#

check the article I am using

tardy delta
#

ye i did and i guess he made that class on his own

torn badge
rough drift
#

i made a thread

hasty prawn
#

Why can't you use &

hasty prawn
mellow gulch
# torn badge

replace y with x and x with 1-y,
where x and y are 0-1 (float within the bounds of a block)
or something like that

hasty prawn
#

I mean every character is really gonna be used regularly, unless it's just not on the keyboard. You can just replace the char in translateAlternateColorCodes.

tardy delta
#

i gave you the methods so register and unregister listeners

hasty prawn
maiden briar
#

How can I set the worldborder with 2 Location points?

hasty prawn
maiden briar
#

Yes

#

The both points are a square, 100%

mellow gulch
hasty prawn
#

^

maiden briar
#

Ok so I have to calculate the distance between the 2 points then?

#

Center was already clear

#

Thanks guys, I will try it out

hollow arch
mortal cedar
#

Is it possible to enable monster spawning outside the world border?

mellow gulch
hasty prawn
mortal cedar
#

I don't like where this is going :/

worldly ingot
#

World border size is a diameter, yes

hasty prawn
#

Well, alternatively, you could send packets to players as the worldborder so the server doesn't know it's there lol

#

But the player can still see it

worldly ingot
#

Working on API for that

hasty prawn
mellow gulch
mortal cedar
#

I tried using packet borders but since minecraft packages etc is very different in 1.17+ from 1.16 I've got my problems getting support for all my plugin's supported minecraft version

#

I didn't even manage to get a single net.minecraft class with reflections but it worked fine with hardcoding the exact same class I failed to get with reflections (ClassNotFound)

vague oracle
midnight shore
misty ingot
#

how can I setup a MySQL database for my plugin

#

1.18.1 Java 17

worldly ingot
midnight shore
#

but thats the line it says

hasty prawn
#

179?

#

That's a warning

#

Hover over it, I assume that its telling you it's always true/false.

vague oracle
mortal cedar
worldly ingot
#

Bukkit does have @UndefinedNullability but I mean in this case the method should probably just be @Nullable

mortal cedar
#

Still works tho

vague oracle
#

Got you ty for the help 🙂

mortal cedar
#

Just use the latest dependencies shouldn't be much changed

misty ingot
#

I dont want a "still works tho" way
I want a way that is new and reliable

worldly ingot
#

Alternatively we could re-implement that method so that it returns an AIR ItemStack if the fetched value is null

#

Maybe better to do that tbh

mortal cedar
#

its the same as ever before

hasty prawn
#

I really wish Spigot EITHER returned null or an air itemstack consistently lol

#

not either or catthonk

worldly ingot
#

It is super inconsistent, yeah

#

One of the pain points of working with inventories

#

Issue being that changing it now would break API contracts and break some plugins

hasty prawn
#

Yeah

mellow gulch
hasty prawn
#

I just made a isNullOrAir check and called it a day lol

mortal cedar
brave sparrow
#

@worldly ingot ive definitely run into the issue where spigot says an item will be not null and it ends up being null lol

#

i even think it was for getting the item in hand

midnight shore
#

did you look at the error paste?

hasty prawn
#

Oh I didn't even see you sent that lol

#

What is the warning on 179? Probably has something to do with it

worldly ingot
#

statList is just null

vague oracle
#

Also whilst Im here, anyone noticed a problem with worlds getting stuck on this message when the server is disabling, Im using 1.18.2 but I have looked every where and can't see someone else with the same problem, so I can't tell if its vanilla, a plugin, paper (Ima ask paper too) or something else (Been like this for 2 hours)

worldly ingot
#

;p there's literally nothing else there that can cause an NPE

brave sparrow
#

statList can't be null

hasty prawn
#

^

brave sparrow
#

but statList.getStats() can

#

which is what i think it is

hasty prawn
#

Probably

worldly ingot
#

Suppose so

#

Can't call iterator()

brave sparrow
#

yup

midnight shore
#

but i'm checking that

brave sparrow
#

you're not checking statList.getStats() for null

midnight shore
#

ohhh

#

i see

worldly ingot
vague oracle
#

oh awesome ty

worldly ingot
#

Now resolved I believe but Slime says it was to do with a world generator

#

The former issue, however, is without a world generator as far as I'm aware

mellow gulch
#

i hope my new steps actually let other people reproduce 6956.
hard to tell what's going on, but ya i don't think it's caused by world generation

worldly ingot
#

Yeah I think Marvin was able to reproduce with those steps under specific conditions

#

Him, Doc, and md are actively looking into it. I'm not great with world stuff so that rules me out

midnight shore
#

how can i set an item to be unstackable or to have an amount limit without modifing its nbt? I want to have player heads that are not stackable (which normally isn't possible [i guess]) and to have them in a crafting recipe. However i tried adding an nbt that that has just a random number in it so that every itemstack is technically different. But that also counted towards the recipe which did no longer work.

viral crag
worldly ingot
#

Yeah, the attached NoSpawnChunks.jar which just triggers the possible conditions of hanging

mellow gulch
viral crag
#

interesting, maybe thats why I dont see that behavior

worldly ingot
#

I've not updated my local test server to Spigot 1.18.2, only testing things on CraftBukkit 1.18.2. Though no issues there either. It's happening for a small few

quaint mantle
#

Is it possible to add another line in a custom name for an entity?

lilac dagger
#

no, you must use armourstands

quaint mantle
#

ah ok

worldly ingot
#

@vague oracle is your server running on an HDD or an SSD?

quaint mantle
#

Im currently setting the armorstand position to the entity's location, but it doesnt snap fast enough. Any way i can fix this?

#

im already calling the teleport every tick

vague oracle
#

SSD

#

I was about to make a post on the thing

#

I have a detailed video showing it

worldly ingot
#

PES_BlankieThumbsUp Mention that you're using an SSD as well if you haven't already. Relevant for that issue

tardy delta
#

are you having a cat or a dog? thats relevant too

#

kekw

worldly ingot
#

I don't think there's a way to limit that without just adding some unique NBT, but yeah... fucks with recipes

hasty prawn
raw ibex
hasty prawn
raw ibex
#

is it a placeholder

brave sparrow
#

No

raw ibex
#

but then where would I use HanderList.unRegisterAll(listener)

brave sparrow
#

Anywhere you want to disable that listener

#

But it’s not referencing your HandlerList variable

#

It’s a static method call against the HandlerList class

tardy delta
brave sparrow
#

And for the record it’s unregisterAll(listener);

#

Not unRegisterAll

hasty prawn
tardy delta
#

😂

#

just told him to register and unregister a listener

hasty prawn
#

Wait, Orla, what are you trying to do?

mellow gulch
# midnight shore any ideas?

in a minigame i wrote i got around this with player heads by adding a timestamp hidden with color codes to the lore. kinda janky but it was good enough

raw ibex
# tardy delta im only half understanding what he's trying to do

What I'm trying to make is a bedwars plugin.

When I do /start, then the Event Handler will activate, containing all the events for the game to happen, along with the initiation of the game.

When the game ends, either with a command or automatically, then I will unregister all the handlers

brave sparrow
#

Then that’s it

raw ibex
#

But where do I use HanderList.unRegisterAll(listener)

brave sparrow
#

Anywhere

hasty prawn
#

When the game ends

brave sparrow
#

^

raw ibex
#

it's in red though

tardy delta
#

that would mean you're having listeners for each game?

midnight shore
hasty prawn
#

Because the method name is wrong

brave sparrow
hasty prawn
#

Alex gave you the right one

raw ibex
#

No i mean HandlerList is in red

#

OH LMAO

brave sparrow
#

Import it

raw ibex
#

hander was spelt wrong

hasty prawn
tardy delta
#

why dont you just register the event on enable and listen for games globally?

mellow gulch
brave sparrow
#

So after it ends it would need unregistering

sleek pond
#

Orla should learn java, I think

brave sparrow
#

True

raw ibex
#

I supposedly did a "Java course", turns out it wasn't so helpful

midnight shore
mellow gulch
#

you could make the recipes to just take whatever player head, and then set the result to air in PrepareItemCraftEvent if the heads provided don't match how you want them to

#

the event lets you examine the crafting grid

midnight shore
#

but the recipes are not made by my own plugin

#

ty for the help but i guess its impossible

brave sparrow
#

It’s not impossible

torn shuttle
#
    PlayerInventory playerInventory = (PlayerInventory) Bukkit.createInventory(requestingPlayer, InventoryType.PLAYER, PlayerStatusMenuConfig.getGearChestMenuName());

This gets me a ClassCastException: class org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryCustom cannot be cast to class org.bukkit.inventory.PlayerInventory so I guess that's not possible to cast, is there a way for me to get a PlayerInventory object out of this?

brave sparrow
#

You can listen to a bunch of events to prevent the heads from stacking @midnight shore

#

It’s just gonna be a pain for you

brave sparrow
#

You can’t cast it to a player inventory when it isn’t one

torn shuttle
#

is inventorytype player not a PlayerINventory?

brave sparrow
#

Nope

torn shuttle
#

oh

brave sparrow
#

That’s why the cast doesn’t work

torn shuttle
#

huh

#

is there a way to create an inventory that is a playerinventory?

lapis widget
#

You would want to use a chest

brave sparrow
#

Not that I’m aware of off the top of my head

#

Most plugins use a chest yeah

torn shuttle
#

I was trying to avoid using a chest tbh

brave sparrow
#

Why

torn shuttle
#

this was meant to be the gear info page

#

it just has a useful layout for that

brave sparrow
#

You can’t show a player two player inventory pages anyway

torn shuttle
#

just needed the one

#

oh well

brave sparrow
#

The client won’t do it

#

Like the client will display its own inventory

torn shuttle
#

the client is dumb, minecraft 2 when

brave sparrow
#

You’d have to basically trick the client into thinking their inventory was whatever the display inventory was

#

Which you can do

hasty prawn
#

The client is tricked so easily

#

Lol stupid client

torn shuttle
#

hey don't talk shit like that about clients

#

my mom was a client

hasty prawn
#

oh I'm so sorry

somber hull
#

What did I walk into

raw ibex
#

why can't i check if a key contains

#

.getKey().contains()

#

i thought that worked

somber hull
#

Persistent data?

#

Hashmap?

#

Like what are we talking here

brave sparrow
#

What is getKey()

raw ibex
#

sorry

torn shuttle
#

the key to the universe

raw ibex
#

e.getBlock().getType().getKey()

#

i wanna check if it contains bed

somber hull
#

Hold@up idk what that does

#

Lemme check the docs

#

Link that

brave sparrow
somber hull
#

Ahh I see

brave sparrow
#

The first getKey() returns a NamespacedKey, the second returns a String

somber hull
#

Well there’s an easier way to check if it’s a bed

raw ibex
#

oh yea im dum

#

how?

ancient jackal
#

instanceof

mellow gulch
# torn shuttle it just has a useful layout for that

if you really want to use the player's inventory you could store all of the player's inventory somewhere, then clear it, and add some transactional logic to update an internal collection of itemstacks when they close the inventory, but i don't think it's possible to tell the client to open the player's inventory screen either so this probably isn't a helpful message...

somber hull
#

You can probably check instanceof, or does checking the material not work?

somber hull
#

Ahh

#

Then yea use instnceof

raw ibex
#

ok

#

thanks

somber hull
#

Idk if you have to check the block or the block state

#

Lemme see

raw ibex
#

i keep fogetting to use that

brave sparrow
worldly ingot
#

Block will never be anything but a Block, yeah

#

There is no sub type

brave sparrow
#

^

somber hull
#

Yea it’s block.getGetData

#

And then instanceof

somber hull
raw ibex
somber hull
#

Yea just slap on the getData()

brave sparrow
#

Same thing

somber hull
#

Idk why I put get twice

torn shuttle
#

having to make one book menu for java edition users and one mirrored menu for bedrock edition users is making me want to jump off a cliff twice as tall as usual

somber hull
raw ibex
somber hull
#

Nvm I thought you meant something else

raw ibex
#

yes or no

somber hull
#

Yes you need the block data

raw ibex
#

ok

#

nice

somber hull
#

I mean

#

You could’ve tried it yourself

#

But

#

¯_(ツ)_/¯

raw ibex
#

lmao i just tried to do this

#
            Bukkit.broadcastMessage(`${team} just got `)
#

from javascript lol

somber hull
#

Holy shot

raw ibex
#

oh shoot im so dumb

somber hull
#

The Minecraft movie is a thing

#

Wtf

#

It releases tomorrow

trail pilot
#

uhm

#

did i got an answer for my request lmao

#

anyway i cant find my request

#

i need to save data when server stop

tardy delta
#

save it on onDisable?

trail pilot
#

but how i can write thing on it?

tardy delta
#

wdym?

trail pilot
#

i mean i made a method for sethome

#

but 7something7 said i dont need to do that

#

i dont know im so confused

hybrid spoke
#

7something7

tardy delta
#

lmao best joke i heard today

alpine plover
#

Hi everyone,
is anyone willing to help me with my plugin (in private)?

I tried to post it in the premium section but it was rejected for "coding mistakes" and I can't figure out the errors.

tardy delta
#

or just here so other people can say things too?

trail pilot
tardy delta
#

?paste

undone axleBOT
tardy delta
#

paste it there

alpine plover
#

The plugin does not have any error, it was just rejected for "coding mistakes".

lapis widget
tardy delta
#

any more information? i guess not

alpine plover
#

This is the message:

"Unfortunately, your recent report has been rejected: Resource Update in 'Keycard and Keypad Plugin [PREMIUM]' - Resource with beginner coding mistakes. Improve the quality of your code design (by properly and efficiently using OOP/Bukkit/Java API and using efficient data storage and retrieval) if you want to release it as a premium resource!"

tardy delta
#

you could show code but i dunno if thats what you want

#

as its a premium resource

alpine plover
vague swallow
#

How can I check if a sign is placed on a chest?

lapis widget
tardy delta
#

well then how can we help you?

alpine plover
ebon arrow
alpine plover
ebon arrow
#

Quality testing

alpine plover
#

I did a lot of tests and the "basic" plugin was downloaded 2870 times

#

All bug fix requests sent to me have been resolved

tardy delta
#

looks serious when they say youre not using OOP properly

alpine plover
#

I can send the "lite" plugin, in which I think the errors are present.

tardy delta
#

you can

alpine plover
#

Can I send the link of the plugin?

tardy delta
#

does it has the source code on github or something?

#

otherwise the link would be useful

tardy delta
#

lol luyten slow

#

well the first thing i see is that you're exposing static collections

boreal sparrow
#

is there a way to play custom sounds by forcing a recoursepack

tardy delta
#

i see why they didnt allow it

alpine plover
#

I made this plugin a few years ago, but I thought it was fine anyway.

tardy delta
#

oh ye i forgot that this isnt the premium resource

#

did you change much on it?

alpine plover
#

If the problem is big I can do it again.

alpine plover
vague swallow
#

uh can someone please help me?

#

?paste

undone axleBOT
vague swallow
#

I'm getting this error message:

eternal oxide
#

don't blind cast

vague swallow
#

And this is my code:

try{
            WallSign sign = (WallSign) e.getBlock();
            Location chestloc = new Location(p.getWorld(), sign.getFacing().getOppositeFace().getModX(), sign.getFacing().getOppositeFace().getModY(), sign.getFacing().getOppositeFace().getModZ());
            if(chestloc.getBlock().getType() == Material.CHEST) {
                if(line1.equalsIgnoreCase("[Shop]")) {
                    try {
                        Integer.parseInt(line2);
                        Integer level = Integer.parseInt(line2);
                        e.setLine(0, "§e-----[§6Shop§e]-----");
                        e.setLine(1, line2 + "$");
                        e.setLine(2, p.getDisplayName());
                        e.setLine(3, "§e---------------");
                    } catch (NumberFormatException error) {
                        p.sendMessage("§eOn the second line you have to write the price, so just a number!");
                        e.setLine(0, "§c§l[ERROR]");
                    }
                } else return;
            } else {
                e.setLine(0, "§c§l[ERROR]");
                e.setLine(1, "§0Shop signs can");
                e.setLine(2, "§0only get placed");
                e.setLine(3, "§0on chests");
            }
        } catch (NullPointerException error) {
            return;
        }
    }
vague swallow
#

but I didn't even import any nms into that class

eternal oxide
#

WallSign sign = (WallSign) e.getBlock(); is a blind cast. You never check to see if the block IS a wall sign

vague swallow
#

How can I do that?

#

because WallSign is not a material

#

and I don't want to do it for all the sign materials

quaint mantle
#

How hard is it to make a custom attribute modifier

eternal oxide
#

if (Tag.WALL_SIGN.isTagged(e.getBlock()))

#

or something close

raw ibex
#

how do i make something happen every 1 second

eternal oxide
#

?scheduling

undone axleBOT
raw ibex
#

thank

lilac dagger
#

has anyone ever used the proguard maven plugin?

#

i'm facing an issue with a module of a project that i use, the dependency that that module has isn't being seen and it results in this issue

alpine plover
lilac dagger
raw ibex
#

how do i get world in a command

chrome beacon
#

As an argument or from the sender

tardy delta
alpine plover
#

Thank you very much for your time, just one last thing, what do you mean by "exposing variables" and "not delegating responsability to the proper class"?

#

I really suck at English...

tardy delta
# tardy delta

like this, making your collections public and working on them directly

#

instead of having like a KeypadManager with methods to modify the collection

#

try to make things clean and choose where you put your methods

upper mica
#

Hello, is there a way to modify default minecraft command's tab completions? I tried TabCompleteEvent, but it only catches commands that are registered by a plugin

tardy delta
#

implement TabCompleter and do Command#setTabCompleter

#

then override onTabComplete

#

i can show an example

raw ibex
#

like in the file

tardy delta
#

you basically have to return a List<String> based on the args and the length of thr args

#

lol i push to github and intellij is broken

upper mica
lapis widget
#

great

alpine plover
torn badge
#

Someone good with vectors and maths and could maybe help me?

tardy delta
#

ah default commands, not sure if you can set a tabcompleter for that, i would listen for the TabCompletEvent

raw ibex
tardy delta
#

Bukkit.getWorld(args)

minor fox
#

When I disable commands in the bungee config, they are still tab completed. Any way to fix this?

upper mica
tardy delta
#

dunno

#

lol intellij hates me

raw ibex
#

why

raw ibex
tardy delta
#

the argument that the user specifies in a command

#

like args[0] or something

#

if your command is /command <world>

trail pilot
#

hm

raw ibex
#

no

tardy delta
#

lol it duplicated config files

raw ibex
#

like no args

trail pilot
trail pilot
tardy delta
#

intellij just broke

#

eclipse fans being happy

vague swallow
#

How can I check if a Block is a Wallsign placed on a chest?

trail pilot
tardy delta
#

dependencies gone lol

#

lets try maven reload

upper mica
#

So wait, is tab-completion for default minecraft commands handled client-side or something? Because not even protocollib packet listener could catch it, it works for plugin commands tho

quaint mantle
#

basic java ik but im dumb,
how do i replace the first slash in a string cus if i try i get this

upper mica
#

Use String#substring

#

if you only need to get rid of the first character

quaint mantle
#

alright

#

making a loop command took me way longer than it should

#

which event would i use for checking if player had the damage taken by Void? its a 1.8.8 (ik its old its just for someone requesting it and buying it from me)

quaint mantle
hasty prawn
#

getCause()?

#

If that doesn't exist in 1.8.8 then I have no idea. That's old af

quaint mantle
#

yeah it is

#

yeah there it is but i didnt see it before thats weird

#

thank you

raw ibex
#

how to get who did the damage in EntityDamageByEntityEvent

young knoll
#

getDamager

raw ibex
#

ok thanks

hasty crow
#

Hello, is there any way to get a list of blocks that have no hitbox like fire lava and water or check if a block does not have hitbox?

raw ibex
#

Would this work?

#
@EventHandler
    public void arrowHit (EntityDamageByEntityEvent e) {
        Entity damager = e.getDamager();
        if(damager.getType() == EntityType.PLAYER) {
            Player p = damager.getServer().getPlayer(damager.getUniqueId());
        }
    }```
young knoll
#

You can just cast damager to player

raw ibex
#

k

#

and check if it's null?

#
    @EventHandler
    public void arrowHit (EntityDamageByEntityEvent e) {
        Entity damager = (Player) e.getDamager();
        if(damager != null) {
            Player p = damager.getServer().getPlayer(damager.getUniqueId());
            ItemStack item = p.getInventory().getItemInMainHand();

        }
    }```
#

is this good now @young knoll

young knoll
#

What

#

No, instead of using Bukkit.getPlayer, cast

raw ibex
#

ok

#

would that work @young knoll

#

what i put

#

i casted

#

to player

young knoll
#

No

#

You can't blindly cast entity to player

raw ibex
#

ok so what do i do

#

@young knoll instead of that

young knoll
#

Just replace the getPlayer part with a cast

raw ibex
#

ok

tardy delta
#

use instanceof

shell hedge
#

Heyo, what is the alternative for ItemMeta#setLore (Deprecated)? The Javadocs are not up to date yet 😐

tardy delta
#

which version?

shell hedge
#

1.18.1

tardy delta
#

i dunno about 1.18

#

for me nothing is deprecated in 1.17.1

raw ibex
#

This is good?

#
    @EventHandler
    public void arrowHit (EntityDamageByEntityEvent e) {

        Entity damager = e.getDamager();

        if(damager instanceof Player) {
            Player p = (Player) e.getEntity();
            ItemStack item = p.getInventory().getItemInMainHand();
            ItemMeta im = item.getItemMeta();
            if(im.getDisplayName().contains("Levitation Bow")) {
                p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 5, 1));
            }
            
        }
    }```
#

@tardy delta @young knoll

tardy delta
#

?

raw ibex
#

instanceof

young knoll
#

Looks reasonable

tardy delta
#

i dont think you know what youre doing

#

Entity damager = e.getDamager();

    if(damager instanceof Player) {
        Player p = (Player) e.getEntity();
raw ibex
#

what

young knoll
#

Oh yeah

#

Didn't see that

raw ibex
#

i did what coll dude said

young knoll
#

You check if the damager is a player

#

But then cast the damegee to player

tardy delta
#

checking if damager instanceof Player and then blind casting the entity?

#

instead of the damager

raw ibex
#

i did what coll said

tardy delta
#

coll uwu

raw ibex
#

what do i have to change

raw ibex
tardy delta
#

better than someone saying 7something7 instead of 7smile7

#

😳

raw ibex
#

lol

raw ibex
tardy delta
#

someone did

#

best joke i heard today

raw ibex
#

lmao

raw ibex
#

better?

#
       if(e.getDamager() instanceof Player) {
            Player damager = (Player) e.getDamager();```
tardy delta
#

ye

lapis widget
#

personally I prefer to do this

#

if(!(e.getDamager() instanceof Player) ){ return; } Player damager = (Player) e.getDamager();

raw ibex
#

ok

tardy delta
#
if (event.getDamager() instanceof Player damager)```
kekw
raw ibex
#

should i do that fourteen brush

#

what kekw

#

should i do that

lapis widget
tardy delta
#

thats java 8+ way

#

i recently switched lol

blazing scarab
#

you mean java 16+ way

raw ibex
#

oh wait i'm java 8

lapis widget
tall dragon
#

yea thats java 16, not 8

blazing scarab
#

move to something newer

raw ibex
#

i can't

#

it doesnt work

tall dragon
#

why not.

raw ibex
#

ok it's 16 now

#

nice

young knoll
#

Does 1.8 run on 16?

lapis widget
#

nope

blazing scarab
#

it does

young knoll
#

IIRC it was before spigot added max versions to the jars

#

So it should in theory

raw ibex
#

this good?

#

    @EventHandler
    public void arrowHit (EntityDamageByEntityEvent e) {


        if (e.getDamager() instanceof Player damager) {
            
            if (e.getEntity() instanceof Player p) {

                ItemStack item = p.getInventory().getItemInMainHand();
                ItemMeta im = item.getItemMeta();
                if (im.getDisplayName().contains("Levitation Bow")) {
                    p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 5, 1));
                }

            }
        }
    }```
lapis widget
#

Your gonna need to check if the item has an itemmeta before accessing it

tall dragon
#

i mean, i would not use the display name to check for your unique item.

blazing scarab
#

Use PDC Instead ^

young knoll
#

No PDC in 1.8

#

🙃

raw ibex
#

im in 16 now

lapis widget
#

He means if your developing with MC 1.8

#

your not gonna have PDC

raw ibex
#

i'm in 1.18

tall dragon
#

then use nbt

raw ibex
#

so what are you suggesting i do now?

hexed hatch
#

Another good way of identifying custom items is using localized names

raw ibex
#

aaaa so many people

young knoll
#

Nah

hexed hatch
#

Which can’t be affected by the player

young knoll
#

PDC all the way

#

?pdc

raw ibex
#

what's the final answer

tall dragon
raw ibex
#

ok

vague swallow
#

Does anyone know how I can get the Location 5 blocks in the line of sight of a player?

raw ibex
#

why does the displayName not work

tall dragon
#

it works

#

but its bad

young knoll
#

Players can rename items

#

Players can't change the PDC

tall dragon
#

for example yes

raw ibex
#

its for a yt vid

young knoll
#

You disabled anvils?

raw ibex
#

anyways gtg

vague swallow
tall dragon
tall dragon
lapis widget
blazing scarab
#

Since PDC exists, what's the point?

rotund pond
grim ice
#

It doesnt look like any abuse

#

a custom item has a custom localized name

tardy delta
grim ice
#

it just makes sense to me

young knoll
#

Or just NMS

grim ice
#

thats fucking dumb

#

to use nms just to identify a custom item

rotund pond
#

Oh I see

grim ice
#

or any library

rotund pond
#

Ty

rotund pond
young knoll
#

Then don't use 1.8

grim ice
young knoll
#

Doesn't exist in the 1.8 api

grim ice
#

localized name does not?

blazing scarab
#

take L 1.8 users

young knoll
#

Not sure actually

grim ice
#

ok it doesnt

worn tundra
#

ugh 1.8

grim ice
#

imagine blaming devs for doing what their owners want

blazing scarab
# grim ice It doesnt look like any abuse

Well, sure it can have, same with display name and lore. However, all of those can be easily changed by other plugins and never were intended to be used as data storage

#

Imagine working for owners who still on 1.8

grim ice
#

you're setting the internal name for a custom item

worn tundra
#

imagine being a developer whos fine with an owner with 1.8

grim ice
#

it looks normal to me

rotund pond
blazing scarab
grim ice
blazing scarab
#

nbt api is a crap

grim ice
#

it's not something a player can change

#

if a developer changes it

blazing scarab
#

sorry the code is awful

grim ice
#

their fault

blazing scarab
rotund pond
#

Wait, what's a localized name for you ?
To me, it's the method for items to get the name of the item, without taking account the display name

young knoll
#

I actually have no idea what it does tbh

grim ice
#

you're gonna store the item name

#

its meant to be the item name

#

and its essentially that?

blazing scarab
#

Well it looks like getLocalizedName is just a method existing only because dumb spigot doesnt supports Components in item names

grim ice
#

eitherway

#

imo that's definitely not api abuse

#

as long as ur not storing some random shit that isnt related to the item name

#

its just a convenient way to check if an item is yours, without the risk of using display name which can be modified by players

blazing scarab
#

You can store the Item name here, but you definetly shouldnt use it as identity

grim ice
#

its not editable by players, so why not

blazing scarab
#

AyUniz stop reacting messages with 😂

rotund pond
viral crag
#

localized : assign (something) to a particular place.

blazing scarab
#

idk just feels weird

grim ice
#

if u think about it, its sort of an internal name, internal as it cant be modified by players, so storing the custom item's name there, and checking for it to identify it, would make complete sense to me

blazing scarab
#

because localized name.. is a f**king Localized Name, not an identifier?

#

like,
Red Glass
or minecraft:red_glass

grim ice
#

yes

#

red glass identifies the item, to a red glass

rotund pond
grim ice
blazing scarab
#

Objects doesnt have names, fields and variables do. But as you can see field names are short and informative without spaces

grim ice
#

its a human readable, uneditable by players name

#

names identify an object or a person

#

for example if you had a forge custom item

#

and it was a clone of the apple item, but with some extra stuff to it.

blazing scarab
rotund pond
grim ice
#

Yes

grim ice
blazing scarab
#

There's a reason why mojang use id's instead of just checking the display name of itme

grim ice
#

the whole point is that its not one, and it cant be edited by the player

blazing scarab
#

Mojang doesn't check for localized name either. They use proper ids

rotund pond
grim ice
#

just because they dont use it

#

it doesnt mean that we cannot use it

#

and it makes perfect sense to use it

blazing scarab
#

No it doesnt

grim ice
#

and what is an example of "proper ids"

blazing scarab
#

Namespaced Keys, integers, UUIDs?

viral crag
#

How many general programmers want to reference an ID chart every time they program something with or for an ID?

grim ice
#

integers?

blazing scarab
#

Yes, widely used in databases

grim ice
#

and you talk about identifiying

blazing scarab
#

yes i do

grim ice
#

that doesnt identify the item

blazing scarab
#

It can

grim ice
#

6

#

what item is that?

#

Green Apple

blazing scarab
#

gets the item info from registry

grim ice
#

tells me that

#

the item is a green apple

#

its just simple and human readable

#

iwjefiuwhefouwaebhfunawefuabwefuoawnefp

tardy delta
#

wat

grim ice
#

im not writing a uuid btw im lazy

grim ice
#

namespacedkeys make sense

#

a uuid also makes sense i guess but its not human readable

#

and it doesnt identify it outside of the code

blazing scarab
#

Takes unnecessary space. An idnetifier should be short and point to the actual info, not representing them

grim ice
#

that doesnt give any info about the item

#

its a mere number

blazing scarab
#

for uuids and integers i just get info i need from a registry, rather than storing it as key directly

grim ice
#

and it can be as long as the actual identifier ive talked about

blazing scarab
#

It does give a pointer, still

grim ice
#

for example if u had 1000 items

#

an item name can be that amount of digits

#

and it identifies an item

#

even outside of code

#

which makes it way more convenient

#

than having to memorize a number for items

#

what is more convenient?
Memorizing DIRT for dirt OR
2 for DIRT

#

2 is simple so you can memorize that

#

but as the number grows, it gets complicated

tardy delta
#

what are we talking about? 👀

grim ice
#

read up the conversation

viral crag
#

value of using setLocalizedName, getLocalizedName

blazing scarab
#

Just use PDC and short descriptive identifiers rather than full names

#

I'm not going to argue anymore it seems pointless

viral crag
#

the longer your code length gets, the more valid it's use is in preventing errors

grim ice
#

it's a better way. but for legacy versions (Which you cant stop people from using, get over it) it doesnt exist, and using another library for that is dumb

#

and i would use localizednames even in 1.99

#

as long as there isnt another simple human readable, uneditable by players, almost invisible to users way

#

why does almost every platform in the internet use a username

#

since it identifies yo

#

they couldve just used the ids

grim ice
#

like in discord

blazing scarab
grim ice
#

e.g
Hello! How's your day 518325046528442369?
Hello! How's your day Domino?

blazing scarab
#

Numbers are just faster than strings

grim ice
#

I know that

blazing scarab
#

Separate Display Names and Identifiers

grim ice
#

but for items it's a separate case, you can replace the "518325046528442369" with a "DOMINO"

viral crag
#

using gApple, rApple, yApple etc within something like an apple orchard code is reasonable, sure you could use the 2 +1 id but how easy would it be to find the reason for the wrong color apples growing under a certain condition?

grim ice
#

but people can have the same names in discord

#

so that would not work out

#

and a string will 100% do the identifying job better than integers

blazing scarab
grim ice
#

How about legacy versions?

young knoll
#

Heck em

grim ice
#

dont bring the "omg legacy stop support" argument please

blazing scarab
#

idgaf about legacy

#

use nbt or something

grim ice
#

No

blazing scarab
#

maintain your own fork or something

grim ice
#

I'm not using nms for that, that's even worse

blazing scarab
#

that's your problem forcing you to use workarounds

grim ice
#

What problem do you have with localizednames

#

it makes perfect sense to use them, regardless of the version

blazing scarab
#

no

lapis widget
blazing scarab
#

You're breaking method contract at least

grim ice
#

I do not care what country he supports

blazing scarab
lapis widget
#

My point is that you can't win his argument

#

he's not willing to accept your opinion

grim ice
#

I do not care about that either

#

Proving my opinion has nothing with him accepting it

viral crag
#

if you write something to support both java and bedrock, localized names make things much simpler

grim ice
smoky oak
#

what's the best way to store per-player-data, while wishing for the ability to access all of it would the need arise?

grim ice
#

pdc

smoky oak
#

(yes i know PCD is a thing but i really dont think it would be a good idea to iterate over every player that ever visited the server)

grim ice
#

or that

#

You didnt give enough information in your question

#

you did not mention iterating

grim ice
#

NoSQL would work too? or not?

young knoll
#

Yeah

smoky oak
#

tf is NoSQL

young knoll
#

Something queryable though

blazing scarab
#

garbage

grim ice
#

e.g mongodb

young knoll
#

Like Mongo

grim ice
#

mongo uses documents

viral crag
grim ice
#

you would want to learn that

#

yeah

#

for example 4mb of data

#

u cant store data with pdc

smoky oak
smoky oak
grim ice
#

a database possibly

smoky oak
#

or to check over all players

#

ofc i could just stuff everyting in a datastream and serialize that

grim ice
#

You can use config files, as a second option if the server doesnt own a database

#

which im not sure if you want to do that

#

as for large networks, it would get very messy

#

but if its a large network, they would have a db

viral crag
#

do you already use an anti-griefing plugin/database?

grim ice
#

so they can turn the option to use a db on

smoky oak
#

its a mysql one

#

still

#

the reason i ask is because of that 'check all players' thing

viral crag
#

your answers are a bit confusing, why do you need to check offline player inventory?

young knoll
#

Yeah you generally want a DB if you are going to be checking all players

smoky oak
#

this is going to be annoying

#

welp

viral crag
#

just trying to sort out if you are better hooking into coreportect/prism rather than rewriting the wheel

smoky oak
#

say what now?

viral crag
#

both those store all player data in a database that you can access

smoky oak
#

wouldnt that make a plugin dependent on the presence of those plugins?

#

iirc the database coreprotect generates is about the same size as the world

viral crag
#

yes it would, but you also would not have to collect and maintain the collection

smoky oak
#

sounds like it'd be a good idea to just stuff a few options in the config file for which plugin or database to use if any

viral crag
#

it comes down to "why do you need to check offline player inventory"

smoky oak
#

not that one

#

but things like team etc

#

you asked about the volume of data

viral crag
#

I asked about type and how much player data

#

If you are intending to undo an action or remove inventory items, then using one of those two others would be advisable

smoky oak
#

ah that makes sense

#

some of the things i plan on doing would benefit from having a stack/history to pop

rough drift
#

best storage option: DOP wrapped with DOS

#

reading is DIP with IIS

smoky oak
#

wat an wat now?

rough drift
#

DataOutputStream wrapped with DeflaterOutputStream

#

DataInputStream wrapped with InflaterInputStream

#

or reverse

#

idk

smoky oak
#

thats for storage efficient storage

willow stream
#

Hey, I want to make a class that will be handling configuration files (messages and per player config (playerdata)). I can't seem to find an example on how to do that and the current implementation that I'm using is throwing a NPE. Can someone provide me with some examples please?

rough drift
willow stream
#

Yes, I need one for my messages file and per player config.

rough drift
smoky oak
#

alternatively if its not data that's need to know for anything but the plugin look into PDC

rough drift
#

you can have really small files with alot of data

smoky oak
#

because its the same thing over and over again

#

I'd recon that makes the compression a lot more efficient

rough drift
#

yes indeed

#

same byte repeated for like 1MB can be compressed into 8 bytes iirc

willow stream
rough drift
#

not exactly

#

but it still works

visual viper
#

Hello, how can I make it so that when a player places a block, they have to wait 10 seconds for it to break?

daring lark
#

placeBlockEvent and timer

visual viper
#

ok grax

daring lark
#

and also breakBlockEvent

mellow gulch
#

if you are going to have a ton of blocks like that you may want to think about putting timestamps on the blocks via metadata instead of using timers

smoky oak
#

why not do Bukkit.getScheduler.runTaskLater

sterile token
smoky oak
#

wait seriously?

mellow gulch
#

ya that's another option, but players can place blocks fast and metadata would probably be better than flooding the scheduler with tasks

daring lark
smoky oak
#

if thats a rickroll I stg

sterile token
mellow gulch
#

yep, usually a long

smoky oak
#

how do you actually know which blocks to check tho

mellow gulch
#

because the player tried to break it

smoky oak
#

well then you know which block to add the timestamp on

#

but i aint checking the entire world each tick if the block should break

#

i am using a sceduler there

mellow gulch
#

just check if it has the metadatavalue on block break

smoky oak
#

ah

#

i read the question wrong

#

nvmind

mellow gulch
#

if yes, is timestamp older than 10 seconds from now?
if yes then allow the break and remove the metadata

smoky oak
#

doesnt metadata get erased anyways when a block turns into an item?

mellow gulch
#

no, it stays at that xyz until the server shuts down

smoky oak
#

ah

#

note taken

mellow gulch
#

and pistons moving blocks will not move the metadata

#

because it's location based (afaik)

tall dragon
#

no i don't think so

viral crag
#

why be choosy about the block to break, your players would probably be less confused by a general cooldown than a specific block?

#

sees a player miss-placing a block on a build and destroying all the blocks around the wrong one ... and then complaining about it

silver shuttle
#

What is a good name to give to a plugin that allows for completely customizable items with different effects, of all kinds?

viral crag
#

anothercustomitemsplugin

hasty prawn
#

ACIP

silver shuttle
#

It is more of a core plugin to provide options for others to hook into

silver shuttle
#

Yet Another Custom Items Plugin
YACIP

#

but no, forreal

sterile token
viral crag
#

sort of guessing you might need to go backwards if you want anything containing "custom items"

#

how about ChallengerCI ?

silver shuttle
#

oh god no I hate such names with "Pro", "Elite", "Boss", "Ultimate"

viral crag
#

looks at your username

silver shuttle
#

I CANT CHANGE IT OKAY

#

its konstanius ingame

#

this one is so old

#

ok u know what

sterile token
#

Which netty module should i use as dependency?

#

It seems i cannot find the api module

silver shuttle
#

oh come on

#

I cant even leave the server to reverify

grim ice
#

should i learn python mainly for ML?

grim ice
#

or is it possible to do ML in java

silver shuttle
sterile token
silver shuttle
#

where ;-;

sterile token
undone axleBOT
silver shuttle
#

....

sterile token
#

Or just tag a staff and explain your problem

silver shuttle
#

Do I dare?

sterile token
#

And dont get mad lmaoo. Im just trying to help you

silver shuttle
sterile token
sterile token
mellow gulch
#

where did the 'e' come from? why aren't they called imails?

silver shuttle
#

uwu are you mail or femail

viral crag
#

electronic apple didnt make the i[phone by then

silver shuttle
mellow gulch
#

i would stand for internet

#

ah i suppose that makes sense maybe

viral crag
#

it wasnt originally the internet

silver shuttle
#

the internet wasnt really a popular term back then

sterile token
#

the internet didnt* exists let say, it just where peer-peer connection

#

If im not wrong

#

lmao 10/10 my english "wasnt exists"

mellow gulch
#

lol

viral crag
#

trying to help MS create more "correct" spellings

grim ice
#

uh

#

anyonne has a guide for ml in java

#

the ones i found dont rly explain it well

silver shuttle
#

How to translate both normal color codes and hex color codes from a string to colors in chat?

viral crag
#

some university/tech school does

sterile token
undone axleBOT
grim ice
sterile token
grim ice
#

pretty sure none of these

#

has any topic related to ml except maybe oracle

#

and i doubt it

sterile token
#

Oh idk, i never learned something from university

#

I always learned myselft

grim ice
#

im not a uni student

sterile token
mellow gulch
#

are you asking about the language or machine learning?

grim ice
#

machine learning

sterile token
grim ice