#help-development

1 messages Β· Page 2196 of 1

sterile token
#

are u still alive?

tardy delta
#

y

sterile token
#

c++ != java

paper viper
sterile token
#

isnt java channel?

paper viper
#

it was just a general question

#

lmao

sterile token
#

Or others lang are support

#

Oh lol

#

Didnt know that

#

I think i have a new place where i can atomize with typescript questions

#

🀭

paper viper
#

it wasnt a syntax/language question it was just a cross-compiler thing

tardy delta
#

uh no

sterile token
#

Fourten?

#

Fourten?

tardy delta
#

what

sterile token
#

How do you validate frontend inputs into backend?

#

Do you ue DOM?

tardy delta
#

dont know what you mean with frontend

quaint mantle
#

frontend = UI

#

in general

sterile token
#

Yeah

tardy delta
#

ye ik but ive only used visual c# for frontend

quaint mantle
#

@sterile token i think you're mistaking "frontend" with "clientside"

sterile token
#

Lmao conclure included into my lang the "mye"

quaint mantle
# sterile token Mye

the client sends the message, then the server hashes the message, then sends the client the hash

tardy delta
#

same

quaint mantle
#

if the client's hash doesnt match the response hash, then the messages are being tampered with

sterile token
#

Because im doing a form validation which i send it as a POST into backend

#

But everybody can do that

#

So it a big issue

quaint mantle
#

packet loss

crude estuary
#

What Happens at my Local Mail Service

sterile token
quaint mantle
#

you can probably sue for that

sterile token
#

But meh

crude estuary
#

not here

quaint mantle
quaint mantle
sterile token
#

i cannot

quaint mantle
#

🀨

sterile token
#

I dont kno

sterile token
#

hhaha

#

I can also fallao portugues

quaint mantle
#

i wasnt talking to you

crude estuary
sterile token
quaint mantle
crude estuary
#

xD

sterile token
#

In spanish

#

New friend unlocked

#

pbt we are a few that talk native spanish

crude estuary
#

Really?

sterile token
#

Yeah, mostly here talk english as native

#

I think in the uniq Uruguayan here πŸ˜†

crude estuary
#

i Have a lot of Friends from there

sterile token
#

Me too

#

Mostly works i do are from americans

shadow gazelle
#

Decompilers don't make random fields final

crude estuary
#

But they think that they are Final

#

and Put them Final

shadow gazelle
#

they don't

#

there might be an option to tell some of them to, but they don't by default

crude estuary
#

Some of them Work that Way

#

Thinking that a Field is Final

shadow gazelle
#

Which ones?

#

Fernflower doesn't

paper viper
#

The semantics of final is only enforced during compile time

#

I think they actually do exist in the class file, just most decompilers choose not to include them probably cause of performance or smthing

crude estuary
#

That's the Thing

#

But Recaf does the Final Fields thing to me

#

and i don't Put Final on those Fields

#

idk What Decompiler i used

paper viper
#

that's kinda odd

crude estuary
#

i Just use Whatever it Works

paper viper
#

but i mean regardless final is good

#

lol

crude estuary
#

Yes

#

xD

paper viper
#

always add it when you can

crude estuary
#

i Should do that

#

But Sometimes i Forget

paper viper
#

i use a plugin to do it for me

limber owl
#

anyone know how to make chunkgenerator?

crude estuary
paper viper
#

yes

#

The plugin is called Save Tools iirc

tardy delta
#

oh god

#

final keyword user

paper viper
#

lmao

#

Final has proven benefits

crude estuary
#

Looks Good

tardy delta
paper viper
#

Let me get the post

tardy delta
#

99% of the time youre not mutating a variable

#

lol

paper viper
#

im too lazy

shadow gazelle
#

You can only put ingots in the second input slot of the smithing table, right?

paper viper
tardy delta
#

serves for the compiler as a hint to apply optimisations??

paper viper
#

yeah

#

lmao

#

it actually optimizes code a little (sometimes)

crude estuary
#

You Help the Machine to Stop Looking for Another Modification of the Same Variable?

paper viper
#

^ that and also it saves the programmer time

#

what if you want to find a variable that mutates?

#

would you want to go searching all around in your code

#

to find 1 god damn variable

#

lol

crude estuary
#

xD

tardy delta
#

im not mutating my variables by accident lol

paper viper
#

Sometimes you have to mutate something

#

You can't always assume that everything will never be changeable lol

#

anyways i see no reason not to rlly, unless you are really lazy or something, but at that point just use a plugin to do it for you

grim ice
#

until i think that i need it to be modified

ivory sleet
#

final overrated x)

grim ice
#

basically same case with kotlin val and var

ivory sleet
#

yeah kotlin makes it a little bit more appealing

grim ice
#

always use val until u need to use var

tardy delta
#

rust is just mutable and threadsafe by default

ivory sleet
#

😌

tardy delta
#

immutable*

grim ice
#

devs getting fatter and fatter as technology progresses

#

2055: writes 1 letter code works

tardy delta
#

anyways lets go to bed

#

gn yall

grim ice
#

its like 12

tardy delta
#

1

#

got school

grim ice
#

im not sleepy yet aaa

tardy delta
#

im not either but i will be in class aaa

grim ice
#

drink coffee

#

DO IT

tardy delta
#

i dont drink that

grim ice
#

what

#

how

tardy delta
#

idk it tastes weird

grim ice
#

WHAT

tardy delta
#

smh

grim ice
#

HOW DOES COFFEE TASTE WEIRD

hybrid spoke
#

coffee is ew

grim ice
#

