#help-development

1 messages ยท Page 356 of 1

terse ore
#

can you extend player class and be able to make it have my own methods?

#

(without modifying spigot api)

river oracle
#

Usually if you want to extend player your doing something wrong with your data structure

terse ore
#

not really

river oracle
#

Yes really

terse ore
#

I am doing something wrong with my structure? No
I was going to do it? Yes

river oracle
#

Spigot doesn't allow you to natively associate any other data with Player so wanting to extend it shows something wrong is up

terse ore
#

okok ill make it in another awy

river oracle
#

If you want to associate more data with the player use PDC

terse ore
#

I just liked the idea of doing player.mymethod

river oracle
#

Or make a uuid wrapper and use a database

terse ore
river oracle
#

That's your best option

#

You could have an internal getBukkitPlayer method or something along those lines

tender shard
#

Just snack some crack cocaine

river oracle
#

Alex back to being unhinged

tender shard
#

Whatever that meanw

#

Means*

hardy pollen
#

@tender shard

#

hi

#

i am using ur JeffLib

#

but it good an error

#

for entity player

remote swallow
#

?paste it

undone axleBOT
hardy pollen
#

can you help me how to use?

remote swallow
#

you need to define the method

hardy pollen
remote swallow
#

can an EntityPlayer even have a path finder goal

hardy pollen
#

that why i asked here

#

i want to make my EntityPlayer or humanEntity have pathfinder

remote swallow
#

if an EntityPlayer represents a player, that can move them self i doubt they can have a path finder goal

hardy pollen
remote swallow
#

no sorry

hardy pollen
#

oh

river oracle
#

And add them yourself

terse ore
#

I want to store a selected kit

#

by name

#

should I use a .yml or a db

river oracle
#

Whatever your scale is tbh yml is fine for tiny amounts of data. Otherwise the next step up would be JSON, than Sqlite than, something like MongoDB or MySQL

terse ore
#

I should not use Sqlite right?

river oracle
#

Sqlite is fine

terse ore
#

didn't sqlite have only 1 connection?

#

like could only take a single connection

river oracle
terse ore
#

okok

river oracle
#

Yea go with MySQL or Mongo

remote swallow
#

mingo

terse ore
#

Mingo?

river oracle
#

Shut

terse ore
#

oh okok

river oracle
#

Brit

terse ore
#

xdd

remote swallow
dull magnet
#

I'm wondering how to make the chat visible to all players when I type a command I've created.

urban mauve
#

how i can get block data(block id:block data) without getData() cuz it deprecated

icy beacon
#
val type = object : TypeToken<Map<UUID, Killstreak>>() {}.type

why is "object" needed here?

river oracle
#

