#help-development

1 messages Β· Page 97 of 1

tardy delta
#

😒

scarlet creek
#

Hmmm it doesn’t seem to work anymore…

#

I didn't do it wrong right?

                List<Entity> nearbyMobs = arrow.getNearbyEntities(rangeX,rangeY,rangeZ);
                for (Entity entities : nearbyMobs){
                    if (entities.getType() != EntityType.PLAYER && entities.getType() != EntityType.ARROW){
                        arrowLocation.toVector().subtract(entities.getLocation().toVector()).normalize().divide(new Vector(1.5, 1, 1.5));
                    }
                }```
#

Looks the same to me unless I'm blind

onyx fjord
#

uh did you add vector to the entity

scarlet creek
#

πŸ€¦β€β™‚οΈ

onyx fjord
#

oh wait

#

i forgor i divide

#

if you wanna multiply, multiply

#

i think the higher you go with divider the lower the end result is

scarlet creek
#

ah

#

Thanks for telling me that!

onyx fjord
#

np

#

haters will say its too complex 😠

tardy delta
#

it wont

#

yes

river oracle
#

Idk how you plant to trigger it

#

I mean ofcourse by itself it won't do anything there's nothing spawning the creeper

onyx fjord
#

would be nice if you actually summoned him

#

World#summonEntity ?

#

spawnEntity *

#

it returns entity

quiet ice
#

Plus EventHandlers are only going to get called if the class of the event that they are listening for has a handler list

scarlet creek
#

Because the mobs seem to get sucked into the arrow after 1 second of it being shot and stay at that location, but it is funny

charred blaze
#

if (getConfig().isSet(p.getUniqueId().toString())) {

#

why isnt this check returning true?

#

config contains uuid

#

db498e7e-89c9-3ea7-887b-3d0330cfc132: true

old cloud
charred blaze
old cloud
#

nvm

#

I guess you have to provide more info. From what you have send so far it should work.

#

Is it in the right file?

#

Use EntityType.CREEPER

tardy delta
#

(Creeper) world.spawnEntity(/* whatever */, EntityType.CREEPER)

#

generic enums for the win smh

sacred mountain
#

hey how do i read json from a file with gson?

#

into a hashmap

#

and a filereader or bufferedreader

tardy delta
#

whats in that file

#

gson.fromJson(Files.readString(file.toPath()), SomeClass.class) probably

#

spawning one if you hit one :/

#

try it

#

not the one you hit

#

when you hit a creeper with some projectile, it spawns a new one and explodes it

onyx fjord
#

how do i stop task in itself?

#

scheduled task

worldly ingot
sacred mountain
#

because the class has other things other than the map

#

this is the map

tardy delta
#

the type that you serialized

sacred mountain
#

a hashmap<uuid, list<playerquest>>

sacred mountain
tardy delta
#

uhh isnt there a gson::fromJson method that only takes a string?

onyx fjord
#

can i easily make bossbar visible to everyone on server?

tardy delta
#

check out bossbar methods to add players

worldly ingot
#

Just have to add all online players to it, then add players on join

onyx fjord
#

so i have to loop?

tardy delta
#

yes

sacred mountain
#

Cannot resolve method 'fromJson(String)'

tardy delta
#

ah um im wondering if you need a typeadapter

sacred mountain
#

i'm currently using one with a reader

sacred mountain
tardy delta
#

try HashMap.class idk

#

i forgot

#

it cannot infer the uuid and list<quest> iirc

worldly ingot
tardy delta
#

the good old forEach

#

i hate it when copilot suggests me stuff that idk if it works

onyx fjord
#

okay and runTaskTimerAsynchronously doesnt return anthing, how am i supposed to store it somewhere

#

i need to cancel it from somewhere else

eternal night
#

yea no idea what the issue with that method is

tardy delta
#

nice it gave me a wrong index

eternal night
#

like the one that takes Consumer<BukkitTask>

onyx fjord
eternal night
#

flame spigot API design

tardy delta
#

you already have a way to do smth with the task ig

onyx fjord
#

inside of it sure

#

or wait

tardy delta
eternal night
#

Yea but why does that not just return the bukkit task too

#

now you get to use the bukkit runnable trash

#

because you can cancel that one from inside and it returns your the ref

onyx fjord
#

ima just use te one without consumer ig

tardy delta
#

runtaskAsync(plugin, task -> { this.task = task }) would this be possible?

eternal night
#

Well, no

onyx fjord
#

okay and im done with that

#

all g

eternal night
#

that code would execute too late potentially

onyx fjord
#

now i need 2 remove bossbar

reef lagoon
#

how do i check if the clicked inventory was the player's inventory

#

on an invetnroy click event

tardy delta
#

first execution time vs others :/

sacred mountain
#

lets goooooo

#

read the data

tardy delta
#

i started to execute a few before actually measuring but when i start measuring the first one there also takes longer :/

mellow edge
#

I have a question

reef lagoon
#

description: yESsss

iron glade
#

?ask

undone axleBOT
#

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

tardy delta
#

smh

mellow edge
#

how can I make a player invisible with armour

mellow edge
#

like in bedwars

sacred mountain
#

πŸ‘

#

buy from the shop

#

2 emeralds

reef lagoon
#

someone give this guy an oscar

flint coyote
#

I think he wants full invisibility, no?

tardy delta
#

Player#hidePlayer(Player, Plugin) and loop thro onlinePlayers

mellow edge
#

I am saying how can I add it to my own plugin, the problem is that I can still see his armour

flint coyote
#

wtf xD

tardy delta
#

rather not

onyx fjord
#

invisible like effect

onyx fjord
#

or invisible that nobody can see him

sacred mountain
#

packets probably do something like that

onyx fjord
#

you can also disable ambient particles and shit

mellow edge
reef lagoon
#

ratio

onyx fjord
#

o

#

thats a thing

#

wow

tardy delta
#

pff i'm trying to measure my test but the time it takes depends on the amount of precious tests πŸ€”

eternal night
#

you are using a proper test setup right ?

#

like JMH

tardy delta
#

hehe

#

HEHE

#

no

eternal night
#

ah so your tests are useless πŸ˜‚

tardy delta
#

πŸ˜‚

sacred mountain
#

HEHEHEHA

eternal night
#

love those tests

eternal night
#

just write proper benchmarks

#

Β―_(ツ)_/Β―

tardy delta
#

i should learn

eternal night
#

its so easy

sacred mountain
eternal night
#

its wild

#

like jmh is really really straight forward

tardy delta
#

would you recommend it?

#

whatever it is

eternal night
#

that thing is literally maintained by the openjdk team

#

I don't think you could recommend it more

tardy delta
#

hmm lets follow the baeldung guide

eternal night
#

if you are using a cool build tool (gradle) you also get a super easy plugin to use it

reef lagoon
#

gradle πŸ’€

#

you only use gradle when you don't have a choice

eternal night
#

suffer while your default shade plugin version does not even support the latest java version yet kekw

sacred mountain
#

tho

reef lagoon
#

suffer while your cool build tool takes hours to build

eternal night
#

hours ? my daemon starts once πŸ˜‚

#

after that gradle has incremental compilation lol

#

but w/e

#

jmh is pretty good

#

just make sure to properly blackhole your outputs

sacred mountain
#

guys do any of you suggest a good GUI library/api

eternal night
#

so they don't get omitted

sacred mountain
#

alrigt

#

checking it out

ivory sleet
reef lagoon
#

I know but still, I see no advantages in using gradle over maven

hybrid spoke
#

have a big ass project and then you will

#

otherwise maven is way better

waxen plinth
#

Gradle has much shorter build scripts and faster build times which is what I want

#

I hate xml

eternal night
#

(obviously except mini message my beloved)

waxen plinth
#

No exceptions

#

xml bad

eternal night
#

i am grabbing my pitchfork

waxen plinth
#

Might fuck around and make a MiniMessage competitor

eternal night
#

there is minedown from phoenix

waxen plinth
#

Markdown but for minecraft?

#

I like that

eternal night
#

ye

waxen plinth
#

Yeah I like that much better

eternal night
#

only issue is with colours, when do they end

#

but yea

#

its a nice format too

waxen plinth
#

They probably end when you reset or change the color

eternal night
#

yea, but that is not always what you might want

waxen plinth
#

It never isn't

eternal night
#

I guess you just redefine the color you used before

waxen plinth
#

Yeah

onyx fjord
#

&b πŸ˜‚

eternal night
#

that thing literally does have your legacy colour codes

onyx fjord
#

ik

waxen plinth
#

Which I also like

onyx fjord
#

because i use it in fact

waxen plinth
#

I prefer for it to be as straightforward and succinct as possible

onyx fjord
#

legacy is sometimes just faster

eternal night
#

I never had an issue with <red>

onyx fjord
#

thats 5 letters

#

you can do 2

#

&c

eternal night
#

you write java ?

#

write kotlin

#

you can do it in less code

onyx fjord
#

well, but i tab out stuff πŸ˜‚

eternal night
#

why ?

#

that is more letters

#

stop that

onyx fjord
#

no?

eternal night
#

obviously on file that is just larger

waxen plinth
#

I don't like kotlin

onyx fjord
#

same

eternal night
#

but why ?

onyx fjord
#

feels weird

eternal night
#

hmm but it can do what java can do with less letters kacper

waxen plinth
#

It feels like python-ified java almost

eternal night
#

this should be your preferred language no ?

waxen plinth
#

I care about that with text

#

With code I have a very different philosophy

eternal night
#

I mean, the only time that works is if you have memorised all the colour codes

waxen plinth
#

Code is designed, but text is just text

eternal night
#

which, give, a lot of people have yes

onyx fjord
#

except in java i can just write few letters and press TAB

waxen plinth
#

Code defines behavior, text is just appearance

#

And with code, you should aim to avoid having hidden or subtle behavior

eternal night
#

but objectively as a standard, a format that uses &6This is gold is just worse than <gold>This is gold

waxen plinth
#

Kotlin has a lot of hidden and subtle behavior

eternal night
#

the first only works because people had to learn those colour codes

waxen plinth
eternal night
#

Yea

waxen plinth
#

So if you want it to be more clear you can do it that way

eternal night
#

I am not arguing against minedown

#

I like the lib

waxen plinth
#

But honestly everyone still uses legacy color codes

onyx fjord
#

people just remember legacy

eternal night
#

tbf I never have

#

I always concatted chat colors

#

ChatColor.GOLD + "This is gold"

iron glade
#

lmao

waxen plinth
#

I did too, but I used legacy codes for configurable messages

#

I think they should always be an option

eternal night
#

Well you need to expand them to something like minedown anyway tho

#

I wonder

#

does minedown implement an adventure serialiser

waxen plinth
#

Paper better not drop support for legacy text

eternal night
#

I mean

#

not for a while no

waxen plinth
#

It's still by far the simplest way to send messages

#

And if you have very basic formatting it's the best for that too

eternal night
#

I mean preferably everyone moves to proper components

#

what parser/format you use to build them, idc

onyx fjord
#

legacy should always be fallback

eternal night
#

for all I care, pure legacy

waxen plinth
#

It should literally always be an option to do legacy text

eternal night
#

meh

onyx fjord
#

components sure, but for gradients and shit

#

thats the only use i know

eternal night
#

click and hover events haunting you tonight

onyx fjord
#

at times i configure for example 2 thousand lines of messages

waxen plinth
#

I never have that many

eternal night
#

πŸ‘» RBG colours πŸ‘»

waxen plinth
#

I just don't use them

#

People can configure them if they want

onyx fjord
waxen plinth
#

I use legacy codes

eternal night
#

aww minedown does not implement an adventure serialiser

onyx fjord
#

how big is adventure

eternal night
#

jar wise ?

onyx fjord
#

yes

onyx fjord
eternal night
#

no you need to ship the spigot platform

#

tho the platform should be somewhat small

#

actually, eeeh they might ship gson

onyx fjord
#

yeah...

#

why tho

#

spigot has gson

eternal night
#

lemme double check

#

they might not

#

beyond that tho, spigot is not really the coolest dependency provider

#

like, version wise

#

ah yea, they do ship gson. Mostly because they ship their adventure component to json module

#

which is cross platform (and hence includes gson)

waxen plinth
#

300kb is a fair bit

#

I wish minimize worked better

#

I tried it out by shading RedLib but only using one method from it

#

It still shaded 200kb of it in

#

Realistically it should have been able to cull that down to something like 30kb

#

For reference the full jar is 400kb

hasty prawn
#

RedMinimize inc

waxen plinth
#

lol

desert frigate
#

yeah it doesnt work at all

#

and i cant find the packet for setting pose of player

quiet ice
sacred mountain
#

'setDisplayName(java.lang.@org.jetbrains.annotations.Nullable String)' is deprecated

#

?

#

itemmeta

quiet ice
#

You're using paper, nothing to worry

iron glade
#

.displayName() on paper

sacred mountain
#

ah ok

#

didnt see that

quiet ice
#

You should use adventure components however if you intent to be paper-only

sacred mountain
#

meta.displayName(Component.text("text"));

#

there we go

iron glade
#

yes

small current
#

can a double be unisgned in mysql ?

quiet ice
#

If you intent to support spigot, make sure to USE the DEPRECATED method

golden turret
#

wtf πŸ€”

#

1.18

iron glade
#

do you think paper will remove those deprecated methods at some point?

golden turret
#

I think I did something wrong

quiet ice
#

Deprecated != Deprecated for removal

golden turret
#

guys

#

what is the name of the field

#

of the entity's pitch

#

in nms

#

1.18.2

sacred mountain
#

if i use the translatealternatecolorcodes inside a Component.text

#

will it work

quiet ice
#

Obfuscated?

sacred mountain
#

how should it

#

i

quiet ice
#

Or perhaps, but I would not bet it

golden turret
#

wtf

#

how is that possible

#

do <<

tardy delta
#

that will compile when just using javac

#

afaik

#

lemme test

golden turret
#

I tried to access that method

#

it didnt work

tardy delta
#

javac not recognized as a command :/

#

tf

quiet ice
tardy delta
#

^^

quiet ice
#

javac will not compile it however

tardy delta
#

huh i read that it will

quiet ice
#

Nah it wont

golden turret
#

the code I sent is from the IntelliJ decompiler

quiet ice
#

At least on older JDKs

sacred mountain
quiet ice
quiet ice
sacred mountain
#

alright

#

yeah

#

i got it

#

do i still need to use translatealternate

quiet ice
#

If you only have ampersands (like here) no

#

However if you hard-code those strings I'd not use that method

#

Instead use Component.text("Green", NamedTextColor.GREEN);

dim bronze
#

does anyone with kotlin experience know if it understands @org.jetbrains.annotations Contract for smart casting?

quiet ice
#

Kotlin probably does not understand it as it is meant for debug tools like IDEs and whatnot

#

but me never having used Kotlin I cannot tell for sure

tardy delta
#

ah dont have jdk on my path

quiet ice
#

I should really set up a permament alias for javac/jps/jstack/javap/javah/etc. to that command (and similar)

fleet comet
#

How should I use Player#remove without getting UnsupportedOperationError.
I've tried creating an instance, but that is not working

tardy delta
#

it doesnt work like Entity#remove

quiet ice
#

Custom players

tardy delta
sacred mountain
tardy delta
#

what

quiet ice
fleet comet
tardy delta
#

hmm im installing mine locally for ij

fleet comet
#

its a commission all right, its not my idea

sacred mountain
#

mmm yes

reef lagoon
#

is tabnine any good

quiet ice
#

I'd hijack the netty pipeline instead

sacred mountain
#

no

#

i hate tabnine

tardy delta
#

looks like i dont have a JAVA_HOME

reef lagoon
#

y

tardy delta
#

and tabnine sucks

#

copilot ftw

sacred mountain
#

gives me stupid autocorrects when i dont need them

#

and its a hassle to undo them, then it just gives it to me again

quiet ice
sacred mountain
#

just cancel all packets sent to the player

#

right

#

and set the timeout to a long period

quiet ice
#

I'd do it at a netty pipeline level

fleet comet
sacred mountain
quiet ice
eternal night
fleet comet
fleet comet
sacred mountain
fleet comet
eternal night
#

I was wondering if their serialiser implemented the given adventure interface

fleet comet
#

just seems ahhh, im bad with NMS

eternal night
#

I know minedown can produce adventure components

sacred mountain
#

having updates would be sending the player info of whats happening, on the server. so how would you disconnect them from the sevrer with server updates still happening

#

im not sure what ur trying to achieve

fleet comet
quiet ice
sacred mountain
#

erm

#

ok

#

tell him to dm me kek

fleet comet
sacred mountain
#

google it

quiet ice
#

How exactly this is done I cannot say because I have 0 knowledge about minecraft internals

sacred mountain
#

or maybe tell him that it's not really viable

#

and ask him why he wants it

quiet ice
#

Oh, it is possible

fleet comet
sacred mountain
#

its definitely possible, just not really easy

quiet ice
#

Especially if you were able to redirect the player to a minestom server it would be easy AF to troll the client

sacred mountain
#

if uyou have a proxy however

quiet ice
#

Synchronizing the minestom and normal mc world would a bit harder than netty pipeline hijacking though

sacred mountain
#

you can keep players connected to servers even through restarts, and perhaps mess with the client whlist the server is off

fleet comet
#

im going to ask for more then 5$ ;-;

sacred mountain
#

i've done plugins which keep players online through restarts

sacred mountain
#

im bored as hell

fleet comet
quiet ice
#

It's just calling a method lol

sacred mountain
#

why does she need it tho

#

yea

#

and why does she need it

fleet comet
quiet ice
#

player.getConnection().pipeline().add() or somethign like that

sacred mountain
#

like i feel theres a better way to do what she ACTUALLY wants

quiet ice
fleet comet
sacred mountain
#

his mappings

quiet ice
#

I made the method names up

sacred mountain
#

lol

#

its not as simple as that

#

but i wouldn't charge 5$ for effectively removing something that exists

quiet ice
#

It'll probably be player.getConnection().getChannel()/*might need AW for that*/.pipeline().addLast(new ChannelInboundAdapter() { /* ... */ });

fleet comet
quiet ice
#

It is hard to create a desync knowingly without meddling with the connection

fleet comet
quiet ice
#

It certainly is not part of the bukkit API!

fleet comet
quiet ice
#

Lemme boot up recaf and find what you want

fleet comet
eternal night
#

that should be a plain public field

#

idk if there is a getter

grim ice
#

even if its really simple 10$ minimum

#

ur wasting ur time on a 5$ comm

quiet ice
#

Channel c = ((CraftPlayer) player).getHandle().networkManager.m

fleet comet
#

now time for build tools once again 😒

eternal night
#

mojang mappings wen

quiet ice
#

I am using "slightly"-outdated paper builds as a reference there

#

So some things (especially the .m part) could've changed compared to a fresh spigot install

fleet comet
#

I'm going to charge more then 5$ for this thats fo sure

grim ice
#

bro 5$ for a nms plugin

sacred mountain
#

brh

grim ice
#

is just a scam

sacred mountain
#

yeah

fleet comet
grim ice
#

i would take no less than 25$

#

or 30$ if im feeling lazy

sacred mountain
#

i've never taken any money for any of my commissions

#

and i've spent like hours on hours

sacred mountain
#

...? i just like to do my projects for free

#

that's not naive

quiet ice
#

And here I am helping people get rich

fleet comet
fleet comet
tardy delta
#

hmm yep doesnt work

quiet ice
#

They are keywords everywhere, no matter whether it makes sense to be there

#

However after that they went for more intelligent keywords, hence you can still call variables record, sealed and whatnot

#
        Object sealed = null; // valid
        Object record = null; // valid
        Object permits = null; // valid
        Object implements = null; // invalid
fiery prairie
#

how would I check if a player's inventory contains more than a given amount of an item?

flint coyote
undone axleBOT
quiet ice
#

HMMMMMMMMMMMMMMMMMMMMM I wonder what method I could use

flint coyote
#

Exceptions for things I really like and can get behind and that I might learn from aswell

fiery prairie
quiet ice
#

(do note that you have to add one on the int parameter to get more than a certain value)

fleet comet
#

whats the 1.19.2 maven name 😭

chrome beacon
#

Remapped?

quiet ice
#

1.19.2-R0.1-SNAPSHOT

fleet comet
fleet comet
#

your the best

quiet ice
#

Bukkit and spigot have never ever recieved a stable release

#

At least from my knowledge

fiery prairie
#

My brain is dying today, why cant i check if config.getInt is null to see if it was ever set in the config? lmao

chrome beacon
#

int can't be null

fleet comet
#

@quiet iceoh no

fleet comet
#

this is the worst feeling

chrome beacon
quiet ice
#

I assume that it is just not visible

#

It is visible under paper, but they could have easily patched it

fleet comet
#

sorry i am new to nMS

quiet ice
#

Okay discard that, I'll write up some pseudocode

fleet comet
#

fuck spigot damn that is the most ironic var. that doesnt even make sense 😭

chrome beacon
#

That's how the code looks without mappings

fleet comet
quiet ice
#
        Field fn = null;
        for (Field f : EntityPlayer.class.getDeclaredFields()) {
            if (f.getType().equals(NetworkManager.class)) {
                fn = f;
            }
        }
        NetworkManager x = (NetworkManager) fn.get((((CraftPlayer)player).getHandle());
quiet ice
#

Safest code in the world

fleet comet
#

o

fleet comet
#

thats some reflection

quiet ice
#

It is safer than remapping

#

Oh no

#

I forgot to handle access

fleet comet
quiet ice
#

You need to make the field accessible

#

But should be easy for you

chrome beacon
quiet ice
#

If it isn't you shouldn't be taking up commissions...

quiet ice
# fleet comet thats some reflection

Reflection can be VERY safe if you know what you are doing. There is the meme going around in the recaf discord that the safest part of all LWJGL code is the method to obtain the instance of the sun.misc.Unsafe class through reflection

fleet comet
flint coyote
#

NMS != Reflection

#

Making a field accessible is full reflection.

quiet ice
#

Well you could use the unsafe for that

supple elk
#

Anyone know why this is incorrect?

fleet comet
quiet ice
#

But to get the Unsafe you need reflection, so yeah

fleet comet
supple elk
#

yes

quiet ice
supple elk
quiet ice
#

Or better said what does the terminal think the command is

supple elk
fleet comet
#

this code 😭

quiet ice
#

Don't worry that was the easiest part

fleet comet
quiet ice
#

Now you will have to add an Inbound and an Outbound channel adapter and do packet magic

quiet ice
fleet comet
#

great! done

quiet ice
#

Or if it is rather intelligent it will just disconnect the player cleanly

fleet comet
fiery prairie
#

dont mean to interrupt again, but what does index in getInventory.setItem mean? as i said earlier, my brain is dead today and i dont understand the spigot docs lmao

quiet ice
#

However because windows is not linux my help ends there

fleet comet
supple elk
#

alright thanks lol

quiet ice
#

Try doing something like C:\\

fleet comet
#

omh i have made something amazing

supple elk
quiet ice
#

Actually, you need to escape all your backslashes

supple elk
#

0_0

quiet ice
#

Although then you also have ', so idk

supple elk
#

escaping didn't help

quiet ice
#

I know that "proper" linux grammar (if volumes were a thing) would be C:///Program\ Files/Java/jre1.8.0_331/bin/java.exe

fleet comet
#

i need to learn NMS and netty 😭

quiet ice
#

channel.pipeline().addLast() or channel.pipeline().addFirst

chrome beacon
quiet ice
#

My help ends there however given that while I have worked with netty in the past, I have never worked with NMS

fleet comet
fleet comet
#

also how would i create a channelhandler for that?

fleet comet
buoyant viper
#

"

lost matrix
# supple elk

You have spaces in your name so you need to use ""

rough drift
#

TIL setting Xmx to 512 reduces paper ram by 2X

buoyant viper
#

sometimes u just gotta force the server to optimize uwu

golden turret
#

How can I cancel the PlayerMoveEvent but allow things like setVelocity?

chrome beacon
flint coyote
quiet ice
fleet comet
sacred mountain
#

ignore the missing spaces, but why is the text component seemingly offset

chrome beacon
#

offset?

sacred mountain
#

its downward a bit

#

the 30

chrome beacon
#

It's not

sacred mountain
#

bruh i swear im not tripping

zealous osprey
#

It's not

quaint mantle
sacred mountain
#

adm ok

rough drift
#

I just got my server under 300mb

sacred mountain
#

lmao my world alone is 1g+

rough drift
#

memory usage

sacred mountain
#

oh

rough drift
#

under 420 flying around at mac 10 in spectator generating chnks

#

sometimes even under 400

sacred mountain
#

what version u on

quiet ice
#

the JVM will grab as much ram as you allow it to grab

rough drift
#

No no

#

I found some JVM flags

#

also that

quiet ice
#

(grossly oversimplified, but that is the case)

rough drift
#

I know

#

I read most of the jvm spec

rough drift
quiet ice
rough drift
#

though I did read more about other stuff as well

sacred mountain
#

well

#

it may be because i have more than one player on

#

but thats a large difference

quiet ice
#

Eh, even an office PC with 5 Gb of ram can handle ca 6 players

sinful rapids
#
                        Inventory createKitGUI = Bukkit.createInventory(null, InventoryType.ANVIL);
                        ItemStack stack = new ItemStack(Material.PAPER);
                        createKitGUI.setItem(0, stack);

Why doesn't it add the item in the gui?

chrome beacon
#

create inventory doesn't work well with anvils iirc

sinful rapids
#

And how do I create a gui with the anvil then?

chrome beacon
sinful rapids
#

okk

#

thanks

quiet ice
#

Yeah, bukkit anvils are pain

#

To the point that something that should work on spigot doesn't work on spigot, but partially works under paper

sacred mountain
#

lore all automatically generates based on quest data now

#

lest goooo

#

prolly the most productive ive been for ages

tepid thicket
#

Still, the change seems to come from the refactoring. As before both behaved the same. But right, I'm using the String-names now.

cobalt thorn
#

org.bukkit.craftbukkit.1.19.entity.CraftPlayer how i can import this? im trying importing it for sending packet i need to use the build tools and import it with maven or something else entire code:

    private static void sendPacket(Player player, Object packet) throws Exception {

        Class<?> craftPlayer = Class.forName("org.bukkit.craftbukkit." + serverVersion + ".entity.CraftPlayer");
        Object craftPlayerObject = craftPlayer.cast(player);

        Method getHandleMethod = craftPlayer.getMethod("getHandle");
        Object handle = getHandleMethod.invoke(craftPlayerObject);
        Object pc = handle.getClass().getField("playerConnection").get(handle);

        Class<?> Packet = Class.forName("net.minecraft.server." + serverVersion + ".Packet");
        Method sendPacketMethod = pc.getClass().getMethod("sendPacket", Packet);

        sendPacketMethod.invoke(pc, packet);

    }

normally trying it doesn't work

chrome beacon
#

If you're on a modern version you're going to need other class and method names

#

That sendPacket method is obfuscated

void wraith
#

Hi! I working an invsee plugin. How can I execute a task, when an event ends?

cobalt thorn
crystal palm
#

Heyo. Using the 1.19 API right now. Material.BLAST_FURNACE doesn't exist. What do I use instead?

chrome beacon
#

You can only call code in an event

#

You can use the scheduler to run code next tick

#

Be aware of the issues that might cause though

crisp steeple
void wraith
worldly ingot
#

It's usually small spelling changes

#

For instance "color" in en_us, but "colour" in en_ca or en_uk

trail dune
#

hey uh so i just got into dev and i know nothing and i cant setup SDK/JDK becuase when i try running code i get a masive errorr code im using IntelliJ so can someone help?

trail dune
quiet ice
#

What are you using

quiet ice
trail dune
#

its just a long line of red errors

quiet ice
#

You'd need to supply zones, somehow

#

Wow, java.text - that is an API I haven't heard about

#

No a locale is a language or country

#

For example en_us corresponds to the united states, but there are multiple time zones in there

#

The locale here is probably used for things such as 0.5 vs 0,5

#

If it just needs to work on your machine, sure. If it needs to work on other computers - not really

hazy parrot
#

There is setTimezone method

quiet ice
#

having something like HH:mm:ss z seems to be the workaround for SimpleDateFormat

hazy parrot
#

On simple date format

quiet ice
#

Timezone

gray merlin
#

I can't find the spigot/craftbukkit APIs for 1.15 onwards, where can I find them?

undone axleBOT
gray merlin
#

Ahh I see, it changed from there on

#

Thanks

quiet ice
#

Probably, though the question still stands why you are using legacy API

chrome beacon
onyx garden
#

Hi
is there an example to search automatically any CustomBiomeTypes of intalled plugins?
An biome caller to cache the biome provider?

quiet ice
#

The new J8 java.time API has usually replaced the older J1/J1.1 one you are using

chrome beacon
#

If you mean the texture you can use a resource pack

#

Player skins won't work on the creeper model

#

You can use packets to make the creeper look like a player though

visual tide
#

Welll technically

#

You can use options custom entity model

#

As a resiurcepacl

chrome beacon
#

With Optifine

#

Not vanilla

visual tide
#

but what Olivo said seems more sensible

quiet ice
#

Alongside others

#

Yes, although then you would probably have the issue with you having to use LocalDateTime that we had earlier

#

However it actually looks like specifing a zone in the DateTimeFormatter might help

#

Yep, if you specify the zoneId you can still use Instants

#

So

        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:MM:SS").withZone(ZoneId.systemDefault());
        System.out.println(formatter.format(Instant.now()));

works as intended

#

Although for some reason it is 42 minutes behind my system clock...
Java be java I guess

#

More or less

#

Given that both are a TemporalAcessor

quiet ice
#

SS are centiseconds

quiet ice
quiet ice
#

When it isn't set it infers the Zone ID from the temporal

#

As such LocalDateTime (which stores the Zone ID) will not crash, but Instant (which does not) will cause it to crash

#

I think the fact that it does not store the zone id causes the performance loss

obsidian drift
#

I'm trying to set the player's resource pack through BungeeCord. This is my packet: https://paste.md-5.net/recawegiwo.java
When the player logs in, I try to send them the packet. Although, they get kicked with this message:

#

I'm sending them the packet like this:

event.getPlayer().unsafe().sendPacket(new ResourcePackPacket("CORRECT_URL",
                        "", true, false));
#

CORRECT_URL is not actually in the code

onyx garden
#

Need help! BiomeLoadEvent insteed of ChunkLoadEvent.

arctic moth
#

how would i get a list of mobs spawned in the evoker's vex thing

#

or vice versa from creaturesawnevent

flint coyote
#

Get which evoker summoned the vexes?

#

Because there's no other natural spawn for vexes besides the evoker iirc

arctic moth
arctic moth
#

not trying to change the spell

#

just giving the vexes effects

flint coyote
#

Not sure if it updates after spawning. Worth a test

quaint mantle
#

Is there a way for minecraft to load your custom entity instead of the entity it's extending?
I think this means adding an entity type which will break things? maybe?

flint coyote
#

wdym?

#

You have to spawn it urself

quaint mantle
#

when extending e.g Blaze with your own class you can summon it

flint coyote
#

Cancel the creaturespawnevent and spawn your own

quaint mantle
#

righty

#

I thought just maybe there would be a different way

#

but ig I'm too used to fabric :]

flint coyote
#

I mean there might be a hacky way to replace the original blaze with your own. But you will probably struggle doing that and should just stick to cancelling the event and then spawning yours

quaint mantle
#

Yeah, I'm gonna store an ID in the PDC of every custom entity and spawn my own

#

thanks!

lost matrix
quaint mantle
#

lol

#

nah

#

I don't wanna replace it

patent fox
#

how can i stop players from adding item to inventory using num keys?

sullen canyon
#

hi does anyone know how to divide an array into six equal parts

young knoll
#

Be careful

#

Spawning an entity in the spawn event will trigger the spawn event

rotund pond
#

(No relation with you this, just asking something when someone ask help without telling his problem)

#

?ask

sterile token
#

?1.8

undone axleBOT
#

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

sterile token
#

Its seems you are using 1.8, arent you?

#

morice i thought he was talking about 1.8 not trolling

#

Yeah for adding data to things via spigot use PDC

#

Plugin Docker Container?

#

or Persistant Data Container*

#

My bad

arctic moth
#

the 10 speed vector is quite slow, and i have seen things go faster in the game. how would i make them go faster?

young knoll
#

Just use a Boolean

#

And flip it before you spawn the replacement

#

Ignore spawn events while the Boolean is set

sterile token
#

So wait EntityRespawnEvent triggers the the EntitySpawnEvent?

#

That is a wird design

#

Indeed

#

He is not also using PDC

young knoll
#

Also I believe that null check is redundant

sterile token
#

Please use PDC!!!!!

#

Dont use name

sterile token
#

Yeah

young knoll
#

Or like I said

#

Boolean

sterile token
#

Read about PDC

#

Doing a boolean is the harcoding

young knoll
#

And?

sterile token
#

Harcoding doesnt make your code look profesionally

quaint mantle
#

yes, pdc isn't changable with commands

sterile token
#

But i dont care meh do what you like more... as it yours code and not mine - hahaha

sterile token
sacred mountain
#

i just spent. a whole hour

sterile token
#

I have use PDC and changed then via command

sacred mountain
#

i didnt close my filereader

#

ffs

sterile token
undone axleBOT
#

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

quaint mantle
#

lol

#

you too fast

sacred mountain
sterile token
#

Oh sorry

#

Nothing

#

Im drug

sacred mountain
#

LMao

#

i literally didnt close both my reader and writer

#

😭

sterile token
#

I mean i really depressed

quaint mantle
sacred mountain
#

fr

sterile token
sterile token
#

Its the worst thing that can happen to someone, imagine being 15y and a 16y girl saying u embarrass me

quaint mantle
#

Yeah okay

#

I get it yes

sterile token
#

I dont wanna be father im just a child

#

And i also didnt want to do it i was drunk and she too

quaint mantle
#

-<

#

I hope ya can figure something out

#

I gotta go sleep or I will be as depressed

sterile token
#

See you mate

sterile token
#

😘

young knoll
#

PDC is 100% modifiable via command

#

Also using a Boolean to ignore certain event calls is not hardcoding

sterile token
#

Yeah i know how

#

Click over them

arctic moth
#

is there an event for when a goat breaks its horn on a wall

sterile token
#

And go to settings

#

I know how to do it but i dont really know how to explain it

#

Close the class

#

And re open it

#

I get bug i mean

golden turret
#

please

#

make the LightingStrike

sterile token
golden turret
#

able to edit if it is only the effect or not

#

(ignore the fact i took a long time to elaborate that)

sterile token
#

Not understand you

golden turret
#

im asking to add that method

young knoll
#

What

#

Am confusion

#

You want to modify the lightning entity to just be client side?

sterile token
young knoll
#

Because that’s not really possible

#

strikeLightningEffect never actually spawns the entity

#

Just sends a packet to players

upper vale
#

no hes talking about the LightningStrike interface lol

#

theres like an isEffect boolean but you cant modify it

#

probably for a good reason but yeah you'll have to create a new lightning strike

upper vale
young knoll
#

Wait there’s a Boolean on the entity though

#

Huh

upper vale
#

oh

#

Β―_(ツ)_/Β―

agile anvil
#

Listen to the Pickup event and cancel it if it's not the player who dropped it self

sterile token
#

What the best option for tracking items from a player?

arctic moth
#

how do i make a goat attack someone? the setTarget method doesn't seem to work

dim bronze
#

Should I be storing my redis resource instance, or should I be storing the redispool and opening a new resource each time I need to publish a message to a channel

arctic moth
#

why is there no setRamCooldown function on goat

#

or setJumpCooldown

dim bronze
sterile token
sterile token
#

I always use it like that

dim bronze
#

figured so, just don't know how expensive it is to call getResource()

sterile token
#

I dont have much experience so i when do know something i just look for it online

dim bronze
#

Yeah their wiki says to store JedisPool and not Jedis because Jedis isn't thread safe. But it will all be running on the same thread so wasn't sure if storing a Jedis instance would have been okay

sterile token
dim bronze
#

Yes, that's what I'm doing

sterile token
#

I have been looking your profile may i ask something?

dim bronze
#

So I thought store 1 Jedis instance in the thread that's subscribed to the channel, and store another for publishing messages

#

and yes, happy for you to dm

fervent gate
#

Anyone have experience using fawe API ? I can't seem to get it into maven...

arctic moth
#

anyone know what is the nbt set function to nms entity

#

there are like 4 with NBTTagCompound params

young knoll
#

Not using remapped πŸ™ƒ

wet breach
#

try it and see

#

one of them is bound to work πŸ˜›

arctic moth
#

is there a remapped nms that isnt obfuscated

undone axleBOT
#

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

dim bronze
fervent gate
#

Yea hold on

dim bronze
#

you're missing a lot of what's the wiki

fervent gate
#

I also pasted this one but it doesn't work

dim bronze
#

make sure you follow the examples fully

sterile token
dim bronze
#

the pom import needs to be in a dependency management block

sterile token
#

can you be more specific

arctic moth
sterile token
#

magnament dependencies is what you use for remote deploys

#

I think

dim bronze
#

Haven't used maven in a long time, haven't used dependency management but if that's what the wiki does and my pom isn't working, then that's what I'm going to do

fervent gate
#

I'm just getting a few "cannot resolve", for the com.fastasyncworldedit for example

sterile token
#

should be inside

<dependencies>
  <dependency>
     // group id here
     // artifact id here
     // version here
     // scope here 
  </dependency>
</dependencies>
sterile token
fervent gate
#

yea, for me that is the case

#

Let me try their exact wiki thing again

sterile token
#

I think their dependency is not on a common repo like maven2/etc

wary topaz
#

Can I have someone message me? I'd rather not put my code in chat.

sterile token
#

Maybe 1 in 30 help you

#

πŸ˜‚

fervent gate
#

The only repo they are importing there is papermc

#
<repositories>
    <repository>
        <id>papermc</id>
        <url>https://repo.papermc.io/repository/maven-public/</url>
    </repository>
</repositories>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.intellectualsites.bom</groupId>
            <artifactId>bom-1.18.x</artifactId>
            <version>1.13</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependency>
  <groupId>com.fastasyncworldedit</groupId>
  <artifactId>FastAsyncWorldEdit-Core</artifactId>
  <scope>provided</scope>
</dependency>

Since this is their importing

arctic moth
wet breach
fervent gate
river oracle
wary topaz
#

I already have someone helping me.

young knoll
#

If it’s still obfuscated then you haven’t done it right

young knoll
#

Well it does work

#

I’ve used it before

arctic moth
#

oh i did an oopsies and forgot the extra import

fervent gate
young knoll
river oracle
river oracle
#

Never done before

vocal cloud
#

99% chance if you need help with code it's not worth stealing loll

#

Also shame on whoever is giving DM help

lost matrix
arctic moth
#

or the things like NBTTagCompound were renamed

lost matrix
river oracle
river oracle
vocal cloud
young knoll
lost matrix
young knoll
#

Don’t remember the mojmap name for it

wet breach
fervent gate
#

Still nothing

river oracle
#

I know I just thought fawe was minecraft exclusive project

lost matrix
#

Thats why we has classes like the BukkitAdapter

lost matrix
young knoll
#

I thought that was just for multi platform

#

Not multi game

torn jewel
#

i have a event registered but yet it doesnt trigger

#

eventhander tag is setup

river oracle
young knoll
#

X to doubt

torn jewel
#

public class PlayerEvents implements Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e){
if (Gigaconomy.dataHandler.playerHasAccount(e.getPlayer()))
{
Gigaconomy.dataHandler.createAccountForPlayer(e.getPlayer());
e.getPlayer().sendMessage(Languages.getString("welcome.message"));
Bukkit.getLogger().info("Has joined");
}
Bukkit.getLogger().info("Has joined1");

}

@EventHandler
public void onTabComplete(TabCompleteEvent e){
    Bukkit.getLogger().info(e.getBuffer());
}

}

getServer().getPluginManager().registerEvents(new BasicEvent(),this);
getServer().getPluginManager().registerEvents(new PlayerEvents(),this);

river oracle
#

No code? Can't help everything you have said so far makes me think it's gon work

#

Ow my eyes

arctic moth
fervent gate
torn jewel
#

how do you do the code block

quaint mantle
#

`

#

before and after

river oracle
undone axleBOT
lost matrix
golden turret
#

pls spigot πŸ™

#

a

river oracle
#

A

golden turret
#

bruh

#

why it is not sending my image

river oracle
#

B is after a mb

golden turret
#

I needed to do that because Spigot dont have api for that 😭

#

finally

mystic sky
#

wow

torn jewel
river oracle
#

Simple

lost matrix
torn jewel
#

there is no message being logged upon join

river oracle
mystic sky
golden turret
young knoll
lost matrix
young knoll
golden turret
#

i just copied the implementation of World#strikeLighting

golden turret
#

im just opening the wiki again to see how to do the request

torn jewel
#

it was updated

young knoll
#

If choco or that other lad doesn’t PR it I’ll PR it

torn jewel
#

i tried hard to figure this out

#

neither event triggers

lost matrix
torn jewel
#

that is the entire onenable block and the entire event class

#

i have double checked with jdGUI

#

unless i got some odd version of spigot which i havent tested for then idk

river oracle
#

As long as you got it from build tools you should be fine πŸ™‚

torn jewel
river oracle
#

Prob doing something weird wrong in the methods your calling

#

Just create an empty listener in a new class and try sending a logger info