#help-development

1 messages · Page 2009 of 1

west oxide
#

ay bro thanks am gonna try that

digital haven
#

Yeah

#

So that makes sense

#

You could use runTaskLater and loop through all online players to set that block to the new one and back with Player#sendBlockChange as gush said

smoky oak
#

I'd do a failsafe that you cache the tasks somewhere and manually call them if onDisable gets called

earnest forum
#

i was thinking that

tender shard
#

I would not change the blocks at all

#

I would just use Player#sendBlockChange

#

so even if the server crashes, the blocks are still intact

#

if we are still talking about the glowstone trail

lavish hemlock
#

I had no idea that was a thing

earnest forum
#

we are

tender shard
earnest forum
#

i didnt know it was either

#

thought it was nms

tender shard
#

nope

#

of course you'd have to send it to all players

#

unless you want only one player to see it

tacit drift
#

Didn't know that sendBlockDamage was a thing

#

is that new?

earnest forum
#

bruh

tender shard
earnest forum
#

hours i spent looking at block break texture packets wasted

#

lol

lavish hemlock
#

btw @tender shard What kinda blog software did you use?

tender shard
lavish hemlock
#

Oh I see

tender shard
#

my main website also uses wordpress lol

lavish hemlock
#

btw is WordPress free w/ custom domains...?

tender shard
#

no idea, I'm hosting it myself

lavish hemlock
#

oh

#

I don't have the ability to do so

tender shard
#

just get the free server from oracle

#

it's more than enough for some websites

quaint mantle
#

lol i done the same

tender shard
quaint mantle
round elbow
#
        for (HomeModule module : manager.getPlayerHomesList()) { // this line somehow causes this exception
            if (module.getLocation().getWorld() == null) {
                SetHomes.sendPlayerMessage(event.getPlayer(), "Your home with the name \"" + module.getName() + "\" was deleted automatically. World is corrupt.");
                manager.removeHomeModule(module.getName());
            }
        }

ConcurrentModificationException: null

tender shard
#

lol my RAM is 70% full but the CPU is only at 2% lmao

tender shard
#

there are basically to ways to solve this:

  1. use a copy of your collection or another collection where you add the elements to be removed later
  2. use an iterator
tacit drift
#

you have 125gb ram and 50gb of storage? 💀

round elbow
tender shard
tender shard
smoky oak
tacit drift
#

8TB of nvme? bruh

tender shard
tender shard
tacit drift
#

💀 💀 💀

tender shard
#

but both are RAID1 so only 50% capacity

tacit drift
#

And I couldn't get around on getting a 1TB ssd in a year 🤣

tender shard
#

so proxmox has 3.84TB of storage and the proxmox backup server has 20TB of storage (non-SSD, just enterprise hdds) lol

tacit drift
#

What do you store on that much storage?

tender shard
#

every VM gets backed up hourly, daily, weekly, monthly and yearly

tacit drift
#

bruh

earnest forum
#

if i were to make a custom enchantment system should i use persistent data containers or the enchantment class?

tender shard
#

because actually the enchantment class isnt meant to register custom enchantments at all

earnest forum
#

i tried to do one

#

and then when i anvilled a vanilla enchant

#

it was removed

tender shard
#

yeah

#

better use PDC

#

also you can only register enchantments using reflection

earnest forum
#

yeah

#

ik

tender shard
#

so that already tells you it's not meant to be used

cerulean mirage
#

I have a question about jdbc database integration in a bungeecord server. I am recently using hikaricp for my connection pooling and read things about how too many connections greatly increase transaction queue times. Now i was thinking to make a sort of plugin that has postgresql jdbc and hikaricp. I would use this plugin as an api for other plugins to get connections from as i dont want too many plugins all making connection pools. I was wondering if i could make a bungeecord plugin that gives out connections to plugins inside a spigot server. Would this be possible?

#

Those spigot servers are connected to the bungeecord server ofc

wet breach
brave sparrow
#

Also no, bungeecord cannot give spigot plugins connections

wet breach
#

if you have long transaction queue times then you need to relook at your setup

brave sparrow
#

The spigot servers and the bungee servers are not the same

#

They can’t share resources

cerulean mirage
cerulean mirage
brave sparrow
#

No

brave sparrow
#

Creating a connection on the minecraft server is slow

#

The connection pool creates a bunch of connection objects that wait for you to need them

cerulean mirage
#

yeah

brave sparrow
#

So you can establish a connection to the database much more rapidly

#

It has nothing to do with the actual database server

cerulean mirage
#

so 1 plugin api that has a connection pool per "sub" server on a main bungeecord server is fine?

brave sparrow
#

Yes

cerulean mirage
#

k thanks

quaint mantle
#

I never close a connection 🙃

brave sparrow
#

Uh

#

That’s not good

#

Lol

wet breach
# cerulean mirage k thanks

keep in mind, that if you have issues such as connection limits being hit, you have to modify the db server config files. By default MySQL or MariahDB are conservative out of the box and most times this does alright.

brave sparrow
#

You should use a connection pool and close the connection to return it to the pool

tender shard
#

yeah default is 151 connections lol

#

that's like... 5 plugins using hikari

#

and you already hit the limit

wet breach
# quaint mantle I never close a connection 🙃

this is impossible if you are using TCP, unix sockets are different so doesn't really matter except memory being exhausted possibly in this way. But TCP there is a max time frame a connection can be active.

cerulean mirage
#

hikari points out that having too many connections based on cpu core count is discouraged

#

this same for amount of connection pools?

wet breach
tender shard
#

hikari uses a connection pool itself

wet breach
#

Yeah, you don't want a lot of pools, this is a waste. Pools are similar to Worker queues

#

too many of them and you just have a bunch of useless objects doing nothing and occupying resources

brave sparrow
#

The point of that is you want a pool that isn’t too large

#

So basically your threads can block more and CPU time isn’t being split across that many threads at once

#

A saturated pool will be faster than a larger pool that lets all your threads progress

cerulean mirage
#

would you need to split up connections per pool based on cpu core count

#

like lets say

#

you have 16 cores

#

thats 32 threads

#

but you need 3 pools

#

would you do 3 pools with 32 connections

#

or 3 pools with 10 connections

#

cuz they are still on the same cpu

brave sparrow
#

Why do you need 3 pools?

cerulean mirage
#

we have multiple spigot servers on the bungeecord

brave sparrow
#

Ah so it’s 1 pool

cerulean mirage
#

how

brave sparrow
#

Per program

cerulean mirage
#

yeah 1 per spigot server

#

1 api

brave sparrow
#

So 1 pool

cerulean mirage
#

which other plugins can request pools from

tender shard
brave sparrow
#

That’s the opposite of what hikari suggests in that documentation

#

Lol

cerulean mirage
brave sparrow
#

Because each spigot server is independent

cerulean mirage
#

yeah i mean

