#help-development

1 messages ยท Page 337 of 1

icy beacon
#

like the one that epic shows

remote swallow
#

my main class would be in the mycoolplugin folder

coarse hazel
#

so by "same main Class directory" they mean "main class directory with the same name"?

icy beacon
#

well the wording is a bit weird in this part of the article

#

it's basically just showing the traditional way to name your packages

coarse hazel
#

pretty sure they mean with the same name

#

cause otherwise it makes no sense

icy beacon
#

e.g. after your website but backwards

#

so i'm confused by the wording too

remote swallow
#

well if i had a plugin called mycoolplugin i would call my main class MyCoolPlugin

#

and my package would be me/epic/mycoolplugin

coarse hazel
#

pretty sure it means to avoid conflicts with different plugins with the same name

#

tyvm guys

remote swallow
#

yeah

dry yacht
icy beacon
#

out of curiosity, is it somehow possible to change the quote-unquote default tab completer? i'm talking about the fact that when a tabcompleter returns null, it provides the list of online players, but can I modify that list for all commands? i'm thinking of TabCompleteEvent -> getCompletions(), but i'm not sure if i can know whether it's returing a list of all players' names

#

it'd be trivial to do this for the commands in my plugin but i want to do it for all commands

#

ok this seems to be something cool

public void onPing(final TabCompleteEvent ev) {
    final List<String> allPlayerNames = Bukkit.getOnlinePlayers().stream().map(Player::getName).toList();
    if (new HashSet<>(ev.getCompletions()).containsAll(allPlayerNames)) {
      // ...
    }
  }

the only thing bothering me is that there might be a delay between a tab completion and the event being called?

#

hashset for performance

weak kayak
#

i think you should try it out to see if there is a big delay

icy beacon
#

sure i'll do it

weak kayak
#

it seems slow but who knows, it might be unnoticeable

icy beacon
#

now that i think of it, it should be fine if a couple tabcompletions fail every minute

#

the chance of a player leaving/joining during that very delay is so small that it'll probably have no impact

weak kayak
#

yea and even if a player joins, the list will still contain all the player names of the other players

#

it would be true nonetheless

icy beacon
#

yep

weak kayak
#

only possible problem is a player leaving during the delay but the chances of that are small as you said

tardy delta
#

ugh and thats a reason for it to not compile ๐Ÿ’€

#

should see whats its gonna be replaced with

icy beacon
#

you might have deprecation set to an error level in the ide

paper viper
#

i used it in the past (cause of some code i used online) and i just deleted it and it worked ig ๐Ÿ’€

weak kayak
#

code throws errors? just delete it!

#

works every time

icy beacon
#

Preferences -> Editor -> Inspections

tardy delta
#

uh just testing some stuff

icy beacon
#

there's a search bar so look for deprecat there

weak kayak
icy beacon
#

haha

#

just for ambiguity reasons

weak kayak
#

i will add that to urban dictionary now

#

just invented a new word, feelin' good

icy beacon
#

i think it's Java -> Code maturity -> Deprecated API usage

dry yacht
# icy beacon hashset for performance

Uhm, maybe I'm missing something, but how does it make something more performant when you have to allocate a new hashset which then has to go through all items and calculate a hash for them anyways? I don't see the advantage there at all.

tardy delta
icy beacon
paper viper
icy beacon
paper viper
#

either way securitymanager is a mess lmao

icy beacon
#

i'm not experienced with performance

tardy delta
icy beacon
#

so i just did

quaint mantle
#

How to use "translate" object with spigot? Is this a thing?

i.e I have the command /tellraw @p [{"translate": "advancements.adventure.kill_a_mob.title"}]is there a way to make this a code, without using dispatchCommand?

icy beacon
#

i think it is a translatable key or smth

weak kayak
paper viper
#

use adventure ๐Ÿฅฒ

icy beacon
tardy delta
#

just make a tell command that uses color codes

icy beacon
#

i want to get a mac for funny outlines and rounded corners

tardy delta
#

me being bored and looking at how NativeMethodAccessorImpl works

#

native code is always fun

weak kayak
icy beacon
#

shrt

tardy delta
#

you have a long pinky then

weak kayak
#

they don't call me long pinky joe for nothin

#

my name isn't joe, my pinky is just long

tardy delta
#

๐Ÿ’€

#

what stuff can you do with the pinky?

icy beacon
#

his gf is shivering

tardy delta
#

if he even has one

weak kayak
#

that's the thing, my pinky is so long that moving it flings anyone near me miles away

icy beacon
#

pinky telekinesis

weak kayak
#

i have longpinkyitis

icy beacon
#

as magic as this accessor impl

tardy delta
#

poor gf

weak kayak
#

by that i mean she's in space

tardy delta
#

hehe DelegatingMethodAccessorImpl

weak kayak
#

that's more or less how forge does translations iirc

icy beacon
tardy delta
#

UnsafeQualifiedStaticDoubleFieldAccessorImpl

#

heehee

weak kayak
#

and that flying higher than the speed of light is possible

weak kayak
icy beacon
#

there was a site that would create overindustrialized java class names

#

i wanna find it

weak kayak
#

and pointer finger

icy beacon
#

found it

#

TestDecoratorReponseMethodDatabaseOrderModelGetterProducerCallback

tardy delta
weak kayak
icy beacon
icy beacon
weak kayak
tardy delta
onyx fjord
#

I have a problem with gradle, basically I have a library that includes certain dependency and shades it.

However when I add that library to my project gradle still looks for the dependency that's already in the library

weak kayak
#

me on my way to throw an instance of IdentifierContainerMapperCallbackListDefinitionFacadeMethodInterceptorMethodManagerResolverPrototypeSchemaExceptionAdvisorManagerException

remote swallow
#

undefinedCandidateIteratorMessageModelFilterDispatcherConfigurationManagerMapInfoAdvisorInterceptorPrinterDescriptorWorkerImporterProxyExpressionEventContextInterceptorRequestAuthenticationPrinterThreadInvocationPool

weak kayak
#

undefined ๐Ÿ’€