Kotlin :(

icy beacon
#

thanks for your answer, anybody else wanna try?

glossy venture
#

lmao kotlin

river oracle
#

Most people here don't use that

remote swallow
#

it defines the type

glossy venture
#

thats the reason

icy beacon
remote swallow
#

iirc if you use var you shouldnt need object:

icy beacon
#

nah typetoken is just a goofy ass thing

#

it's weird in both java and kotlin

#

gson is goofy in general it seems

#

this line looks like this in java

#
final Type type = new TypeToken<Map<UUID, Killstreak>>() {}.getType();
river oracle
#

TypeToken Is like a hack lol

icy beacon
#

like, those curly brackets threw me off the first time i saw it

river oracle
#

It's so scuff

icy beacon
#

gson is hacky asf

rough drift
#

in a EntityDamageEvent, if the cause is FALL can I get the player that caused the fall damage? (eg attacked by player a and then took fall damage, like A was doomed to fall by B)

eternal oxide
#

only if you track all damage

icy beacon
#

you can manually track it maybe, track the last damager in a map like Map<UUID, UUID> and do something with it

eternal oxide
#

can't be obtained via events

rough drift
#

well I was able to get the killer (such as various player-triggered entities) using damage cause

#

figured I could use it for fall

eternal oxide
#

yes but FALL has no cause

rough drift
#

oh

eternal oxide
#

FALL is the cause

rough drift
#

alr thanks

eternal oxide
#

you could track last damager and then lookup if the cause is fall

#

but timestamp it so you know it's not from an hour ago

rough drift
#

Oh alright

terse ore
#

Best way to fill an area?

mortal hare
terse ore
#

oh

#

up to 14M?รง

#

I don't think I get to 1000 blocks

tall dragon
#

?workdistro

tall dragon
#

this helps alot too ^

terse ore
#

I need it for less than 1k blocks

tall dragon
#

well then ur fine

terse ore
#

how should I do it for that?

hazy parrot
terse ore
#

3 nested loops?

tall dragon
terse ore
#

okok

hazy parrot
terse ore
#

should I check if the block is not air to set it to air and then set it

#

or just set it?

tall dragon
#

hmm why

#

u can just set it directly no?

terse ore
#

ig so

#

maybe seting a block uses more resources than an if

#

so if I if it

#

I would save some resources

tall dragon
#

ohu mean check if its already the block ur changing it to

terse ore
#

yeah

tall dragon
#

u could do that, it'l probably be a little bit more performant yea

hybrid spoke
mortal hare
#

this is soo smart

#

ngl. I've never had thought you can just predefine a queue that uses special amount of tick time for each work task, without lowering the tps

#

@tall dragon thanks

#

i really really like this

#

@lost matrix

tender shard
#

I thought 7smile is dead

echo basalt
#

nah he was on last week

remote swallow
#

yeah

tender shard
#

didnt he die last week?

#

huh maybe I'm confusing him with so else

remote swallow
#

how would we even find out

echo basalt
#

nah

tender shard
#

oh yeah I confused him with sachin

#

mb

remote swallow
#

who is sachin

tender shard
#

sachingorkar

#

the dude who made Tweakin

#

and Cosmin

remote swallow
#

oh

tender shard
#

and all the other plugins that end with -n

hardy pollen
#

nah i give up

tender shard
#

anyway

#

did anybode here text sachin in the last weeks?

#

I suspect he's actually dead

tender shard
#

plugg

icy beacon
#

yeah?

tender shard
#

have you heard anything from sachin in the last months?

icy beacon
#

nah not really

#

let me check my last dms

#

with him

tender shard
#

I remember he went to the hospital and after that I never heard fron him again D:

icy beacon
icy beacon
#

wait no

tender shard
#

oh ok thats good

icy beacon
#

i did not

#

i just saw his about me

tall dragon
icy beacon
#

that said he was available

#

don't you have some of his contact info

#

like i remember he had a gofundme for a surgery

#

i thought he had some there

tender shard
icy beacon
tender shard
#

oh yeah he had this gofundme

#

but I dont think it said anything about his address

tall dragon
icy beacon
#

oh ty

tender shard
#

@tawdry scroll

#

you still alive?

#

pls answer

#

I already got DMs of people asking whether yo uare fine

icy beacon
#

his last github contribution is on october 19

tender shard
#

yeah that's like 5 months ago

icy beacon
#

wait

tender shard
#

4 months*

icy beacon
tender shard
#

oh

icy beacon
#

wait wtf

#

how does github work

#

am i blind or is there no "2 weeks ago"

tender shard
#

wtf

#

lol

#

yeah

icy beacon
#

ah his fundraiser doesn't have any contact info

final monolith
remote swallow
#

.mf

vague swallow
#

?paste

undone axleBOT
tender shard
remote swallow
#

looks so jank tbh

tender shard
#

none that I know

icy beacon
#

yeah same ๐Ÿ˜ฆ

tender shard
#

there's a good CLI app though

tender shard
#

but I dont remember how it's called

icy beacon
#

i want everything to be gui so that my eyes can be pleased

tender shard
#

๐Ÿฅฒ

#

opposite for me lol

remote swallow
#

code in vim

eternal night
#

Code in sed and echo

icy beacon
#

i spent 9 hours picking my intellij theme like 3 months ago

#

i'm not kidding

tender shard
eternal night
vague swallow
#

Hey,

Could someone please help and/or explain me these Error Messages and what I have to change?
https://paste.md-5.net/dugokafori.pl

This is my codestarting from line 127:

for (Entity en : p.getWorld().getEntities()) {
                if(en instanceof ArmorStand) {
                    ArmorStand as = (ArmorStand) en;
                    if(as.getScoreboardTags().contains("Holotable")) {
                        Location locE = p.getLocation().add(25, 25, 25);
                        Location locF = p.getLocation().subtract(25, 25, 25);
                        if(isNear(as.getLocation(), locE, locF)) {
                            coms.sendMessage(as, p, msg, false, false);
                        }
                    } if(as.getScoreboardTags().contains("nightsister")) {

                    }
                }
            }
tender shard
#

people who claim their code sucks > people who claim their code is god-like

vague swallow
#

the first one

icy beacon
#

2 tabs

vague swallow
tender shard
#

the world got unloaded

icy beacon
#

nvm i didn't read the error

#

is this inside an async runnable?

vague swallow
tender shard
#

when do you execute the code you sent?

vague swallow
icy beacon
#

oh

tender shard
#

the world got unloaded

icy beacon
#

i think you should run a non async task inside it

#

because bukkit api can't be used async

tender shard
#

^

icy beacon
tender shard
#

do your stuff in a synced task

vague swallow
icy beacon
#

it isn't

#

it was a false assumption

#

ig

vague swallow
icy beacon
#

make a synced task inside the event and run your stuff there

tender shard
#
public void onSomeAsyncEvent(AsyncWhatEverEvent event) {
  Bukkit.getScheduler().runTasklater(() -> {
    // do your stuff here
#

sth like that

icy beacon
#

?scheduler

#

ah

tender shard
#

it's ?scheduling

icy beacon
#

?scheduling

undone axleBOT
vague swallow
icy beacon
tender shard
icy beacon
tender shard
#

you are not allowed to do any "world"-related things in any async context

icy beacon
#

probably not necessary

tender shard
#

IIRC, "scheduleSyncDelayedTask" with a delay of 1 is the same as runTaskLater

#

not sure though

icy beacon
#

just in case runTask runs on the same thread as whatever it was declared in

eternal oxide
icy beacon
#

oh ok then

#

alex

#

what's your attitude to kotlin

#

i recall you wanted to code a plugin with it some time ago

tender shard
#

I do not like kotlin for a few reasons

#

I did many things in kotlin because I wanted to learn it, but I didnt like it

#

for example for the following reason:

vague swallow
tender shard
#
public class MyClass
  public String name;

  public void setName(String newName) { ... }
tender shard
#

in kotlin you do not know whether you call the setter, or set the field manually, when doing myClass.name = "asd";

vague swallow
icy beacon
#

it should be your plugin instance i think

tender shard
mortal hare
#

if something throws an exception on your classloader if halts the execution right

#

but what something bad happens on separate classloader?

mortal hare
#

it doesnt halt the main classes?

icy beacon
#

i'll try smth with the kotlin thing rq

vague swallow
icy beacon
#

oh

#

uh oh

tender shard
#

sth you gotta pay for if you're not a student ๐Ÿฅฒ

vague swallow
mortal hare
# tender shard wdym?

lets say i have classes which throws unhandled exception on application classloader

#

that halts the flow of code right

tender shard
mortal hare
#

thats java question

#

more

tender shard
#

are you loading these classes in onEnable() or somewhere else

mortal hare
#

yes im loading them using URLClassLoader

#

what im asking if the badly written jar file can interrupt plugin's work

#

if their classloaders are separate

tender shard
#

if you do it in onEnable() and do not the catch the exception yourself, then the plugin will get disabled

mortal hare
#

you're givin me chat gpt vibes

tender shard
#

how so lol

icy beacon
tender shard
#

all my messages are written by a real drunk german human

icy beacon
#

because if i set the setter to private, it won't allow me t o do it

tender shard
#

to me it is weird

icy beacon
#

i mean it's not really though

#

is it

mortal hare
#

i mean lets say I load classes using different classloader, Spigot plugin uses PluginClassLoader to load plugin's classes and i load plugin's subplugin jar file using URLClassLoader class

tender shard
#

I also dislike kotlin for their weird funny idea of getting rid of knowing variable types

icy beacon
#

it's just conciseness to the point

mortal hare
#

does that halt the execution

icy beacon
#

like i did in var a: String = "A"

mortal hare
#

of the parent

icy beacon
#

or do you mean smth else

mortal hare
#

if child is dum dum and had a bug

tender shard
#

imho kotlin doesn't do anything useful besides adding stuff to java that wasn't added to java in the first place for good reasons

icy beacon
#

the three reasons i enjoy kotlin are 1) syntax sugar 2) conciseness 3) extensions to classes omg omg

tender shard
#

e.g. var/val

tender shard
icy beacon
#

๐Ÿ˜„

tender shard
#

some people call it "conciseness", I call it "inaccuracy"

icy beacon
#

i also love that NPEs basically don't exist now

#

just the cherry on top

tender shard
#

well

#

NPEs only exist if you fuck up

#

just don't fuck up

icy beacon
#

haha

#

that's what every dev does

#

they fuck up

#

sometimes intentionally (?)

tender shard
#

myNullObject.doSomething() yeah just don't do this ^

icy beacon
#

lmao

#

crystal clear

tender shard
#

tbh I love that java throws an NPE instead of just returning null

icy beacon
#

yeah in kotlin if it's null it just won't do the thingy

tender shard
#

if you wanna be able to debug stuff being null all the time, go use LUA

icy beacon
#

depends on the context of the usage

tender shard
#

I agree that kotlin is nice for allowing you to decide whether you want an NPE or just getting null

#

however I never saw ANY reason in using it

icy beacon
#

๐Ÿ˜„

tender shard
#

if "myObject" is null, I WANT to get an NPE

icy beacon
#

true

#

fail-fast

charred blaze
#

How do I do this with regex? |
e.getMessage().replace("&0", "").replace("&2", "").replace("&4", "").replace("&6", "").replace("&8", "").replace("&a", "").replace("&c", "").replace("&e", "").replace("&m", "").replace("&o", "").replace("&1", "").replace("&3", "").replace("&5", "").replace("&7", "").replace("&9", "").replace("&b", "").replace("&d", "").replace("&f", "").replace("&l", "").replace("&n", "").replace("&r", "");

icy beacon
#

i do have some use cases where it could be better

charred blaze
icy beacon
#

please strip color with chatcolor

#

maybe replace & with paragraph

charred blaze
icy beacon
#

yeah...

tender shard
#

ChatColor.stripColors

#

or sth

icy beacon
#

stripColor

tender shard
#

and yes, it exists

icy beacon
#

i think you just need to replace & with paragraph

tender shard
#

yeah

mortal hare
#

even if it didnt exist char for loop would be way more clean than this

charred blaze
icy beacon
#

and if you really want the regex you could probably use (\&[0-9obdflnr])

#

i think

charred blaze
#

does everyone agree?

tender shard
#

yes

charred blaze
#

ok ill use it

tender shard
#

no

icy beacon
#

well regex requires more computations

#

use chatcolor

charred blaze
icy beacon
tender shard
#

the & stuff will only work on "pre-ChatColor.translateAlternate...." stuff

charred blaze
icy beacon
#

just replace & with paragraph and strip color

tender shard
#

what the heck are you even trying to do

icy beacon
#

why use regex

icy beacon
#

?xyproblem

#

?xy

undone axleBOT
charred blaze
icy beacon
#

it's not weird???

tardy delta
#

ยง

tender shard
#

if at all, then ยง is weird

hybrid spoke
#

its ๐Ÿ”ฅ

icy beacon
#

i use this symbol all the time because i am a student

tender shard
#

your mom is fire

icy beacon
#

if it's weird, what isn't

hybrid spoke
#

true

charred blaze
icy beacon
charred blaze
icy beacon
#

anyway i don't get what you are trying to do either

hybrid spoke
#

who was btw the first who translated & to ยง and set the standard?

charred blaze
#

ChatColor.stripColor(e.getMessage().replace("&", "ยง"));

#

right?

icy beacon
#

if they are using & to chat, it shouldn't get translated to colors anyway

#

unless some other plugin does that

charred blaze
icy beacon
#

and if you want to prevent other plugins from doing that, you can probably disable that in the conig

charred blaze
#

some does

icy beacon
#

config*

charred blaze
#

i know

#

i was just trying to filter text message from &a and others

icy beacon
#

ah

charred blaze
icy beacon
#

well then don't do replacing

bright spire
#

Is GPL license inherited from Bukkit when I make a plugin that does not include any of the Bukkit libraries?

icy beacon
#

the colors are already translated

#

just do ChatColor.stripColor

icy beacon
#

if you aren't, then you aren't making a bukkit plugin

bright spire
icy beacon
#

well that's what every plugin does i think

#

unless you use reflection for every single method you are still kinda including it

bright spire
#

Do that means I need to inherit the GPL license?

icy beacon
#

well nobody really enforces it

#

my plugin uses apache 2.0

eternal oxide
bright spire
eternal oxide
#

then do that

#

everyone here uses whatever license they want for their plugin.

icy beacon
#

yeah

vague swallow
#

Why is the PrepareAnvilEvent not triggered if the name of the AnvilInventory is different?

icy beacon
#

wdym

#

show your code

vague swallow
vague swallow
# icy beacon show your code
@EventHandler
    public void onAnvilInput(PrepareAnvilEvent e) {
        Bukkit.broadcastMessage("bro");
        if(e.getView().getTitle().equals(GUI_NAME2)) {
            if(e.getView().getPlayer() instanceof Player) {
                Player p = (Player) e.getView().getPlayer();
                openCallInput(p, e.getInventory().getItem(2));
                p.sendMessage("te");
            }
        }
    }
#

it is only broadcasting "bro" when the name of the anvil Inventory is not changed

icy beacon
#

well first of all

#

?arrowcode

undone axleBOT
eternal oxide
#

if(e.getView().getTitle().equals(GUI_NAME2))

icy beacon
#

it's the first thing in the method

icy beacon
#

lmao

#

i just yawned and my right ear started hearing better

lost matrix
eternal oxide
#

cleaner is to if (!e.getView().getTitle().equals(GUI_NAME2)) return;

icy beacon
#

if it does then there's no need to check for player instanceof

icy beacon
#

because the only class that is a humanentity is player for now afaik

#

so it can be just casted

vague swallow
#

y

#

yes

#

but that's not the point

icy beacon
#

that's just something to tell you

eternal oxide
#

No idea on why you don;t see bro

icy beacon
#

we haven't figured out the reason yet

tender shard
#

Plugins might implement it

icy beacon
#

though isn't that a bukkit api misuse

#

sounds like one

tender shard
#

Eg Citizens

icy beacon
#

oh in that case i hereby allow it

tender shard
vague swallow
#

allow what?

hybrid spoke
tardy delta
#

dont compare inventories by title, if title changes you cry

tender shard
icy beacon
#

though working with inventories in general is pain

hybrid spoke
icy beacon
#

there's no true good way to check if an inventory is one you want

#

ngl

hybrid spoke
#

InventoryHolder

icy beacon
#

i used to create custom inventoryholders

#

but that's a misuse too

#

i don't wanna do that anymore

#

i just use triumphgui

tardy delta
#

abusing inventory holders

hybrid spoke
#

misuse

vague swallow
hybrid spoke
#

nah

#

feature

icy beacon
#

lol

tender shard
tardy delta
#

uh i havent really been following

icy beacon
hybrid spoke
#

in that case my inventory is an inventoryholder

hybrid spoke
lost matrix
hybrid spoke
#

stated as a "bad practice" from spigot, but that doesnt stop me

icy beacon
tender shard
hybrid spoke
#

its the same as using a deprecated method

hybrid spoke
#

im a proud inventoryholder user

icy beacon
#

fucking undeprecate that shit

tender shard
#

Oh

#

My bad

#

First thing

#

Not the third one

icy beacon
#

i got json working

#

finally

hybrid spoke
#

just advices not to

#

due to bugs which can occur

icy beacon
#

"if it's not forbidden it's allowed"

#

i mean yeah

hybrid spoke
#

no but im free to choose

#

but anyways

icy beacon
#

i used to use inventoryholders for a while

hybrid spoke
#

if it would be not allowed i would do it anyways

icy beacon
#

didn't have any real bugs with that

tender shard
#

I have talked to md5 about this 3 years ago and he said โ€ždont do itโ€œ

hybrid spoke
#

sounds like a you problem to me

tardy delta
#

๐Ÿ’€

tender shard
#

Do whatever you want

icy beacon
tender shard
#

And what did that link say?

icy beacon
#

oh it was a copypastable wall of text

#

if i find it i'll tell you

tender shard
#

Oki

icy beacon
#

but i honestly don't care, i only care about this

tardy delta
#

๐Ÿ’€

icy beacon
#

which means that there needs to be an alternative?

terse ore
tender shard
#

Paypal also stopped working in turkey for no proper reason

#

Fuck paypal

lost matrix
# vague swallow ``` @EventHandler public void onAnvilInput(PrepareAnvilEvent e) { Bu...

If you have only one type of custom inventory:

public class SomeInventoryManager {
  
  private final Set<Inventory> customInventories = new HashSet<>();
  
  public boolean isCustom(Inventory inventory) {
    return customInventories.contains(inventory);
  }
  
  public void registerCustom(Inventory inventory) {
    customInventories.add(inventory);
  }
  
  public void unregisterCustom(Inventory inventory) {
    customInventories.remove(inventory);
  }
  
}

Or if you have a specific functionality for each inventory:

public class SomeInventoryManager {

  private final Map<Inventory, InventoryHandler> customInventories = new HashMap<>();

  public boolean isCustom(Inventory inventory) {
    return customInventories.containsKey(inventory);
  }

  public void registerCustom(Inventory inventory, InventoryHandler handler) {
    customInventories.put(inventory, handler);
  }

  public void unregisterCustom(Inventory inventory) {
    customInventories.remove(inventory);
  }
  
  public void propagate(InventoryClickEvent event) {
    Optional.ofNullable(customInventories.get(event.getClickedInventory())).ifPresent(handler -> handler.handleClick(event));
  }

  // ... do other events
}
icy beacon
terse ore
tender shard
#

But i also do understand md5 not wanting to deal with stripe etc because tvh stripe is even worse

icy beacon
#

there are like 2 ways for international transfers in russia, and i only call recall one

terse ore
#

Spain and another country were the only ones to not need a card

tender shard
#

Tbh* typo

icy beacon
#

tbh misspelled prob

#

v and b are close

#

why was n afraid of v?

#

because 7 ate 9

tender shard
#

Go home plugg

vague swallow
icy beacon
tender shard
icy beacon
#

such as not using an arrow code anti-pattern

tender shard
#

^

icy beacon
#

alex send that link to your article once again

#

actually send it twice just in case

lost matrix
icy beacon
#

good alex

terse ore
#

@tender shard why dont you use or?

#

instead of a lot of ifs

astral condor
icy beacon
#

void

remote swallow
remote swallow
icy beacon
tender shard
# lost matrix

If you think that adding a ton of code blocks for a one line statement is needed: okay

terse ore
icy beacon
#

also why is your class in lowercase

remote swallow
vague swallow
astral condor
terse ore
#

how should it be done then

lost matrix
remote swallow
tender shard
remote swallow
icy beacon
#

also don't name your main classes Main

remote swallow
#

?main

icy beacon
#

yep

terse ore
#

?help

icy beacon
#

was looking that up

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.

astral condor
remote swallow
terse ore
tender shard
terse ore
#

oh the timing

lost matrix
icy beacon
#

i was looking up the thread

#

didn't know that it was a command too haha

remote swallow
#

lol

hybrid spoke
icy beacon
#

well your company is quite goofy

tender shard
#

In my company its standard that people do whatever is appropriate

hybrid spoke
terse ore
#

how old are you guys?

tender shard
#

27

lost matrix
icy beacon
terse ore
icy beacon
terse ore
#

it's in my ab me xd

hybrid spoke
#

you cant work with 50 people without the code being messy without conventions and standards

icy beacon
#

ah

tender shard
#

I will be 28 on feb 22

icy beacon
#

damn

terse ore
#

?reminder

icy beacon
#

we have a 1 day birthday margin

#

mine's on 23

tender shard
#

Oh

icy beacon
#

and i'll be 15 haha

tender shard
#

My best friend has birthdax on feb 21 lol

terse ore
#

lol

tender shard
#

Haha

vague swallow
terse ore
#

february is the new meta month

hybrid spoke
tender shard
icy beacon
#

if you are trying to get input from anvils please use WesJD's AnvilGUI

vague swallow
icy beacon
#

TEXT WALL

#

?paste

undone axleBOT
remote swallow
astral condor
vague swallow
icy beacon
#

it'll really make your life easier

tender shard
#

Anyway, using a block for a single return statement is kinda useless imho

lost matrix
#

Imagine someone writes code like this:

if(condition) return;

And later on you need to add functionality to that.

if(condition) {
  someLoggerCall();
  somethingElse();
  return;
}

Thats just a hustle and now if we remove the two lines again
we would also have to remove the body to get standardised code again.

Also clearly separating your scopes is very important. Its not clear
that everything after a conditional statement is a new scope if you just
skim over some code.

hybrid spoke
prisma needle
#

Modify default loot table for a block

astral condor
hybrid spoke
astral condor
lost matrix
pseudo hazel
#

player.setscoreboard

tender shard
#

Instead of merely comparing them by their name

pseudo hazel
#

wrong person xD

tender shard
#

Oh

lost matrix
#

Ah

tender shard
#

Mb

#

Sorry

astral condor
#

๐Ÿ˜‚

lost matrix
#

Thats the almost 30 brain kicking in

tender shard
#

Yeah anyway lol

astral condor
pseudo hazel
#

where you want to set the scoreboard to the player

icy beacon
#

well whenever you want to set it

#

jinxed

pseudo hazel
#

I assume you have some class that determines what the scoreboard should look like

#

thatd be the first place I would look for applying the board to the player as well

astral condor
#

I confused

pseudo hazel
#

hmm

#

i looked at your code and im confused too since I never worked with fastboard

#

so idk what it does and doesnt do on its own

#

because you create a new board in join using the player as an argument

#

for all I know that should already set the board

astral condor
#

thank you for the advice

lost matrix
astral condor
icy beacon
#

imma have dinner now cya

hybrid spoke
astral condor
#

what happened

eternal night
#

Your scoreboard class is extending javaPlugin

#

Which it isn't allowed to do as you can only have one java plugin type and instance

bright spire
#

What should I do if I have a business out of Bukkit plugins but most of the people is getting the jars for free by compiling the source code? Am I forced to publish the source code by the GPL license?

#

I want to try to comply the licenses without the business getting bankrupt

pseudo hazel
#

usually people dont post the source of their premium resource

#

but yeah otherwise you would probably need to update the license on it

bright spire
#

@pseudo hazelBy the GPL license of Bukkit, I am forced to use GPL on all my plugins.

terse ore
#

make code private

#

I doubt you could sue them

bright spire
terse ore
#

no

eternal night
#

You should contact a lawyer about that

eternal oxide
#

Don;t comply with GPL

terse ore
eternal night
#

No one here has any opinion that is worth anything to you

#

Nothing anyone here says is useful

#

In terms of "oh fuck I am about to get sued"

eternal oxide
#

keep private your source and anyone who trys to force you to give it ignore

bright spire
#

I think I can redistribute it for a price

#

As long as I don't deny it

#

The source code

eternal oxide
#

are you talking about yoru own plugins? or other peoples?

bright spire
#

My own

#

I think I can distribute source code with a fee

#

And that would comply with GPL

#

And prevents people from getting the plugin for free

eternal oxide
#

then you have no responsibility to expose your source, so long as you are not packaging any OS libs

bright spire
astral condor
#

why it doesn't connect

eternal oxide
bright spire
#

Thats why I want to make sure I comply

eternal oxide
#

they will, but they have no grounds to sue

#

only a license owner can sue you

bright spire
#

I just want them to stop

#

I know

#

But I just want to comply for them to stop

eternal oxide
#

Your choice, I'd use the block button

hasty prawn
eternal oxide
#

They only want things for free but have no way to force you

hasty prawn
#

He beat me to it

#

Darn you elgar. angery

bright spire
#

Its a group of developers

eternal oxide
#

Only license holders can sue

pseudo hazel
#

sounds like a bunch of babies

eternal oxide
#

Doesn;t matter

#

They don;t hold any license to the Spigot API

bright spire
#

Thanks, I will try to ignore them

#

:)

