#help-development

1 messages Β· Page 46 of 1

undone axleBOT
wet breach
#

Yes, that is a good refreshing start

civic wind
#

I thought I had amended it, hence why I was asking again.

tender shard
#

Please just show your current code

#

thanks

#

okay so you have a command that gives you a backpack, right? and that item should have "I said HES THE GOAT" as lore, right?

#

but it doesn't have this lore - is this correct?

civic wind
#

yes

tender shard
#

okay, that is weird, because the code you sent should actually show that lore

civic wind
#

Yeah...

tender shard
#

sorry to ask this, but have you tried to actually stop your server, install the "new version" of your plugin, and then start it again?

maiden briar
#
private boolean placedCustomStructure;

@EventHandler
    public void onStructureEvent(StructureGrowEvent e)
    {
        if(e.isFromBonemeal() || placedCustomStructure)
            return;

        e.setCancelled(true);

        StructureManager structureManager = Bukkit.getServer().getStructureManager();
        Location location = e.getLocation();
        List<Structure> structures = new ArrayList<>(structureManager.getStructures().values());
        Structure randomStructure = structures.get(new Random().nextInt(structures.size()));

        placedCustomStructure = true;
        randomStructure.place(location, true, StructureRotation.NONE, Mirror.NONE, -1, 1, new Random());
        placedCustomStructure = false;
    }

This let's the server crash with

[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk wait task info below: 
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] 13,22 in 'world:
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Load Task - none
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Save Task - none
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk Holder - non-null
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk Status - minecraft:empty
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk Ticket Status - minecraft:structure_starts
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk Holder Status - null
[15:16:59] [Paper Watchdog Thread/ERROR]: [com.destroystokyo.paper.io.PaperFileIOThread] Chunk Holder Priority - 44
civic wind
#

No, it does update how i'm doijng it but no harm in trying

tender shard
#

please try to actually restart it properly

#

the /reload command can be VERY WEIRD sometimes

civic wind
#

Lol yeah, worked aha

tender shard
#

haha

#

okay

wet breach
#

one day, I will be made a moderator πŸ˜›

floral drum
#

POG

#

I hope so

vocal cloud
heady leaf
#

I don't want to insist, there are many who ask for help and few supporters, when someone has a little time, look #1005824446164127745 πŸ™‚

tender shard
wet breach
#

but that is probably not today

sour wedge
#

Now its shows no border at all on the first player that's joins,

WorldBorder wb = Bukkit.getServer().createWorldBorder();
                                    
wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
wb.setSize(Island.getIslandSize(p));
                
p.setWorldBorder(wb);
tender shard
#

lol

floral drum
#

maybe

tender shard
#

yeah I'm staff myself there lmao

sour wedge
wet breach
tender shard
onyx fjord
#

porn is L

tender shard
#

I just became staff there to ban homophobic jerks

wet breach
#

I just want to be on the spigot staff team so that I can say that I have been both Bukkit and Spigot staff member πŸ˜„

solid jungle
#

Why are we talking in the help channel 0_0

onyx fjord
#

i will vouch for you frost

tender shard
wet breach
#

I don't need vouching, md_5 knows who I am very well πŸ˜›

tender shard
#

I applied for staff on spigot twice but was never accepted

#

But I nag md5 via email like every week so he probably at least knows me by now, lol

wet breach
#

md knows me because I have been following the spigot project for a long time, even when I was a bukkit staff member. In fact, md_5 has helped me on more then one occasion on some things

sour wedge
#

Lets build it again xD

wet breach
#

well depends on the time period

tender shard
#

he's so chill

#

and he's also kinda cute lmao

wet breach
#

there was a period of time I would say where he didn't have such a great attitude towards some, but in grand scheme it made sense

tender shard
#

but choco is cuter

tender shard
#

sometimes you just can't take it anymore lmao

wet breach
#

but he started spigot project while fairly young so I mean a bit of immaturity was bound to get mixed in etc πŸ˜›

onyx fjord
#

how old was he

tender shard
#

yeah sure

tender shard
wet breach
tender shard
#

whut

#

no

#

he was older

#

he is about my age rn

wet breach
tender shard
#

27

#

do you wanna change the actual skin?

maiden briar
tender shard
maiden briar
#

Ok I will wait, ping we ASAP

tender shard
#

oh yeah, I fear that you cannot change the "own player's skin" that easily

wet breach
# tender shard 27

yeah I was almost correct he was older so like 16 or 17 when he started spigot

tender shard
#

the client probably simply doesnt query the server "was my own skin changed?"

tender shard
wet breach
#

you have to resend the playertab packet to everyone

tender shard
#

you said 15, I said 18, but it was actually inbetween lol

wet breach
#

otherwise the easiest way to change player skin is to re-log

tender shard
#

not sure though

wet breach
#

yes, because the clients cache that packet since the player tab packet for a particular player is never sent again until they re-log

tender shard
#

yeah that's what I figured

#

maybe teleporting the player to another world would update the skin

wet breach
#

possible

#

re-spawning the player might also cause it to update too

tender shard
#

anyway, frostalf, where have you been? I haven't seen you here in months

wet breach
#

because we live on two different continents

tender shard
#

I know but I'm usually online at very weird times lol

wet breach
#

indeed, but it hasn't been months since I been here either

#

I was here last week. Friday-Sunday is my day offs and I work at night

tender shard
#

alright, then we just missed each other everytime lol

#

what's your job again? I forgot

wet breach
#

I am a tire technician. I change out tires on semi trucks and trailers as well as dismount and mount them on rims if need be. Most of the time it is super singles I do that with

drowsy helm
#

Would multiple BoundingBox.contains() be less effective than sqrt distance formula?

wet breach
#

I am also the one they come to if they have any questions about a tire

tender shard
#

oh whut. that's some very interesting, kinda specific thing haha

drowsy helm
#

negligible?

tender shard
#

just do it. If you'd ctrl+B into the entity class and then look at the tick() function, you'll see that vanilla does so many useless things, you really don'T have to worry about doing a bit of math yourself

drowsy helm
#

ah sweet

wet breach
tender shard
#

that sounds good. I'm currently trying to become a flight instructor but it's a hell. Like, Everytime I think "okay, 2 months to go and then I'm done", they come around and tell me "Oh but you also need this weird license as well, you know?!"

#

and I'm always like "oh, no, I didnt knew that, lol"

wet breach
#

I am guaranteed 40 hours a week as well

tender shard
#

how many "paid days" of vacation do you get, if I may ask?

wet breach
#

that means even though they have no work for me, I just sit and do nothing πŸ˜›

wet breach
tender shard
#

I once was an intern in some software / coding company

wet breach
#

Yes but I can't just get sent home either otherwise I make no money that day

tender shard
#

and "doing nothing" was way worse than actually doing sth

tender shard
#

isn't that totally much?

wet breach
#

is that a lot or not enough?

#

and I meant to say, 2 hours of PTO a week XD

tender shard
#

in germany, you basically simply get paid per month, and you get about 30-40 days of "paid time off" per year. And on weekends, you don't work anyways

