#dev-general

1 messages · Page 615 of 1

cinder flare
#

i can setup a docker bungeecord setup on my Windows machine and then go and set the same exact setup on a Linux machine and it will work identically

#

it also centralizes everything really nicely, so you don't have to guess where each config file is, it has to be in the mounted volume

#

Especially on stuff like Pterodactyl panel, you just have a File Manager that shows everything in the container, super convenient

half harness
#

oh does ptero show all files in the machine/container?

#

like if i have an mc server in ptero

cinder flare
#

it shows the docker volume that it is attached to, yes

half harness
#

oh

cinder flare
#

docker has very much revolutionized devops and deployment of applications

#

you can automate deployment really easily by just rebuilding the docker container and booting that bad boy up

#

and kubernetes takes that to the logical extreme, you define some goals and give it a docker to run containers on and it'll make and destroy containers for you automatically

half harness
#

how come you wouldn't just leave the container up running?
online I'm seeing examples such as mysql and nginx, but shouldn't you just leave those on all the time on one machine?

cinder flare
#

well sure, those are a great example of a persistent service

half harness
#

oh

cinder flare
#

but, say for instance, you have a custom web app

#

like at my work

#

whenever someone merges a PR, it runs all the validations, takes down one of the two versions of our web server, applies the update, brings it back up, takes the other one down, applies the update, and brings that one back up

#

so we have no downtime while deploying updates

#

and just updates in general for anything you're running

#

for instance, on my Ptero server, I run a Prometheus and Grafana setup

half harness
cinder flare
#

whenever I need to change one of the base configs for them, or update them to a newer version, it's as easy as clicking reinstall and booting the container back up

cinder flare
#

they maintain no state themselves, so killing them affects nothing

half harness
#

stateless? 👀

obtuse gale
#

stateless 😌

cinder flare
#

they just read from the database on AWS and get static files from S3

#

so if we wanted, and needed to, we could have 50 of the web app running at once

half harness
#

o

cinder flare
#

and it makes development a breeze

#

I can spin up my own copy of the web app on my machine in about 10 seconds

#

just git pull, and run docker-compose up

#

docker is literally the biggest thing to happen to devops in its entire lifetime basically

#

it allows us to abstract away the actual implementation like never before

cursive jolt
#

Works on my machine… taken to the next level

cinder flare
#

I mean yeah, it is literally guaranteed to

half harness
#

👍

ty for the explanations :D

cinder flare
#

yeah lol, i literally won't use an application if I can't do it through docker anymore

oblique heath
#

docker sexy

hot hull
#

Why do I have a strong feeling that request paid is a scwam

static zealot
#

yeah same. imagine paying 15$ to turn a SVG into HTML/CSS

hot hull
#

I thought you were better than that terfs!

wintry plinth
cinder flare
#

it just makes it so easy to have confidence that a deployment will work

cinder flare
#

docker is amazing if only used solely as a tool to reproduce pip environments

#

those things are fucking dog

wintry plinth
#

Yeah, eventually I'd like to migrate to using it fully, especially these days with all the dependencies required

#

And migrations to new machines seem a breeze

cinder flare
#

yeah dude

#

literally just copy paste bam

#

especially if your container is stateless

#

holy shit it's the best thing in the world

#

deploy a container anywhere, connect to S3 and Aurora, bam you're set

wintry plinth
#

Yeah it looks so cool, I think these days you have so many configuration for like databases, and shit

#

it gets a mess doing that repeatedly

ruby dew
#

have been getting this failed to add pdh counter error for my mc servers

#

please help

#
[20:31:38] [ServerMain/WARN]: Failed to add PDH Counter: \Paging File(_Total)\% Usage, Error code: 0xC0000BB8
[20:31:38] [ServerMain/WARN]: Failed to add counter for PDH counter: \Paging File(_Total)\% Usage
[20:31:38] [ServerMain/WARN]: Disabling further attempts to query Paging File.
cinder flare
#

what the fuck does that mean lmao

ruby dew
#

I cant even accept eula for my 1.18 mc server

#

this stupid error wont get off

#

it just keeps popping up right after bundles are unpacked

#

please helpppp

#

I dont need this stupid pdh counter

cinder flare
#

what even is a pdh counter

#

is that part of vanilla?

ruby dew
#

its spigot

#

but i have never seen anything like that

cinder flare
#

try setting your language to english

ruby dew
#

how can i set the language for each app

#

nvm imma jus google

cinder flare
#

mojang bug report says it happens when you're using non-english language

#

also for each app?

compact perchBOT
sturdy magnet
#

ok so related to spigot plugin to prevent crafting of specific item - golden apple

i get:
Could not pass event PrepareItemCraftEvent to Plugin v1.0.0
org.bukkit.event.EventException: null

Caused by: java.lang.ClassCastException: org.bukkit.event.inventory.PrepareItemCraftEvent cannot be cast to org.bukkit.entity.Player

my code: https://paste.helpch.at/timamuxiwa.cs

Thank you to every in advance

EDIT:
solved

sturdy magnet
#

but... i did that?

#

okwait

sturdy magnet
#

oh

#

i need to do it for event?

old wyvern
#

🤦‍♂️

#

?learn-java

compact perchBOT
#
FAQ Answer:

Online Courses:
Online courses are also great for learning java. Some websites that offer them are:

  • Coursera - Free unless you want a certificate
  • PluralSight - Great courses from what I've seen. Mostly Paid
  • Udemy - Never used them myself but they seem to all or at least most be paid.
    My first ever course was one from Coursera. - I can say it was pretty good at introducing me to the programming world as a whole not just java.