icy beacon
tardy delta
#
ParameterTagTemplateAnnotationListenerFilterPoolListenerCallbackInterpreterCloneWorkerThreadFacadeFacadeTaskProxyListenerDescriptorFilterProccesorContextMappingMapperBroadcasterVisitorFacadeAdvisorSerializerIdentifierAbstractLiteralTemplate```
remote swallow
#

give me a few minutes

weak kayak
remote swallow
#
PublisherListParameterProxyDescriptorIteratorSerializerWatcherExpressionReponseDatabaseMapMappingServiceConsumerProducerInfoCandidateExceptionConnectionCallbackTemplateInstanceVisitorStubOrderConsumerDescriptorInfoWatcherDefinitionPublisherObserverPropertyErrorRequestFacadeMapIdentifierAttributeDecoratorExporterMockComparatorTaskContainerMockInterpreterExporterSerializerMessageParameterConfigurationInterceptorValueExceptionSchemaPrinterWatcherComparatorConsumerMapperHelperAuthenticationPoolMappingFilterTestsContextVisitorThreadIdentifierWatcherMockRepositoryParameterHelperThreadIdentifierProxyExceptionResolverUtilsInterceptorRequestClientIdentifierServiceGetterMethodFacadeMockProducerProccesorExporterStubFacadeDecoratorMapFacadeMethodExceptionListenerDispatcherImporterundefinedCandidateIteratorMessageModelFilterDispatcherConfigurationManagerMapInfoAdvisorInterceptorPrinterDescriptorWorkerImporterProxyExpressionEventContextInterceptorRequestAuthenticationPrinterThreadInvocationPool
weak kayak
#

beautiful

remote swallow
#

do we go longer

weak kayak
#

i'm using that as a class name in my next plugin

icy beacon
#

this is still help-development i'm pretty sure

remote swallow
#

yeah

#

we dont care

icy beacon
tardy delta
#

copilot be like hmm

#

its stealing my parsing code

weak kayak
icy beacon
#

what have I started

weak kayak
#

a mastapiece

icy beacon
#

oh alr then

weak kayak
#

that's what you've started

remote swallow
#
DefinitionDefinitionComparatorStateValueAttributePropertyPrinterMapperFilterAuthenticationStateInterceptorTagInvocationInterceptorTagStrategyProxyConfigurationUtilsReponseQueueTemplatePolicyImporterProducerSingletonTaskTemplateDecoratorBroadcasterFacadeListMapEventMapperSetterMessageInfoPrinterPolicyMockClientPoolBeanUtilsListenerManagerAuthenticationOrderPropertyMethodDescriptorAdapterRepositoryStrategyConsumerPrototypeMockInstanceGetterResolverIteratorUtilsSingletonGetterEventFilterDescriptorDefinitionVisitorConsumerMapUtilsResolverContextPropertyPropertyDefinitionDefinitionCandidateStrategyProxyContainerProxyConfigurationGetterHelperAttributeInfoObserverSingletonStrategyGetterCandidateSchemaObserverErrorHelperDecoratorDecoratorParameterReponseDefinitionCloneQueueQueueValueMappingSingletonContextAttributeCollectionCallbackStrategyMappingPrototypeInvocationResolverAnnotationPrototypeContextContainerStrategyIdentifierAdvisorServerReponseInfoMockComparatorCallbackComparatorParameterDispatcherSerializerTagCallbackComposerFilterTaskMapStubHelperWrapperAttributeInvocationImporterServiceListenerPublisherValueOrderFilterClientMockMapperBroadcasterMockImporterAttributeModelAttributePropertyMessagePropertyFilterProccesorGetterSetterDispatcherTagTaskBeanAttributeProccesorProxyFactoryPredicateAdapterMappingDatabaseFilterPublisherIdentifierConfigurationPublisherSetterMapperTemplateTestsBridgeMapperProxySingletonServerCandidateAdapterConnectionAdapterBroadcasterConnectionServerStubStateMapPredicateServiceTestsPublisherListParameterProxyDescriptorIteratorSerializerWatcherExpressionReponseDatabaseMapMappingServiceConsumerProducerInfoCandidateExceptionConnectionCallbackTemplateInstanceVisitorStubOrderConsumerDescriptorInfoWatcherDefinitionPublisherObserverPropertyErrorRequestFacadeMapIdentifierAttributeDecoratorExporterMockComparatorTaskContainerMockInterpreterExporterSerializerMessageParameterConfigurationInterceptorValueExceptionSchemaPrinterWatcherComparatorConsumerMapperHelperAuthenticationPoolMappingFilterTestsContextVisitorThreadIdentifierWatcherMockRepositoryParameterHelperThreadIdentifierProxyExceptionResolverUtilsInterceptorRequestClientIdentifierServiceGetterMethodFacadeMockProducerProccesorExporterStubFacadeDecoratorMapFacadeMethodExceptionListenerDispatcherImporterundefinedCandidateIteratorMessageModelFilterDispatcherConfigurationManagerMapInfoAdvisorInterceptorPrinterDescriptorWorkerImporterProxyExpressionEventContextInterceptorRequestAuthenticationPrinterThreadInvocationPool
#

that is over 2k chars

weak kayak
#

that is beautiful

#

truly an example of verbose code

icy beacon
weak kayak
#

and i don't even know what verbose means

#

that's how verbose it is

remote swallow
onyx fjord
icy beacon
#

ok ok stop flexing on us :rolled_eyes:

#

wdyfm enough funnies

weak kayak
#

we did get off-topic

remote swallow
icy beacon
#

this

remote swallow
#

never managed to fixit

onyx fjord
#

olivo definetly knows how to fix it

remote swallow
#

yea

chrome beacon
#

hm fix what?

icy beacon
#

i mean he probably knows everything spigot

#

just like choco

#

because they have 5 letter names

onyx fjord
#
I have a problem with gradle, basically I have a library that includes certain dependency and shades it.

However when I add that library to my project gradle still looks for the dependency that's already in the library
remote swallow
#

choko knows bukkit a lot

tardy delta
#

ahh found the Thread impl

icy beacon
rotund ravine
weak kayak
#

i gave up my 6 letter name in favor of another cooler one for youtube purposes

onyx fjord
#
dependencies {
    compileOnly "org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT"

    implementation "com.github.kaspiandev.kommons:Kommons:1-SNAPSHOT"
}
Could not determine the dependencies of task ':shadowJar'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Could not find com.github.retrooper.packetevents:spigot:2.0.0-SNAPSHOT.

something like this happens pretty muich

onyx fjord
chrome beacon
onyx fjord
#

yes

#

and kommons has packetevents shaded

tardy delta
#

๐Ÿ’€

icy beacon
#

is there any way to use chatgpt if my country is banned from openai

weak kayak
#

no Oop, only OOP

icy beacon
#

vpn does not help somehow

weak kayak
#

i know a way

#

use hyperbeam

#

it's basically a virtual browser

icy beacon
#

i'm curious now

remote swallow
#

do you not do that aio

#

i have 1 item builder

weak kayak
#

me and my best friend use hyperbeam to watch shows & stuff

remote swallow
#

that does everything

tardy delta
onyx fjord
remote swallow
#

i do need to update my item builder

#

its missing a few things

icy beacon
weak kayak
#

i agree

#

it is essential to everything

#

the universe would crumble without it

icy beacon
#

i signed up to hyperbeam and it opened the dashboard

#

what now ๐Ÿ’€

weak kayak
#

there should be a button to create a room somewhere

icy beacon
#

i think i chose the wrong option

#

i'll resignup

remote swallow
#

seems weird

#

suse

weak kayak
icy beacon
#

builder mthods >> anything

remote swallow
#

being smart with your code

#

imajin

icy beacon
#

you'll summon Imajin

weak kayak
remote swallow
#

same

remote swallow
#

im staring at him

icy beacon
#

this is still help-development

#

because he's a developer

remote swallow
weak kayak
icy beacon
#

toes

remote swallow
#

look at this sleeping imajin

weak kayak
#

hand toes

icy beacon
#

smh my head

#

has the audacity to sleep

weak kayak
#

sleep is for the weak

tardy delta
#

looks like java has pointer impls

weak kayak
#

which is why i sleep 6-10 hours nightly

remote swallow
#

sleep is for the week****

weak kayak
#

i am the weak

remote swallow
#

weekends are for all nighters

icy beacon
#

erdi should i close mozilla for this to work?

weak kayak
tardy delta
weak kayak
icy beacon
tardy delta
#

sun.jvm.hotspot.debugger.Address

remote swallow
#

i dont like the fact its called Factory when its a Builder

tardy delta
#

also stackframe impls in the internal package

#

java is wonderful

weak kayak
#

hmmmmmmm

#

i love leather skull potions

pseudo hazel
#

my built object are the builders

#

new BuiltObject().addstuff()

#

just most methods return this

#

I found that gives me the least overhead

icy beacon
#

let's fuck around

new BuilderFactory.with(...).build().getFactory().createFactoryEntity().getOrThrow();
pseudo hazel
#

thats cursed

weak kayak
#

perfrecte

remote swallow
#

wait untill you find out about getKey().getKey()

icy beacon
#

oh yeah

pseudo hazel
#

from namespacedkey right

weak kayak
#

keyception

icy beacon
#

and getAddress().getAddress()

#

my favorite

remote swallow
#

or Enchantment.getByKey(NamespacedKey.minecraft(knownEnchantName))

weak kayak
#

addressception

icy beacon
#

erdi this does not seem to work i've recreated the room like 5 times ;-;

remote swallow
#

do you not use 1.18 or higher

#

if not

#

can i have that class please

weak kayak
#

i'll make a room, send it, and give you the remote

icy beacon
#

no way hyperbeam would be shadowbanned in russia

valid basin
#

Does anyone know how to check if killer isn't a player (so like void, mobs, entities or suicide)?
My current code but code if (killer != null) is always true apparently. So I'm trying to get a workaround maybe if (!killer instanceof Player)?

            killer = victimProfile.getLastDamager();
        } else {
            killer = PlayerUtils.getNearestPlayer(victim);
        }```