wet breach
#

it comes out to like 96 hours a year if I take no day offs

tender shard
#

so I wonder - if you say 2 days per week, is that "additional" to the "you dont gotta work on weekends" thing anyway? or do you basically "use" those 2 days by not working on weekends, every week?

wet breach
#

but I don't really need day offs unless something comes up. But my schedule is flexible too, there is 3 other days I can swap my shift with

young knoll
#

Isn’t that like 4 days a year

tender shard
#

then it won't change anything

wet breach
tender shard
#

Yes

wet breach
#

here is how flexible my hours are. Lets say I need monday off. I don't actually need to use my PTO for that

#

I could just switch my Monday shift for a Friday shift

tender shard
#

nice

#

but you also have "employment at will" right?

#

so they could, in theory, fire you at any time

wet breach
#

While they could fire me at any time, it doesn't mean there is no risk to them for doing so either

solid jungle
#
Caused by: java.lang.NoSuchMethodError: 'java.lang.String org.bukkit.entity.Player.getClientBrandName()'
    at aioplugin.aioplugin.events.PlayerJoinEvent.onPlayerJoin(PlayerJoinEvent.java:24) ~[?:?]
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:577) ~[?:?]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.1-R0.1-SNAPSHOT.jar:?]
    ... 15 more
``` im getting this error when im doing `String Client = event.getPlayer().getClientBrandName();`
tender shard
solid jungle
#
package aioplugin.aioplugin.events;

import aioplugin.aioplugin.AIOPlugin;
import aioplugin.aioplugin.database.MongoConnect;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import java.util.UUID;

public class PlayerJoinEvent implements Listener {

    @EventHandler
    void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event){

        if(event.getPlayer().hasPlayedBefore()){

            String PlayerName = event.getPlayer().getName();

            UUID uuid = event.getPlayer().getUniqueId();

            String IP = event.getPlayer().getAddress().getAddress().toString().split("/")[1];

            String Client = event.getPlayer().getClientBrandName();

            MongoConnect.NewJoinsData(PlayerName, uuid, IP, Client);

            Bukkit.getLogger().info("Player Has Joined for the First time, Name: " + event.getPlayer().getName() + ", UUID: " + event.getPlayer().getUniqueId() + ", Client: " + event.getPlayer().getClientBrandName());

        }

    }
```this is my playerjoinevent
young knoll
#

Is

#

Is that even a spigot method

dusk flicker
#

no

#

it is not

tender shard
solid jungle
#

Tf why did intellij suggest it bruh

dusk flicker
#

what api are u runnin

tender shard
#

are you using Paper API?

solid jungle
dusk flicker
#

yeah its a paper method

tender shard
#

yeah, that explains it

solid jungle
#

should ask in paper then

tender shard
#

Paper has many more methods than spigot has

solid jungle
#

alright thanks

delicate lynx
#

well you can't use paper API on a spigot server

tender shard
#

So, it will work on PaperMC but it will not work on "plain spigot"

tender shard
wet breach
solid jungle
delicate lynx
#

xd

tender shard
#

because the "client brand" can be easily "faked" anyway

#

there is literally no reason to ever check it

solid jungle
#

Β―_(ツ)_/Β―

#

i saw that method and i decided to use it lol

#

seemed like it might be a bit useful

onyx fjord
#

where does he work

tender shard
#

I'd also love to visit the USA again but I'm too poor to afford the flight haha

wet breach
tender shard
#

it's like 1000€ just for the plane ticket

#

I can't afford that rn

wet breach
#

but the dental insurance through my company costs me $3/month

tender shard
#

wtf

onyx fjord
#

what company

wet breach
#

JB hunt

tender shard
#

3$ per month for dental stuff?!

#

you'd be stupid to not take that

#

3$ per months, that's nothing

wet breach
#

yes you would. Its partial dental insurance for the first year with the company

#

and then its full dental coverage after that

#

the rate doesn't change either

tender shard
#

I have to admit - I haven't seen a dentist in like 4 years now lol

#

I could go there anytime, but I'm just too lazy

wet breach
#

Well the ironic part though is that I didn't seek out the company

#

they found me

tender shard
#

lol

#

how

wet breach
#

I had a profile on indeeds

tender shard
#

aaaah haha

#

in germany, this "indeed" company got a funny ad on TV

wet breach
#

one of their recruiters emailed me. So I was like, why not. And they gave me a hiring bonus too πŸ˜„

tender shard
wet breach
#

lmao

tender shard
#

btw another funny thing: I am now a "supporter" on spigotMC and people always think that I'm staff now

dusk flicker
#

lol

tender shard
#

actually it's just a donor rank

wet breach
#

anyways what is awesome is that since they hired me and put me on night shift. The location I work at, this is the first time they have ever had a tire tech at night. There is only two of us tire techs too. One works in the day time a normal 8 hour day shift monday-friday.

tender shard
wet breach
#

Well I could see how someone might confuse it for staff

#

but, at the same time supporter doesn't actually indicate staff either technically

tender shard
#

yeah, people obviously think "supporter" means "this is someone from whom I get support from"

#

I'll probably suggest to rename this to sth else

wet breach
#

Well, if they logically thought about it, generally such people don't have a title of supporter πŸ˜›

#

they are usually called Customer Support or Tech Support etc

tender shard
#

that is true πŸ˜„

#

but yeah

solid jungle
solid jungle
#

could have been prevented

#

if i went earlier

tender shard
#

yeah I will probably do that soon

solid jungle
eternal oxide
#

yeah, at 5k an implant

rain mason
#

@tender shard just finished making the Clan, you're right, it's so much easier to do stuff lmao

solid jungle
wet breach
tender shard
#

I mean, my teeth do look totally fine

solid jungle
rain mason
#

quick question, is there a way to get the JavaPlugin without always having to specifity it with new Clan(plugin) or new Clan(this)?

solid jungle
#

but the dentist said otherwise

wet breach
#

point being is it is annoying having to brush your teeth when you could just invest into some implants and really never worry about it again

tender shard
#

everyone send teeth pics now haha

#

heres mine haha

solid jungle
wet breach
onyx fjord
#

mine is alright

#

white, the shape is sometimes not correct

#

but its not an issue

solid jungle
#

πŸ˜‚

tender shard
#

my father also has one and it's "working fine" since like 40 years now

wet breach
tender shard
wet breach
#

cavities won't be an issue again

tender shard
#

gold teeth are just awesome

#

they look a bit weird but they just work and never break

wet breach
#

gold teeth are not pure gold

#

they are caps

tender shard
#

yeah ik

wet breach
#

you have to have some good tooth base in order to have a cap

tender shard
#

9 out of 10 dentists recommend...

wet breach
#

which btw

tender shard
#

I wonder what the other dentist recommended instead

wet breach
#

can be a small number depending how many dentists we are talking about

tender shard
#

probably exactly 10

#

lol

wet breach
#

usually its more like 4-5 dentists

tender shard
#

in germany, every TV ad for toothpaste is exactly like this
"9 out of 10 dentists recommened Oral-B Plus Super Extra-White. Why are you not using it yet?!?!?!?"