Oracle Docs:
Oracle docs can help a lot at learning and understanding java:

  • Start with this,
  • Breeze through this (skipping stuff that doesn't seem relevant like bitwise operators),
  • Hit this.
    They're the first three from this larger thing which you should definitely go through overall. But those three should be enough for slightly better understanding of what is happening here without feeling like a huge time sink.
    That one is a small part of this larger site wherein "Essential Java Classes" and "Collections" also have good useful stuff

Other services:
Some other cool services that will help you learn java are:

As you can see there are plenty of good ways to learn as long as you're willing to invest the time. Have fun learning!

primal crystal
#

do it for the player

sturdy magnet
brittle leaf
#

tho it doesnt look like there is a getPlayer method

ocean quartz
#

And yeah that event doesn't give you the player, it gives you the viewers of the inventory which will be HumanEntity

sturdy magnet
#

i'll do this to my post

distant sun
#

any idea why IJ doesn't work properly?? main is just a folder

static zealot
#

right click it and there's a button to mark it as the main module or something like that

distant sun
#

ah yea

#

well, that doesn't look good lol

lunar cypress
#

main is supposed to be "just a folder"

#

you gotta mark java as source root

distant sun
#

I SEE

static zealot
#

kek

agile galleon
#

all programming pros here

obtuse gale
#
boolean a = true;
boolean b = !a;

compiles to boolean b = a ? false : true 😵‍💫

cinder flare
#

spooky lol

#

i can't believe a ternary expression is faster than a binary not

obtuse gale
#

you see, it's not

#

but the jvm has no specific instructions for booleans

#

so it compiles to a branch lmao

cinder flare
#

awe jeez that sucks for performance

obtuse gale
#

though the jit will 100% optimize that away somehow lol

#

jvm jit is jvm jit after all

cinder flare
#

mmmmmm jit

#

so good

potent nest
#

There are even more specific interpreter instructions that will be used before any proper optimizations are applied. Not sure if stuff like that is replaced there already, but might be a candidate

tranquil crane
distant sun
tranquil crane
#

I don't even know what it was doing, I have 24 threads in this cpu and it still ate that much

distant sun
#

Looks like me trying to open the material enum

tranquil crane
#

That's normally what would happen but I was just selecting some text lol

tranquil crane
#

must have been some incredibly heavy text

hot hull
#

IJ gobbles up what it can

tranquil crane
#

it's back down to >1% cpu and 3.5gb of ram

hot hull
#

cpu usage is normally fine, just the ram consumption is insane

tranquil crane
#

who knows what kind of wizardry it's storing in all that ram

hot hull
#

My shitty ass code

#

@lavish notch tell brc he a dumbass

tranquil crane
#

what'd he do

hot hull
#

Man single handedly fucked the entire plugin

tranquil crane
#

well that doesn't sound good

hot hull
#

It was a hella good plugin, and now this shit, dissapointment intensifies

latent dirge
#

@hot hull Why did you resign from support position?

agile galleon
hot hull
#

sgp

cinder flare
obtuse gale
#

whats better:
Intel Xeon E3 1230 V3 32gb for $49 a month
or we can do a ryzen 5600x 64 gb for 99 a month
or we can do an i9 9900k 64gb for 115 a month

obtuse gale
#

ok thanks for your help

pure arrow
#

also the xeon would be pretty shit as servers require better single core performance rather than more cores

obtuse gale
#

gotcha

#

its old af

cinder flare
pure arrow
#

?

cinder flare
#

basically the only difference is value, and they're nearly at the same price lol

pure arrow
cinder flare
#

wow 5% and 4%

#

well within the margin of error, and user benchmark is not a pinnacle of quality either

pure arrow
#

idk, that's what i would choose anyway and it's 15$ cheaper per month

cinder flare
#

i wouldn't choose it if adequate cooling was given and I needed those higher clock speeds

cinder flare
#

has it been a year yet?

hot hull
#

2 more months

jolly fjord
#

where is the channel to ask stuff about spigot plugins?

cinder flare
lavish notch
#

y'know he doesn't respond to me any faster than you.

hot hull
#

Man cucked the entire plugin

static zealot
#

what plugin

hot hull
#

sgp

static zealot
#

yes I know what that is.

#

oh oyu mean shopgui+?

onyx loom
#

what happened

lavish notch
#

What did he do to fuck SGP?

#

It works fine for me.

distant sun
#

It doesnt accept frosty's config for 1.2.5 made in 2012 smh

hot hull
#

Pretty much yea lmao

agile galleon
#

what

#

bruh

hallow topaz
#

its possible hook placeholderapi to php?

boreal needle
#

probably

#

it's not practical in the slightest

primal crystal
# boreal needle probably

I don't think even probably would work...he can do is add the required placeholder to database... or open something like an API

hallow topaz
#

with database maybe (?)

primal crystal
hallow topaz
#

alright ty :>

boreal needle
#

what are you trying to achieve

#

this sounds like a potential xy problem

primal crystal
#

most prolly display stats on webpage or use it there

hallow topaz
#

yea

boreal needle
#

yeah placeholderapi is not designed for that

primal crystal
hallow topaz
#

alright, ty

lavish notch
hot hull
#

Had to make a custom plugin which bypasses sgps menu click cause it doesn't want to execute a blank action properly

lavish notch
hot hull
#

Config is just fine, just blank actions don't want to work

lavish notch
hot hull
#

blank

lavish notch
hot hull
#

As in you click and it does nothing, now it always opens the buy item menu

static zealot
#

use the dummy item type

lavish notch
#

@hot hull use a dummy item like Blitz said

#

Here is an example;

1: 
  type: dummy
  item:
    # usual item stuff
  slot: 1
hot hull
static zealot
#

true

lavish notch
agile galleon
#

@cursive jolt quick question, does PacketEvents have a wrapper for the EntityPosition packet? i cannot seem to find it

cursive jolt
#

Yes

agile galleon
cursive jolt
#

Check NPCManager

agile galleon
#

oh

#

NPC.java

#

got it, thank you

prisma wave
#

kinda wish that spigot events had an undo method rather than the whole setCancelled thing

#

would make async stuff in events a lot easier

#

rather than just "pray that its in cache"

#

unless anyone knows a better solution

obtuse gale
#

What do you mean?

#

Kinda like rollback-able state?

prisma wave
#

yeah

#

player places block
Lookup location from database async
If location is protected, undo the place

obtuse gale
#

Well you shouldn't need to fetch, it should be cached

#

In chunk load or whatever

#

Or maybe during player move and load data from surrounding chunks when they cross one

#

Idk

#

But there are so many things that can happen on block break, say you break a chest

#

A second later the action is undone

#

But the player has all the items etc

#

gg

prisma wave
#

yeah that's true

#

Assuming it's cached is probably the best way ig

pliant dagger
#

Anyone know a python dev that can work with telegram api?

cinder flare
#

probably like, most people who can use python

#

im sure the telegram api ain't half bad

pliant dagger
#

Yee

#

Alright, looking for python dev

old wyvern
#

is it that earlier task?

sturdy magnet
#

ok so for InventoryClickEvent
there is this getTitle() method which is depricated.
i searched for other methods from 1.18.1 for InventoryClickEvent event but i can't find what i need
any thoughts? https://prnt.sc/jfUaplCk1wcv

#

(tag me when you answer)

mental trench
#
  1. dont use title, use inventory holder
#
  1. getTitle exists, inside getView
#
  1. read number 1
sturdy magnet
mental trench
#

did you read

#

what i just said?

sturdy magnet
#

but it says it's depricated
and i am trying to do this in 1.16.5
but will need this for 1.17 (where maybe getTitle() doesn't exist)

mental trench
#

ok, first

#

is not deprecated

#
  1. i said: getView getTitle, never said anything about getInventory getTitle
#
  1. Use inventory holders, not title
sturdy magnet
#

ok then, i thought this doesn't exist in 1.17+ (and i checked, however i didn't use search option but CTRL+F at InventoryClickEvent docs)
getView().getTitle() worked, thanks

mental trench
#

yeah it works

#

still, you should never check inventory title

#

use inventory holders, as most people do

sturdy magnet
#

i never used inventory holders, will check out later

mental trench
#

title can be faked, not a good option

#

additionally, inventory holder is 100 times better as you can "track" (save) data in it

#

to use them as you wish instead of relying on title

#

anad hashmaps to store dynamic data

sturdy magnet
mental trench
#

performance, cant tell that tbh

#

but they are better 😛

sturdy magnet
agile galleon
#

InvHolder wasnt meant for these actions as a bukkit dev stated

obtuse gale
#

@zinc basin accept my friend request

mental trench
#

still better than checking title, imo

unique field
#

imma looking for some package which will check two strings russia.com and soviet.org for example, and will return the value in percentage of how much they are same
For javascript expansion

gentle hinge
#

hi

#

plugin noflyzone doesnt work please help me!!!!

dense dew
#

?startuplog

compact perchBOT
#
FAQ Answer:

Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.

brittle leaf
#

i open my plugin workspace, then im like nah i cant be bothered then i close it and go watch youtube.

#

does anyone else do this?

distant sun
#

Ofc

brittle leaf
#

its the story of my life at this point

wintry plinth
#

Yep, its called procrastination 😂

brittle leaf
#

wish i could stop doing that and just get this mmo done

wintry plinth
#

Best thing is just get started, dont think about it

#

and break it up into small chunks

#

Like rn I'm building a tagging system for grouped analytics, seems complicated, but when you split it up, it seems easier

prisma wave
#

We do a little decomposition

old wyvern
#

We do a little functional composition

brittle leaf
#

im currently working on skills, judt gotta figure out how to implement skills

#

like they arent that difficult really

static zealot
brittle leaf
static zealot
#

Someone please save me. Is Vysor something I should use to access my phone screen (that has the display broken) from my pc or is it a virus? bcz youtube removed dislikes...

#

found some 2018 comments saying its ok. but we're 4 years later now

pure arrow
#

how anyone know how to add CanDestroy tag to an item using NBTAPI? it's a list

distant sun
#

looks like you get the list and add your values

fickle tusk
#

Can someone explain me why this isn't functional

var VaultRank = '%vault_rank%';

function getVaultRank() {
    if (VaultRank == "default") return "hasdefault";
    else if (VaultRank == "iron") return "hasiron";
    else if (VaultRank == "gold") return "hasgold";
    else if (VaultRank == "diamond") return "hasdiamond";
    else if (VaultRank == "emerald") return "hasemerald";
    else if (VaultRank == "ruby") return "hasruby";
    else return VaultRank;
}
getVaultRank();
pastel imp
#

Suppose thats using PAPI

#

Are you parsing it?

#

Also, why dont you just hook to vaultapi?

pure arrow
#

also switch statement

pastel imp
#

And that

pure arrow
#

you need to optimize js code as much as possible because papi js uses a lot of resources

#

a ton more compared to a java papi extension

pastel imp
#

Ye

pure arrow
#

also you can use papi expansion changeoutput probably

#

try and see if it fits your needs

#

@fickle tusk

fickle tusk
#

I'm by no means an expert within any coding language I just know bare basics, I don't know why it wasn't working. All I did was change the file name from shardsfix.js to shardfix.js And now the placeholder is parsed correctly.

fickle tusk
fickle tusk
pure arrow
#

and it was basically the same thing, checking yaw of player and returning a special character that was a texture in my texture pack

fickle tusk
#

None of my js placeholders update constantly

#

only when requested which is like once every long time e.g. this is for whenever users want to buy items within a GUI

sly sonnet
boreal needle
fickle tusk
#

I don't understand the switch thing i'll just stick with what I have as it's not causing issues

#

can an output have multiple options ?

#
    view_requirement:
      requirements:
        anythinghere:
          type: string equals
          input: '%vault_group%'
          output: 'gold + diamond + emerald + ruby'
distant sun
#

no, it will expect your output to be literally that

mental trench
#

someonr said js expansion was slow (i mean when using it)

sturdy magnet
#

related to events
is event.setCancelled(true) the same as return?

#

for ChunkUnloadEvent event

obtuse gale
#

ChunkUnload is not cancellable

#

return is just return from your listener function, changing the cancellation state (for cancellable events) just "marks" the event to prevent it from happening on the server

sturdy magnet
#

ok i hate this api changes

#

i never used to create 1.13+ plugins

obtuse gale
#

You should use plugin tickets

sturdy magnet
obtuse gale
#

If you want a chunk to be loaded you should add to the chunk a plugin ticket, it's now the supported way to not unload chunks

#

Search in the javadoc for "ticket"

sturdy magnet
#

so that's why i used event.setCancelled()

#

however i see now this isn't supported anymore

obtuse gale
#

okay

sweet cipher
#

Lol

pastel imp
#

did he

#

just completely ignore Emily lol

cursive jolt
#

yeah use tickets

#

1.14 changed the internal chunk system to use tickets.

distant sun
#

I HATE THIS CLASS

onyx loom
#

bad pc

distant sun
#

"the ide is running low on memory" it has 3GBs ffs

agile galleon
distant sun
#

🙈

obtuse gale
distant sun
#

🤣

obtuse gale
ocean quartz
#

Give it 6GB!

wind patio
#

very fun when you misclick

sick belfry
wintry plinth
quartz fox
#

ezrankspro plz anyone

#

how much ram i need for a base 1.18.1 server with 25 plugins btw

#

i have 8gb they tell me my memory is low sounds like BS

cursive jolt
#

how many players?

#

as memory usage depends on plugins and players, really

sick belfry
#

oh so having jetbrains runtime set as your JDK on the project doesnt support removing methods in debug IJ? funny

#

thought it had DCEVM on it

oak mist
#

[08:45:29 ERROR]: Username 'Vreeens' tried to join with an invalid session

#

how to fix it

drifting aspen
#

Not sure whether this is the right channel for this, but I think this is caused by the fact you have an online mode server, and the player is trying to connect with a cracked acc

cobalt pecan
#

Who haves coinflip plugin?😀

zinc vapor
#

anyone know if its possible to display item/armor durability on the scoreboard?

distant sun
#

Player#getEquipment()#getHelmet()#getDurability() ?

agile galleon
#

^

#

never look at docs huh?

sly sonnet
#

why look at docs when you can ask here and waste more of your time waiting?

agile galleon
#

right, my bad PES_LMAO

wind patio
#

python 😩

obtuse gale
#

Makes sense

obtuse gale
#

Oh how I’ve missed my emily

inner umbra
obtuse gale
#

i dunno man, js always has a fucked up trick under its sleeve

cursive jolt
#

It's NaN

inner umbra
old wyvern
#

8?

marble plaza
#

Hello! How can I replace all colorcodes with ChatColor codes? For example:
&c is ChatColor.RED
Do I really need to replace manually?

hot hull
#

ChatColor#replaceAlternativeColorCodes

marble plaza
#

That's weird, can't find it under ChatColor API

#

I see translateAlternateColorCodes

static zealot
#

yeah that's the one

marble plaza
#

Yeap, thanks :)
ChatColor.translateAlternateColorCodes('&',somestring)