R U BRI'ISH (obv kidding im not racist okay)

#

lul

tardy delta
#

no

#

dont dare to give me tea

grim ice
#

then u dont like both?

#

bruh

#

just smelling coffee makes my day

#

i loved coffee from my childhood lol

tardy delta
#

hmm

#

cya

grim ice
#

gn

humble tulip
#

Cofe is amazing

knotty gale
#

so what is an alternative for the || symbol, I am trying to get something to work where a listener detects if an arrow hit a block, but I realized that I need to listen for multiple different blocks, by using the or symbol, the problem is that Material. wont let you use the || symbol

tall dragon
#

loops

knotty gale
#

ok

knotty gale
#

ok

knotty gale
lost matrix
#
  1. Create a Set field.
  2. Initialize a HashSet
  3. fill it with Materials
  4. call contains on it in the listener
knotty gale
#

ah ok

opal sluice
#

Hi, does someone knows how to spawn an AreaEffectCloud with AIR particles (to make particles invisibles) through NMS? I can't figure out how to change the particles :/

lost matrix
#

Its an entity. You can just make it invisible.

opal sluice
#

I know, but then in spectator mode, you'll be able to see its "ghost"

spiral hinge
lost matrix
queen patio
#

I am working with some GUI stuff, and was wondering what this Component is. I can't seem to find documentation on how to initialize it or how it works, but maybe I'm just blind. In this case I just want to give a string, but not sure how to make the component a string

spiral hinge
opal sluice
spiral hinge
humble tulip
#

Ohh

#

U didn't connect to the db yet

#

Do you know java?

tall dragon
#

ur trying to create a method inside ur main method

#

uhhhh

spiral hinge
#

That seemed to fix it. I believe

winged anvil
humble tulip
#

Change the - 5 to - range

#

But no nt really

winged anvil
#

facts wtf

#

damn

tall dragon
#

could just do block#getLocation() no?

humble tulip
#

Oh yeah lol

#

Doesn't really matter too much since getlocation returns a new loc

tall dragon
#

yeaa true. but i do feel like its cleaner

#

just my opinion ig haha

#

though i get annoyed over little things

#

for example the fact that ur looping Y->X->Z

#

i would never do that to myself

winged anvil
#

bless up

#

we got anything for ArmorEquipEvent?

#

or does anyone know a way

tall dragon
modest shard
#

awesome

queen patio
ivory flume
#

When my plugin runs onEnable, can I immediately access the scoreboard? or do i have to wait

#

hmm, it says it is only loaded ater the "first world has been loaded"

#

do plugins load before or after

#

okay i looked and it looks like they do so i should be fine but pls correct if im wrong there are no javadocs on onEnable

humble tulip
#

Plugins load after the world loads

#

Unless u want your plugin to load before then it won't

#

Sorry

ivory sleet
#

frqnny most stuff is accessible when onEnable runs

humble tulip
#

Enable

#

Not load

ivory sleet
#

things like the scheduler isnt

subtle folio
#

how do I check if a player is critting?

#

how to check if hit is critical hit in damage event?

#

if (player.getFallDistance() > 0 && !player.isOnGround()) event.setDamage(event.getDamage() * 1.5F); fig out ty guys

winged anvil
#

?paste

undone axleBOT
winged anvil
#

for some reason this will not stop throwing a NoClassDef exception. I have everything the same as what's in the github from mfnalex as well as their website on how to shade. I've tried a different dependency as well and that doesn't work either

shadow gazelle
#

getEntity in PlayerDeathEvent returns the player that died, right?

nova sparrow
#

Just wanted to ask, does using the inventory#getSotrageContents() give you an array with only itmes, or are there placeholders

nova sparrow
#

for emtpy slots

humble tulip
#

how does pathing work inside a jar file?

#

i'm trying to get a resource with the path 1.13\somefile.yml

#

should i not use \

#

ill try / and report back

river oracle
#

generally I reccomend staying away from \ for files your going to want to use /

humble tulip
#

nvm i used / and it worked

river oracle
#

\ is a windows only thing

humble tulip
#

i didnt use \ intentionally

#

used File.separator

#

jarfiles use / i assume cuz / works now

river oracle
#

unix standard for file seperator is / generally safe bet is File.Seperator

halcyon mica
#

Alright, here is an advanced reflection question

#

I am writing a automatic annotation based nbt serializer

#

As such, I have "NbtParser" maps which map a certain type to a valid nbt element

#

The NbtParser has two generic parameters, the origin type and the resulting nbt element

#

But since I am iterating reflectively over annotated fields, I don't have any specific types

#

So how can I capture the actual type of the field in a way where I can pass it to the parsing method?

ivory sleet
#

reifiable types

upbeat yarrow
#

are spigot 1.16 and 1.18 fully backward compatible?

#

cause Im trying to port a mod from 1.18 and i noticed i accidentally had 1.16 as the main dependency and never noticed till now

halcyon mica
river oracle
#

Again its not safe to assume. I'd do quite a bit of testing

upbeat yarrow
#

i accidentally made it portable is what Im saying

#

like I made a whole mod for 1.18.2 using the 1.16.5 api

river oracle
#

a 1.16 plugin should fully support 1.18 depending on the use-case

upbeat yarrow
#

yea it seems so

#

lucky ignorance on my part lmao

river oracle
#

I thought you meant the other way around

upbeat yarrow
#

I did say it like that

river oracle
#

1.18 plugin meant for 1.16.5

upbeat yarrow
#

so i understand your confusion

dusty herald
river oracle
#