#

3 pools per cpu

#

or on the pcu

#

cpu

brave sparrow
#

Each spigot server is running in its own JVM

#

Don’t think of them additively, there’s a lot more going on

#

It’s 1 pool on each server so optimize that 1 pool independently of other servers

cerulean mirage
#

k

#

So we have 24 threads. Best to do 3 pools with 8 connections or 3 pools with 24 connections?

#

We talking about the cpu now

#

each spigot jvm has a pool

#

3 spigots on a bungeecord

cerulean mirage
#

k

brave sparrow
#

How many cores do you have

cerulean mirage
#

16

#

24 threads

brave sparrow
#

connections = ((core_count * 2) + effective_spindle_count)

cerulean mirage
#

that * 2 stands for threads probably

#

so should i do 24 for core count * 2?

wet breach
brave sparrow
#

Lol

west oxide
#

hey so i got the dependency right but it keeps doing this
here's my code

        TextComponent discord = new TextComponent("Discord");

        discord.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Join Our Discord !").create()));
        discord.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,"link"));
        discord.setBold(true);
        discord.setColor(net.md_5.bungee.api.ChatColor.DARK_AQUA);
        discord.toLegacyText();

        return discord;
    }
}```
cerulean mirage
brave sparrow
wet breach
#

but yeah

brave sparrow
young knoll
brave sparrow
west oxide
young knoll
#

Looks fine to me

#

Just send it properly

brave sparrow
#

How are you sending it @west oxide

west oxide
brave sparrow
#

That’s why

#

You can’t do that

west oxide
#

oh

young knoll
#

Player.spigot().sendMessage

brave sparrow
#

^

west oxide
#

ahh okay i will try

#

how can i make it send inside of the line tho ?

brave sparrow
#

You can’t

young knoll
#

append other components to it

brave sparrow
#

The line needs to be part of the component

young knoll
#

You can’t treat it as a string

brave sparrow
#

^

fickle frost
west oxide
#

ohh okay i understand now

#

thank you

brave sparrow
short raptor
#

I can make an item unbreakable by setting the durability to -1 correct?

brave sparrow
#

No

short raptor
#

It changed?

#

Aw darn

young knoll
#

Just use setUnbreakable

brave sparrow
#

You can make an item unbreakable by setting the unbreakable attribute

#

You don’t have to do anything hacky

wet breach
brave sparrow
#

Less is more

short raptor
#

2015 answers moment

wet breach
#

you can always increase the amount later as you need them

#

but if you are not hitting some resource barrier

#

best to not use up all the resources just because you can

#

or even half

young knoll
#

You need to be doing a ton of queries to warrant a large connection pool

wet breach
#

4 threads can easily handle up to 200k connections

cerulean mirage
#

true

lean gull
#

how do i open build tools as a file in intellij to view all the nms code? i forgor

wet breach
#

you mean spigot jar?

#

because buildtools itself doesn't contain mc code

lean gull
#

honestly idk what im doin, if you say so then you're probably right

wet breach
#

?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

lean gull
#

i'm still very much learnin

wet breach
#

should read it, will help you obtain the appropriate jars to use in a project in regards to nms

lean gull
#

i don't understand

kindred valley
#

how can i equal a player to PlayerMoveEvent. PlayerMoveEvent does not allowing player.

young knoll
#

What

#

PlayerMoveEvent#getPlayer?

kindred valley
brave sparrow
#

@kindred valley you don't have enough understanding of Java for anyone here to help you

earnest forum
#

why not?

brave sparrow
#

learn how to code in Java and then come back

quaint mantle
#

How can I create YamlConfiguration instance in BungeeCord API?

I want to do something like:

YamlConfiguration conf = new YamlConfiguration();
conf.set(...);
...
earnest forum
kindred valley
#

?paste

undone axleBOT
rough drift
jagged thicket
lean gull
#

what's the difference between # and .?

earnest forum
#

that's what I'm thinking

brave sparrow
rough drift
#

or just PlayerMoveEvent.getPlayer()

earnest forum
lean gull
earnest forum
#

I learnt java while doing spigot and it was very annoying

earnest forum
young knoll
#

is used to denote instance methods

rough drift
brave sparrow
#

you learn a lot of bad habits trying to hack spigot code together

lean gull
#

i don't get it

quaint mantle
#

hi guys, can you do in a plugin that automatically spawns a command block with specific commands in specific positions?

river oracle
#

I learned java while doing spigot I did perfectly fine it's more challenging for sure but if it keeps you into it just do it.

young knoll
#

PlayerMoveEvent.getPlayer looks like a static method

brave sparrow
#

I also learned java from spigot which is why I highly recommend not doing it

young knoll
#

So # is used to differentiate

rough drift
#

don't know how

#

but yes

lean gull
#

i don't know what static is

jagged thicket
#

i started java from school then used it for spigot

young knoll
#

Okay

rough drift
brave sparrow
#

see this is what happens

#

you have to have a basic working knowledge of the language to make any headway

jagged thicket
#

wow i see what you mean

#

sorry

#

i thought he knew some stuff

lean gull
#

before you make fun of me, i should mention that i have some certain learning disabilities
that means i cannot watch an hour long tutorial like you do and understand as much as you do

lean gull
#

reading is even harder

brave sparrow
#

i'm not making fun of you

river oracle
#

I learned java alongside spigot though If I don't understand something I did it in Java first before applying it to spigot

brave sparrow
#

i'm telling you, you have to learn java first

lean gull
#

it seems that you were implying certain things

rough drift
#

i used java for around 4 years before jumping into plugins

brave sparrow
#

im not implying anything, im stating outright that you don't know java and shouldn't be making plugins yet

rough drift
#

but thats because i realized plugins where a thing at that time

lean gull
#

im learning along the way, that's how i do it with my disabilities

brave sparrow
#

spigot is too complicated if you don't already know java

lean gull
#

anyways, i have not come here to argue

brave sparrow
#

this is like trying to read Hamlet without learning English first

lean gull
#

can someone tell me or link me a tutorial on how to open the spigot buildtools jar with intellij to view nms code?

brave sparrow
#

that isn't a thing

#

lol

lean gull
#

idk what it's called

#

the spigot api jar i think

brave sparrow
rough drift
#

wait what

brave sparrow
#

yes

rough drift
#

that looks like r/programmerhorror or how was it called

brave sparrow
#

pretty much

earnest forum
#

theyve updated it

young knoll
#

If you want to view nms code you can just look at the source inside he buildtools folder

earnest forum
#

or thay

young knoll
#

I think it’s spigot/spigot-server

lean gull
rough drift
#

because inside he buildtools ain't correct english iirc

earnest forum
#

gui

#

you drag a jar in

#

And it recompiled it

#

decompiles*

lean gull
#

idk what that means

earnest forum
#

you can see all the code

young knoll
#

IntelliJ also has one built in

rough drift
#

there's a plugin for intellij to browser jar files

earnest forum
#

basically breaks apart the jar into classes

rough drift
#

and it has decompilation builtin

lean gull
#

i've done this before, i had a project with all the buildtools stuff in it, i just forgot how to do it again

red sedge
#

how would i make player damage an entity with a damage cause of projectile

lean gull
#

do i need to open the buildtools as a module thingie?

#

like in project structure > modules

brave sparrow
river oracle
rough drift
red sedge
#

...

kindred valley
young knoll
#

You cannot specify damage cause with the API

brave sparrow
rough drift
#

you know you get an instance in your event handler

brave sparrow
#

I've been there and it's a massive pain in the ass to fix after you've started

young knoll
#

That’s why we use #

earnest forum
#

Do e.getPlayer()

rough drift
#

or event.getPlayer()

earnest forum
#

whatever you called it

rough drift
red sedge
lean gull
#

alex, sadly i don't see any other way to do it with my disadvantages

earnest forum
brave sparrow
#

I have actual university level computer science education experience and students trying to do things they don't have the prerequisite base knowledge for have the most issues

rough drift
brave sparrow
red sedge
#

oh its that simple..?

earnest forum
#

I don't believe they are an English speaker so I can't understand what they want

rough drift
kindred valley
#
getFrom()
Gets the location this player moved from```
young knoll
#