sly sonnet
#

yes

drifting aspen
#

Trust me, once you start using it, you won't go back.

marble plaza
drifting aspen
static zealot
#

LMAO

drifting aspen
static zealot
#

I agree with your message

drifting aspen
#

oh ok

#

I thought that I fucked something up, I should be less paranoid

long dagger
ocean quartz
#

Dark mode task manager on next win11 update thonk

obtuse gale
#

Mail app omegaalul

#

speaking of which I should check mine

marble plaza
#

Hey! I'm trying to find already spawned entities when they are being loaded with chunk.
ChunkLoadEvent has getChunk().getEntities, but it's empty, doesn't list any entities...
How can I get entities that are already spawned? Is there any entity load event?

marble plaza
#

But how much? I see that they are loaded async, but time always varies.

#

There's really no entity load event I could use?

inner umbra
marble plaza
#

That's spawn, not load

#

Entity is already spawned and being loaded from unloaded chunk.

inner umbra
#

Then yeah just add a 1 tick delay. Entities aren't spawned async. They literally can't be xD

marble plaza
#

Will try - thank you!

inner umbra
#

EntitiesLoadEvent was apparently added.

marble plaza
#

What the... Google is piece of sh*t, didn't come up with searches like "spigot entity load event"
Thank you!!!

warm sigil
#