yea you should be fine, but its just better to use the most up to date API in the future as I'm sure your aware there are more features and stuff

quaint mantle
#

how can i add damage to the base damage i deal to a mob? I have a strength system where if you have 4 points of strength, you deal 1 extra damage so if i do 5 damage base, and have 4 points of strength, id deal 6 damage in total

upbeat yarrow
#

weird

river oracle
quaint mantle
#

yep im using that event but there is no real addDamage or something

upbeat yarrow
#
plugins {
    id 'java'
}

group 'me.xyz.abc'
version '1.0'

repositories {
    mavenCentral()
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
}

task afterJarRemoteCommands(type: Exec) {
    commandLine 'cmd', '/c', after_jar_remote_script, jar.getArchiveFile().get().asFile.getPath()
}

task afterJarLocalCommands(type: Exec) {
    commandLine 'cmd', '/c', after_jar_local_script, jar.getArchiveFile().get().asFile.getPath()
}
#

this is my build.gradle

#

works for 1.18

#

but not 1.17

river oracle
#

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

quaint mantle
#
double dealtDamage = damaged.getLastDamage();
damageModifier = userStrength * .25;
edmg.setDamage(dealtDamage + damageModifier);```
just did this
#

should hopefully work

river oracle
river oracle
upbeat yarrow
#

im now even more confused

#

it doesnt work for 1.16 either

#

even though build.gradle says 1.16

river oracle
#

error?

#

?paste

undone axleBOT
upbeat yarrow
river oracle
#

its because you specified your api version in your plugin.yml as 1.18

upbeat yarrow
#

ah

river oracle
#

plugin.yml -> using 1.18
gradle using -> 1.16.5

#
[21:10:38 ERROR]: Could not load 'plugins\DuelPlugin-1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.18```
quaint mantle
#
org.bukkit.event.EventException: null```

what exactly does this mean?
river oracle
#

?paste

undone axleBOT
river oracle
#

send everything

quaint mantle
#

the entire error or the code?

river oracle
#

entire error

quaint mantle
river oracle
#

lets see where you register the event at

quaint mantle
#

and just another very fun thing, the apply poison doesnt work so thats cool

river oracle
#

Where do you register the even though?

quaint mantle
#

oh in a class called EventListener

river oracle
#

also did you send the entire stack trace with the error? I'm not seeing any of your classes in there

river oracle
quaint mantle
#

lemme get it to print a stack trace

#

well see, its other events work fine

#

but this one doesnt

river oracle
#

are all your events in one class?

quaint mantle
#

nope, only the smaller ones

river oracle
#

well since that stack trace you sent doesn't see the whole picture something in teh code you sent is null

#

the stack trace should tell you exactly where hunt out for your class names in it and it should provide an exact line

full forge
#

?learnjava

undone axleBOT
full forge
#

thanks bro

humble tulip
#

@quaint mantle data is null

#

did you instantiate it?

quaint mantle
#

omg no i didnt

#

im so stupid

humble tulip
#

lol

quaint mantle
#

1s

quaint mantle
humble tulip
#

i'm not sure how your sqlstatshandelrclass looks

#

however your constructor looks would be my guess

quaint mantle
#
        this.plugin = plugin;
    }
#

this bit?

river oracle
#

Yes sir

quaint mantle
#

so based off this, how should i be instantiating it?

#

i had this same issue earlier but i got no idea what i did to fix it

river oracle
#

Just create a new object but I'd be passing the same one around if your dealing with a db a bit overkill to have so many connections open

humble tulip
#

instantiate in ur main class

#

create a getter

#

and get it frm ur main class in your lsitener

quaint mantle
#

im so lost lol, ive lost the ability to think this.data = new SQLStatsHandler(this); this?

#

this is in my main class

humble tulip
#

Yes

#

And create a getter

#

Then pass your main class to ur lostener the same way u do in ur statshandler

#

And do plugin.getData()

#

And voila u have ur data instance

quaint mantle
#

where should the getter be made?

humble tulip
#

Main class

quaint mantle
#
public SQLStatsHandler getData() {
        return this.data;
    }

like this right?

humble tulip
#

yes

humble tulip
#

public SQLStatsHandler(ThunderLearn plugin) {
this.plugin = plugin;
}

#

do something like that with ur listener class

#

so then u can do this.plugin.getData()

#

and u have the data

quaint mantle
#

this goes in the Listener?

humble tulip
#

yes

#

but with ur listener class name ofc

quaint mantle
#

uh i already had one in this class java public EventListeners(ThunderLearn plugin) { Bukkit.getPluginManager().registerEvents(this, plugin); }
should i just modify this one?

humble tulip
#

yeah

#

how did u write a whole sql data class without knowing abt constructors and dependecy injection

quaint mantle
#

a lot of intellij telling me wtf i did wrong

#

lol

humble tulip
#

lmfao

quaint mantle
#

im fairly new to java with basic knowledge but ive working with python a lot so i have some programming knowledge

humble tulip
#

ohh

#

?di

undone axleBOT
humble tulip
#

read that quickly

#

ig u already read it hence why ur passing ur plugin instance to constructors

quaint mantle
#
public EventListeners(ThunderLearn plugin) {
        this.plugin = plugin;
        this.plugin.getData();
        Bukkit.getPluginManager().registerEvents(this, plugin);
    }```
should i be removing that second line?
#

feel like it shouldnt be there lol

humble tulip
#

yeah

#

u can have a data instance in ur listener class

#

or every time u wanna get data just do plugin.getData.whatever method

quaint mantle
#

goddamit still getting this.data is null