As long as you are in a modern version

rough drift
#

iirc there's also a type, otherwise i am mistaken for fabric

brave sparrow
#

spigot is a very specific java API and is therefore far more complicated than a beginner project should be

river oracle
young knoll
#

There is no type

kindred valley
rough drift
young knoll
#

I asked MD about it and he said a plugin damaging an entity will always be a damage cause of plugin

#

Which I guess makes sense

#

But it’s a bit annoying

rough drift
#

from shit code to less shit code

lean gull
#

i think my current way of doing things is the best way i can (asking people and watching short tutorials here and there). i learn things and eventually i'll learn how to do them in a better way more and more

earnest forum
#

I don't even know how to make a regular java program

rough drift
#

spigot is too complex for a beginner

earnest forum
#

I keep thinking I have to make the main class extend javaplugin haahhahaah

rough drift
#

even i get confused sometimes

brave sparrow
kindred valley
brave sparrow
#

you've learned a ritual to do specific things without really understanding why

earnest forum
#

Event

#

Bukkit event

rough drift
#

no

kindred valley
young knoll
#

Blood ritual

rough drift
#

they want to run getFrom() when PlayerDeathEvent is triggered

kindred valley
rough drift
#

the problem is that event does not have it

lean gull
#

alex i think you just have a different prespective of things, that doesn't mean anyone's right or wrong

young knoll
#

Correct

#

The death event is not the move event

brave sparrow
earnest forum
#

End of the day you can do what you want

rough drift
#

no

#

you can't

earnest forum
#

Don't have to learn a certain way

rough drift
#

you either learn

lean gull
#

yes but i don't think you understand the current choices that i have

rough drift
#

or memorize

brave sparrow
#

and i have experience educating students with learning disabilities in computer science

#

lol

#

do something simpler before jumping into spigot

kindred valley
#

i gave potion effect to player when DeathEvent is triggered but even blocking jump player can move.

red sedge
brave sparrow
#

you're trying to do calculus without learning algebra

earnest forum
red sedge
#

oh is it learning spigot without learning java?

kindred valley
brave sparrow
red sedge
#

you can learn java from spigot

earnest forum
lean gull
red sedge
#

its like learning java from making a game

brave sparrow
#

it's a bad way to learn java

kindred valley
wet breach
tall dragon
rough drift
tall dragon
#

Spigot is not beginner friendly at all

red sedge
#

first learn basic java

young knoll
#

It’s not like learning java from making a game

#

Spigot is a third party API

earnest forum
# kindred valley yes

I suggest in the PlayerList class you put a Boolean variable and then when the player dies, set it to true and in PlayerMove check if it is true and if so cancel

red sedge
#

yeah but you're also learning java while using the API

rough drift
#

this is the equivalent of learning quantym physics from knowing 2 + 2

red sedge
brave sparrow
#

spigot is not even close to beginner friendly, and the community is full of bad habits because plenty of people want to make plugins without learning

#

you're shooting yourself in the foot

lean gull
rough drift
earnest forum
#

U don't even need to learn java itself just learn data types, oop, basic programming knowledge

#

I came from a very beginner level of c++

tall dragon
earnest forum
#

straight to spigot

brave sparrow
wet breach
rough drift
young knoll
#

I learned java through spigot before this channel existed

#

Dark times

#

:p

brave sparrow
rough drift
#

Just:

  • Learn java
  • Make sure you learnt it
  • Learn it more
  • Make hello world plugin
  • Learn more java because you didn't learn it you liar
tall dragon
earnest forum
brave sparrow
#

I learned Java through spigot and it took me years to un-learn all the bullshit I picked up

earnest forum
#

I used YouTube videos that taught me methods that looking back now are horrific

red sedge
# lean gull of course

you should try to learn java from using spigot if you want to, it is most certainly not the best thing but keeping your passion alive is more important

rough drift
wet breach
ancient jackal
red sedge
#

after you have enough passion to sit through the boring stuff you will actually start learning

brave sparrow
tall dragon
#

they hold up the main thread

red sedge
#

but dont learn plain java if you dont want to, your passion is more important than learning the best way

rough drift
#

its not

#

lmao

#

passion comes last

rough drift
#

you first learn

red sedge
rough drift
#

then you apply

rough drift
brave sparrow
rough drift
#

it really does

#

so please

#

learn basics

#

before making stuff

earnest forum
#

learn primitive data types

tall dragon
earnest forum
#

oop

rough drift
brave sparrow
# lean gull uh... oops

im telling you man, i've made all the mistakes you're making right now and you're screwing yourself over

rough drift
#

learn syntaxes

red sedge
#

if an art teacher just teaches a kid with passion colour theory and the boring stuff they will kill that kids passion to do art

rough drift
#

learn wording

earnest forum
#

there's videos on YouTube that are barely 10 mins

young knoll
#

If your SQL database is local it should be pretty fast tbf

earnest forum
#

which explain basic concepts

rough drift
#

it won't

#

if you don't ONLY explain that

#

explain and apply

red sedge
rough drift
#

and repeat

lean gull
rough drift
#

they won't

tall dragon
rough drift
#

if i told you "What's Composition?" what would you reply

brave sparrow
earnest forum
#

my programming class at school has me doing block coding on minecraft education edition

lean gull
#

ok lemme ask you this, what do you think i should do

earnest forum
#

thank God it has python and javascript

rough drift
#

mhm

red sedge
#

if youre starting something new with passion, try to keep that passion alive

brave sparrow
rough drift
#

js is fine