wet breach
#

yeah its the same in the US

#

however in the US they actually have to state how many dentists they surveyed

tender shard
#

aaaaaand

wet breach
#

but they put it in small print at the bottom

tender shard
#

I also always think: When 9 out of 10 dentists recommend it, its probably shit. Because if this toothpaste would actually be so awesome, then we wouldnt need dentists anymore, and surely they won't tell you to use something that makes them go bankrupt

wise mesa
#

what is the best library to use for json in spigot

#

is gson the recommended option?

#

isn't there one that's included with the server and is it gson?

#

ok i just asked three redundant questions

#

hopefully you can still manage a meaningful answer

dusk flicker
#

Gson

wise mesa
#

ok thanks

#

awesome

glossy scroll
#

Bukkit.getPlayer only works for online players, correct?

tender shard
wet breach
tender shard
#

IKR?!?!

#

I mean

#

erm

#

how to put it into words

#

erm

sour wedge
#

Thank you
It works well now!

tender shard
#

people haven't used any toothpaste for thousands of years. Okay, I gotta admit that they are all dead by now, but that probably was not the reason why they died

wet breach
#

basically toothpaste is just a waste of money except for some special kinds that help with sensitivity for example if you have that kind of problem. But for the most part toothpaste is just a very fancy mouth freshener.

floral drum
tender shard
#

:3

wet breach
sour wedge
#

Sometimes we need help, or 30 hours try & error

tender shard
wet breach
#

however one of the big differences from back then to now though, is that sugar was not a very big thing to consume back then and even they did, the sugar they did consume was mostly natural sugars and not all of this artificial and fake sugar stuff

floral drum
#

fruit and veg is best no cap

#

I love brocolli

#

or frozen vegetables

tender shard
#

true, sugar used be some kind of very expensive thing like 100 years ago

wet breach
#

well not just expensive but only grew in certain parts of the world as well

#

so it wasn't like you just go down to your local mart back then and just buy some lmao. You had to wait for some merchant to bring it in from where ever it mostly grew

sour wedge
#

for somebody thats need it for future her is my code:

Main.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(Main.getInstance(), () -> {
    WorldBorder wb = Bukkit.getServer().createWorldBorder();
                    
    wb.setCenter(new Location(p.getWorld(),(is.chunkX*16)+8,0,(is.chunkZ*16)+8));
    wb.setSize(Island.getIslandSize(p));
                    
    p.setWorldBorder(wb);
}, 20);
undone axleBOT
wet breach
#

probably could have saved you a lot of trouble too using di as opposed a static instance. Not saying static can't be used just there are some technical draw backs to statics most are unaware about

tender shard
#

oh tbh, a static getter is perfectly fine imho

#

that's my opinion, at least ^

wet breach
#

it is pefectly valid to use it, and I am not saying it isn't

sour wedge
#

This works pretty easy for me at this moment

wet breach
#

however there is some behind the scenes things that happen in java in regards to statics

#

that most generally never get taught or bother to research

#

they do have some drawbacks that are not very straight forward obvious to see

#

for instance, caching problems

sour wedge
#

ahh yeah, they saying always there are multiple choices to get something to work

wet breach
#

it is always nice to have choices, just it would be nice if developers bothered to take the time to understand why there is different choices and what the actual differences are between them

sour wedge
#

what can happend with this static instance? if it is my own server

wet breach
#

I don't know exactly how all of your code looks

#

but using static like above could prevent another plugin from working with your plugin

#

for example

#

or just make it more difficult

sour wedge
#

Yes im aware of that

#

im using less plugins than one big own writen plugin

#

thats hold Survival and Skyblock

wet breach
#

the amount of plugins is generally not an issue

#

it just depends on the quality of the plugins more so then how many

#

Java is capable of handling thousands of class files just fine

sour wedge
#

true, but unlikly bungeebridge will abuse my plugin xD

#

but i get your point

wet breach
#

java has come a long way

#

I remember the old days where java would crash your computer by eating up all the resources

#

and needing to force close them java apps before that happened

#

but then again, this is also in the time where we didn't have systems above 2GB and 4GB

sour wedge
#

true thats why you can read your heapdump to searching leaks

#

i use 128GB of memory spread on 8 bungee servers

tardy delta
#

is there any chance that there's a better way of validating an item is a hoe than checking if the material name ends with "_HOE" or having some enumset with all hoe types? i thought the Tag<> interface was creating to handle such cases but it only contains a Tag.ITEMS_STONE_TOOL_MATERIALS

sour wedge
#

a Xeon(R) E5645 2.40GHz 12 Core

#

Thats will handle my bungee network for some time till grow above 500+ online i think

wet breach
#

I could see it being expanded for most custom stuff but I also really don't see that happening as it can become a mess quite easily and quickly lol

tardy delta
#

hmm ye reason why not to do a pr

quaint mantle
#

hello

#

for my plugin

tardy delta
#

not going to click on that lol

quaint mantle
#

loll

tardy delta
#

?services ig

undone axleBOT
wet breach
#

?paste

undone axleBOT
tardy delta
#

so the best way to check if a material is a specific tool would be to place all the materials in an enumlist 🀭

wet breach
#

which there currently is

#

unless that was removed

#

could be a registry now

#

in which case just use the namespacedkey I think it is?

ivory sleet
tardy delta
#

mwoa probably wont use nms

ivory sleet
#

Mwoaayea

tardy delta
#

doesnt seem useful

peak depot
#

who would I go about doing a replay system?

wet breach
#

who?

tardy delta
#

?services ig

undone axleBOT
tardy delta
#

lmfao

wet breach
peak depot
tardy delta
#

whos joe

peak depot
#

joe grandma

wet breach
#

well their question didn't quite make sense. I don't know if they were asking in where to go or if they were wanting a specific person to go to

quaint mantle
#

they probably meant "how"

wet breach
#

that makes too much sense for it to be correct

tardy delta
#

joe mama will beat you to death

wise mesa
#

with special source maven should i use the -remapped.jar or the -remapped-obf.jar

vocal cloud
#

Should be a regular jar without the extra stuff you can use

wise mesa
#

oh the regular jar works too?

vocal cloud
#

Should

wise mesa
#

i seeeeee

#

so do they all work except original-

#

but ill just use the one named regularly

wet breach
#

the two jars you mentioned above serve two different purposes

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

peak depot
#

why is a jungle button returning Material air on inv click

cold tartan
#

is there a way I can pass any persistentdatatype to a method?

#