humble tulip
#

yeah cuz u didnt set this.data to this.plugin.getData

quaint mantle
#

oh shit wait

humble tulip
#

obv it's still null

quaint mantle
#
        this.plugin = this.plugin.getData();

like this..? in that code i sent above

humble tulip
#

no

quaint mantle
#

sorry if im being stupid lol

humble tulip
#

how can u set plugin to be a data

quaint mantle
#

yeah thats what i was wonderin

humble tulip
#

thats like setting an integer as a string

quaint mantle
#

then what exactly should i be doing :thonk:

humble tulip
#

think abt it a bit

knotty gale
#

so like, I want to check if a player shoots a target block but the thing is, that 'Material.target' is not a thing so what should I do

quaint mantle
#

i need to set this.data to this.pluget.getData(); right

knotty gale
#

that doesnt work

humble tulip
knotty gale
#

ok then

waxen plinth
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

knotty gale
#

I am missing something

waxen plinth
#

What version of spigot are you on

#

And what version are you depending on in your build script

knotty gale
#

i am using 1.15.2 or 1.18.2

#

i forgot which one

#

ok its 1.154

#

15]

humble tulip
#

i wonder why it isnt there

knotty gale
#

damnit

#

well lemme see with 1.18

humble tulip
#

it'll be there in 1.18

knotty gale
#

is there any quick why of just switching my plugins version?

quaint mantle
#

no friggin idea :sadge:

#

ive been tryin things but seems i cant get it

knotty gale
#

like switching the spigot version from 1.15 to 1.18

humble tulip
knotty gale
#

k

quaint mantle
#

i needed to just remove the parenthesis!!?

humble tulip
#

No

#

Let me see ur code

#

?paste

undone axleBOT
knotty gale
#

how do I use maven?

#

i stg

quaint mantle
humble tulip
#

And ur onenable method

#

?maven

undone axleBOT
quaint mantle
knotty gale
#

ty

humble tulip
#

Thunderin sure it's not another error

#

Send the error

#

Everything looks fine

quaint mantle
humble tulip
#

oh wtf

#

ur doing this.plugin = this.plugin.getData

quaint mantle
#

that doesnt sound good

humble tulip
#

do this.data = this.plugin.getData

quaint mantle
#

oh my gosh

knotty gale
#

@humble tulip it still doesnt work in 1.18.2 πŸ’€

quaint mantle
#

yup that fixed it :D

#

lovely

golden turret
#

?contribute

quaint mantle
#

so much fun

knotty gale
#

not for me atleast

humble tulip
#

did u reload ur pom?

quaint mantle
#

is nms used for NPC's or can i do it thru spigot

humble tulip
knotty gale
quaint mantle
#

which is better iyo?

humble tulip
#

citizens is easier

quaint mantle
#

then ill do that once i move to making npcs

humble tulip
#

nms is messier but ur plugin wont depend on another

#

depending on ur plugin tho u may wanna go nms

#

like a minigame plugin, u wanna do nms

#

if it's for servers like survival or prison that's gonna have citizens already feel free to use citizens

knotty gale
#

what version were u using in that screenshot?

humble tulip
#

1.18.2

knotty gale
#

hmmmm

#

what method did u use?

humble tulip
#

no method?

#

just did Material.TARGET

#

and it worked

knotty gale
#

ok then idk what to do

humble tulip
#

use maven

knotty gale
#

well it is up to date

#

I just remade the thing

humble tulip
#

remade what?

knotty gale
#

the plugin

#

it was a test

#

so it took no time

humble tulip
#

how will that fix the fact that ur using 1.15?

#

u need to use 1.16+

knotty gale
#

because I put it in 1.18.2

humble tulip
#

where?

knotty gale
#

in the external jars...

humble tulip
#

remove 1.15

tender shard
#

lol wtf

knotty gale
#

ok

tender shard
#

use maven

humble tulip
#

is it ok to have a long ass method to load a file?

tender shard
#

sure

knotty gale
#

I mean i never had 1.15 in the new project

#

so what could be the problem

humble tulip
#

idk bro

#

if u had maven all u had to do was change 1.15.4 to 1.18.2 and click a button

knotty gale
#

ok

humble tulip
#

LOL

#

wanna see mine?

tender shard
#

sure

humble tulip
#

it's a monstrousity

#

?paste

undone axleBOT
quaint mantle
#

214 lines?

#

im afraid

humble tulip
#

most of them are just checking that the user isnt stupid tbh

tender shard
#

seems ok to me on first glance

humble tulip
#

it's easy enf to follow

#

just hope im not unable to understand what i wrote one day

quaint mantle
#

how can i combine a sharpness 6 book with my sword? can i do this thru some event?

quaint mantle
humble tulip
#

listen to anvil event

quaint mantle
#

there doesnt seem to be an anvil event

humble tulip
#

or inv click even or something

tender shard
quaint mantle
#

oh cmon bro, another guy and i were looking for it yesterday and we both didnt find it

humble tulip
#

lmfao

#

google is really amazing yk

tender shard
#

I just googled "spigot anvil event" lol

quaint mantle
#

hmm, there doesnt seem to be a way for me to get both the items placed in the anvil slots

tender shard
#

of course you can

#

getInventory() returns an AnvilInventory

#

then you can check the items in the first 2 slots

#

and then set the result

quaint mantle
#

oh well then, and how can i get the player who opened the anvil? maybe im stupid but you cant do like e.getWhoOpened or something similar to an inventoryclick event

tender shard
#

check the viewer of the inventory: event.getInventory().getViewers().get(0)