#

its a good lang, but py AND js?

earnest forum
#

Can you believe I'm learning the stuff in year 9 that I learnt in year 6

lean gull
#

i'm doing that, just not the way you want me to

rough drift
brave sparrow
earnest forum
lean gull
#

i'm actually not that new

rough drift
red sedge
#

what do you know?

brave sparrow
rough drift
#

but TOGETHER?

earnest forum
#

you can switch between

rough drift
#

jeez man

earnest forum
#

is what I meant

rough drift
#

one or the other

#

its much simpler to start off with one

lean gull
#

i've been learning java and spigot for a good couple months now, it's been very slow though given the way i'm learning

rough drift
#

you don't learn 6 languages when you're born

brave sparrow
earnest forum
#

curriculum wants me to do block

rough drift
earnest forum
#

I always just do it in js and then convert to block

#

but that's boring

#

I don't learn anything

tall dragon
earnest forum
#

Yes you have to learn how to use javadoc

brave sparrow
lean gull
#

the only docs i use is spigot docs, for java i just look at short tutorials

tall dragon
#

people ask alot of questions here too. that they can find out themself with one search one the javadoc

earnest forum
#

Sometimes it's good to ask a person tho

#

You can get a much better answrr

lean gull
#

i ask a bit too much here

earnest forum
#

But first go to javadoc

young knoll
#

No one does

earnest forum
#

If you can't find what you are looking for then ask here

tall dragon
#

sometimes. but usually the javadoc comments are sufficient.

young knoll
#

The javadoc is unloved

earnest forum
#

Unfortunate

red sedge
#

@lean gull if you know java nough to make plugins, start by making small things that you want in minecraft for example idk removing that shit mob called phantoms, while doing that you will learn teeny bits of information each time

#

definetely not the best way but it will keep you wanting to make stuff

brave sparrow
#

Typically I'll answer a question even if it's a trivial javadoc search unless the wording of the question tells me the individual isn't capable of using the information if I gave it to them

earnest forum
#

I personally struggle with finding things to do

#

I have so much passion and want to code I jsut have no ideas

young knoll
#

Be like me

lean gull
#

99% of the time i need someone to explain things to me, i haven't really tried java docs before but i won't be suprised if it's just a bunch of text that is exteremly hard to understand. checking my theory now

young knoll
#

Have ideas but no motivation

tall dragon
#

same lol hahahaha

young knoll
#

Javadocs are very simple to understand

red sedge
young knoll
#

That’s what they are designed for

earnest forum
#

I usually just make small stuff give up on it halfway and then stop programming, come back 6 months later, repeat from step 1

lean gull
ancient jackal
#

Well don’t give up that quickly

red sedge
#

jsut start from making small stuff

lean gull
#

they use words that i do not understand quite frequently

red sedge
#

idk /fly or smth

ancient jackal
#

Press a few buttons, if you know Java you’ll see how it’s put together

tall dragon
earnest forum
#

That's awesome

#

I'm gonna do that

tall dragon
#

goodluck.

earnest forum
#

Do falling blocks work with any block or just blocks that have gravity

tall dragon
#

they can be any block yea

earnest forum
#

awesome

red sedge
#

@lean gull look up tutorials for mechanics like /fly after a while you will start to look up tutorials for random things instead of whole mechanics

#

but you need to look for whole mechanics to get to that point

ancient jackal
#

You can make chests fall?

young knoll
#

Yes

red sedge
#

if you want to leanr java from using spigot

young knoll
#

You can make anything fall

tall dragon
young knoll
#

Some things don’t render tho

lean gull
#

you can use armorstand holding / wearing a chest, you can use falling blocks

#

you can use normal blocks but that's lame

tall dragon
smoky oak
#

take note that if you use an armor stand you need to take care of rotation and size

#

since the block would be a mini block otherwise

lean gull
#

make it with a giant zombie that has a chest on its head, that'd be cool... trust me :)

earnest forum
#

Is there a way to get a player head of a specific skin, even if that player doesn't have that skin on? I remember looking at this a bit ago, and something about skin signatures

smoky oak
#

iirc you can just turn a string into a skin

#

theres some specialized serialization for that one iirc

tall dragon
#

pretty sure you can get the texture string

#

and turn that back into a head

young knoll
#

There’s a new API for that

tall dragon
#

but they do need to wear the skin at that time for that to work

young knoll
#

PlayerProfile

earnest forum
#

nms or spigot

smoky oak
#

spigot

young knoll
#

Spigot

#

NMS wouldn’t be an API

earnest forum
#

true

sage patio
#

Hi, I've this method for creating a ItemStack

#

but i want please can leave the Durability value empty

young knoll
#

Use the wrapper type

#

Integer

#

That will accept null

sage patio
#

ow, thanks

#

and durability changes the item type ? like a blue glass or red class insted of default glass

young knoll
#

In 1.old, yes

sage patio
#

its a 1.8 plugin, because plugin is for bedwars

next stratus
visual tide
chrome beacon
#

Use mojmaps ;/

visual tide
#

look it up

lunar flax
#