like ```java
doStuff(PersistentDataType.STRING, "hello");
doStuff(PersistentDataType.INTEGER, 23);

#

without method overloading because that would sort of break the whole point of passing the PersistentDataType to the method

tardy delta
#

<T> void smth(PersistentDataType<T, T> type)

#

or PersistentDataType<?, ?> if you want to support custom ones too

glossy venture
#

material tags

cold tartan
# tardy delta `<T> void smth(PersistentDataType<T, T> type)`

so something like this?

public static <T> T getKeyValue(String keyStr, Player player, PersistentDataType<T, T> dataType, T defaultVal) throws Exception {
    PersistentDataContainer pdc = player.getPersistentDataContainer();
    NamespacedKey key = NamespacedKeyManager.getKey(keyStr);
    if (!pdc.has(key))
        pdc.set(key, dataType, defaultVal);
    return pdc.get(key, dataType);
}
glossy venture
#

or does that not apply to items

#

org.bukkit.tag i think

ivory sleet
#

Yes

#

But there isnt one for hoes specifically iirc

#

Just whats mineable with hoes

tardy delta
#

πŸ’€

chrome beacon
#

Use a hash set instead for better compatability with future versions

tardy delta
#

i will edit it in the future

#

i wont jk

#

does enumset compares elements with ==?

ivory sleet
#

nope

#

Ordinals iirc

eternal night
#

enum set is just a glorified bitset

#

the ordinal value is the index of the bit to check

ivory sleet
#

^

worldly ingot
#

It's great. Once you exceed 64 bits though it gets a bit clumbsy

eternal night
#

either a long or long[] depending on the enum size

#

yea

tardy delta
#

hmm

ivory sleet
#

Well you can use an identity hash set otherwise altho thats not gonna be too different from a normal hash set

worldly ingot
#

You're fine to use an EnumSet for materials so long as you're aware that your plugin might not be compatible with a future version

#

Which isn't the worst thing tbqh

tardy delta
#

mye

worldly ingot
#

Just means you have to prepare a trivially easy update

eternal night
#

or just bet that md_5 never merges that

tardy delta
#

doing my stuff like this now πŸ’€

eternal night
#

and live a happy life

worldly ingot
#

It's pretty ready to go

#

Could be merged at any point

glossy venture
worldly ingot
#

(on a major ,that is)

eternal night
#

hasn't that PR been "pretty read to go" since like 1.17 xD

worldly ingot
#

Mhmm

zenith saddle
#

Whate is the best way to freze someone for a second?

river oracle
#

Player move event cancel for a second

worldly ingot
#

player.freeze()

#

Nah I'm just kidding with ya. Y2K's right lol

#

Add the Player in a Set, if they're in the Set, cancel the move event

river oracle
tardy delta
#

how dare you to use a set of players :bonk:

#

still no nitro 😒

worldly ingot
#

A Set<Player> is fine, especially if you're holding them only for a second lol

upper vale
desert frigate
#

Hah lol I have no clue, but I fixed it already

ivory sleet
eternal night
worldly ingot
#

I'd argue the rotating arm is far funnier and cooler

tardy delta
#

my man does it even worser than me aaaa

#

me trying to find good yt coding stuff :(

sacred mountain
#

could someone give me help on how to convert this into an abstract class or something that i can create classes with?
e.g.

public class SomeBlock extends DynamicBlock {

}```
and then it will have override methods and stuff
river oracle
tardy delta
#

ye its pretty bad

river oracle
#

Think of them like interfaceswith some implementation already

worldly ingot
#

Any non-final method you declare can be overridden

#

If you require that a method be overridden, you can declare it abstract and not give it a body

#
public abstract class MyAbstractClass {

    public abstract void mustOverride();

    public void canBeOverridden() { }

    public final void cannotBeOverridden() { }

}```
sacred mountain
#

hm ok, its just i still want it to be instantiated e.g.new DynamicBlock(blah), just also able to create a class that will inherit all those values too

river oracle
#

I highly reccomwnd not using abstract to enforce constructor arguments these can be enforced via getters and setters in an interface

worldly ingot
#

Your methods can just have empty bodies if you don't want them to do anything

sacred mountain
#

mk

worldly ingot
#

Again, anything non-final can be overridden πŸ™‚

tardy delta
sacred mountain
worldly ingot
tardy delta
#

now only need to handle the correct tools

#

no no no

azure dirge
#

excuse me, but can i ask how to get package version for 1.17+ ?
my old code only correct for 1.16 and below

tardy delta
#

lets do a quick push to gh rn

worldly ingot
#

The package version? v1_17_R1

azure dirge
sacred mountain
worldly ingot
worldly ingot
#

Keep in mind they're mutable

#

Nothing stopping me from doing yourBlock.getLocation().add(0, 1, 0); right now

sacred mountain
#

oh right ok

#

and that would modify the value?

#

thanks ill change that

worldly ingot
#

Yeah it would modify the internal Location

#

Just a call to clone() when you return them is all you need

#

return location.clone();

tardy delta
#

uhh its only worth to override equals and hashcode when that class is either used as a key type in a collection or as an entry?

#

ah me doing stupid stuff again then

ivory sleet
#

myes

worldly ingot
#

Should definitely override hashCode() and equals() in that class too

#

You can just hash/equals the x/y/z coordinates

sacred mountain
river oracle
#

I never override hash code because I have no clue what it is

worldly ingot
#

It's what uniquely identifies your object in a hash-based collection

river oracle
#

Probably should look into thag

worldly ingot
#

Any time you override equals(), you should be overriding hashCode() too

ivory sleet
#

@tardy delta hashCode is for hash based collections like HashBasedTable, HashMap, HashSet WeakHashMap etc

#

equals can be useful outside tho

river oracle
sacred mountain
#

with the other values btw, integers won't get changed internally right? or do i need to clone everything

worldly ingot
#

For hash codes there's generally a pattern for it, yeah. hash += prime number * hash of value

ivory sleet
#

Tho yea whenever you override one of em it goes without saying the other one is smart to override

worldly ingot
#
public int hashCode() {
    int hash = 31;
    hash += 31 * Integer.hashCode(x);
    hash += 31 * Integer.hashCode(y);
    hash += 31 * Integer.hashCode(z);
    return hash;
}```
river oracle
#

How do you hash the code or your custom object though πŸ€” or is Integer.hashCode take in an object param

tardy delta
#