When compiling plugin in gradle/jar it compiles but when I drop it in plugins directory in server it says that it don't have plugin.yml when it is located in src/main/resources

drifting aspen
cinder flare
#

It won't put your resources in unless you are

warm sigil
marble plaza
#

This is so weird, entity.getName() is the same as entity.getCustomName(), when custom name is set.
Anyone knows how to get entity initial name? That's being set by the server, can't be changed?

cinder flare
#

What even is the initial name? Like Cow?

marble plaza
#

Yes

warm sigil
cinder flare
# marble plaza Yes

Uh, maybe you can access the translations? and then convert the EntityType enum to a name?

marble plaza
#

That's the thing, can't use entity type, because one type can have different names.

cinder flare
marble plaza
#

For example: TROPICAL_FISH can be Triggerfish, Cichlid, etc...

cinder flare
#

oh man I have no idea

#

maybe a Fish has what type it is?

#

ah yeah TropicalFish#getPattern()

marble plaza
#

Huh, that's kind of sloppy way... I still can't understand why getName() changes, when setting setCustomName... what's the point of custom name if it changes getName...

cinder flare
#

oh weird, so getName is from CommandSender

#

and getCustomName and setCustomName are from Nameable

#

I don't think there even is a default "name", just that getName from CommandSender happens to give you the i18n entity name for whatever entity it is

marble plaza
#

onEntitiesLoadEvent() entity.getName(): Creeper lvl 1 ; entity.getCustomName(): Creeper lvl 1

#

Literally the same... damn shame. I'll try to temporarily "null" custom name and let's see what happens to the getName then.

cinder flare
#

Pretty sure it just calls getCustomName under the hood

#

ah no, they both call the NBT name

warm sigil
cinder flare
#

and you're running gradle shadowJar and it just gives you an empty jar with only a META-INF?

marble plaza
# cinder flare ah no, they both call the NBT name

Well, nulling setCustomNake works, I can get the initial name with that.
Where did you see that they both call NBT name? Maybe I can get "raw" initial name somewhere by reading some other NBT tag?
Because initial name is being set after setting setCustomName(null):
1onEntitiesLoadEvent() entity.getName(): Creeper lvl 1 ; entity.getCustomName(): Creeper lvl 1
2onEntitiesLoadEvent() entity.getName(): Creeper ; entity.getCustomName(): null

cinder flare
# warm sigil Yeah

Then either the build script isn't right, or you're not calling it right

cinder flare
#
    public void setCustomName(@Nullable Component name) {
        this.entityData.set(Entity.DATA_CUSTOM_NAME, Optional.ofNullable(name));
    }

    @Nullable
    @Override
    public Component getCustomName() {
        return (Component) ((Optional) this.entityData.get(Entity.DATA_CUSTOM_NAME)).orElse((Object) null);
    }
#

That's the code straight from Paper

#
    @Override
    public Component getName() {
        Component ichatbasecomponent = this.getCustomName();

        return ichatbasecomponent != null ? Entity.removeAction(ichatbasecomponent) : this.getTypeName();
    }
#

aha!

#

@marble plaza there it is

warm sigil
cinder flare
marble plaza
cinder flare
#

So I guess you have to set the customname to null to get access to that name, unless you break into NMS lol

marble plaza
#

Setting null seems easier :D Thanks once again :)

cinder flare
#

the top level one isn't the actual plugin

marble plaza
#

Hey! I'm trying to create BungeeCord plugin, but can't figure out how to determine if command was executed from Bungeecord console or not.
Spigot has:
if (sender instanceof ConsoleCommandSender)

What about Bungeecord?

tulip patrol
#

Hello everyone! How would I make a compass pointer spin in spigot coding?

tulip patrol
#

I'll be a little more specific. I have gotten the compass to point to players but when there are no players online it still points to the last point the player was at. I want it to spin instead of pointing to the ghost of a player who once joined.

agile galleon
tulip patrol
#

so if I make the compass target location the player, then it will spin?

agile galleon
#

not the player itself but its location

tulip patrol
#

lol, I can't believe I haven't tried that, ill give it a shot

#

yeah ik the player.getlocation

agile galleon
#

👍

tulip patrol
#

I just got back from school and tried it....

#

it doesn't spin 😭

agile galleon
#

what

#

you have to always set it to the players location

tulip patrol
#