remote swallow
#

can i have that class

valid basin
#

I'd appreciate help

remote swallow
#

for educational purposes

pseudo hazel
#

just write it yourself ๐Ÿ™‚

remote swallow
remote swallow
#

one second

icy beacon
remote swallow
#

i can do this

icy beacon
#

if (!(killer instanceof Player playerKiller))

weak kayak
remote swallow
#
public enum ItemEnchant {
PROTECTION(Enchantment. PROTECTION ENVIRONMENTAL) ,
FIRE PROTECTION(Enchantment.PROTECTION FIRE),
FEATHER FALLINC(Enchantment.PROTECTION FALL),
BLAST PROTECTION(Enchantment.PROTECTION EXPLOSIONS),
PROJECTILE PROTECTION(Enchantment.PROTECTION PROJECTILE),
RESPIRATION( Enchantment . OXYGEN) ,
AQUA AFFINITY(Enchantment.WATER WORKER),
THORNS( Enchantment. THORNS) ,
DEPTH STRIDER(Enchantment.DEPTH STRIDER),
FROST _ WALKER( Enchantment. FROST _ WALKER) ,
CURSE OF BINDING(Enchantment.BINDING CURSE),
SHARPNESS( Enchantment . ) ,
SMITE(Enchantment.DAMAGE UNDEAD),
BANE OF ARTHROPODS(Enchantment.DAMร„GE ARTHROPODS),
KNOCKBA Enchantment . KNOCKBACK) ,
FIRE ASPECT(Enchantment.FIRE ASPECT),
Enchantment. LOOT BONUS MOBS),
SWEEPING EDGE(Enchantrent.SWEEPIKG EDGE),
Enchantment.
SILK TOUCH(Enchantment.
UNBREAK Enchantment .
D16_SPEED),
SILK _ TOUCH) ,
DURABILITY),
#

windows did fine

#

probably

pseudo hazel
#

I mean kinda

#

better than starting from 0

valid basin
pseudo hazel
#

.. i guess

remote swallow
#

entity damage by entity event

#

check if their health is 0

pseudo hazel
#

me

icy beacon
#

yeah in this event killer is always a player apparently

#

so you don't need this check at all

remote swallow
#

its very weird

#

i hate it too

pseudo hazel
#

nice event name then

valid basin
stiff zinc
#

Why is REMOVE_PLAYER action removed from ClientboundPlayerInfoUpdatePacket in 1.19.3?

eternal night
#

Separate packet

tall dragon
stiff zinc
#

yeah I'm not using ProtocolLib atm

tall dragon
#

well then find the equivelant packet

#

idk which one that is off the top of my head

stiff zinc
#

well there is a ClientboundPlayerInfoRemovePacket

tall dragon
#

thats probably it

last bolt
#

I'm trying to incorporate bStats in my plugin, I'm using Intellij, have followed the directions on the bStats site, but intellij is not shading bStats into my plugin.

chrome beacon
#

How are you building your plugin?

last bolt
#

Intellij>Build>Build Artifacts

chrome beacon
#

Yeah that won't shade

#

You need to use maven or gradle

last bolt
#

Is that something I can do from within the IDE?

chrome beacon
#

Yes

tardy delta
#

interesting

chrome beacon
#

You can make a maven or gradle project in your IDE

last bolt
#

Thank you.

quaint mantle
#

hmm okay so I wanna make a gui inventory so when someone opens the gui and clicks on the item x I wanna make it like it adds the item to the guys inventory

#

how do I do that?

pseudo hazel
#

using inventory click events

quaint mantle
#

I was told to define the item with itemstack but where? in the main class or?

tall dragon
#

right after you create the inventory

tardy delta
#

you get the clicked item