Objects.hashcode(x, y, z) :(

azure dirge
worldly ingot
#

Oh my lol

glossy venture
tardy delta
#

ye probably

balmy valve
#

Anyone know good libraries or API’s for custom mob AI’s

worldly ingot
#

Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; should get you the version you need

worldly ingot
#

If you're hashing a lot of objects, then yeah that's fine

ivory sleet
#

Altho arguably has a steep learning curve

balmy valve
river oracle
#

Mojang mappings make it much more accessible imo

river oracle
worldly ingot
#

Also, my implementation was really bad. You should be multiplying the existing hash by the prime then adding the hash value lol

public int hashCode() {
    int hash = 7;
    hash = hash * 31 + Integer.hashCode(x);
    hash = hash * 31 + Integer.hashCode(y);
    hash = hash * 31 + Integer.hashCode(z);
    return hash;
}```
#

That one's a lot better

balmy valve
river oracle
balmy valve
glossy venture
#

otherwise it would be so easy

sacred mountain
#

ok now my head hurts, this is probably one of the most fundamental things but
if i do

x = new SomeObject();
y = new SomeObject();
x = y;
y = new SomeObject();```
does x change or no?
river oracle
#

Yes

#

Your setting x to y

sacred mountain
#

right ok good so that doesnt change

#

ever

river oracle
#

Huh

sacred mountain
#

if its not an object

#

then it doesnt right

river oracle
#

I'm confused

ivory sleet
#

Anyway for beginners nms ai is just a queue with goals where the queue can have a max of x goals running at the same time, we have two of these queues, one for choosing the target (to attack for instance), and one for choosing physical actions such as movement or direction to look at. To make our entity move we use goal navigators. Look at some of the entities to enhance the understanding of how it works. But yeah thats that, then we have villagers but they’re a bit more sophisticated and intricate with memory modules and brains.

sacred mountain
#

as in after i set x to y

#

if i modify y afterward

#

does x change

worldly ingot
#
x = new SomeObject();
y = new SomeObject(); // This is x
x = y;
y = new SomeObject(); // This is y```
sacred mountain
#

are they literally the same object now

#

or a clone

ivory sleet
worldly ingot
#

Then you re-assigned y to a new instance again

sacred mountain
#

i thought they were only the same one the line x=y

#

because beforehand theyre both seperate instances right

worldly ingot
#

Correct

sacred mountain
#

up until that point as in?

worldly ingot
#

Heh, poor phrasing on my part I guess

ancient plank
#

dog on the mind

sacred mountain
#

lol

worldly ingot
#
x = new SomeObject(); // Different
y = new SomeObject(); // Different
x = y; // Same
y = new SomeObject(); // Different```
sacred mountain
#

πŸ‘

#

okay

wet breach
#

Well technically in your example x and y are different

#

even when you assigned y to x, what did become the same is the data

worldly ingot
#

Lol don't confuse him!

wet breach
#

lol

sacred mountain
#

yeah im just gonna stick with the

tardy delta
#

the pointer refers to the same thing lmao

sacred mountain
#

what i already know

#

lol

wet breach
#

in this case java would treat x and y as two different objects but with same values

tardy delta
#

let me try to be smart πŸ™„

wet breach
#

at some later point if a GC happens, yes the pointers for both could become the same if it doesn't change

ivory sleet
#

everytime
variable = new Type
that variable gets a new object entirely meaning no other variable usually points to it unless you use
otherVariable = variable (somewhere later)
:>

tardy delta
#

πŸ˜‚

wet breach
#

It really just depends how it starts out, but yeah you can have two objects with same values. And the pointers never being the same for the objects all because in the beginning you started them both out as two separate objects.

sacred mountain
#

ive got 0 clue about pointers

wet breach
#

now if you started with x being one object, then cloned x for y, then they will be both point to same memory space until you assign y its own object

sacred mountain
#

should i know this D:

wet breach
#

not until some time later when you got a large project and some optimization techniques are needed

#

but for the time being you really don't need to worry about it

ivory sleet
tardy delta
#

i read some book about oses in java and i thought i was smart πŸ€“πŸ€“

sacred mountain
#

you clearly didnt πŸ‘€

wet breach
#

Java OS's used to exist when our technology was not good enough

ivory sleet
#

reference is iirc favored to pointer as terminology when it comes to Java

tardy delta
#

hehe old shit

glossy venture
earnest forum
#

its a memory address

#

isnt it?

ivory sleet
#

Well cpp pointers are pretty much

wet breach
#

pointer literally refers to the exact memory address

ivory sleet
#

Or well they point to a place in memory

glossy venture
heady leaf
ivory sleet
#

But java has sth else because the variables are to some extent pointers, but also the objects themselves

glossy venture
#

an ID which is probably mapped to a memory address

wet breach
glossy venture
#

weird

#

the fields take 64 bits

#

i tihnk

#

so how would it know

wet breach
#

depends on the object type

glossy venture
#

primitives arent ofc

#

but any object

civic wind
#

So i'm trying to add itemstack to a players inventory on command, whilst checking for permission & also a second method for target player. No errors in console but it's not returning the command or doing anything since I added the "Target" method... I think it's how i've set it out or the returning true;?

wet breach
#

the exception being String

#

which is both a primitive and not a primitive

sacred mountain
#

why is string not primitive

glossy venture
#

java doesnt store any objects on the stack

#

it stores references

#

and any variable is on the stack

wet breach
glossy venture
#

which is why you can assign any object to an Object parameter

ivory sleet
tardy delta
#

cuz string being a primitive would mean its a fixed size

desert frigate
#

is it possible to test if a block is solid? like cobbble stone and not water?

ivory sleet
#

Yeah and also object orientability

tardy delta
#

i mean if you have a string with a length of 2 and one with a length of 72262626 chars that would be wasted space

ivory sleet
#

Altho jvm and jit heavily optimized strings

civic wind
#

Any help?..

wet breach
wet breach
glossy venture
#

but then it has to move them to the heap anyways

#

after the block is done

tardy delta
#

stack variables have a fixed size right? so either primitives or pointers?

sacred mountain
#

so a string is just a concatenated char array at memory level?

wet breach
#

but it is a way you could think of strings

ivory sleet
#

Yeah well all objects in principle lives on the heap

desert frigate
ivory sleet
#

The stack just stores a reference to it iirc

tardy delta
#

^^

glossy venture
#

every single object is stored in the heap
an object variable or field is just a reference to an object

ivory sleet
#

When you create local variables and what not

civic wind
#

So i'm trying to add itemstack to a players inventory on command, whilst checking for permission & also a second method for target player. No errors in console but it's not returning the command or doing anything since I added the "Target" method... I think it's how i've set it out or the returning true;?

wet breach
ivory sleet
#

True

glossy venture
#

at least not on the stack

#

not locally

wet breach
#

Some objects do indeed live on the stack

glossy venture
#

like

tardy delta
#

πŸ‘€

sacred mountain
#

so you're running it if they dont have permission

glossy venture
#

otherwise you wouldnt be able to assign

Object o1 = new A();
Object o2 = new B();
Object o3 = new C();
``` if A, B and C are different sizes
ivory sleet
#

Primitives can be on stack only iirc

civic wind
#

Ignore that bit i fixed that

glossy venture
#

like int ptr

ivory sleet
#

Ya

tardy delta
#

nullpointer hehehehe

civic wind
wet breach
ivory sleet
#

Oh yeah good point

last swift
#

Via the EntityDamageByEntityEvent, is it possible to get who shot the arrow that damaged a player?

tardy delta
#

(void*) 0 😒

sacred mountain
#

i mgiht be wrong

civic wind
#

What?

#

I've used this method loads, for commands like heal. It usually works

sacred mountain
#

oh ok

civic wind
#

It's still giving me the itemstack

#

but im typing /sword tt - it should return with the message saying thats not a player

kind hatch
sacred mountain
#

not sender.

#

wont make a difference but idk

heady leaf
sacred mountain
#

i cant find a problem

wet breach
ivory sleet
#

Well constants are inlined now when I think of it

wet breach
#

Java's documentation hasn't really been updated in like forever well the specs anyways

#

occasionally something might get updated lol

glossy venture
sacred mountain
#

does bukkit wait for the runTaskLater to finish before running subsequent code

sacred mountain
#

if its in a method

ivory sleet
#

But if you declare code after the runTaskLater then no

heady leaf
ivory sleet
#

runTaskLater(() -> execute());
other();

#

Here other() wouldnt wait

civic wind
glossy venture
#

might be able to find something about the stack here

ivory sleet
#

Yeah well local variables, primitives and method invocations are the only things that are stored on the stack afaik

ornate mantle
#

this isnt a spigot question but what algorithm begins with $SHA$

sacred mountain
#

so the code will never reach that point

#

just read it to yourself and follow it

#

thats how i do debugging sometimes

glossy venture
wet breach
sacred mountain
#

then i default to just Sysout everyhting

#

pro debugger

glossy venture
wet breach
#

For the most part that is how everything works, it isn't until you get into the more intricate parts where you encounter the exception rules

#

like statics for instance

glossy venture
#

for the "class file stack frame"

wet breach
#

anytime a class object is created or a class is accessed other then using reflection, it will create a stack frame for entry method

#

I might have to start making tutorials or lesson plans for those wanting to learn the intricacies of the JVM

ivory sleet
#

There are some technical stuff that might alter when user mode / virtual threads get implemented since they can switch underlying thread they get executed on when suspended and re continued

wet breach
#

something to consider in regards to arrays or array type collections. If you use an unequal sized array, it is more optimal memory wise then one that is say perfectly equal

#

a lot of people don't think about this

glossy venture
#

and do you mean by entry method the instance initializer?

wet breach
# glossy venture entry method or every method?

technically every method gets a stack frame, they just don't get created until the method is called. creating a class object calls the classes entry method automatically or when you access it via static means.

glossy venture
#

the constructor is a separate method call right

ivory sleet
#

Yes

#

They’re just methods at the end of the day

wet breach
#

the above exception is when using reflection

#

as you can bypass the initialization process with reflection

ivory sleet
#

Yeah which well is just a direct call to unsafe, or used to be that iirc

glossy venture
#

and other data too

#

debug

#

says the jvm

#

spec

glossy venture
#

the initializer?

wet breach
daring whale
#

any idea on how do i fix this

#

oh yea

ivory sleet
#

Paste it

daring whale
#

pastebin

tardy delta
#

?paste

undone axleBOT
ivory sleet
#

Yaaa

wet breach
#

?paste

undone axleBOT
glossy venture
#

so the instance initializer is called the entry method?

tardy delta
#

bae

glossy venture
#

officially

daring whale
#

SO this is a open source premium plugin,

ivory sleet
#

Yours?

daring whale
#

the plugin only works on 1.8 so i cannot test it on the latest versions

#

not really

#

its open source

#

so i compiled it

ivory sleet
#

Do you know anything about Java?

daring whale
#

Not much

#

all i know its a text util error

ivory sleet
#

Hmm, might wanna just contact the dev to fix it then, or ask someone to fix it with

#

?services

undone axleBOT
wet breach
# glossy venture so the instance initializer is called the entry method?

Well, in programming there is always an entry method, this is referred to the very first method that will be encountered regardless of what happens. I just use this term to refer to the constructors in classes because well, it is the first thing that will happen other then what is initialized at the top of the class outside of the constructor which typically don't do anything themselves.

glossy venture
#

oh alright

#

but the constructor is a separate method call

#

and not related to allocating and initializing the instance

#

although it is called <init> in the stacktrace

#

which is confusing

daring whale
#

account with at least 20 posts

#

Ah well

#

thats out the window

#

my account is old but i dont have 20 posts for sure

#

or do reviews count as posts

wet breach
glossy venture
#

yeah, but i think you can just allocate and call the instance initializer

class A {
   {
       // this thing
   }
}

using reflection or unsafe or smth

#

code block fail

#

the thing relating it is the new keyword

wet breach
#

well it depends on how the class is setup

#

some classes without reflection, the constructor will always get called

#

anyways, for the most part you really don't have to worry too much about the stack memory

#

unless you just have a crap ton of statics and object initializations at the top to exceed the 1mb default size XD

#

or primitives

amber vale
#

(I'm damaging the mob for 845659861 damage and he stays as a red boy and goes up and down)

flint coyote
#

probably an overflow so he dies but then again has positive hp again. Just a wild estimation

amber vale
#

I figured out I could just remove the entity

desert frigate
#

Would it be possible to make a fishing rod get thrown?

#

like a normal player fishing

wary harness
#

hey anyone know how to register aliases

#

to be tab compatible

#

I know hot to register new aliases

#

for main part of command

#

but you can't tab complete them

#

so for example /potato will work

#

but not tab complite

carmine nacelle
#

What is everyones favorite idea theme

#

I have material icons rn but for syntax highlighting and stuff

tardy delta
#

one dark vivid

carmine nacelle
#

woah

dim bronze
carmine nacelle
#

that might be a little TOO vivid lol

#

almost hurts my eyes

dim bronze
#

have used gruvbox in the past

lost matrix
#

I like the default dracula one

sage dragon
azure dirge
dim bronze
# wary harness

can you not just add command aliases through the Command object spigot gives you?

#

getServer().getPluginCommand("command).setAliases(...)?

tardy delta
#

why not just putting it in the plugin.yml

dim bronze
#

I assume it needs to be done programatically for some reason

#

otherwise of course just add them to the plugin.yml

azure dirge
wary harness
dim bronze
#

for subcommands, you'd need to handle this in the tabcompleter as normal?

ebon stratus
#

so im using mojang mappings and the remapped jar to spigot sometimes still gives errors, for example: java.lang.NoSuchMethodError: 'net.minecraft.network.chat.IChatBaseComponent net.minecraft.world.item.ItemStack.G()', should i update the specialsource somehow or?

dim bronze
ebon stratus
#

its working, for most stuff, only some methods / fields that dont work

wary harness
#

if you didn't understand my aliases get registered but you are not able to /tab them

dim bronze
#

you mean your command aliases now right? I wasn't sure if you were talking about subcommands or that sort of thing

azure dirge
dim bronze
ebon stratus
#

oh yeah

dim bronze
#

not sure how much of NMS gets changed between minor versions

crimson scarab
#

is it possible to make all surfaces

#

glide like ice

dim bronze
#

but I guess that would account for only some of methods being erroneous

dim bronze
#

and the server just agrees that that's the way they expect the client to move across ice

crimson scarab
#

so packets?

dim bronze
#

don't know much about packet manipulation for that sort of stuff but it should be possible if you can fake the client into thinking its on ice whilst rendering another block

lost matrix
#

If the client thinks he is on ice then it will render ice...

dim bronze
#

thats what I mean

#

I didn't think it would be possible

desert frigate
# lost matrix Not easily

I found js Entity hook = player.getWorld().spawn(player.getEyeLocation(), Fish.class); hook.setVelocity(new Vector(player.getDirection()).multiply(2)); but idk if it works

wise mesa
#

ok so part of my plugin requires downloading the client jar from mojang so I thought i would use the api to get the client jar link for the current version. i started with this test that just downloads the 1.19.1 version.json but I'm having issues

#

here's my code

#
        // Stream from the url
        getLogger().info("Streaming from url...");
        try (InputStream is = new URL("https://piston-meta.mojang.com/v1/packages/92e6f1eba1748a43b8e215d0859a42bce4f999d2/1.19.json").openStream()) {
            //System.out.println("Making buffered reader...");
            //BufferedReader rd = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8));
            //System.out.println("Reading from file...");

            //int readByte;
            //while ((readByte = rd.read()) != 1) {
            //sb.append((char) readByte);
            //}

            getLogger().info("Making json object");

            JsonObject json = JsonParser.parseReader(new InputStreamReader(is, StandardCharsets.UTF_8)).getAsJsonObject();

            getLogger().info(json.getAsJsonObject().getAsJsonObject("downloads").getAsJsonObject("client").getAsJsonPrimitive("client").getAsString());
        } catch (IOException e) {
            e.printStackTrace();
        }
dim bronze
#

actually

#

with resource packs there is a way of changing the scaling of an item in a item frame to a full block

#

but that would probably be glitchy and laggy

wise mesa
#

so this is the error im getting

#

maybe i can copy it

#
[10:46:33 INFO]: [MCPlanes] Enabling MCPlanes v0.0.0
[10:46:33 INFO]: [MCPlanes] Streaming from url...
[10:46:34 INFO]: [MCPlanes] Making json object
[10:46:34 ERROR]: Error occurred while enabling MCPlanes v0.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonPrimitive.getAsString()" because the return value of "com.google.gson.JsonObject.getAsJsonPrimitive(String)" is null
        at co.tantleffbeef.mcplanes.Plugin.onEnable(Plugin.java:76) ~[mcplanes-1.0-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-81]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-81]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:634) ~[paper-1.19.jar:git-Paper-81]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:420) ~[paper-1.19.jar:git-Paper-81]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.jar:git-Paper-81]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1122) ~[paper-1.19.jar:git-Paper-81]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303) ~[paper-1.19.jar:git-Paper-81]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[10:46:34 INFO]: [MCPlanes] Disabling MCPlanes v0.0.0
dim bronze
#

?paste

undone axleBOT
wise mesa
#

so basically for some reason getasjasonprimitive is returning null

#

ooh yea

lost wolf
#

Player.getLocation().getYaw() returns the rotation of the player's head
Is there a way to get the rotation of a player's body?

wise mesa
lost matrix
wise mesa
#

right but the json file im trying to stream from the internet does have that path

#

so im just wondering where I'm going wrong ehre

opal juniper
#

I need to listen for any block change. is there a way to listen for like block event or something

wise mesa
#

ooh maybe ill try loading the json file from my own machine first

#

alright ill let you guys know how that goes

crimson scarab
#

is it possible to simulate the ice effect whats so ever

#

or nah

dim bronze
#

@crimson scarab I have an idea but I'll get a demo working first

#

because it's hard to explain

#

and I'm not wasting my time explaining if it doesn't work

lost matrix
dim bronze
#

but it requires a texture pack

#

and no, the texture pack doesn't just change the texture of ice

#

I mean I say it works

#

it's really less than ideal

supple elk
#

Are there better ways to make sequences like this rather than using a runnable and switch statement?

#

that would be a smart idea

#

actually I'm not sure I could do that

dim bronze
#

actually, in this switch, all that needs to be determined is the title message

#

and then only play the sound if your switch expression >= 140

opal juniper
fervent basin
#

Hey, I can't configure the TAB plugin to show the town names from the Towny plugin, can anyone help?

dusk flicker
#

no

#

stop asking in every channel

#

and be patient

fervent basin
#

shut up fucking dog i didn't asked you

dusk flicker
#

lmao

#

you asked this channel, which I am in, so you did indeed ask me

wet breach
fervent basin
#

your grandma fell off balcony

dusk flicker
#

thats nice

#

you act like you are like, 8

fervent basin
#

you do mad kid

round finch
dusk flicker
#

your spelling also reflects it

round finch
#

DramaAlert

quaint mantle
#

So basically there's my friend who changed some code in my plugin and i dont know how to fix it. Basically the scoreboard, commands, and everything loads to him

#

can someone help?

worldly ingot
#

Knock it off. The question should be (and still is?) in #help-server. Wait patiently for an answer. If nobody answers after a while, it's likely no one has one

#

if it was bumped up because of other chatter, you can always bump it (politely) or create a thread

delicate lynx
quaint mantle
#

Ok lemme explain

#

In my plugin there's a bunch of commands, events and scoreboard. In the PlayerCacheHandler he coded it so it loads the scoreboard only for him

#

wait lemme send the code so its better

ocean ice
#

im trying to make a custom crafting table how can i check if a List<Material> matches a .json crafting recipe file in the "pattern" sections or is it even possible

{
  "type": "minecraft:crafting_shaped",
  "pattern": [
    "###",
    "# #",
    "###"
  ],
  "key": {
    "#": {
      "tag": "minecraft:planks"
    }
  },
  "result": {
    "item": "minecraft:chest"
  }
}
quaint mantle
#
    private void onPlayerJoin(final PlayerJoinEvent event) {

        if (event.getPlayer().getName().equals("TheRealYasuo")) {

            final Player player = event.getPlayer();
            final Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
            player.setScoreboard(board);

            final PlayerCache playerCache = new PlayerCache(new Board(board), player);

            playerData.put(player, playerCache);

            NameTag.setNameTag(player, ChatColor.GRAY + "[1] " + ChatColor.GREEN + "" + ChatColor.BOLD, ChatColor.RED + "" + ChatColor.BOLD + " IS TESTING!", playerCache);
            NameTag.displayNameTagsToYou(player, playerData);

            playerCache.updateLevelBar();

            player.teleport(spawnLocation);
        }
    }
dim bronze
#

πŸ‘€ someone who uses final 🎊

kind hatch
quaint mantle
#

Hello, So recently I just decided to start using spigot and i was expirementing with something, I am using kotlin and trying to spawn a tnt with a customname that has colors, and now it just wont spawn, how would I use colors and fix the issue?

val tnt : TNTPrimed =  e.player.world.spawnEntity(e.player.location, EntityType.PRIMED_TNT) as TNTPrimed
            tnt.customName = Color.RED + "a"
            tnt.isCustomNameVisible = true
#

thats what im saying

#

im a begginer and i dont know how to change it

kind hatch
#

Just remove that first if statement,

quaint mantle
dim bronze
kind hatch
quaint mantle
#
    private void onPlayerJoin(final PlayerJoinEvent event) {

            final Player player = event.getPlayer();
            final Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
            player.setScoreboard(board);

            final PlayerCache playerCache = new PlayerCache(new Board(board), player);

            playerData.put(player, playerCache);

            NameTag.setNameTag(player, ChatColor.GRAY + "[1] " + ChatColor.GREEN + "" + ChatColor.BOLD, ChatColor.RED + "" + ChatColor.BOLD + " IS TESTING!", playerCache);
            NameTag.displayNameTagsToYou(player, playerData);

            playerCache.updateLevelBar();

            player.teleport(spawnLocation);
        }
#

like that?

kind hatch
#

Yes, like that.

ocean ice
quaint mantle
#

and one question

quaint mantle
#

how do i change the syntax highlighting code in discord

#

btw

#

use ``

#

but with 3 `

#

and then the language

#

like ```kt

#

or

kind hatch
quaint mantle
#

yeah

#

ok thanks <33

dim bronze
quaint mantle
#

all other people are helping somebody else

kind hatch
#

What's the problem?

ocean ice
ornate patio
#

Hello I would like to know what is the format to put on mysql I would like to retrieve all items with this line [Lorg.bukkit.inventory.ItemStack;@7a80ba30 in a setContents pls ?

daring lark
#
        at org.bukkit.plugin.java.JavaPlugin.saveResource(JavaPlugin.java:193) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.saveDefaultConfig(JavaPlugin.java:180) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
        at me.placek.cakerpg.CakeRPG.onEnable(CakeRPG.java:32) ~[CakeRPG.jar:?]```
#
    public void onEnable() {
        plugin = this;
        this.saveDefaultConfig();
        playerMenuUtilityManager = new PlayerMenuUtilityManager();
        rpg = new Rpg();
        restoreData();
        setCommands();
        setListeners();
        rpg.getWorldsManager().createWorlds(rpg);
    }```
kind hatch
# quaint mantle a

I'm not sure if PrimedTNT can even have a custom name. I know you can spawn holograms above it, but I'm not 100% sure if they can have a custom name.

daring lark
#

did anyone know how could i export config.yml together with jar file?

buoyant viper
#

well do u have config.yml in the jar?

quaint mantle
daring lark
#

i have that in src folder in my project

azure hawk
#

Hello Guys, i have a question...
Heres the code: https://paste.md-5.net/ocusiyifug.cs
Is it possbile so the messages are like "Acacia Planks" like with the pickup event but when i craft acacia wood e.g. to planks i get "WOOD" in chat and all is toUpperCase and with "_". Do you guys have any ideas how i can fix this?
Thx ^^

quaint mantle
#

but even if it wasnt a primedtnt how would I do it

dim bronze
buoyant viper
#

what IDE and/or build system (maven/gradle/ide)

quaint mantle
kind hatch
#

Oh, well if it supports it, you need to run it through ChatColor#translateAlternateColorCodes()

daring lark
buoyant viper
#

i think u need to put it in resources folder

dim bronze
#

kotlin doesn't like implicitly calling .toString() on things like java does

buoyant viper
#

src/main/resources

dim bronze
#

so you either have to manually do
ChatColor.RED.toString() + "a"
or ${ChatColor.RED}a

quaint mantle
#

thanks

#

damnit

daring lark
quaint mantle
#

didnt work

dim bronze
#

are you sure tnt can have custom name?

azure hawk
#

bruh

kind hatch
azure hawk
#

that obvius

azure hawk
#

not my problem

#

lol

dim bronze
kind hatch
#

Ah, I don't use Kotlin so I didn't know. πŸ˜› Weird that it doesn't do that automatically.

quaint mantle
#

well i specifically said I use kotlin in the help message lmao

#

kotlin is nice tho

#

yall should look forward to it

#

very simple

dim bronze
#

is it possible that the PrimedTNT is detonating before you can see it? Maybe you need to set the fuse ticks?

peak depot
#

its there a easy way to do an inv update check?

kind hatch
#

Well the learnjava help links are some of the better places to learn. I learned the most from the Oracle book itself.

quaint mantle
kind hatch
#

My school provided it.

#

It was pretty easy to follow.

#

It was just a large book.

quaint mantle
#

Bothering you again, but I need help. I'm getting an error when try to do my /spawn command:

kind hatch
#

I didn't have to, but it's nice to have.

#

I can tell you that macbooks aren't the best choice for software development. Their issues are mostly with overheating, but if they didn't have that issue, they would be a solid choice. You'd likely want to look into the "gaming" laptops since they have higher specs.

The only reason you would need higher specs is for the faster compile times and the larger ram capacity.

dim bronze
#

13" ipad with intellij code server 😏

kind hatch
quaint mantle
#
private void removeBlocksSync() {
        Bukkit.getScheduler().runTaskTimer(plugin, () -> {
            for (final RepBlock block : blockRemovalSet) {
                world.getBlockAt(block.getLocation()).setType(block.getMaterial());
                blockRemovalSet.remove(block);
            }
        }, 5L, 1L);
    }
daring lark
#

how could i copy default config form my resource folder?

kind hatch
#

#saveDefaultConfig()

daring lark
kind hatch
kind hatch
daring lark
#

it doesn't give any error but it's not written to file

kind hatch
#

Do you have a config file that has already been written to disk?

daring lark
#

config in my data folder is empty

#

but in my projest it looks like this
PREFIX: "&6[&eRPG&6]&a "

daring lark
#
    public void onEnable() {

        plugin = this;
        this.saveDefaultConfig();

        config = getConfig();
        playerMenuUtilityManager = new PlayerMenuUtilityManager();
        rpg = new Rpg();
        prefix = color(config.getString("PREFIX"));

        restoreData();
        setCommands();
        setListeners();

        rpg.getWorldsManager().createWorlds(rpg);
    }```
kind hatch
daring lark
kind hatch
quaint mantle
#

wait

kind hatch
#

Also, what does your RepBlock class look like?

quaint mantle
#

here it is

private void removeBlocksSync() {
        Bukkit.getScheduler().runTaskTimer(plugin, () -> {
            for (final RepBlock block : blockRemovalSet) {
                world.getBlockAt(block.getLocation()).setType(block.getMaterial());
                blockRemovalSet.remove(block);
            }
        }, 5L, 1L);
    }
quaint mantle
quaint mantle
# kind hatch Also, what does your RepBlock class look like?
@Getter
public class RepBlock {

    private final Material material;
    private final Location location;

    public RepBlock(final Material material, final Location location) {
        this.material = material;
        this.location = location;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        final RepBlock repBlock = (RepBlock) o;
        return location.equals(repBlock.location);
    }

    @Override
    public int hashCode() {
        return Objects.hash(location);
    }
}
kind hatch
quaint mantle
kind hatch
#

Where are you populating your blockRemovalSet?

kind hatch
#

Where are you adding the RepBlocks to that list?

quaint mantle
#

private final ConcurrentSet<RepBlock> blockRemovalSet = new ConcurrentSet<>();

kind hatch
#

That's your declaration. Where are you adding the blocks to the list? In an event, a command, or?

quaint mantle
#

in an event, it removes obsidian in tot seconds

ivory sleet
#

altho highly doubt u actually need that one

#

As its much more exhaustive resource-wise

#

That ConcurrentSet is probably from some crappy 3rd party library

quaint mantle
#

So it would be
private final Set<E> blockRemovalSet = ConcurrentHashMap.newKeySet();

#

right?

ivory sleet
#

Yes but still why