that doesn't work 😭

agile galleon
#

why

sick belfry
#

I can say that although copilot is cool and gives good suggestions

#

it can be annoying

#

really annoying

old wyvern
#

Intellij is brain-dead again

viral grove
#

Idea keeps asking me to convert my classes to records :/. LET ME KEEP MY PRIVATE FIELDS VIA DI PRIVATE, INSTEAD OF MAKING MY CLASS A RECORD

sly sonnet
#

@SuppressWarnings("ALL")

#

ezpz

steel heart
#

💀

cinder flare
#

or lower their priority so it won't underline

naive parcel
#

Hi, there is a warning in my plugin when the server starts: https://paste.helpch.at/fuwuqaximu.sql
But this error does not affect the work of the plugin, I would like to know what this error is about and how to remove the warning

cinder flare
#

In AJoinerPlugin#onEnable, you execute a query with MySQL, what does that look like?

#

Because I think you're supposed to do ResultSet.next() or something to get the first part of the ResultSet

naive parcel
cinder flare
#

oh yeah so

#

you need to do ResultSet.next()

#

cause the pointer that resultset gives you

#

is before the database

#

then you have to do next to go to the first row

potent nest
warm sigil
#

How can I get a <version>1.0.0</version> into sendMessage ?

potent nest
#

what

plush bridge
#

hello

#

i want to make a simple placeholder

plush bridge
#

Yes i did everything specified in the website. I used With a plugin Internal class one

#

It is registered also

#

But when i try to parse it, It wont work

cinder flare
#

send your main class

#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

plush bridge
cinder flare
#

and doing /papi parse me %example_hello% doesn't return anything?

plush bridge
#

oh

#

I used %hello%:(

#

Thanks

cinder flare
#

np

distant sun
obtuse gale
#

Hello, with deluxemenu. I can't create a command that opens a menu to ban a player example: /ss <player>

It tells me that the command does not exist? do you have any idea please?

long dagger
#

@obtuse gale I can do your luckperms

obtuse gale
#

dm me

long dagger
#

open your dms

nimble cliff
#

guys

obtuse gale
#

yeah?

#

No working

#

CustomModelData

#

In config. Pls fix.

#

1.18.2 version

#

no working nbt_int: CustomModelData:1

#

no showing.

#

what? what plugin are you talking about?

agile galleon
#

They prob mean DeluxeMenus

distant sun
ruby dew
#

@neon crater 🤓

primal crystal
rotund blade
#

for minecraft plugins,

      if (cmd.getName().equalsIgnoreCase("start")) {
           player.sendMessage("Starting in 3");
           //delay 1 sec
           player.sendMessage("Starting in 2");
           //delay 1 sec
           player.sendMessage("Starting in 1");
           //other command...
       }```

is there any simple delay code? i tried .scheduleSyncDelayedTask and other thing but have many problem, im new at this
cinder flare
#

There's no simple way to do that due to async code and stuff

rotund blade
# cinder flare https://www.spigotmc.org/threads/creating-a-countdown.266702/

thanks for answer,

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.function.Consumer;

public class CountDown implements Runnable {
    private JavaPlugin plugin;
    private Integer assignedTaskId;
    private int seconds;
    private int secondsLeft;
    private Consumer<CountDown> everySecond;
    private Runnable beforeTimer;
    private Runnable afterTimer;
    public CountDown(JavaPlugin plugin, int seconds,
                          Runnable beforeTimer, Runnable afterTimer,
                          Consumer<CountDown> everySecond) {

        this.plugin = plugin;
        this.seconds = seconds;
        this.secondsLeft = seconds;
        this.beforeTimer = beforeTimer;
        this.afterTimer = afterTimer;
        this.everySecond = everySecond;
    }

    @Override
    public void run() {
        if (secondsLeft < 1) {
            afterTimer.run();

            if (assignedTaskId != null) Bukkit.getScheduler().cancelTask(assignedTaskId);
            return;
        }
        if (secondsLeft == seconds) beforeTimer.run();

        everySecond.accept(this);
        secondsLeft--;
    }

    public int getTotalSeconds() {
        return seconds;
    }

    public int getSecondsLeft() {
        return secondsLeft;
    }

    public void scheduleTimer() {
        this.assignedTaskId = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, this, 0L, 20L);
    }

}```

i copy one of the best answer from that thread, but i confused how to use it?
cinder flare
#

Looks like you make an instance of the object and run scheduleTimer on it

rotund blade
cinder flare
#

do you see the constructor?

#

you give it what it needs

#

so an instance of your main plugin, the seconds it will take, a runnable to run before the timer, a runnable to run when the timer is done, and a lambda that takes a CountDown object and does something every second

storm kelp
#

Man it's been so long since I was here that I actually understand the code now 😭

remote goblet
#

when you go from being bullied to being the bully in helpchat Sadge

storm kelp
#

no I was 100% the bully 4 years ago as well

remote goblet
#

welp

wintry plinth
#

Ayy 3 years running

static zealot
#

man 2020 is my favourite. I am so sad that I Didn't participate

wintry plinth
#

Yeah the colours were so nice

#

The others are bland

distant sun
#

I want mine ragedbarbarian

static zealot
#

😦

wintry plinth
#

Wtf

#

I remember a few weeks ago you mentioned it was in limbo

static zealot
#

yeah. pretty sure its lost

distant sun
#

yeah, most likely

#

😒

rotund blade
#

hi, i have a lil problem as a new

inside alpha.java file :

    public void example(final Player player) {
        Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            public void run() {
                player.sendMessage("message here");
            }
        }, 20L);
    }```

inside beta.java file :
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] a) {
    if (sender instanceof Player && cmd.getName().equalsIgnoreCase("test")) {
        Player player = (Player) sender;
        example(player);
    }
    return false;
}

i want run example(player) in beta.java from alpha.java, how to connnect it?
cinder flare
#

import it

rotund blade
#

i do, but still not working

#

i import alpha file from beta

cinder flare
#

send the whole code in a paste

#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

rotund blade
cinder flare
#

the class isn't called beta

#

and you didn't put a semicolon

#

and you should be capitalizing your classes

hot hull
wintry plinth
rotund blade
#

i put semicolon, forget to write it

primal crystal
cinder flare
#

that could very well be a static utility method tbh

primal crystal
cinder flare
#

you don't need to lol

#

you make the method static

primal crystal
#
    public void EXAMPLE(final Player player) {
        Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            public void run() {
                player.sendMessage("message here");
            }
        }, 20L);
    }
#

correct me if i am wrong?

#

it isn't static right?

cinder flare
#

yeah it's not

#

but you would make that method static

#

not the import

primal crystal
rotund blade
#

umm so how to make it static?

primal crystal
#

😂

cinder flare
#

public static void EXAMPLE(final Player player)

primal crystal
#
    public static void example(final Player player) {
        Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
            public void run() {
                player.sendMessage("message here");
            }
        }, 20L);
    }
primal crystal
cinder flare
cinder flare
primal crystal
primal crystal
cinder flare
#

i mean, you did it first is my point lmao

primal crystal
cinder flare
#

he didn't import it as static
this doesn't mean what you think it does

rotund blade
#

what is IDE? sneaky_simon

cinder flare
#

oh jeez lol

primal crystal
primal crystal
rotund blade
#

told ya im new angry_fingerguns

primal crystal
rotund blade
#

IntelliJ IDEA 2021.3.2

primal crystal
#

And thats an example of IDE

rotund blade
#

ooo i see, btw
'com.vanezzz.countdown.BETA.this' cannot be referenced from a static context

cinder flare
#

oh I forgot that was your main class

#

yeah put that in a separate file and pass in a reference to your main class

primal crystal
rotund blade
#

lemme try

#

ah i give up, ill just put it all in my main file

#

thanks guys for helping

primal crystal
#

Also i hope you are registering those commands too

static zealot
#

@desert horizon you're the github guy. in an issue or a response to an issue is there a fast way to mention a commit same way you'd do with a PR? #24 for example?

hot hull
#

Can't you just link the commit number?

desert horizon
static zealot
#

oh interesting

#

thanks

desert horizon
#

Yeah. GitHub didn't had a good Markdown page, so I went with making my own, especially since some features aren't documented yet

leaden sparrow
#

Hey, any1 know a way to convert DocX to PDF without having to pay for it? (Java)

static zealot
leaden sparrow
#

well everything I found used libraries like aspose or something like that which costs money

#

but I will give this a shot

distant sun
#

Apache poi is nice

rotund blade
#

hi, im making 2 file, main.java and alpha.java

main.java extend JavaPlugin

but alpha.java also need extend JavaPlugin, because i run .scheduleSyncDelayedTask on that

i tried put this inside alpha.java

    private Plugin plugin;

    public alpha(Plugin plugin) {
        this.plugin = plugin;
    }```