quaint mantle
#
 @Override
            public void run() {
                for (Player player : Bukkit.getOnlinePlayers()) {

                    ItemStack item = player.getInventory().getHelmet();

                    if(item == null) {return;}
                    if(item.getItemMeta() == null) {return;}
                    if(item.getItemMeta().getDisplayName() == null) {return;}
                    ItemMeta meta = item.getItemMeta();
                    String ItemName = item.getItemMeta().getDisplayName();
                    if (ItemName.equals(ChatColor.RED + "Dctr's Space Helmet")) {
                      
                }
            }``` so this is my main class file where I have defined the item stack so if I wanna add it to the gui listener do I just spacehelm = item and head over to the gui listener add it make it add this etc?
tardy delta
#

put it in your listener class

remote swallow
#

wasnt someone else doing that

#

i remember something exactly like that

#

yeah

#

they made a thread recently

#

but someone did it like 4/5 months ago

quaint mantle
#

that was me

remote swallow
#

was it?

dusk flicker
#

chatgpt?

quaint mantle
#

it was

dusk flicker
#

its great

pseudo hazel
#

dude why do you even document that in the first place

dusk flicker
#

I had it document a 300 line class

pseudo hazel
#

"this string is the string"

#

like wtf

#

whats the method called

weak kayak
pseudo hazel
#

it is, but if i write my code like that all my files would 10x as big

#

the only things worth documenting are the non obvious things

dusk flicker
#

if its something others are going to be working with, I document everything

weak kayak
#

what counts as obvious

pseudo hazel
#

like if this method also will flip the calendar or some shit

regal scaffold
regal scaffold
#

lol

#

That I open this channel and that convo is where I land

remote swallow
pseudo hazel
#

if I call my method getItem() i dont have to put docs saying, :"returns the item"

#

unless it does 20 other things

#

in which case you rename the method

#

no

regal scaffold
#

How's your day going ebic

remote swallow
#

tiring

weak kayak
#

it might seem obvious to me since i've been working with it for hours, but to a random person it might not be as obvious

pseudo hazel
#

well thats what you can do if you wanna waste time

dusk flicker
#

Im having gpt write me some interfaces for a program im doing atm lol

weak kayak
#

i make sure to document everything that other people work with

#

or i try to

regal scaffold
pseudo hazel
#

well yeah I just try to make it clear what the code does, most simple methods can be more easily read over

remote swallow
pseudo hazel
#

unless you just have teh docs and not the actual code

remote swallow
#

ive watched wandavision season 1

#

black panther

#

and youtube

pseudo hazel
#

in which case it would be a little more documentation, but still

weak kayak
regal scaffold
#

lolol

#

You were watching that yesterday bro

remote swallow
#

which

pseudo hazel
#

I assume you don't write docs for your getters if they don't do anything past returning the value?

regal scaffold
#

wandavision

remote swallow
#

yeah

#

that was like the 2nd episode

weak kayak
regal scaffold
#

Fair

pseudo hazel
#

yeah so where do you draw the line

minor garnet
#

((CraftPlayer).getHandle().playerConnection.sendPacket,

when sending the packet to the client, will this packet be received by the client in the next tick or will it already be sent?

weak kayak
#

bamn, argument destroyed

pseudo hazel
#

I think I could probably document a little better, but I see some folks commenting on everything like its a school assignment

#

well named methods go a long way

weak kayak
#

it should immediately send

#

i might be wrong, but that's what i think

#

i'll maybe have to research more

dry yacht
# minor garnet ((CraftPlayer).getHandle().playerConnection.sendPacket, when sending the packet...

Sending packets is not synchronized to the main thread. There should be a send method with an optional callback, either a runnable, some future stuff or something completely new in 1.19 trash.

It's usually sent immediately, but there's also a queue for when the socket is currently unavailable, which shouldn't happen in normal operation tho.

It doesn't have to be immediate tho, as this heavily depends on the network condition.

minor garnet
#

queue for when the socket is currently unavailable wdym by that?

dry yacht
# minor garnet *queue for when the socket is currently unavailable* wdym by that?

I'm not sure when the socket isn't connected tho. Maybe that has something to do with auto-reconnect when the connection has ben severed. Would be odd tho. Just forget the queue. It's still not guaranteed to be sent immediately, which is why there's a callback parameter available, which netty calls when the packet has been written.

vivid skiff
#

Why am i getting this error when i change the chat format UnknownFormatConversionException: Conversion = 'm'?

dry yacht
vivid skiff
chrome beacon
#

Looks like a bad format

#

Not sure what you think we can help with if you only send those three lines

vivid skiff
#

the chat format variable contains only a string

#

If i use the same string putting it manually it works

dry yacht
vivid skiff
#

It contains "ยง7-"

tardy delta
#

heehee

edgy crystal
onyx shale
#

Anyone know why would a entity not actually appear? debug showed it did actually spawn Dungeon spawned SPIDER atLocation{world=CraftWorld{name=DwarvenCrypt-b52e5bfe-e5f7-3f4e-94a0-93e6f8cf35ef},x=288.3917820484588,y=53.0,z=-1.5090394101488653,pitch=0.0,yaw=0.0}

tardy delta
pseudo hazel
#

excel be like

tardy delta
#

looks like bytecode impl

onyx shale
dry yacht
# vivid skiff It contains "ยง7-"

Don't think that it does contain this, as your exception said something about the caracter m. When you try to change the format, your format is validated and if it's invalid, an exception is being thrown (probably what you experienced). Maybe check how Java's String#format works before you try to work with it here: https://www.javatpoint.com/java-string-format

tardy delta
chilly patio
#

Is it possible to know which plugin logged something in the console? (if it didn't use it's own logger, but the server's logger)

hazy parrot
#

I don't think so

dry yacht
tardy delta
#

theres a PluginLogger#getPlugin but dont think that may help

chilly patio
pseudo hazel
#

how many do you have

chilly patio
#

not if it uses the server logger

chilly patio
#

and it's in a prod server

pseudo hazel
#

oof

tardy delta
#

damn java compiler package has the same stuff im using

tardy delta
dry yacht
tardy delta
#

why isnt this in the std lib

pseudo hazel
#

because its too good

chilly patio
#

I have no idea which way they do it

chrome beacon
#

You can change the output stream and then get the stack trace

#

You should be able to find the plugin from that

chrome beacon
dry yacht
dry yacht
tardy delta
chilly patio
tardy delta
dry yacht
tardy delta
#

hmm never heard of

dry yacht
#

That looks promising already, before each print it's stacktrace of declaring classes is printed out, joined by ,. I guess you'd have to loop that list until you find a class which corresponds to a plugin for automatic plugin detection. Gonna tinker with it a few more minutes.

last bolt
#

In terms of performance, readability and recommended code style, is there any difference between passing a reference to your plugin to a class through the constructor, vs using (MyPlugin) Bukkit.getPluginManager().getPlugin("MyPlugin") ?

#

I've been tending towards using the latter as it reduces a method parameter each time.

pseudo hazel
#

I have a static method get() in my plugin class that returns the instance

#

which does bukkit.etc

last bolt
#

That sounds like a good alternative ^

#

public MyPlugin get() {
return this;
}

#

This type of thing?

pseudo hazel
#

well no

#

make it static

last bolt
#

Yes, sorry I missed out static.

pseudo hazel
#

then return bukkit.getpluginmanager.getplugin.whatrver

remote swallow
#

?di

undone axleBOT
last bolt
#

Or that won't work because the method is static I suppose.

pseudo hazel
#

exactly

#

static methods have no this

rare rover
#

would there be a way to get the Type inside of a Consumer?

#

wanting to get the GUISlot

dry yacht
last bolt
pseudo hazel
#

np

dry yacht
# rare rover wanting to get the `GUISlot`

No, due to type erasure. These generic types are only available during compile-time and are all erased to Object afterwards. The only place where you can actually still retrieve them at runtime is on member-fields. If you need that class, you need to pass it as a separate argument, like GUISlot.class.

rare rover
#

okay, thank you

frank kettle
#

is there a way to know how much a block is broken

hazy parrot
#

Your probably want supplier

rare rover
#

does the same thing?

hazy parrot
#

With suppler you can call get() , and get instance made in anonymous class or lambda

dry yacht
tardy delta
#

use supplier.get() and you have a T value

#

which in this case a GUISlot

dry yacht
# tardy delta use supplier.get() and you have a T value

Yeah, you could actually run supplier.get().getClass(), xD. Just for the consumer I don't think that there's a way to do this, as it just takes an Object parameter. But the supplier actually gives you an instance of the type which satisfies the type which had been there at compiletime.

trim creek
#

How the hell does this work?! ๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ

dry yacht
chilly patio
trim creek
#

Its from an official Spigot Wiki

#

or something

tardy delta
#

plugin messages

trim creek
#

but how does it really work

#

lol

eager jacinth
#

Hello, this is a kind of silly question, but I hope you can help me. Recently I decided to try to make a "multi module" project, but I ran into a small problem... I have an API module - with basic interfaces and stuff, and a Plugin module - the spigot plugin. I looked in other plugins, like "SkinsRestorerX" and "HolographicDisplays", that I should make and initialize some "API provider" - I did that, but still, when I want to call some method in my other plugins - I get an error. ๐Ÿซค

tardy delta
#

it uses a player connection to send data, what youre sending is the ways to send stuff

dry yacht
chilly patio
dry yacht
tardy delta
#

ugh

rare rover
#

If i use a supplier how do i run the code?

#

since there's no .accept()

ivory sleet
#

.get()

rare rover
#

oh that's it

tardy delta
#

check the docs too

rare rover
#

alr

rare rover
tardy delta
dry yacht
# rare rover true true

Or just use your IDEs intellisense. If it's already grabbing gigs of your system memory, it better do something for it.

tardy delta
#

whats intellisense?

#

the tabcompletion?

trim creek
dry yacht
dry yacht
trim creek
#

Ah well now then my problem is to solve a way to get a s... wait nevermind I might have got the idea lol

#

nope i didnt

#

fuck

odd adder
#

Hi , i am coding about TranslatableComponent in net.md_5.bungee.api.chat , can i get the key in locale file from an item id string?

tender shard
#

i wrote a pull request for that but it didnt get merged yet

#

you currently need to use NMS for this

onyx fjord
#

how do i change player's view distance?

odd adder
tender shard
#

yes

glacial shell
#

So, I am trying to figure out how to set a block, that the player is looking at, on fir., the code below gives this error: Cannot resolve method 'setType(Material)'

player.getTargetBlock(null, 50).getLocation().getWorld().setType(Material.FIRE);
tall dragon
#

remove .getWorld()

tender shard
#

setType only exists on block objects

rare rover
#

alex could you send me the link to your website

tender shard
#

which website?

#

the blog?

tall dragon
rare rover
#

i reset my brave dont have it pinned

#

yes

#

pelase

tender shard
tall dragon
#

actually that method prolyl returns a block

#

dont it

rare rover
#

ty

tender shard
#

np

tall dragon
#

@tender shard whats ur opinion on intellijs new beta UI

#

u like it?

tender shard
#

it sucks

#

it just uses more space than before, while showing less buttons

tardy delta
#

i wanted to say smth but i wont

tall dragon
#

haha yea thought u'd say that

tender shard
#

it's a bad joke

tall dragon
#

i dont rlly like it either

#

it makes the ui look like its made for a 5 year old

glacial shell
#

umm intelliJ just crashed and is like opening and closing/minimizing and unminimizing itself..

tender shard
#

I mean nobody ever said "oh my IDE doesn't look fancy", it's about features and not about how it looks lol

glacial shell
tardy delta
#

i kinda like it now

#

its thicc

astral radish
#

i have the Clan plugin and i want to have the rank of the player in the chat to with the clan does someone know how to do this this is how it looks now Clan Trixy_clapps: test and i want this Clan Rank player message does someone knows how to fix this code is now ChatFormat: '%clan%&8 %player%: &f%message%'

tender shard
#

just look at how many more classes fit on the screen using the old UI

onyx shale
tardy delta
#

true

#

it wants us to buy bigger screens

onyx fjord
odd adder
astral radish
onyx fjord
#

something.replace("%player%", playerName)

#

if thats what you mean

rare rover
#
``` getting this error for some reason? Should be set
```java
    public SpendingGUI(String name) {
        new SpendingGUI(name, 3);
    }

    public SpendingGUI(String name, int rows) {
        this.name = name;
        this.rows = 3;
        this.inventory = Bukkit.createInventory(null, (rows * 9), name);
        guis.put(name, this);
    }```
and my main
```java
        SpendingGUI gui = new SpendingGUI("Test"); // Creating GUI Here?
        gui.createGUIItem(new GUISlot(0, gui, new ItemStack(Material.GRAY_STAINED_GLASS_PANE)), () -> {
            sender.sendMessage("Hello");

            return (Player) sender;
        });
        gui.addPlayer((Player) sender);```
chrome beacon
#

Probably not their plugin

tardy delta
#

just use their api

tender shard
tardy delta
#

wait wha public SpendingGUI(String name) {
new SpendingGUI(name, 3);
}

tender shard
#

e.g. Bukkit.getUnsafe().getItem(myItemStack).getDescriptionId()

#

sth like that

tardy delta
#

call this()

#

or stackoverflow

#

probably not but whatever

astral radish
chrome beacon
#

So Kacper suggested how you would fix it with code

onyx fjord
#

is there a method to resend chunks to the player?

rare rover
#

i cant do that?

tardy delta
#

i guess your one constructor has to call the other one?

rare rover
tender shard
tardy delta
#

this(name, 3)

rare rover
#

im so dumb

#

thanks ๐Ÿ˜…

tardy delta
#

calls the SpendingGUI(String, int) constructor

rare rover
#

also 1 more question because i cant find it

#

is there a way to get the inventory's name?
Inventory inv = blah;

#

.toString()?

#

that's for the class itself tho

#

i think

trim creek
#

getView().getTitle() I think

tardy delta
#

you need the InventoryView

#

like in click event

chrome beacon
#

Don't compare inventories by their name

tardy delta
#

dunno if theres a field for the inv name

tender shard
odd adder
trim creek
#

btw I am dumb or I just did something wrong? Shouldn't this method send the message to all - curretnly two - whitelisted players?

public void multiplePlayerMessageTest(Player player) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream data = new DataOutputStream(out);
        try {
            for (OfflinePlayer players : Bukkit.getWhitelistedPlayers()) {
                data.writeUTF("Message");
                data.writeUTF(players.getName());
                data.writeUTF(prefix + "ยงfTesztรผzenet a tรถbb szemรฉlyzeti lehetล‘sรฉgre.");
            }
        } catch (IOException e1) {
            e1.printStackTrace();
        }
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
    }