quaint mantle
#

what does .get(0) do exactly?

tender shard
#

getViewers returns a List, and get(0) gets the first one from that list

#

since anvil inventories are unique to everyone, there will never be more than 1 viewer anyway

quaint mantle
#

oh thank gosh

#

i was gonna be conerned

tender shard
#

I mean chests for example can have more than one viewer

#

but not anvils

sour brook
#

Performance Better

humble tulip
#

I saw a prem resource that there is none similar to and i feel like i can make a better one. should i give they guy some competition?

#

i wanna do it just cuz

tender shard
#

it always wants you add random casts

quaint mantle
#

intellij is so nice

tender shard
#

for example if you do someItemStack.getDisplayName() it suggests you to cast someItemStack to Player

#

lmao

sour brook
tender shard
#

it's simply stupid

sour brook
tender shard
sour brook
#

Oh

sour brook
tender shard
#

instead of telling me "getDisplayName() is not a method on ItemStack" it adds a random cast to Object and obviously there's still no getDisplayName

compact haven
#

isn't getDisplayName only on ItemMeta

sour brook
compact haven
#

and IntelliJ has problems like that sometimes too lol

#

IntelliJ cache drives me crazy sometimes

tender shard
humble tulip
#

reading baeldung tutorials are so much shit

compact haven
#

fucking need to invalidate like 5 times for it to work

#

ah well yeah that's what happens lmao, it doesn't suggest nonsense like that

tender shard
tender shard
#

i just used this example to show you how shitty eclipse is

compact haven
#

alex do you have the new UI preview

tender shard
#

instead of giving a useful hint, it just makes everything worse

tender shard
compact haven
#

did you apply for it

tender shard
#

no

compact haven
#

no

#

why no

tender shard
#

why would I exchange my sweet intellij ultimate with a weird hamburger app

compact haven
#

LOL

sour brook
compact haven
#

it's ok and not ok at the same time

#

it looks nice but some of the things are terrible

tender shard
compact haven
#

I noticed instantly that I can't select a whole line by clicking to the left of a line number

quaint mantle
#
@EventHandler
    public void AnvilPrepare(PrepareAnvilEvent e){
        Player player = (Player) e.getViewers().get(0);
        Inventory anvilInv = e.getInventory();
        player.sendMessage(anvilInv.getContents().toString());
    }```
that final line sends an... uh... well not the items i guess
compact haven
#

all it does is add a break point

#

and the entire top nav bar is collapsed into a hamburger

tender shard
#

works fine

compact haven
#

Not on the new UI preview

#

that's what I meant

tender shard
#

oh

#

ok

#

yeah as said the new UI is shitty

#

I hope it never happens

compact haven
sour brook
compact haven
#

like actually just let me select the line pls

tender shard
#

for example eclipse's maven integration is upper bullshit

compact haven
#

oh it fucking is terrible

#

the integration like doesn't exist, not by default

tender shard
#

it breaks everytime when you have a .project folder lol

tender shard
quaint mantle
#
@EventHandler
    public void AnvilPrepare(PrepareAnvilEvent e){
        Player player = (Player) e.getViewers().get(0);
        Inventory anvilInv = e.getInventory();
        player.sendMessage(anvilInv.getContents().toString());
    }```
that final line sends an... uh... well not the items i guess

and mfnalex, is your name alex or jeff...
tender shard
#

or do you mean my real life name

sour brook
compact haven
#

he means ur irl name

quaint mantle
#

irl, unless ud rather not share

compact haven
#

that's actually a good question

#

pretty sure it's alex tho

tender shard
#

my real life name is ALEXANDER CHRISTIAN MAJKA!!!!1111one

compact haven
#

christian

humble tulip
quaint mantle
#

im doxxing you as we speak

compact haven
#

weirdchamp

tender shard
#

my address is on my website

quaint mantle
#

oh wtf

#

why

humble tulip
#

lol

tender shard
#

because that's how it works

humble tulip
#

cant dox someone if they dox themselves first

quaint mantle
#

that could be a bad idea

tender shard
#

Information pursuant to Sect. 5 German Telemedia Act
JEFF Media GbR
Junkerstraße 17
48153 MΓΌnster

Represented by:
Herr Alexander Majka
Junkerstraße 17
48153 MΓΌnster

Herr Nikolai SchΓΆning
Bodelschwinghstraße 7
48165 MΓΌnster

Herr Tobias SchΓ€uble
Brüderstraße 14
48145 MΓΌnster

Frau Marlen Beckmann
A

tender shard
compact haven
#

it's a requirement

quaint mantle
#

oh

compact haven
#

his company is legally registered so

#

hoyl shit

#

your site is nice

tender shard
#

thanks lol

quaint mantle
tender shard
#

getType on what?

quaint mantle
#

.getContents should allow me to call getType on it no?

tender shard
#

no

#

getContents returns an array of itemstacks

sour brook
compact haven
#

remove the borders around the icon and I can't complain

tender shard
compact haven
#

the icons aren't centered properly lol

quaint mantle
compact haven
#

look at like the phone and mic, then the graph

tender shard
tender shard
winged anvil
#

alex

tender shard
#

no idea where the icons are from

winged anvil
#

i would really like to use your armorequipevent api

#

but my maven is a bitch

tender shard
#

tell him to shut up and do its job

#

lol

compact haven
winged anvil
#

so

quaint mantle
winged anvil
#

right now im tryna use NMS and even the plugin to remap the jar just doesnt give me any jars

humble tulip
#

(76, 175, 80)

winged anvil
#

yes