but still show Cannot resolve method `'scheduleSyncDelayedTask(com.vanezzz.ngckevent.alpha, anonymous java.lang.Runnable, long)' `
obtuse gale
#

Show your task

remote goblet
#

thoughts

pastel imp
#

uhm what's the difference between p.getInventory() and p.getOpenInventory()? AKA what's the difference between playerinventory and inventoryview

static zealot
#

getInventoryView? is this a player method? bcz I can't find it. Do you mean getOpenInventory?

pastel imp
#

fk ye

#

misread it

#

mb

#

it returns an inventoryview and my brain died lol

#

anyways yes, getOpenInventory.

static zealot
#

Pretty sure PlayerInventory just refers to the actual player inventory.

#

but an InventoryView gets both inventories a player might have open. the top and bottom one.

pastel imp
#

hmm okay thx

#

trying to see how I will do an invsee command

#

sounds easier than understood lol

#

I am actually confused how I will make it work and be able to even edit it in real time lol

#

at the end it's probably easy af and I am just quite dumb

sly sonnet
remote goblet
#

thank CH_Shy

humble silo
#

Would be prettier in kotlin 😩

obtuse gale
#

lulw

pure shuttle
#

hey is anyone here actual discord staff

sweet cipher
#

@compact perch are you a discord staff by any chance?

static zealot
compact perchBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

steel heart
remote goblet
#

perhaps

#

ive spent

#

5 hours on this fucking recode

#

to realise it doesn't work

#

and i had to restart

#

ive been doing this since 2pm, its now 9:40pm

dawn island
#

what didn't work with the previous recode?

remote goblet
#

uh

#

everything

#

the command system completely flunked on me, the entire config system created to allow comments just worked exactly the same

#

everythin just fell apart

#

so im just gonna use the same library rosewood plugins use because its less work for me

mental trench
viral grove
#

Are there any downsides for using plugman to test my plugins?

distant sun
#

yes, plugman should be avoided

#

you could look into hotswap if you want a quick reload, it works in most of the cases

static zealot
storm kelp
#

Only ever use /reload on a dev/testing environment

#

and even then, only really for config files

viral grove
#

Thanks everyone!

leaden sparrow
#

Hey I am trying to convert a groovy Transformer to Gradle KTS, I am struggling at this part:

def lines = context.is.readLines()
        lines.eachWithIndex { String line, int i ->
            def replacement = lines[i].replace("language1", "language" + matchCount)
            lines[i] = replacement
            result.append(replacement + "\n")
        }``` there is no readLines in kts
#

does anyone know an alternative?

leaden sparrow
#

TransformerContext

mental trench
#

i rather using /reload instead

ocean quartz
leaden sparrow
ocean quartz
#

Oh nice nice

hot hull
#

Gotta love these request paids where they don't even say what they need

dawn island
#

Doesn't two of the requests not follow the key points from yesterday (with the infinitely expandable budgets)

inner umbra
hot hull
#

Absolute tards

rotund blade
#

how to disable break for specific block? like only grass block

    List<Player> blockbroke = new ArrayList<Player>();

    public void onBlockBreak(BlockBreakEvent event) {
        Player p = event.getPlayer();
        if(blockbroke.contains(p)) {
            event.setCancelled(true);
            p.sendMessage("You can't break a block!");
        }
    }```
heavy goblet
#

btw i already asked this question from a plugin dev but
can making minecraft plugins help increase my proficiency in java coding?

lunar cypress
#

I mean, sure, if you do things right

#

There are people who have been doing plugin development for ages and still write truly horrendous code

heavy goblet
#

ooooo

heavy goblet
#

next question, will my knowledge in java eventually expand while making minecraft plugins? (assuming i will eventually attempt to create more complicated plugins)

pastel imp
#

You don't usually use the full extent and capabilities of java while coding minecraft plugins.

#

It's a good way to start with java in my opinion, but if you want to expand knowledge, you need to go outside Minecraft in my opinion.

#

But you will probably learn most of the things you need in Minecraft just fine. I would say it highly depends on how much you wanna know.

pastel imp
# lunar cypress There are people who have been doing plugin development for ages and still write...

Adding to this, I would say a good way of preventing this is doing things outside of our knowledge scope and try to improve it. One way I am currently doing it (since I am not really an expert in java and maybe not even "decent") is that I actually study theory of Java, I see examples of how code would work, I check resources explaining different methods of achieving something and read a lot about best practices.