Only the first player on the list gets the message, second never afterwards, only if they are in first priority.

dry yacht
glacial shell
#

How do I like set this to a variable so I can change the block at this place, because it won't let me do setType anymore:

player.getTargetBlock(null, 50).getLocation().add(0,1,0). ??
tender shard
tardy delta
chrome beacon
chrome beacon
tender shard
chrome beacon
#

It only accepts one identifier and data

trim creek
tardy delta
#

hmm what does 1 | 2 do again? binary or?

#

doesnt work for doubles

tardy delta
#

why doesnt it just use binary ieee754 encoding

tender shard
#

you have to send it to every player that should see the message

trim creek
#

And offline players cannot send messaegs

#

Meaning it would get me a lot of errors in console

azure quarry
#

is it possible to make it so squids dont need to spawn on water from squid spawners? via api

tender shard
#

huh? but that's why you're using bungee plugin messages

trim creek
#

It just can't send messages through null players

#

I can't set the player to "mfnalex", if "mfnalex" is offline

tender shard
#

no clue what youre talking about. instead of sending the plugin message to only "player", send it to all players

trim creek
#

but I can if it is

#

Read the code again...

dry yacht
# tardy delta what are you gonna use instead?

Vim with lsp. The only reason we need modern IDEs is that our buildsystems are a overcomplicated clusterfuck. I'm gonna automate those few tiny things IntelliJ does for me otherwise, without 10G+ ram use.