hasty prawn
#

Doesn't it like... not even matter? Bukkit/Spigot may use GPL but since we're not compiling their code only relying on it as an external dependency, you can put whatever license you want on your own plugin?

#

Or am I misunderstanding how GPL works

eternal oxide
#

Not quite

#

When you compile you actually include some of the API

#

So IF Spigot wanted to enforce it's license THEY and they alone could demand your source

astral condor
#

I finally solved the problem myself.

hasty prawn
#

Ah, gotcha.

astral condor
#

and everyone who helped

trail lintel
#

Hey guys, I notice when I open an ender chest programmatically with player.openInventory(player.getEnderChest()), the name displayed at the top is always "Ender Chest", regardless of what the players language setting is set to. However when opening an ender chest normally, the language is displayed correctly. Is there something more I need to do to get this localization working? I notice openInventory() returns an InventoryView, which has a setProperty() method. But I feel like it should be using the localized string automatically. Any help would be appreciated =]

#

Hmm set property does not appear to be what I need

#

theres even a getTitle() method, but no setTitle() =[

mortal hare
#

problem is that spigot always sends hardcoded name for some reason. Container names are hardcoded into OBC classes

trail lintel
mortal hare
#

you can send localized name, but it involves probs some packets or setting localized chat component as the container name

#

its just a dumb thing tbh that spigot has

trail lintel
#

Oh interesting, that is a bit above what I have worked with so far. Could you suggest some reading for packets?

#

I also was unable to find a way to "set container name" at all. There doesn't seem to be a setTitle method

mortal hare
#

on paper there's an easy fix for this

#

but it involves using Adventure API's TranslatableComponent

trail lintel
#

Hmm, I looked up adventure API. I would prefer to keep the plugin with zero dependencies. However if that is the only way, what can ya do haha

mortal hare
#

yea but its built into paper rn

trail lintel
#

Ohh is it, that changes things

#

oh wait!

lyric mica
mortal hare
#

Bukkit.createInventory(InventoryType.ENDER_CHEST, Component.translatable("container.enderchest"))

#

would create enderchest type of inventory with translated text on paper

#

but this would be separate from player's ender chest

trail lintel
#

Oh that is an interesting approach, creating a temporary inventory. I am slightly worried doing that as it might cause some duplication issues if there were packet drops or something. But that is a total guess haha

mortal hare
#

i think sending a packet would be cleaner approach

#

but this would involve some NMS

#

or protocollib

trail lintel
#

"Resending this packet with already existing window id, will update the window title and window type without closing the window."

#

eureka, thats it baby THATS IT

#

now I just gotta figure out how to send packets haha

worn tundra
#

Are you looking to just rename the open inventory once?

trail lintel
#

Yup thats right, I want to rename the inventory with the correct localized name

worn tundra
#

And you have that localized name as what?

trail lintel
#

It should be in the game already as "Ender Chest"

#

I think haha

worn tundra
#

Yeah but does that not translate to other languages or whats the problem?

trail lintel
#

Yeah, when opening the ender chest programmatically. No matter what the language setting is set to the title is "Ender Chest".

worn tundra
#

Oh okay perfect

mortal hare
#

server just sends the json key to the client

vague swallow
#

I've just got the shortest Error in my life:

java.lang.ArrayIndexOutOfBoundsException: null```

Does anyone know how to fix something like that?
worn tundra
mortal hare
#

and client translate it to normal lang

worn tundra
#

It uses protocollib

#

To read the windowId and containertype

#

when a player opens any inventory

#

Then uses that info to resend an open packet

#

with the same id

#

which in turn just renames

lyric mica
worn tundra
#

the open inventory

trail lintel
#

Excellent, I would prefer to avoid using any external libs, but this looks like a very good resource to look at for renaming a window title with packet sending

worn tundra
#

Yeah you could write some NMS I think as well

#

Since minecraft IS capable of renaming windows

#

(inventories)

trail lintel
#

Hmmm, protocol lib DOES look nice though

#

but I doubt the implementation of this specific packet will change much since I'm not planning anything advanced

mortal hare
#

you can do this without protocollib, but you would need to setup your maven or gradle project in a way to support NMS

#

and add abstraction classes

#

to each minecraft version you wish to support

#

Just use protocollib

trail lintel
#

Honestly yeah, sounds like its protocollib time

mortal hare
#

There are more slaves to update that plugin than your nerves and braincells watching the minecraft server's netcode

#

how would you call plugin which get loaded by the spigot plugin

#

addon?

#

extension?

#

subplugin?

trail lintel
#

This does of course raise the question..... Why doesn't spigot just use the localized name when opening an inventory lol. But thats just me bitchin ๐Ÿ˜‰

mortal hare
#

probs due to backwards compatibility

#

or due to many people relying on names rather than inventory types

#

in order to detect ender chests

#

idk

trail lintel
#

OH you know what. I bet I could make protocollib a softdepend couldn't I. So its not REQUIRED but if they do have it then it will do the thing.

mortal hare
#

it just seems weird indeed

mortal hare
#

its a minor feature

trail lintel
#

I have my plan =]

#

thanks a bunch guys you all rock

#

specifically you dovidas you helped a bunch =]

mortal hare
#

you're welcome

mortal hare
#

hol up

#

at least on my paper

#

nms

#

its translatable component

#

what version of paper do you use

#

if you use it at all

#

im guaranteed that 1.19 paper will send enderchest container names correct

#

unless you create them explicitly

#

with Bukkit.createInventory() and use string instead of component

#

im not sure about spigot tho, iirc spigot didnt had chat components

#

or they were pretty shhh... (*cough* bungee ones)

vague swallow
#

How can I get a UUID from a String?

mortal hare
#

UUID.fromString()

#

iirc

vague swallow
mortal hare
#

np

trail lintel
#

Ummm so hold up, lemme wrap my head around that

#

So I am using paper v1.19.3

#

and I am opening the inventory using player.openInventory(player.getEnderChest())

mortal hare
#

im running purpur, but its almost the same (Paper, Pufferfish and some other fork patches)

#

but it defines the translatable component

#

maybe you're using some kind of resource pack

#

that alters the locale?

trail lintel
#

Hmmm, I do have a custom resource pack enabled that skins the item. Let me turn that off and see if the problem persists.

#

Hm, even after disabling all resource packs it still seems the title isn't localized

mortal hare
#

can you try downloading purpur

#

and see if that persists

#

for a moment

trail lintel
#

Yeah I can try it on purpur

#

one moment =]

mortal hare
#

it could be that this is fixed in purpur but is not on paper

#

i could be wrong tho

trail lintel
#

Hmm nope it seems the same thing happens on purpur

mortal hare
#

ok lemme try that myself

trail lintel
#

Need me to send you any sample code to test with?

mortal hare
#

no

#

already did it

twilit roost
#

is there an BungeeCord alternative for OfflinePlayer?

mortal hare
#

huh

#

interesting

#

it really doesnt translate for some reason

trail lintel
#

Very strange right

mortal hare
#

ok second test

#

one sec

blazing monolith
#

Does anyone know how to make a player mount an entity? Im trying to make a player mount a minecart using minecart.addPassenger(player), but it wont work

mortal hare
#

ok

#

this is not fixed

#

but its translatable key exists within a code

#

wtf

#

so apparently from reverse engineering you can see that the openInventory() calls for inventoryType to retrieve the name

#

inventoryType serializes old legacy hardcoded strings into components

#

thus no translatablecomponent is being sent

#

to the client

#

you'll still need packets

trail lintel
#

Oh wow, you know this codebase pretty well ๐Ÿ˜ฎ I would have never been able to delve that deep

#

Very interesting

#

So I have accidentally stumbled upon a bug huh haha

mortal hare
#

its probs not a bug

#

but a leftover

#

to keep broken plugins alive

#

who check if inventory.getType().getTitle().equals("Ender Chest")

trail lintel
#

OHHHHH

#

That makes sense

mortal hare
#

the thing is it does correctly for ender chest blocks

#

it just doesnt whenever you open via the code

trail lintel
#

Right? Thats what I found peculiar haha

mortal hare
#

in this method args

#

that belong to the block classes

#

in other words, just use softdepends and protocollib to fix this

#

i doubt spigot would ever fix this

trail lintel
#

Working on it now =] I notice the enums in protocollib are slighly different than the ones listed on the packet site

mortal hare
#

yes

#

they're standardised

#

so that the names wont change

#

like in NMS they sometimes do

#

actually its an easy fix from spigot side

trail lintel
#

this guy must be a GOD tier developer, to create something that works across multiple versions like that

mortal hare
#

just change defaultTitle() to TranslatableComponent

#

and everything would be translated

#

but this is left purposefully if i had to guess

trail lintel
#

yeah prob what you said about compatibility is why

mortal hare
#

getting string equivalent name is even deprecated

#

im 99% sure that this is intentional, but its a codesmell that contributors of spigot and paper know about ;D

trail lintel
#

Ohh ya know what though, I just thought of something....

#

I intercept the OPEN_WINDOW packet, but theres no context there telling me whether its them opening an ender chest normally, or through my custom item

#

Hmmmmmm

mortal hare
#

you can just send the translatablecomponent

#

nvm

#

you would change custom titles

#

if you do that

trail lintel
#

Ahh yeah for like other plugins and stuff

#

scratches head this is a tough one haha

mortal hare
#

what type of component does protocollib return

#

if its native to spigot or paper

#

you can do comparison

#

with == to detect

#

if the title is legacy hardcoded

trail lintel
#

hmm when you say component what do you mean? I don't see any component class in the spigot API, but I saw some in your code from before

mortal hare
#

can you retrieve WrappedChatComponent object from the intercepted packet?

trail lintel
#

it does appear that I can

mortal hare
#

ok this wont work

#

because WrapperChatComponent does not hold real component objects

#

but what you can do instead is to check the ids

#

of the containers

#

nvm

#

hmm

#

maybe you shouldnt intercept

#

packet

#

but instead send one

#

by wrapping the openInventory function

#

but you need to somehow get the menu id

trail lintel
#

Oh! I think you might be on to something!

fair vapor
#

How can I check what the item a player is attempting to pickup is

rotund ravine
#

use the event?

fair vapor
#

EntityPickupItemEvent?

#

I'm new to minecraft development sorry.

remote swallow
trail lintel
#
PacketContainer container = new PacketContainer(PacketType.Play.Server.OPEN_WINDOW);
try {
  manager.sendServerPacket(player, container);
} catch (InvocationTargetException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}

I think you sent me on the right path @mortal hare ๐Ÿ˜‰

#

I just have to make sure to send the correct window ID

fair vapor
remote swallow
#

if (event.getItem().getItemStack().isSimilar(YourItemStack) { do stuff }

fair vapor
#

I see

#

Thanks ๐Ÿ™‚

mortal hare
#

but im thinking of a way to bypass that

#

since that would break version support

blazing monolith
#

How do I make a player mount a minecart? addPassenger() isnt working

mortal hare
#

i mean you can do simple check if wrappedchatcomponent is "Ender Chest" but that would make all the ender chests translatable

#

even if that was explicitly defined as "Ender Chest"

trail lintel
#

I think I am heading down the right route with this, lemme see if this is stupid ๐Ÿ˜‰

mortal hare
#

its stupid, since its a smelly fix

#

it doesnt fix the root problem

trail lintel
#
PacketContainer container = new PacketContainer(PacketType.Play.Server.OPEN_WINDOW);
container.getIntegers().writeSafely(0, inventoryId);
container.getIntegers().writeSafely(1, 2);

the inventoryId still need to find a way to get that, but the second one is writing to index 1, with the value 2
https://wiki.vg/Protocol#Open_Screen
https://wiki.vg/Inventory

mortal hare
#

eureka

trail lintel
#

I'm not entirely sure I'm using that right. But I think I'm heading in the right direction

mortal hare
#

i know

trail lintel
#

OH SNAP

mortal hare
#

create a new variable

#

to store your id

#

int

#

make a map

#
Map<Player, int> ids = new HashMap<>();
#

as a global class field

#

outside the method

#

intercept a packet of open_window

#

check if MenuType is EnderChest if so add to map

#

intercept packet close_window

scarlet moat
#

?paste

undone axleBOT
mortal hare
#

remove the id

#

from the map

#

now you have a map which holds windowId

#

without nms

#

of a player

scarlet moat
mortal hare
#

use it next to openInventory() to send packet, like you provided in the snippet above

#

idk if that would work but it could

trail lintel
#

Ohh that is interesting. But how would I know if its a real ender chest vs my custom item? Since the ender chest already translates correctly, I don't need to send the packet in that case

mortal hare
#

you dont need to

#

you wrap the method

#

of openinventory

#

since player can see only one container on the client

#

by executing wrapped method you're guaranteed player is opening patched one

#

but it would work only if you execute the wrapped method

#

to open the enderchest ivnentory

trail lintel
#

OHHHHH

#

I see what you are saying now

mortal hare
#

this should work

trail lintel
#

EVERY time a chest is opened, add its ID to that map, then ONLY when my custom open inventory is called will I send that ID

mortal hare
#

yes

trail lintel
#

the only time that ID will be sent, will be in the context of my method

#

thats clever

mortal hare
#

you send the id from the map

#

because last id is the latest one player sees

trail lintel
#

genius haha

mortal hare
#

but im not sure if packet send listener gets called instantly (single threaded execution) or its async

green prism
#

How can I use custom args in Aikar Command Framework?
I've created an Object class:

@Getter
@Setter
@RequiredArgsConstructor
public class Arena {
    private final UUID id;
    private final String name;
    private final ArenaType type;
    private final World world;
    private final int maxPlayers;
    private final Map<TeamColor, Location> spawns;
    private final Map<GeneratorType, List<Location>> generators;
    private final Location lobby;
    private final Location[] shop, upgrade, beds;
    private GameStatus status = GameStatus.WAITING;
}

And I would like to use it inside a subcommand arg

    public void join(final CommandSender sender, Arena arena) {
mortal hare