wintry plinth
#

Odd request, but is it possible to be able to get a string with the color codes, without it translating?

I'm trying to log out a placeholder api placeholder (from deluxetags), I need to see the string with the colours, but without them being replaced

#

Is this possible somehow?

distant sun
#

you can send the string to console

wintry plinth
#

it replaces it weirdly

#

(using paper 1.18)

distant sun
#

ah well, papi replaces colors by default I believe

pastel imp
#

if you are using mini message

#

just don't parse it?

wintry plinth
#

can this be turned off somehow?

pastel imp
#

if that makes sense

distant sun
#

I dont think so

wintry plinth
#

papi is fucking my output

#

for tags

pastel imp
#

oh

#

oof

wintry plinth
#

its doing shit like §2§2§3§3§4

#

for hex stuff

#

which means minimessage dont work

pastel imp
#

what's ChatColor.values(String) for?

hazy widget
#

your account name is Siri?

#

sheeeesh

distant sun
#

d;spigot chatcolor#values

wintry plinth
#

haha

ruby craterBOT
#
public static ChatColor[] values()```
Description:

Returns an array containing the constants of this enum type, in the order they are declared.

Returns:

an array containing the constants of this enum type, in the order they are declared

tranquil sinew
#

Hello, iam currently programming a Spigot Plugin (for 1.18.1) and iam looking for a bukkit listener event when a player steps in water :D

pastel imp
#

I suppose

wintry plinth
#

it doesn't let me pass a value

#

just gives me every type

pastel imp
#

wut

distant sun
#

d;bungee-chat ChatColor

ruby craterBOT
#
public final class ChatColor
extends Object```
ChatColor has 25 fields, 13 methods, and  1 extensions.
Description:

Simplistic enumeration of all supported color values for chat.

pastel imp
#

oh oof

quiet depot
#

4head

pastel imp
wintry plinth
#

I can't use hex deluxetags with minimessage

#

screws me over because of papi translation

tranquil sinew
pastel imp
tranquil sinew
#

thx

pastel imp
#

but really, use google, it's your best friend.

#

literally what I searched

pastel imp
#

instead of using papi

static zealot
wintry plinth
#

oh really..

pastel imp
#

oof

wintry plinth
#

and its from a configurable string

static zealot
#

yeah. I was thinking of adding a raw placeholder

wintry plinth
#

yes please

static zealot
#

when I get to it xD

wintry plinth
#

because its caused me non stop grief 😂

static zealot
#

but for you that's in a few minutes

wintry plinth
#

i was up until 2 last night

#

banging my head

static zealot
#

ok good. that was my intention all along

wintry plinth
#

Because if I give it the string raw, it parses fine

#

but papi parsing with dtags causes that shit

#

and hahahaha godsend, ty <3

static zealot
#

pretty sure papi only parses the colors using the ChatColor#translateAlternativeColorCode method. not hex.

#

which is also a bug I believe which is hopefully going to be fixed one day

wintry plinth
#

oh...

#

fuck sake 😂

#

deluxetags is open sourced right?

static zealot
#

right...

#

LMAO

wintry plinth
#

you're joking?

static zealot
#

no

wintry plinth
#

fuck

static zealot
#

also. I just realised I fucked up. it will take a few more minutes to send you a build

wintry plinth
#

alright 😂

#

ty lots

pastel imp
#

F

wintry plinth
#

if this works, im speechless, because ive been completely baffled on rhis

pastel imp
#

Why do I have the feeling I will die 5x while trying to recreate invsee++ in my plugin

#

Whatever

static zealot
wintry plinth
#

current tag pls

#

%deluxetags_tag% is what I use rn

#

so like raw_tag

static zealot
#

yea yeah. no id. my bad

wintry plinth
#

lit ty

static zealot
hot hull
#

Charlie leaking shit I see

wintry plinth
hot hull
#

It shows that for every download now

static zealot
#

or actually download yeah

wintry plinth
#

ye ik ahah

static zealot
#

I've adapted already lol. its like it doesn't exist

hot hull
#

Can you even disable it?

static zealot
#

don't think so

wintry plinth
#

still translates

#

well the legacy colors do

#

not hex

static zealot
#

yeah. that's PAPI

wintry plinth
#

works, tysmmmm @static zealot

static zealot
#

no problem

wintry plinth
#

finally

pastel imp
#

Wait you actually got an account named siri?

#

tf

wintry plinth
#

ye lol

#

are me

hot hull
#

We get it

#

You're a virgin

pastel imp
#

😂

#

B- but I am a virgin too without those things lol

wintry plinth
hot hull
#

Is a joke before you start throwing tea at me

wintry plinth
#

I know aha

hot hull
#

Progress?

wintry plinth
#

Omggg you’re making a pet plugin?!

hot hull
#

No lol

#

Can't be fucked

wintry plinth
#

Oh

#

🤣🤣🤣

hot hull
#

Just making custom pet models and shit

wintry plinth
#

Ohhh

hot hull
#

Animations and everything

lethal parrot
#

hey guys may i ask is this a discord support channel?

#

i need help

compact perchBOT
#

There is no time to wait! Ask your question @lethal parrot!

tranquil sinew
#

public void onPlayerMove(PlayerMoveEvent event) {

    Player player = event.getPlayer();
    Material material = player.getLocation().getBlock(); <-----------

    if(material == Material.WATER) {
        event.getPlayer().setHealth(0.0D);
    }
}

Does anyone know why iam getting "Incompatible types. Found: 'org.bukkit.block.Block', required: 'org.bukkit.Material'" Error in the marked line ?

compact perchBOT
#
FAQ Answer:

Looking for discord support?
HelpChat is a Minecraft plugin and development support server and is not affiliated with discord in any way.
If you require support from discord, we recommend you to visit their official support website at https://support.discord.com
On this website, you can read their FAQs, or open a support ticket if necessary.

wintry plinth
#

You need to change it to Block

tranquil sinew
#

then it says: Operator '==' cannot be applied to 'org.bukkit.block.Block', 'org.bukkit.Material'

lethal parrot
#

where should i ask for help ? because my discord account got hacked

#

this is my alternative

wintry plinth
#

discord support

hazy widget
tranquil sinew
hazy widget
#

But aren't you getting a block?

tranquil sinew
#

idk

hazy widget
#

How would that equal Material.WATER?

tranquil sinew
#

ill try your solution

lethal parrot
hazy widget
#

Material material = player.getLocation().getBlock(); doesn't this get a red line or something?

#

getBlock should return a Block and not a Material?

tranquil sinew
hazy widget
#

yep

tranquil sinew
hazy widget
#