tardy delta
#

i dont even know how to exit vim lol

tender shard
#

you wanna send it to multiple players but all you do is to send it to "player" and nobody else

trim creek
#

player sends the message

#

players are who shall receive it

#

as said

#

I can't send messages thorugh offline players

#

Meaning at least one online player is required

dry yacht
odd adder
#

is name of functions in NMS can be map to normal name? or a table i can found them?

tardy delta
#

hmm

remote swallow
#

?nms

tardy delta
#

dont press ctrl+c ig

remote swallow
tardy delta
#

would that exit out of the program?

tender shard
#

you do "players.getName()"

#

use "ALL" if you wanna send it to all players

trim creek
#

Just to make it clear

tender shard
#
    public static void sendMessageToAllBungeePlayers(String message, Player sender, Plugin plugin) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream data = new DataOutputStream(out);
        try {
            data.writeUTF("Message");
            data.writeUTF("ALL");
            data.writeUTF(message);
            sender.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }
trim creek
#

Offline player can not send plugin messages

tender shard
#

I know how it works

#

offline players do not have to send plugin messages

#

just use "ALL" to send the message to all players

trim creek
#

Why would I want to send staff messages to all players?

tender shard
#

because earlier you said you wanted to send it to all whitelisted players

trim creek
#

Yes and they obviously are the staff

#

lol

tender shard
#

and I figured it would be hard to be online while not whitelisted

tender shard
tardy delta
#