How to check if config already exists in plugin folder (or you don't need to)?

young knoll
#

saveDefaultConfig will handle that for you

#

Otherwise just get a file instance and use .exists

lunar flax
#

How can I get config in other class? (this.getConfig() doesn't work)

maiden mountain
#

Quick question, I see some plugins having a custom inventory GUi with a close inventory button inside of it, which item material do they use for this?

#

This item to be exact

lunar flax
#

Uh, can you help me?

lunar flax
maiden mountain
#

aaah thats the name

#

Thanks guys

fallen sandal
#
                BlockWord(event, words);
                BlockMessage(event, words); 
                ReplaceWord(event, words, "text to replace the word with"); ```
#

why this code not working?

tardy delta
#

Methods names starting with uppercase letters 🧐

river oracle
#

I was so conufsed at first I thought this was sudo code

brave sparrow
#

Violation of the Java standard

#

😠

visual tide
#

git log

eternal oxide
#

you probably commited local. didn;t push

brave sparrow
#

Different branch?

terse lily
#

should it be fine to set org.bukkit.Material's ID to -1 for new non-legacy materials?

tender shard
#

what?

terse lily
#

im currently trying to update spigot to first 1.19 experimental snapshot and there are new blocks, so can I set their materials' IDs to -1?

TARGET(22637, AnaloguePowerable.class),
/**
 * BlockData: {@link Switch}
 */
LEVER(15319, Switch.class),
/**
 * BlockData: {@link LightningRod}
 */
LIGHTNING_ROD(30770, LightningRod.class),
/**
 * BlockData: {@link DaylightDetector}
 */
DAYLIGHT_DETECTOR(8864, DaylightDetector.class),
/**
 * BlockData: {@link SculkSensor}
 */
SCULK_SENSOR(5598, SculkSensor.class),
SCULK(-1),
/**
 * BlockData: {@link SculkVein}
 */
SCULK_VEIN(-1, SculkVein.class),
/**
 * BlockData: {@link SculkCatalyst}
 */
SCULK_CATALYST(-1, SculkCatalyst.class),
/**
 * BlockData: {@link SculkShrieker}
 */
SCULK_SHRIEKER(-1, SculkShrieker.class),
/**
 * BlockData: {@link TripwireHook}
 */
TRIPWIRE_HOOK(8130, TripwireHook.class),
/**
 * BlockData: {@link Chest}
 */
TRAPPED_CHEST(18970, Chest.class),
/**
 * BlockData: {@link TNT}
 */
TNT(7896, TNT.class),
#

like this ^

#

non-legacy materials' IDs aren't used as I see and getting ID for non-legacy Material throws an exception, also they seem to be completely random

#

so im asking if i could use -1 for them

next stratus
#

but they need ids no?

terse lily
prisma needle
#

Modifying tab completion for vanilla commands

tender shard
#

physics are server side

#

that I don't know lol

brave sparrow
#

What do you mean?

#

The client performs physics and tells the server how it’s moving, the server validates that movement and corrects if necessary

brave sparrow
#

That’s why you can freeze your minecraft and stop falling for example

#

Right

tardy delta
#

No?

brave sparrow
#

Because players don’t have physics

tardy delta
#

Haha so funny

buoyant viper
#

just do it

#

😎

west oxide
#

hey , if am getting this error in a for loop does it mean that my arraylist is null ?

#
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0```
brave sparrow
#

A lot of work

brave sparrow
#

If it was null you’d get a null pointer exception

quiet ice
#

how does your for loop look like?

west oxide
quiet ice
#

Something like for (var x : list) does not throw such an IndexOutOfBoundsException ideally

#

And for (int i = 0; i < list.size(); i = i + 1) does also not throw an IndexOutOfBoundsException

tardy delta
#

I = i + 1 omg

west oxide
# quiet ice And `for (int i = 0; i < list.size(); i = i + 1)` does also not throw an IndexOu...
              List<Map.Entry< String,Integer>> list = new ArrayList<>(plugin.getPlayerManager().orderByElo().entrySet());


              Player player1 = Bukkit.getPlayer(list.get(i).getKey());
              int elo = list.get(i).getValue();

              if (i == 1){
                  sender.sendMessage(Utils.CC("&d#" + i + " &7" + player1.getDisplayName() + " &d("+ elo + ") &7elo" ));
              }
              if (i == 2){
                  sender.sendMessage(Utils.CC("&6#" + i + " &7" + player1.getDisplayName() + " &6("+ elo + ") &7elo" ));
              }
              if (i == 3){
                  sender.sendMessage(Utils.CC("&b#" + i + " &7" + player1.getDisplayName() + " &b("+ elo + ") &7elo" ));
              }
              else{
                  sender.sendMessage(Utils.CC("&a#" + i + " &7" + player1.getDisplayName() + " &a("+ elo + ") &7elo" ));
              }

            }
        }```
#

i want to get the top10 players

#

i also have this

        HashMap<String,Integer> list = new HashMap<>();
        try {
            PreparedStatement ps = plugin.SQL.getConnection().prepareStatement("SELECT * FROM " + tableName + ";");
            ResultSet rs = ps.executeQuery();
            int elo = rs.getInt("ELO");
            String playerUuid = rs.getString("UUID");
            while (rs.next()) {
                list.put(playerUuid,elo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return list;
    }  ```