nice

tranquil sinew
#

is it difficult to set up an plugin.yml file to easyly change and customise the plugin ?

hazy widget
#

you mean config.yml, not plugin.yml

tranquil sinew
#

yes xD

rotund blade
#

Bukkit.getOnlinePlayers().forEach(player -> player.sendMessage("this is nether"));
how to make this code only send to player in world "nether"?

hazy widget
tranquil sinew
#

thanks so much for your help :D @hazy widget

primal crystal
#

else you can use streams...but I prefer those iterators over lambdas...

rotund blade
#

thanks!

primal crystal
#

i forgot one..in the loop

hazy widget
#

yeah

primal crystal
#

just typed out from here

pure arrow
#

not related to anything above, just curious

hot hull
#

Yes

primal crystal
tranquil sinew
#

how can i use a variable from the main class in another package ?

primal crystal
#

reference the main class into the class or use static

prisma wave
ocean quartz
#

Iirc forEach gets inlined
If not the difference would be almost non existent to the point that sometimes lambda is faster

primal crystal
primal crystal
prisma wave
#

inlining happens at runtime

ocean quartz
#

It can be multi lines

prisma wave
#

the JVM compiles the code into native and applies a ton of optimisations if a bit of code is used frequently enough

ocean quartz
#

Score is in milliseconds

#

Only the first 2 don't use lambda on each (for and while)

prisma wave
#

im still surprised at sequences not being faster

obtuse gale
#

Kotlin bad

#

Obviously

primal crystal
#

i am surprised kotlin is much faster xD

prisma wave
#

It's not lol

#

Lower is better

ocean quartz
#

Sequences only lost to streams in one test BM

primal crystal
#

okay...then forgive me xD

prisma wave
#

The main point of streams is parallel processing, the nicer code is a bit of an afterthought

obtuse gale
#

Also "lambda are slow" is like saying "calling methods is slow so I just have the entire program in a single function"
You're not gonna get any, and I do mean any significant amount of performance increase by doing that

ocean quartz
#

Yeah, lambdas are quite fast

#

If you have the right type tokens a lambda is faster than reflection's invoke

#

The jvm is surprisingly well optimized

prisma wave
#

Don't diss the jvm

#

Although idk if I should be compiling functions in elara to methods or lambda variables

#

Can see the benefits of both

#

but i think lambdas everywhere might not be great for performance

tranquil sinew
prisma wave
#

you need an instance of the class

#

i.e an object

#

or make it static but thats probably not a good thing to do

tranquil sinew
#

and how do i do this ?

prisma wave
#

new ClassName()

#

typically you'll use dependency injection though

#

?di

compact perchBOT
tranquil sinew
prisma wave
#

i mean that's pretty much it lol

#

if Other needs a CoolPlugin, you put it in the constructor and then pass the instance

wintry plinth
#

Or you use static 😍 jk

prisma wave
#

and then go to hell and die

tranquil sinew
wintry plinth
prisma wave
#

NOOOOOOOOOOOOOOOOOOOo

wintry plinth
#

What’s your code so far

prisma wave
#

NOAAAAAAAAa

tranquil sinew
wintry plinth
#

?paste

compact perchBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

wintry plinth
#

Put your code into this

#

Your main class, and the other class you want to reference

tranquil sinew
wintry plinth
#

Paste the link here

tranquil sinew
#

sowwy iam new here :P

wintry plinth
#

So paste your code into the HelpChat paste link, and then click save

#

It’ll give you a link

tranquil sinew
wintry plinth
#

And no worries :) we all start somewhere

#

So for clarification

#

I added

    private Main plugin;
    public WaterListener(Main plugin) {
        this.plugin = plugin;
    }
#

This passes your main class to your listener

#

Then added this to your

manager.registerEvents(new WaterListener(this), this);

This tells WaterListener what your main class instance is

Now you can use plugin.blah in your water listener

primal crystal
#

and i don't think the file would get called...
bcs..this isn't the full path plugins//WaterDeath//config.yml

tranquil sinew
wintry plinth
#

in your water listener

tranquil sinew
tranquil sinew
#

where i am sending the message ?

wintry plinth
#

ye in your water listener

tranquil sinew
wintry plinth
#

Yep

#
public class WaterListener implements Listener {
    private Main plugin;
    public WaterListener(Main plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {

        Player player = event.getPlayer();
        Material material = player.getLocation().getBlock().getType();

        if(material.equals(Material.WATER) && (!player.isOp())) {
            player.setHealth(0.0D);
            player.sendMessage(plugin.getConfig().getString("ResetMessage"));
        }
    }
}
#

to tidy it

tranquil sinew
#

thank you :)

wintry plinth
#

np :)

prisma wave
#

looking through some archives and i found the enterprise class name generator

static zealot
#

omg

prisma wave
#

i forgot how to run it

#
=== 1 Enterprise-Ready Class Names ===
AbstractPredicateVisitorObjectListenerBoostrapCandiateExceptionAdapterBeanBoostrapAbstractMapperExceptionPoolInterpreterBoostrapResponseFactoryVisitorServiceAdvisor
========================================
``` there we go!
static zealot
#

amazing

obtuse gale
#

that sounds like something spring boot would have

agile galleon
#

exactly kekw

obtuse gale
#

Coupling won’t be as tight

tranquil sinew
#

i already did it :D but thanks for the suggestion

obtuse gale
#

You passed main or just your config?

viral grove
#

Anyone have any experiences with gitbook?

steel heart
#

a bit

viral grove
#

Is it worth using? Or is something else better

steel heart
#

I find it good enough, like learning it doesn't take much time and then its pretty trivial and straightforward

#

yet it their themes and design looks clean and appealing to the user

modern swan
#

Could anyone that knows how behavior packs work give me some advice and answer some of my questions in a vc? DM me if possible please

brittle leaf
#

ive started to move away from strings to enums for my map identifiers

#

for stuff like enchants, skills, stats and items

#

which i believe is better for me atleast

brittle leaf
#

so instead of <String,Enchant> im using <EnchantEnum,Enchant>

#

It just looks better personally

#

cause strings were a little difficult to keep track of

agile galleon
brittle leaf
#

the enchant object

#

with the values

agile galleon
#

why do you need a hashmap then

#

just make a list

brittle leaf
#

so i dont have to forloop over it

agile galleon
#

what

brittle leaf
#

id have to for loop over the set to figure out which object has the values im looking for

agile galleon
#

oh

#

would the lookup time the same?

brittle leaf
#

single lookup vs every entry till its found.

agile galleon
#

but what does single lookup do under the hood?

brittle leaf
#

I have no idea