humble tulip
#

with --remapped?

winged anvil
#

yes

humble tulip
#

then i cant help cuz i followed the steps on spigot and like magic it worked

humble tulip
#

still cant explain it

tender shard
#

and then to compile just run mvn package

compact haven
#

I can see that none of the representatives on the site notice are named Jeff

#

how exactly did you come up with that company name πŸ˜”

tender shard
compact haven
#

holy fuck

tender shard
compact haven
#

I hadn't thought about that

humble tulip
#

lmao

compact haven
#

just so you know I'm emailing HR about your transgressions.

winged anvil
#

i copied and pasted EXACTLY how it is on the page, built it, no jars

humble tulip
#

send ur pom?

winged anvil
#

?paste

undone axleBOT
winged anvil
#

ive been beefin with maven for like 3 days now

#

hold

#

mmmm

#

ok

winged anvil
compact haven
#

lmfao

tender shard
winged anvil
#

yes

tender shard
#

awesome

winged anvil
#

which jar am i not supposed to use again?

#

so i dont get sued

tender shard
#

let me check your pom

#

NMSTest-1.0-SNAPSHOT.jar

winged anvil
#

lovely, can i set a artifact to build that directly to my test server plugins folder like i do with other projects?

humble tulip
#

bro has a blog post for everything i swear

tender shard
#

yeah well

#

when you explain the same things over and over again, you get tired and just put it into a blog post

humble tulip
#

understandable

winged anvil
#

i love you and your blog posts bro

tender shard
#

πŸ˜—

winged anvil
#

im straight but if ive got a problem alex for sure has a blog post

compact haven
#

for FAQ #1 if you're shading you can just <finalName> in the <build> section and it works 😏

humble tulip
#

do u know how i can allow ppl to put boolean login in my plugin

tender shard
compact haven
#

welll

sour brook
compact haven
#

whoever automatically builds into the plugin directly is irrelevant anyways

sour brook
#

What time is it there?

tender shard
tender shard
compact haven
#

lmao I'm just messing with you

tender shard
compact haven
#

._.

sour brook
#

Xd

humble tulip
#

is there a quick and easy way to make my plugin load jars?

tender shard
winged anvil
#

im literally about to cry rn bro cause ive got my plugin

#

and its here

humble tulip
#

like a lib or something

winged anvil
#

in my folder

quaint mantle
#
@EventHandler
    public void AnvilPrepare(PrepareAnvilEvent e){
        Player player = (Player) e.getViewers().get(0);
        Inventory anvilInv = e.getInventory();
        player.sendMessage(anvilInv.getContents()[0].getType().toString());
        player.sendMessage(anvilInv.getContents()[1].getType().toString());


    }```

how come it sends the message 3 times per item i click into the anvil gui
tender shard
compact haven
tender shard
winged anvil
tender shard
compact haven
#

god maybe I should make a blog

winged anvil
#

send it to me

#

when you make it

compact haven
#

sure, same as my portfolio it'll be W.I.P for the next, approximately, 1 to 2 years

tender shard
#

oh no he removed the pictures

humble tulip
#

is there any way to load a single function externally in java and execute it at native java speeds? i see i can run javascript files but idk if that takes place as fast as running it as java after after the .js file is loaded

compact haven
#

sure you can

#

you can use a class loader

#

well you must* use a class loader lol

tender shard
#

we recently found a plugin on spigot that included a ton of .dll and .so files lol

quaint mantle
#
for(int i=0;i<anvilInv.getContents().length;i++){
            player.sendMessage(anvilInv.getContents()[i].getType().toString());
        }```
still keeps sending the message 3 times
tender shard
quaint mantle
#

it does? what am i doing wrong

tender shard
quaint mantle
#

oh right..

tender shard
#

first slot, second slot, and result slot

tender shard
humble tulip
#

ty

tender shard
humble tulip
#

lmao

#

cuz of the dlls?

tender shard
#

probably, I and other people reported it. I'm currently checking my notifications but it seems to just be gone

#

it SHOULD be here somewhere but it isn't D:

quaint mantle
#

yeah what should i be doing to fix that? i want to take it out of the for loop too and all but im not sure how to get the items in the anvil

humble tulip
#

i have this class

tender shard
quaint mantle
#

OH COME ON MAN i did something so similar

humble tulip
#

fk it gonna use java script engine and js

compact haven
#

@humble tulip for this, you'd have something like

public class DisplayNameExtension implements Function<Player, String> {
  @Override
  public String apply(Player player) {
    return player.getDisplayName();
  }
}

that'd be compiled into extension.jar. For simplification, I'm going to assume you have the class file DisplayNameExtension.class from the jar already, however there are ways to get that programatically because a jar is just a ZIP basically.

Then, you'd class load using https://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#defineClass(java.lang.String, byte[], int, int), which gives you a Class object. From there, you can create an Object with the Class by using https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#newInstance. With that, you can cast it to Function<Player, String> and call casted.apply(player) to get the display name of a player πŸ˜‰

#

None of that goes into details, but that's how you'd load Java classes at runtime & invoke code from them

tender shard
#

isn't newInstance deprecated?

#

or maybe I'm confusing it with sth else

compact haven
#

could be, haven't touched reflection like this in a while

#

in 8 it wasn't kekw

tender shard
#

IIRC one has to get the list of constructors and then create an instance from that, but anyway, doesn't change the fact that what you said is probably the answer to minion's question :3

humble tulip
tender shard
humble tulip
#

i'm doing it for extreme configurability purposes

#

ty

compact haven
#