public HashMap<String,Integer> orderByElo(){
UUID randomUuid = UUID.fromString("3e8eac9d-c886-47a1-937c-5f0dfdf6114b");

    HashMap map =  getCustomPlayer(randomUuid).getAllPlayersId();
    List< Map.Entry<String,Integer>> list = new ArrayList<>(map.entrySet());

    Collections.sort(list, new Comparator<Map.Entry<String, Integer>>() {
        public int compare(Map.Entry<String, Integer> o1, Map.Entry<String, Integer> o2) {
            return o2.getValue()- o1.getValue();
        }
    });```
quiet ice
#

You'd need i < 10 && i < plugin.getPlayerManager().orderByElo().entrySet().size(); (please cache that list)

quiet ice
fallen sandal
#

okay i fixed the previous issue but this code isnt changing swear words

#
            String msg = event.getMessage().toLowerCase().replaceAll("[*]", "");

            for (String words : getConfig().getStringList("bad-words")) {
                ReplaceWord(event, words, "*"); // Use this if you what to replace the word in the chat with an new one


            }
        }
    }

    private void ReplaceWord(AsyncPlayerChatEvent event, String words, String s) {
    }```
west oxide
quiet ice
#

Because you try to get the 2nd player in that list, which does not exist

fallen sandal
#

ok

quiet ice
#

Also, use Bukkit.getOfflinePlayer unless you really want them to be online

#

otherwise it'll throw an NPE

quaint mantle
#

sigh
Any reason why this doesnt get set to the correct item?

Main Code:

private static ItemStack getRandomItem(String crateType){
        int totalWeight = 0;
        ItemStack item = new ItemStack(Material.TNT, 1);
        Boolean found = false;
        Random rand = new Random();

        String rewardData = "Crates.crateRewardData.";
        FileConfiguration conf = EmeraldsPlugin.jp.getConfig();

        for(String s: conf.getStringList("Crates."+crateType)){
            totalWeight += conf.getInt(rewardData+s+".Weight");
        }

        double r = rand.nextDouble() * totalWeight;

        for(String s: conf.getStringList("Crates."+crateType)){
            if (conf.getInt(rewardData+s+".Weight") >= r && !found) {
                item = new ItemStack(Material.getMaterial(conf.getString(rewardData+s+".Material")), conf.getInt(rewardData+s+".Amount"));
            }
        }

        return item;
    }

Config:

Crates:
  basicCrate:
      0: DiamondRewardBasic
      1: EmeraldRewardBasic

  crateRewardData:
    DiamondRewardBasic:
      Material: DIAMOND
      Weight: 25
      Amount: 5
    EmeraldRewardBasic:
      Material: EMERALD
      Weight: 5
      Amount: 25
quiet ice
#

I cannot use it at school

west oxide
quiet ice
#

I somehow forced my teacher to adopt i++ but that is about it

fallen sandal
#
        at net.dv8tion.jda.api.utils.MiscUtil.tryLock(MiscUtil.java:169) ~[swapnocraft-1.0-SNAPSHOT.jar:?]
        at net.dv8tion.jda.api.utils.MiscUtil.locked(MiscUtil.java:131) ~[swapnocraft-1.0-SNAPSHOT.jar:?]
        at net.dv8tion.jda.internal.requests.ratelimit.BotRateLimiter.stop(BotRateLimiter.java:169) ~[swapnocraft-1.0-SN```
quiet ice
#

i = i + 1

#

There is a lot worse stuff in my course

west oxide
quiet ice
#

I'm someone that absolutely loves their flatfile storage so I cannot really comment on the SQL being used there. But you should really cache it

west oxide
#

i gotta learn that

west oxide
fallen sandal
#

so i changed it to this what i got from spigot thread

#
        Player player = event.getPlayer();
        if (!player.hasPermission(BYPASS_PERM)) {
            String msg = event.getMessage().toLowerCase().replaceAll("[-_*]", "");

            for (String words : getConfig().getStringList("bad-words")) {
                replaceWord(event, words, "*"); // Use this if you what to replace the word in the chat with an new one


            }
        }
    }```
#

now its not giving the error but its not changing swear words

lunar flax
#

How to get config in other class? (spoonfeed with function please)

quiet ice
west oxide
# quiet ice Basically I want you to not repeatedly call a method when you do not expect a ch...
        HashMap<String,Integer> list = new HashMap<>();
        try {
            PreparedStatement ps = plugin.SQL.getConnection().prepareStatement("SELECT * FROM " + tableName + ";");
            ResultSet rs = ps.executeQuery();
            int elo = rs.getInt("ELO");
            String playerUuid = rs.getString("UUID");
            while (rs.next()) {
                list.put(playerUuid,elo);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        this.allPlayersIdElo = list;
    }

    public HashMap<String, Integer> getAllPlayersIdElo() {return allPlayersIdElo;```

is this good ?
lunar flax
#

Can you help with that?

fallen sandal
lunar flax
#

I'm new to java and plugins at all, so I won't mind a bit of help

#

No I guess

lavish hemlock
#

Getters are one of the most common methods in Java :p

lunar flax
#

So I need to do java public static FileConfiguration config; in main and java config = getConfig(); in onEnable?

west oxide
#

i think even if he helps you now you'll still have to learn about getters

Here's an example of getter you can do (am also still new to this btw)

lavish hemlock
#

Yeah you uhh

#

Don't need to repeat getConfig()

west oxide
#

yeah but they asked for it lol

fallen sandal
#

man!

lavish hemlock
#

Lemme show you a better example

#

This is a common pattern in Java called a POJO/DTO (Plain Old Java Object/Data Transfer Object):

public class MyData {
    private final String s;

    public MyData(String s) {
        this.s = s;
    }

    public String getValue() {
        return s;
    }
}
#

It does two things:

misty current
#
    private int iteration;

    @Override
    public void execute(Player player, String[] args) {
        iteration = 0;
        int arg1 = Integer.parseInt(args[0]);
        Location loc = player.getLocation().getBlock().getLocation();
        Bukkit.broadcastMessage(String.valueOf(System.currentTimeMillis()));
        for(iteration = 0; iteration < arg1; iteration++){
            loc.getBlock().setType(Material.GOLD_BLOCK);
            changeLocation(loc);
        }
        Bukkit.broadcastMessage(String.valueOf(System.currentTimeMillis()));
    }

    private void changeLocation(Location location){
        switch (getDirection()) {
            case 0 -> location.add(distance, 0, 0);
            case 1 -> location.add(0, 0, distance);
            case 2 -> location.add(-distance, 0, 0);
            case 3 -> location.add(0, 0, -distance);
        }
    }

    private int getDirection(){
        int direction = 0;
        int iteration = this.iteration;
        for(int j = 1; true; j++) {
            for(int k = 0; k < 2; k++) {
                iteration -= j;
                if (iteration < 0) return direction;
                direction = (direction + 1) % 4;
            }
        }
    }

any suggestions for improvements in this algorithm to generate islands?

lavish hemlock
#

Hold data, and allow you to access it

lavish hemlock
#

Also, you can add a setter if s is not final (AKA if it's "mutable")

#

Because mutability is bad in Java :)

#

And people need to learn constructors anyway

quaint mantle
#

I got my code to work yay, But is there a reason why my random system is sometimes returning the TNT, which is meant to be a false value?

int totalWeight = 0;
        ItemStack item = new ItemStack(Material.TNT, 1);
        Random rand = new Random();

        String rewardData = "Crates.crateRewardData.";
        FileConfiguration conf = EmeraldsPlugin.jp.getConfig();

        for (int i = 0; i < conf.getInt("Crates."+crateType+".Amount"); i++) {
            String s = conf.getString("Crates."+crateType+".Items."+i);
            totalWeight += conf.getInt(rewardData+s+".Weight");
        }

        double r = rand.nextDouble() * totalWeight;

        for (int i = 0; i < conf.getInt("Crates."+crateType+".Amount"); i++) {
            String s = conf.getString("Crates."+crateType+".Items."+i);
            System.out.println(r);
            if (conf.getInt(rewardData+s+".Weight") >= r) {
                item = new ItemStack(Material.getMaterial(conf.getString(rewardData+s+".Material")), conf.getInt(rewardData+s+".Amount"));
            }
        }
#

also hi @lavish hemlock!

lavish hemlock
#

Hi

misty current
#

you should use constructor to tell java that a class must have a certain object

#

and you can't create an instance of it without

lavish hemlock
#

In object-oriented programming (y'know, where classes come from, and what Java follows)

#

You have a core principle known as "encapsulation"

#

Sorry trying to find a chart rn

sage patio
#

is there a better way

#

to do not spamming like this

lavish hemlock
# lavish hemlock You have a core principle known as "encapsulation"

Here:

The word, “encapsulate,” means to enclose something. Just like a pill "encapsulates" or contains the medication inside of its coating, the principle of encapsulation works in a similar way in OOP: by forming a protective barrier around the information contained within a class from the rest of the code.

In OOP, we encapsulate by binding the data and functions which operate on that data into a single unit, the class. By doing so, we can hide private details of a class from the outside world and only expose functionality that is important for interfacing with it. When a class does not allow calling code access to its private data directly, we say that it is well encapsulated.
#

The idea to make only the important, necessary parts of data/behaviour accessible publicly.

eternal oxide
quaint mantle
#

So basically goal of this code is to make block under player glowstone and replace it with last block but problem is that nothing happens





    @EventHandler
    public void onMovement(PlayerMoveEvent e) {
            Player player = e.getPlayer();
            World world = player.getWorld();
            Block block = player.getLocation().subtract(0, 1, 0).getBlock();
            Material type = block.getType();
            if(type != Material.GLOWSTONE && type != Material.AIR) {
                block.setType(Material.GLOWSTONE);
                player.sendMessage("asd");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException i) {
                    i.printStackTrace();
                }
                block.setType(type);
            }

        }

}```
lavish hemlock
#

See, by directly exposing a field as public, it makes it harder to encapsulate.

sage patio
#

can u send an example

#

i know what is loop, but idk how to do it for this

#

its not just from 0 to 8

eternal oxide
#

for( int i = 0; i <= 8; i++)

sage patio
#

its 0 to 8,
9, 18, 27
27 to 34

#

some thing like this

eternal oxide
#

then make an array/list of the indexes

sage patio
#

ow, nice

fallen sandal
#

anyone free? 🙂

lavish hemlock
lavish hemlock
#

?ask

undone axleBOT
#

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

fallen sandal
#

asking from a long time

#

noone cares

lavish hemlock
#

Ask your fuckin' question, not "is anyone available" :P

quaint mantle
#

what should i use instead?

lavish hemlock
#

?scheduler

#

?scheduling

undone axleBOT
quaint mantle
#

you know like in hypixel duels you have players with blocks below them spawning and dissapearing after few seconds? thats what im trying to make

lavish hemlock
#

It's called a trail btw

lavish hemlock
#

You probably just got lost in the middle of it

fallen sandal
#

🙂 ok

quaint mantle
#

alr

lavish hemlock
#

TimeUnit.TICKS when /s

quaint mantle
#

thank you ill try using scheduler

tardy delta
#

is it possible to extend an enum?

lavish hemlock
#

Nope

hardy swan
#

it is

lavish hemlock
#

Fun fact though, enums can implement interfaces

tardy delta
#

uhu

hardy swan
#

technically

#

enums are itself extended

tardy delta
#

they can technically extend a class too

lavish hemlock
#

All enums extend the Enum class

#

and afaik, they're all also final, therefore you cannot inherit an enum

hardy swan
#

yes that more accurate

#

haha

tardy delta
#

oh no you cant, i thought it was possible in earlier java versions

lavish hemlock
#

Wellllll

#

Enums were introduced in Java 1.5

#

So "earlier Java versions" doesn't really go that far back

west oxide
#

its returning an empty list

#

wanted to get it sorted by elo

#

also i did store the list on a variable onEnable

#

am getting that from it

hardy swan
#

Question: How to set special arrows for skeletons? Just need a rough direction, can't seem to find any relevant methods from its interface.

tardy delta
#

this wont return anything as you didnt call rs.next()

#

and you are still putting the same thing in the map

#

so do your int elo = ... in the while(rs.next())

west oxide
#

ahh thank you man

hardy swan
west oxide
#

amma try that

tardy delta
#

anyways whats the parallelism in a forkjoinpool?
parallelism – the parallelism level. For default value, use Runtime.availableProcessors

vocal cloud
#

You can just modify the fired arrow

hardy swan
#

ok that's not optimal

#

actually, my problem was changing the projectile of pillager to fireworks

#

but I thought skeleton is a good analogy

#

probably not

vocal cloud
#

Sigh. XY me to death.

hardy swan
#

lmao

sacred mountain
#

whats the besr way to manage per player config files

vocal cloud
#

Just do this then

hardy swan
#

I will prefer the loaded projectile to be fireworks

sacred mountain
#

hey im using config.set("booleankey", true);

and it's not actually writing to my file, any ideas why not?

tardy delta
#

save it

sacred mountain
#

i have the yamlconfig working as if i edit it manually it works

#

ohhh ok

#

thanks

tardy delta
#

fileConfig.save(file)

sacred mountain
#

ty

#

wasnt saving

tardy delta
#

nobody does that lol

#

thats why i always write a fileconfig wrapper

sacred mountain
#

thanks well

#

rip 1%phone

#

bye

hardy swan
#

yes

#

from the moment he charges

#

urgh

vocal cloud
#

Then get the item in the mainhand if it's a crossbow swap it for a crossbow with a firework

#

Crossbows have item meta

hardy swan
#

then how would you know when he load the crossbow

#

its ok

#

pillager

silver shuttle
#

What's the easiest way of looping through each of the sections under the section "items"?

tardy delta
#

section.getKeys(false).forEach

silver shuttle
hardy swan
#

I know about the method

#

I will try that. I just wanted to know if there is a provided api for fundamentally changing the type of projectile from the source, I guess not.

#

I will see how

ancient jackal
#

You could take a projectile event and then delete the projectile, replacing it with the one you want

hardy swan
#

I don't think any event is fired, no patches for PathfinderGoalCrossbowAttack

hardy swan
tardy flame
#

Since the result can be null and looping through it will result in a

#

Boom

wanton remnant
#

How can I upgrade my plugin to 1.18?

#

nop i import manually my spigot libraries

tardy flame
#

Ale.

#

Alr

#

So you need to change your spigot libraries to the latest version

#

In your case 1.18

#

If you don't use NMS then you don't have to worry about anything

lean gull
#

anyone have a tutorial for making guis with an Inventory instance?

quiet ice
#

Ideally you'd use a dedicated library for that

wanton remnant
quiet ice
#

Are you using spigot or spigot-api?

wanton remnant
#

i take the spigot used for running server

quiet ice
#

And which methods exactly are not recognized

quiet ice
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

wanton remnant
#

:o thx u so much

quiet ice
#

That is why you should read the release notes

#

And perhaps you should use maven or gradle

silver shuttle
#

maven good

#

gradle ugh

viral crag
#

gradle is easy enough and is much better to integrate both maven and gradle dependencies

quiet ice
#

Or just be me and use your own build tool

grim oak
#

how would i write a piece of code thats constantly updating (like a bossbar with a timer that updates with every second)

silver shuttle
#

runTaskTimer

#

make it async

quiet ice
#

It is quite annoying to use an in-house build tool at first but after a while you get used to it and will feel the power

grim oak
#

okay thanks

#

would i make a separate class for that or have it in my main class?

silver shuttle
#

your choice, it doesnt matter

silver shuttle
#

Google it ^^

lean gull
#

ty

#

so im makin a server with guns, and i want to have an easy method of creating the guns. all guns need to have some basic stuff like reload speed and abilities and whatnot. is there any way to make like an easy manager for this?

viral crag
#

..

vocal cloud
#

Use crackshot

ancient jackal
#

Okay so is the delay in taskdelay in ticks or ms?

vocal cloud
lean gull
#

no i don't mean something that can make the guns, i mean a java thing for me to make that i can add default values and requirements for the guns

vocal cloud
#

You'd have to set up crafting yourself somehow

viral crag
#

yeah i saw you change it

rough drift
#

what do you need to realize

viral crag
rough drift
#

o

fallen sandal
#

okay so

#

how to give a sound effect on spigot ?

rough drift
fallen sandal
#

no i mean

#

i made a anti swear pl

#

so

#

its giving a message

#

i want to give a sound with the msg

#

like dragon sound

vocal cloud
#

Player#playSound

quiet ice
#

Player#playSound

#

?jd-s

undone axleBOT
vocal cloud
fallen sandal
#

ok

#

thanks

vocal cloud
#

It's got a search feature use it

#

Pick your poison and enjoy

fallen sandal
#

how to use the sound here?

#
    public void onPlayerChat(AsyncPlayerChatEvent e) {
        String msg = e.getMessage();
        List<String> words = getConfig().getStringList("bad-words");
        for (int i = 0; i < words.size(); i++) {
            if (msg.contains(words.get(i))) {
                e.setCancelled(true);
                e.getPlayer().sendMessage(sc("") + ChatColor.RED + "Swearing Is Not Allowed!")
                
                e.Player.playSound(Player.getLocation(), Sound.ENTITY_WITHER_SPAWN, 1.0f, 1.0f);
                ;
            }
        }
    }```
ancient jackal
#

But if everything is going to work the same, just extend a gun class

#

Or have defaults in the interface

tender shard
fallen sandal
#

oh lol my mistake

ancient jackal
fallen sandal
#

wait

tender shard
#

and wtf is Player.getLocation() ?

#

do you have a field called Player? o0

tardy delta
ancient jackal
#

Fr fr

ancient jackal
#

And then just use that everywhere you used type Player accidentally and everywhere you used e.getOlayer repeatedly

ancient plank
#

Java is a hard language

quaint mantle
#

Why isnt this working?
Bukkit.getScheduler ().runTaskLater (this, block.setType(type), 40);

dire salmon
#

Space

quaint mantle
#

still isnt

dire salmon
#

getScheduler()

#

What is block.setType

tardy delta
#

you cant do api stuff async

#

go back to main thread

dire salmon
#

^^^

quaint mantle
#

so i have to do that in main thread?

tardy delta
#

probably 'not working' means error

eternal needle
#

Hi i want so my players get a message on the screen when thay go to nether and end

if someone can say whats wrong beacus i don't get a message now ```
@EventHandler
public void onPlayerChangedWorldEvent (PlayerChangedWorldEvent e) {
Player player = e.getPlayer();
if(e.getPlayer().getLocation().getWorld().toString().equalsIgnoreCase("world_nether"{
player.sendTitle("empty", "empty", 20, 40, 20);

    }
}

}


Pls help and tag me
dire salmon
tardy delta
#

ye

Bukkit.getScheduler().runTaskLater(plugin, () -> {
  Bukkit.getScheduler().runTask(plugin, () -> {
    // set the type  
  })
}, time)```
ancient plank
#

We need to make the "DONT USE BUKKIT API ASYNC" warning bigger

tardy delta
#

we need pinned messages

tender shard
ancient plank
#

Idk

tender shard
#

but yeah 99% of just send their stacktraces here without reading them

ancient plank
#

I've never accidentally used bukkit API async

tender shard
#

me neither but I've seen a ton of stacktraces from other people doing it lol

#

it usually tells you exactly that you are accessing API async and you mustnt do that

tardy delta
#

or people that dont know they have to watch the console

ancient jackal
#

Can you guys tell me what’s wrong? It says I’m getting an OutOfBoundsException on line 34 saying its out of bounds on an array

lean gull
#

does anyone know what the ender pearl cooldown thing is called? like the fillup thing and how it doesn't let you use it

tardy delta
#

?showcode

#

?code

#

smh we need that too

ancient jackal
#

?sike

tardy delta
#

show code

lean gull
#

does it only work for types of an item, or can i also do it with like items that have a certain nbt tag

tender shard
#

it works for Materials

lean gull
#

ah frick

#

is there anything simillar to it?

tender shard
#

you can of course listen to stuff like PlayerChangeHeldItemEvent and simulate a per item cooldown

#

so if someone switches from your custom diamond_hoe to a normal one, you remove their cooldown

#

and apply it back when they switch back to your custom model data diamond hoe

ancient plank
#

Index out of bounds, I wonder what that means AnimeThinking

tender shard
ancient jackal
tardy delta
#

i said show code

#

?paste or if its small just paste it here :)

undone axleBOT
tender shard
#

you try to access array[n] although array.length is smaller than n+1

#

you try to send a letter to 123 Some Street although there are only 122 houses on Some Street

ancient jackal
tender shard
#

wtf

#

what is that eve nsupposed to do

tardy delta
#

-1 indexer of an array doesnt make sense

#

there is no -1th element

#

it starts counting from 0

#

so arr[0] is the first one

ancient jackal
#

Ok so if I do

arr[-1] = …

Then it should work right

tender shard
#

no

tardy delta
#

NO

tender shard
#

?learnjava

viral crag
#

ever see a bad for array decrement loop?

undone axleBOT
tardy delta
#

it starts at 0

solar sable
#

hey guys i want to ask if any of you know how to ask questions on microsoft without the feedback and stuff

tender shard
#

ask questions on microsoft?

solar sable
#

well yea cause its broken rn

#

i cant open like png and jpg

tender shard
#

microsoft is broken rn?

solar sable
#

it just says this

tender shard
#

just hit the maven reload button and it'll work

#

or run BuildTools with --remapped option

solar sable
#

huh

tender shard
#

it was a joke

#

this isn't exactly the right channel lol

solar sable
#

ok but is there any places that i can ask about this

ancient jackal
#

The problem is photoshop isn’t the default photo app

solar sable
#

but all this time it just opens on the "Photos" app but now it doesnt even open

viral crag
#

they are just viewing photos and windows either updated or broke the app, they need to reinstall it

ancient jackal
#

Is photos a windows store app

ancient plank
#

poor jeff

solar sable
#

reinstall the photos app?

ancient jackal
#

Yes

solar sable
ancient plank
ancient jackal
tender shard
#

what is your peoples' opinion on using enum for utility classes?

misty current
#

how can i generate a void world? afaik you need to override generatechunkdata from chunkgenerator but it's deprecated

ancient jackal
misty current
#

so im not sure if it would work

tardy delta
#

the hate the fact that my screen is so small for coding

#

14 inch or something

tender shard
#

my macbook only has 13 inch

#

but still a higher resolution than my 55" tv lmao

viral crag
eternal needle
#

Hi i want so my players get a message on the screen when thay go to nether and end

if someone can say whats wrong beacus i don't get a message now ```
@EventHandler
public void onPlayerChangedWorldEvent (PlayerChangedWorldEvent e) {
Player player = e.getPlayer();
if(e.getPlayer().getLocation().getWorld().toString().equalsIgnoreCase("world_nether"{
player.sendTitle("empty", "empty", 20, 40, 20);

    }
}

}


Pls help and tag me
tender shard
#

oh wait

#

the code doesn't even compile

#

is that your actual code?!

eternal needle
tardy delta
#

i have a second screen which is bigger but i cant use it all the time

tender shard
#

erm yes, no

#

that cannot possibly compile

misty current
#

did you recode the compiler or something

misty current
#

lmfao

tender shard
#

equalsIgnoreCase("world_nether"{

#

wtf

misty current
#

that would not compile

viral crag
#

you think there is something wrong if you have a missing ) ?

eternal needle