hot java insertFunction(new FunctionCallSite("rand", 0, 2, ctx -> switch (ctx.size()) { case 0 -> Math.random(); case 1 -> ThreadLocalRandom.current().nextDouble(ctx.get(0)); default -> ThreadLocalRandom.current().nextDouble(ctx.get(0), ctx.get(1)); // 2 args }));

tardy delta
#

but looks like i somehow fucked up smth else

tender shard
#

alternatively do it like this @trim creek ```java
public static void sendMessageToAllBungeePlayers(String message, Player sender, Plugin plugin) {
for(OfflinePlayer receiver : Bukkit.getWhitelistedPlayers()) {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(out);
data.writeUTF("Message");
data.writeUTF(receiver.getName());
data.writeUTF(message);
sender.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
} catch (IOException e1) {
e1.printStackTrace();
}
}
}

odd adder
tender shard
#

I still wonder how you can have online players that are not whitelisted

humble tulip
#

If i have a queue that I want processed by a single thread, should I use a single thread executor OR should i use wait amd notify() and my own thread

tardy delta
#

what

trim creek
tender shard
#

yes

tardy delta
#

you mean a blocking queue?

trim creek
#

meaning it only has to have the players

#

right?

tardy delta
#

stdlib has that

trim creek
#

no need to turn it on

tender shard
#

i dont get it

#

what's "it"?

tardy delta
#

joe biden

tender shard
#

and what do you mean "it only has to have the players"

trim creek
#

whitelist

humble tulip
tardy delta
#

idk what you mean

tender shard
#

oh you wanna use the whitelist to keep track of who is staff without enabling the whitelist

trim creek
#

getWhitelistedPlayers() will return the whitelisted players. This is obvious. No matter if the whitelist is on or off, it can always get them

trim creek
tender shard
#

well obviously nobody expects such a behaviour so how did you expect me to magically know that you're abusing this feature like this to detect who's staff and who isn't lol

trim creek
#

Yes it works now. Thanks you. :D

#

(and sorry for being a bit... aggressive)

humble tulip
#

A blocking queue blocks the thread until something is inserted. Exactly what i was looking for

tender shard
#

your problem was that you reused the same stream, but it cannot be read again after having it read once

#

it's basically like
while(stream.hasData()) {
stream.sendData();

#

yo epic who am I?

#

"this should be for api / bungeecord api help, not for syntax"

#

@remote swallow answer!

remote swallow
#

heh

tender shard
#

no for real

#

who am i

#

because I dont know

remote swallow
#

PulseBeat_02#9425

tender shard
#

lol ok

remote swallow
#

had to find it lol

tender shard
#

oh they changed this channel's description

#

it used to say "ask other questions here" which never made any sense lol

remote swallow
#

it was ask development questions ealier

#

oh it was dev related

#

my brain isnt on

paper viper
#

it's just better

glacial shell
#

Do I put 2 separate commands in 2 separate java classes/command executors?

rotund ravine
#

yes

quaint mantle
rotund ravine
#

You do not have essentials

glacial shell
# rotund ravine yes

well I keep getting an error in the console when i try to do the second command, but the first command works.

remote swallow
#

are they both in plugin.yml

rotund ravine
remote swallow
#

2 different people jan

rotund ravine
#

or well

#

Oh

#

my bad

#

Sigh

glacial shell
#

lol

remote swallow
#

are both of the commands in plugin.yml

pseudo hazel
#

also what do you consider different commands

glacial shell
# remote swallow are both of the commands in plugin.yml

yes

name: SuperPowers
version: 0.0.1
author: amazingmation(amazingmationHub)
main: Powers
api-version: 1.19
commands:
  giveflamethrower:
    description: Gives custom Flamethrower to player.
    usage: /<command>
  givefblauncher:
    description: Gives custom Fireball Launcher to player.
    usage: /<command>
pseudo hazel
#

and you registered them in your main class correctly?

#

or wherever you register them

glacial shell
remote swallow
#

?paste the error

undone axleBOT
remote swallow
#

?conventions too btw

quaint mantle
#

Can somebody help? When i spawn vehicles [The paid one] it will give me the chest but when i place it it will disappere

remote swallow
#

which plugin

quaint mantle
#

i got ban :kekw:

remote swallow
quaint mantle
pseudo hazel
#

why xD

quaint mantle
#

for that i bought it and didnt get it

#

so i bought it second time

#

and got banned

remote swallow
glacial shell
quaint mantle
#

can somebody help with vault papi? i got %vault_prefix% it will work but the %vault_eco_balance_fixed% aint working

remote swallow
#

do you have an economy plugin that is vault compatable

glacial shell
quaint mantle
#

nah

#

only vault

sterile token
remote swallow
remote swallow
#

essentialsX has an economy built it and it gives a load of useful features

quaint mantle
remote swallow
quaint mantle
#

bruh

#

ok

#

ty

glacial shell
remote swallow
#

lol

tender shard
eager jacinth
#

But actually I think that there's everything's wrong...

sterile token
#

TestAPI#getInstance() is returning null

tender shard
#

ugh why is gradle's publishToMavenLocal so shit

remote swallow
#

dafuq

#

have they not got it setup properly

tender shard
#

anybody now how I can tell gradle to properly put this in the local maven repo

#

or do I have to run mvn install:install-file manually

#

you know what, I'll just upload it to jeff-media-thirdparty

remote swallow
#

so

#

they have maven publish

#

but dont set maven publish up

#

so smart

#

some people confuse me

tender shard
#

problem solved

remote swallow
#

is 3rd party not public

tender shard
#

thirdparty is private

#

it's stuff from all the people who dont upload their stuff to a proper repo so I dont have to mvn install two hundred thousand libs everytime

remote swallow
#

lmao

#

how do you access it then

#

if its private to non login's

tender shard
#

by being logged in lol

remote swallow
#

you can login to repo tags?

tender shard
#

yes sure

remote swallow
#

hmmm

tender shard
#

I mean how else do you upload stuff? o0

remote swallow
#

well yeah

#

that part i get

#

the login into it though

#

is this just me being a gradle user

tender shard
#

.m2/settings.xml

remote swallow
#

but how would you add that

tender shard
remote swallow
#

thats weird

tender shard
#

how

remote swallow
#

you specify nothing but it has a login

tender shard
#

huh

#

i dont get it

#

I tell it the url, the username, the password

#

what more would you need

remote swallow
#

you set it in settings.xml but it doesnt call on it

tender shard
#

yeah maven reads that automatically

remote swallow
#

i find it weird

tender shard
#

why would I need to specify where my settings.xml is if it's always in ~/.m2/settings.xml ? D:

remote swallow
#

that part yeah

#

but you dont call on the thing in settings.xml

tender shard
#

which thing?

remote swallow
#

imo it should have a <credentials>id/something</credentials>

tender shard
#

that's <servers>

#

in settings.xml

eager jacinth
tender shard
#

you shaded the API

#

set the scope to "provided" instead

#

arent both java versions EOL?

#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

odd adder
eager jacinth
icy monolith
#
public final class BlockBreak implements Listener {
    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        Block block = event.getBlock();
        if (block.getType() != Material.STONE && block.getType() != Material.IRON_ORE && block.getType() != Material.DIAMOND_ORE && block.getType() != Material.EMERALD_ORE) {
            event.setCancelled(true);
            return;
        }
        event.setDropItems(false);
        event.getPlayer().getInventory().addItem((ItemStack) block.getType().createBlockData());
        block.setType(Material.BEDROCK);
        new BukkitRunnable() {
            @Override
            public void run() {
                block.setType(block.getType());
            }
        }.runTaskLater(getInstance(), 20*5);
    }
}```
Hello, does any one know why it does not turn the broken ore to bedrock and give me the item?
tender shard
#

usually you just add an execution to the javadoc plugin, e,g, like this

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.2</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
icy monolith
#

i did that but now when breaking the ore it just cancels it

#

when i break the event gets canceled

#

there is no error

#

wdym

#

Ye thats what i have

tender shard
#

yep

icy monolith
#

so i add asItem() at the end?

#

nvm then its an error

mellow pebble
#

does anybody here have some knowledge about bungee plugin development

tender shard
#

that's normal

#

you have to tell it to ignore warnings

#
                <configuration>
                    <failOnError>true</failOnError>
                    <failOnWarnings>false</failOnWarnings>
mellow pebble
#

@sullen marlin can you help me how to get instance of bungeecord in 1.19 version of bungeecord

tender shard
#

in the javadoc plugin

tender shard
mellow pebble
#

this to be exact

#

tehre is no import net.md_5.bungee.BungeeCord

tender shard
#

`jd-bc

#

?jd-bc

mellow pebble
#

yup totally true

tender shard
#

it is indeed ProxyServer.getInstance()

mellow pebble
#

im acutally dumb really

#

AHHAHAHA

mellow pebble
tender shard
#

usually you put the configuration directly into <plugin> so it applies to all executions

#

but unless you run mvn javadoc:javadoc manually, this doesnt matter

#

oh yeah as said, this only disables warnings

#

not errors

#

you gotta fix the errors or also disable "failOnError"

#

e.g. you must not use "&" in your javadocs but rather use the escaped version &

#

it shows them, but it doesnt fail because of them

#

it fails because you actually have errors in your javadocs

#

as said, you gotta fix those or set failOnError to false

#

huh

#

usually it should be called -javadoc.jar

#

that depends on how your IDE works I guess, no clue

#

hm idk, I usually just do mvn deploy, then it uploads the whole stuff to nexus, and then it just works :/

#

send your full pom pls

undone axleBOT
tender shard
#

hm weird

#

I also attach sources, maybe that's what does the trick

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
#

yeah

#

I have both

#

and for me intellij always shows javadocs

#

no, the one creates a -javadoc.jar and the other creates a -sources.jar

#

none

#

intellij should automatically get it from your local maven repo

#

when you do mvn install

#

np ๐Ÿ˜„

#

yep

rare rover
#

Anyone got a tutorial / link for optimizing / improving your java code

#

Wanna improve my skills

hazy parrot
#

Imo it's just expiriance and contributing to other projects, seeing how other people do things

tender shard
#

only for files without nested keys

odd adder
#

Hello , i am trying to add NMS in my project , but it fail with The parameters 'srgIn' for goal net.md-5:specialsource-maven-plugin:1.2.2:remap are missing or invalid after run specialsource:remap.
And after i open a new blank project
retry the all step in https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
and run specialsource:remap
the same error shows The parameters 'srgIn' for goal net.md-5:specialsource-maven-plugin:1.2.2:remap are missing or invalid : (
anyone can help me?

kind hatch
#

What version are you working with?

odd adder
#

1.18.2

tender shard
#

send your pom pls

odd adder
kind hatch
#

I think you need to use version 1.2.3 of the specialsource maven plugin for 1.18 projects.

odd adder
urban mauve
tender shard
#

just run mvn package and done

tender shard
kind hatch
odd adder
#

yes , i added --remapped flag

kind hatch
#

And you built version 1.18.2 and not 1.18 or 1.18.1?

odd adder
#

i build two version 1.18 and 1.18.2

kind hatch
#

Did you run it normally first (no flags) or did you just run it with the remapped flag?

odd adder
#

this is screenshot of my terminal before

odd adder
tender shard
urban mauve
#

what is updateInstructionsFile

tender shard
kind hatch
#

lol. It's one of those projects.

tender shard
#

the update instruction file contains a list of eg keys you want to get renamed or quotes added etc

#

maybe theres an example update file in chestsort

odd adder
tender shard
#

yes

odd adder
#

ok thanks~

tender shard
#

np

pseudo hazel
#

this is more of a java question but if i make 2 lists and put the same object in both lists, does the object data exist 2 times or does it use some pointer system under the hood to only have one of the actual data?

#

just seeing if I am wasting memory atm xD

vale ember
pseudo hazel
#

okay

#

good

#

so when I modify the object they get changed in both lists since they share the same object

compact haven
#

correct

vale ember
#

yep

pseudo hazel
#

okay nice

vale ember
#

you can .clone() them if you wanna have 2 separate objects

olive valve
#

Hello,
I hope this isn't against the rules, but if so I will delete this message. But I am working on a premium plugin that I need help with. So I need one dev to help me make it. If you want to help me DM me please, I will only accept devs if you. Know how to use github, write clean code (with comments), and write efficient code.
To get more info on the plugin just DM me.

Thank you!

hazy parrot
#

?services

undone axleBOT
olive valve
# hazy parrot ?services

I've tried to use this but the forum wasn't accepted by whatever admin was reviewing it or whatever.

timber crescent
#

Im doing java for(ItemStack itemStack : e.getClickedInventory().getContents()) { p.sendMessage("You chose " + itemStack.); Kit kit = KitPvP.getKitManager().getKit(itemStack.getItemMeta().getDisplayName());
and for some reason the getdisplayname is null, whats causing this

olive valve
#

Try a null check such as

if(item.getItemMeta().getDisplayName() == null)
return;

timber crescent
#

ill try it

#

wait is air considered an itemstack then?

olive valve
#

Like a slot with nothing in it?

timber crescent
#

yea

olive valve
#

I don't think so.

#

Yeah I realize that is probably a better idea then return;.

#

Yeah I realize it wasn't a forEach loop.

hazy parrot
#

return@forEach moment

austere cove
#

#getItemMeta() works on air, it just returns null

mellow edge
#

Hello

river oracle
#

is there any nice and easy way to simulate damage on an item when BlockBreakEvent is cancelled or will I have to do all the math with unbreaking and such myself

mellow edge
#

should this code work like that? because for me it doesn't return true if something happens in the same chunk. Dealing with chunks is very wierd.

        for(int i = 0; i < c.size(); i++) {
            if(chunk1.equals(chunk1)) {
                return true;
            }
        }
river oracle
#

this code makes no sense

mellow edge
#

original code:

#
        for(int i = 0; i < c.size(); i++) {
            if(c.get(i).getTheChunk().equals(chunk)) {
                sender.sendMessage(ChatColor.DARK_GRAY + "[Chunk claim] " + ChatColor.GRAY + "The chunk has already been claimed!");
                return true;
            }
        }
#

shouldn't this code check if something happens in a chunk in a list?

#

because if a player interacts in that chunk that is in arraylist literaly the code is not executed

rare rover
#

anyone have a better color method?

public static String colors(String message) {
        Pattern pattern = Pattern.compile("#[a-zA-Z]{6}");
        Matcher matcher = pattern.matcher(message);
        while (matcher.find()) {
            String hexCode = message.substring(matcher.start(), matcher.end());
            String replaceSharp = hexCode.replace("#", "x");

            char[] ch = replaceSharp.toCharArray();
            StringBuilder builder = new StringBuilder();
            for (char c : ch) {
                builder.append("ยง").append(c);
            }

            message = message.replace(hexCode, builder.toString());
            matcher = pattern.matcher(message);
        }
        return ChatColor.translateAlternateColorCodes('&', message);
    }```
#

or is this one good?

mellow edge
#

and I don't need break, since this is a return method

rare rover
#

oh okay

kind hatch
rare rover
#

IridiumChatColorAPI, or that?

river oracle
#

i kinda took the idea from iridum lol

#

I let ChatGPT and copilot write some of the code it was slower than myself writing it but was fun

timber crescent
#

so instead of return use continue? im trash at java sorry

restive mango
#

is spawnparticle just shorthand to send a packet for a particle being spawned at a location to all players within viewing distance

#

the world spawnparticle method

tender shard
#

yes

odd adder
#

Hello , could I get en_US.properties file with NMS?

humble tulip
restive mango
#

@tender shard thanks my dude

odd adder
humble tulip
#

what mc version are u using?

odd adder
#

1.18.2

humble tulip
#

seems like it's json now?

tender shard
#

the language file is in META-INF/versions/spigot.1.19.3.....jar/assets/minecraft/lang

#

too late :<

odd adder
#

hmm , i open it before , but it seems not is directly to the translate key.

tender shard
#

looks good to me

tender shard
river oracle
odd adder
#

like , the translate key of Elytra should be item.elytra.name
but in the json , it is item.minecraft.elytra

tender shard
#

because that's the correct translation key

odd adder
chrome beacon
#

Yes the json key is the correct one

odd adder
#

ok~

#

but , how can i get it from Plugin with some code?

tender shard
#

wait until my pull request got merged

#

or use NMS

#

CraftMagicNumbers#getItem(Material)#getDescriptionId()

odd adder
tender shard
#

yep

odd adder
#

thanks~~~!

tender shard
#

np

mellow edge
#

nvm, I got it working. it was not the code I sent that was not working

pseudo hazel
#

for items you can directly use the material name and then just to lowercase

#

but its kinda dumb since the matching the enum name is kinda weird

#

like for statistics or advancements it doesnt work for some of them since the naming is inconsistent

#

but yeah having actual easy API support for it is the best way

odd adder
echo granite
#

Hello, why sometimes player.sendTitle(...) doesn't show anything? It's only fixed after a client restart, but I depend on the titles really badly...

pseudo hazel
#

it has never failed for me

kind hatch
#

The timings are probably messed up. You can send new ones with the second #sendTitle() method.

echo granite
kind hatch
#

Title timings are a little weird, but just send new ones and it should fix your issue.

echo granite
kind hatch
#

Well, that might explain it. lol

echo granite
#

as far as I remember, they're the default values

kind hatch
#

The default values are 20, 20, 20 AFAIK.

pseudo hazel
#

yeah

#

-1 works fine for me

echo granite
#

but from my testings, the problem happens randomly

odd adder
#

that maybe is a bug of client,
sometimes i left server ,when joining my single play world ,
the title quickly show and disappear.

echo granite
#

most of the time the titles are sent, but sometimes they don't at all

#

I use the normal 1.19.3 vanilla client

pseudo hazel
#

and you are sure that code is run at the times it doesnt show?

echo granite
#

Regarding the -1:

kind hatch
#

How many titles are you sending to the player at a time? Are you also sending them while the transitions are still in effect? Or are you waiting until they finish?

echo granite
echo granite
odd adder
#

try set delay after few ticks?

kind hatch
#

Oh, well if it's on player join, you may want to delay it a bit since it will take time for the client to render the game screen.

pseudo hazel
#

to the player that joined?

#

yeah I would just delay it by like a second to be sure

echo granite
#

but it's weird that only a client restart solves this