lmao my browser takes me to JDK 8 docs whenever I search "something javadocs" so

compact haven
#

np minion, best of luck

humble tulip
#

if this works i'll make an extension lib

#

and have extensions in all future plugins

#

cuz why tf not

compact haven
#

well typically it's best practice to make an actual API

#

that plugins can depend on & use

#

then if there's anything plugins need to hook into or change before you perform logic/execute you'd use the bukkit event bus

tender shard
compact haven
#

Some plugins don't do this, like PAPI has a mix- the API exists completely but extensions are downloaded & loaded at runtime by a separate class loader, instead of the pluginclassloader

humble tulip
#

yeah im aiming for something like that

#

it'll have an api

#

but it can also load extensions

tender shard
#

I'd check out the source of PAPI or similar plugins like BentoBox to see how they are doing it

compact haven
#

well PAPI has the whole ecloud thing

#

which is quite neat but xd

crisp steeple
#

who thought papi was a good acronym

tender shard
#

why not?

#

does it have a weird meaning in your language or what lol

compact haven
#

never said it'd be hard

#

though am surprised you got it that quick

#

I didn't explain how to get the Jar -> class file -> bytes kekw

humble tulip
#

i had no need to do that?

#

URL url = new File("test.jar").toURI().toURL();
URLClassLoader classLoader = new URLClassLoader(new URL[]{url});
Class<?> clazz = Class.forName("me.saif.test.Main", true, classLoader);

tender shard
#

that only works if the other .jar is also a plugin

#

not if you want to load it yourself

#

oh

humble tulip
#

that's what i have

tender shard
#

ok now you edited the message

humble tulip
#

sorry xd

tender shard
#

lol

humble tulip
#

would it unload safely if say my plugin gets unloaded by plugman?

#

or do i need to unload somehow ondisable?

compact haven
#

the class will still be loaded in memory

#

but that won't cause any problems perse unless it's still executing logic that depends on your plugin be enabled

humble tulip
#

but with no references to it gc should clean it up?

compact haven
#

it'll clean up the instance, not the class

#

class stays loaded, but yes

tender shard
#

the class itself will still stay loaded. that's why stuff like

static { ... }

ever only runs once

humble tulip
#

ohh

#

is there a way to unload the class or should i just not even worry?

tender shard
#

I wouldn't worry about it

humble tulip
#

i can close the classloader

tender shard
#

I'd simply tell people to not use Plugman lol

humble tulip
#

i'll do that to just be safe

#

btw how does spigot know when i use a dependency that i dont have softdepend or depend for?

tender shard
#

every plugin has its own classloader IIRC and it's a custom one

#

lol funny name "maybePlatformClassLoader"

quaint mantle
#

when i restart the server, it closes too fast and my stuff on onDisable() stops abruptly, what can i do to tell spigot to wait until my stuff finishes?

#

this doesn't happen when i shut it down though

tender shard
#

unless you are scheduling new tasks or similar

quaint mantle
#

ah thats probably why

#

its async

#

so if its not it waits until everything finishes?

tender shard
#

yeah you should run stuff synced in ondisable

quaint mantle
#

gotcha

winged anvil
#

this what i got rn

winged anvil
#

no blog post 😦

tender shard
#

I never really did any stuff related to NMS mobs besides spawning holograms

winged anvil
#

im tryna spawn a magma cube in a block and give it glowing and invisibility

tender shard
#

hm as said, no idea πŸ˜„ what's the issue exactly?

winged anvil
#

just spawning with no glowing

tender shard
#

hm what exactly is the "12" for?

winged anvil
#

the id of the entity

#

i have a destroy packet too and it works for that

tender shard
#

okay and the "2000, 0, false, false"?

#

maybe you could set the NBT tag for the glow before you send out the "spawn" packet instead

winged anvil
tender shard
#

maybe you can do what CraftEntity#setGlowing is doing before you actually send the "spawn entity" packet

winged anvil
#

damn nothing

tender shard
#

hm then I also have no idea :<

winged anvil
#

imma mess around some more

#

where do i document my findings if i figure it out

tender shard
#

yeah if you find out pls ping me, I'd be interested in what the problem was ol

#

because both the packet, and setting the NBT tag should work D:

winged anvil
#

wdym NBT tag?

tender shard
#

CraftEntity#setGlowing is setting a special NBT tag IIRC

#

the NMS Entity has the following method:

    public void setSharedFlag(int i, boolean flag) {
        byte b0 = (Byte)this.entityData.get(DATA_SHARED_FLAGS_ID);
        if (flag) {
            this.entityData.set(DATA_SHARED_FLAGS_ID, (byte)(b0 | 1 << i));
        } else {
            this.entityData.set(DATA_SHARED_FLAGS_ID, (byte)(b0 & ~(1 << i)));
        }

    }
#

and CraftEntity calls it like this to enable glowing

setSharedFlag(6, true);
winged anvil
#

i dont think I can get the craft entity from the packet can i?

tender shard
#

no but that's not needed

#

simply do yourEntity.setSharedFlag(6,true)

#

BEFORE you send the "spawn entity" packet

winged anvil
#

I have no entity

tender shard
#

huh then how did you get the UUID of the entity?

winged anvil
#

lmao I'm just testing rn with one entity and just put 12

tender shard
#

no I meant the UUID, not the entity id

#

second parameter in the add entity packet

winged anvil
#

ohh

#

UUID.randomUUID()

tender shard
#

I see

#

okay

winged anvil
#

mbmb

tender shard
#

so

winged anvil
#

lmfao

tender shard
#

you should create an instanceof the NMS entity

#

and then use that in the packet

#

for example, this is how I spawn holograms

#
entity = new AreaEffectCloud(world, location.getX(), location.getY(), location.getZ());
#

then you can just pass that entity into the packet's parameter

#
new ClientboundAddEntityPacket(entity)
#

and yeah between those two, you can do the setSharedFlag(6,true) thing

#

and then it should hopefully work lol

winged anvil
#

nothing

#

but the entity IS working cause I can set its position

tender shard
#

why is it yelling at "serverPlayer.getServer()" ?

winged anvil
#

nullpointer

tender shard
#

hmmm then I really have no idea :<

winged anvil
#

but its not or else it wouldnt create the entity right?

tender shard
#

does it work fine if you use a bukkit slime?

#

maybe glow only works for certain entities? idk

winged anvil
#

i mean you can add glow to normal magmas in game

tender shard
#

hm then it's weird, sorry I have no idea

winged anvil
#

all good, appreciate you tryna debug with me

tender shard
#

looks good to me

#

so

#

weird :/

winged anvil
#

right

#

this what im going for

tender shard
#

ooh I see

#

I know a pugin that aso does this but they are using ProtocolLib. but maybe you can check it out nonetheless how they do it

winged anvil
#

where did you get the 6 from in #setSharedFlag()

tender shard
tender shard
#

this is from the NMS Entity class

#

and that's what CraftEntity#setGlowing calls

winged anvil
#

yeah i just saw and i tried to just call setGlowingTag but it didnt work either

#

potential @tender shard

sacred mountain
#

how tf does java do memory

bold copper
#

Hi tell me the best way to clear all mobs in a certain radius from a given position

sacred mountain
#

getnearbyentities

#

for each

#

then call .remove() on each

tender shard
tender shard
#

or not? idk

#

maybe it works

sacred mountain
#

maybe

tender shard
#

yeah should work since remove() is a method on the entity and not remove() on the collection

sacred mountain
#

yeah

#

i was thinking that

tender shard
#

yeah you're probably right

bold copper
sacred mountain
#

wdym chunks that are allocated

tender shard
#

you don't have to worry about the performance of looping over entities and calling remove() on each

sacred mountain
#

yeah no thats a really quick

bold copper
#

And if there are 10k + monsters ? sorting through so much is no longer fast ..

sacred mountain
#

why are there

#

10k monsters

tender shard
#

I thought you were doing getNearbyEntities()?

summer scroll
#

How do you spawn particle BLOCK_MARKER with specific material?

sacred mountain
#

there wont be 10k near you they'll have despawned or not generated yet right

tender shard
summer scroll
#

alright, thanks

torn shuttle
#

anyone know why intellij could possibly not allow me to add files to git versioning?

#

I've never really seen this before

torn shuttle
#

no

#

I can't add anything to git

tender shard
tender shard
#

you do have a git repo in your project though? πŸ˜„

torn shuttle
#

yeah, I do

#

I can commit my main class which tbf on this project is the only class file

#

but I wanted to add the plugin.yml and some of the gradle stuff

tender shard
#

what happens if you run git add filename manually? it would probbaly either work or show a message that explains why you can't do that

summer scroll
tender shard
bold copper
torn shuttle
#

fatal not a git repo: .git

tender shard
torn shuttle
#

but it is a git repo

tender shard
torn shuttle
#

ok how can I nuke this garbage

tender shard
#

lol that's weird. you could rename your existing .git folder and create a new repo

torn shuttle
#

it doesn't really matter this was something I started like 4 years ago and only has a couple of commits

tender shard
#

simply rename or delete the existing .git folder, restart intellij, then do VCS -> Create git repo or however its called

torn shuttle
#

you know what I just realized I don't see a .git folder

#

but intellij still says this is a legit git project

tender shard
#

as said, you do not have any git repo πŸ˜›

#

huh

#

that's indeed weird

torn shuttle
#

I think intellij had a stroke

tender shard
#

btw intelliJ won't show the .git folder

torn shuttle
#

yeah I looked at the directory itself

#

it's not there

tender shard
#

hm that is really weird

#

idk if it's "hidden" on windows by default

#

let me check

#

yeah it's hidden

torn shuttle
#

it isn't, I checked on my main project and I can see the .git directory

#

I mean I can see hidden files

#

not that it's not hidden

tender shard
#

it's hidden for me

tender shard
#

yeah well if it's not there, it's not there. very weird

torn shuttle
#

I mean

#

it even gives me a proper git log... I wonder if it's reading it from online sources?

tender shard
#

huh

#

that's some next level shit

torn shuttle
#

but it gives me a local... wtf

tender shard
#

maybeeeee your .git folder is in a parent folder or sth? i have no idea

torn shuttle
#

nope

tender shard
#

then I have no idea :X

torn shuttle
#

ok guess I have to find how to nuke an invisible git repo...

tender shard
#

check out .idea/vcs.xml

#

maybe that will show you where the .git folder is located

torn shuttle
#

oh

#

ok

#

see I suspected this might be the case but I wasn't seeing it

tender shard
#

if the repo is in the same folder it should look like this

torn shuttle
#

yeah so the git repo is at the level of my class, that's why

tender shard
#

aah

torn shuttle
#

it can't add files that are above its own directory

tender shard
#

yeah that's definitely not good

sacred mountain
torn shuttle
#

no clue of how this happened, this is old enough that it might've been an issue with passing things on from netbeans to intellij

sacred mountain
#

if tou're needing 10k +

#

just use the world getentities

#

its not laggy

tender shard