#help-development

1 messages ยท Page 244 of 1

fluid river
#

.

hazy parrot
#

If you decide to no longer have config.yml and remove it from source, it will still remain in target folder as package will just overwrite files

maiden thicket
#

maven moment

fresh timber
#

ohh ok

fluid river
#

just use clean to, you know, keep it clean

fresh timber
#

I was confused cus when I just use package, i get my plugin name-shaded and if I use clean, I dont get that

fluid river
#

i don't think there is any connection

fresh timber
#

huh

fluid river
#

between having clean in goals and having projectName-shaded.jar

maiden thicket
#

maven shade plugin beat

fresh timber
#

does this not work when I use clean?

fluid river
#

bruh

#

everything works fine with and without clean

#

but

fresh timber
#

yea ik

fluid river
#

clean package is better

#

๐Ÿ˜‰

fresh timber
#

ok -.-

#

xD

#

max reactions boi ๐Ÿ’ช

round finch
#

.๐ŸŽ‰

fluid river
#

ok

sterile token
#

Graven >>> Maven >>> Gradle

fresh timber
#

no

remote swallow
#

dafuq is graven

ivory sleet
#

i mean gradle isnt perfect

#

but its far better than maven as soon as you need sth a bit more powerful on the spot

remote swallow
#

i personally like the 80% smaller build files

ivory sleet
#

they take around the same amount of lines if thats what you mean?

#

in most cases

remote swallow
#

mine are normally shorter than all the maven ones i ever used

round finch
#

Cute doggo

fluid cypress
#

how do i import nms?

remote swallow
#

maven?

fluid cypress
#

what repository, how is the dependency called

#

yea maven

fluid cypress
#

while this thing compiles, or whatever its doing

#

what does it mean that nms is not cross version compatible?

#

does that mean i will have to update the imports if i want to recompile the plugin again in the future?

#

or the jar will literally stop working on future versions

#

and ill have to compile it again with the updated nms?

remote swallow
#

from what i know about nms, most of it is version specific but you can implement multi version support

fluid cypress
#

version specific meaning

#

the jar will stop working

#

or that ill have to update the source if i want to compile it again

#

and this thing just finished compiling

#

where do i have to put the jar? so that maven, or whatever, can know it exists and use it

remote swallow
#

if you only add and build spigot for the 1 version , it will only work on that version. if you build multiple versions and add the deps and tell the plugin to run certain classes according to version

remote swallow
#

just change the dep to spigot not spigot-api

fluid cypress
remote swallow
#

correct

#

also in pom make sure to add the rest of the stuff

fluid cypress
#

yea, i just did that

remote swallow
#

should be set to go with nms

fluid cypress
#

i would like to know how it knows that a jar has just been created in a random folder somewhere

#

something about a local repo i think

#

i remember using nms like a year ago

remote swallow
#

it builds spigot, it also builds the api and minecraft server to your maven local

fluid cypress
#

right

#

and where is that maven local repo?

remote swallow
#

iirc users/.m2

fluid cypress
#

m2 meaning maven 2 i guess?

remote swallow
#

no idea

fluid cypress
#

i dont think so, its maven version 3 apparently

#

well, anyway, thanks, it works

remote swallow
#

it works anyhow

fluid cypress
#

well, it seems like net.minecraft.server.v1_16_R3.WorldServer no longer exists

#

any idea how it may be called now?

#

or where is it

remote swallow
#

might be craftbukkit stuff i think

fluid cypress
#

im getting this error with mvn package, which part of pom.xml do i have to send

[INFO] --- specialsource-maven-plugin:1.2.2:remap (remap-obf) @ databaseinventories ---
Downloading from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.pom (5.2 kB at 16 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.jar (84 kB at 154 kB/s)
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR]   supported. Please add the goal to the default lifecycle via an
[ERROR]   <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR]   remove this binding from your POM such that the goal will be run in
[ERROR]   the proper phase.
[ERROR] - You removed the configuration of the maven-jar-plugin that produces the main artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.579 s
[INFO] Finished at: 2022-11-30T23:07:51-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-obf) on project databaseinventories: Failed to create remapped artifact, project main artifact does not exist. -> [Help 1]
remote swallow
#

?paste your pom

undone axleBOT
fluid cypress
#

all of it?

remote swallow
#

yeah

fluid cypress
remote swallow
#

you have 2 different versions i would guess

#

ln 96/96

#
                            <remappedDependencies>org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
#

but you have 1.19 spigot

fluid cypress
#

uhh

#

youre right

#

i forgot to change that

remote swallow
#

lol

fluid cypress
#

but

#

apparently thats not the cause of the error

#

wait, this thing is doing stuff, i think

wet breach
#

Usually helps to create custom properties for versions. This way instead of multiple places to change you just have one

fluid cypress
#

yea, same error

wet breach
#

Something to look into after you fixed your problem for organization purposes

wet breach
remote swallow
#

how are you building?

fluid cypress
#

yea, i literally have no idea how to do that, im not familiar with java at all

fluid cypress
wet breach
#

?bootstrap

undone axleBOT
#

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

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

wet breach
#

Just follow those steps

fluid cypress
wet breach
#

Har?

#

Should be jar

fluid cypress
#

typo

#

yea, i did jar

wet breach
#

Well I am at work currently. So limited in what I can do until I get home

remote swallow
#

quick question, whats the exec plugin for

wet breach
#

Have you tried doing a clean build?

fluid cypress
#

running scripts

#

i think

#

idk, i made a boilerplate tool like a year ago

#

bc i didnt want to learn maven again every time i wanted to make a plugin

#

like, i literally forget the very basic things

fluid cypress
#

what do i remove

wet breach
#

What does it do?

fluid cypress
#

the scripts?

remote swallow
#

yeah

fluid cypress
#

nothing, just moving the jar to the sv and reloading the plugin

wet breach
#

mvn clean

fluid cypress
#

and adding a command to plugin.yml if i forgot to do so

fluid cypress
#

it works

wet breach
#

It clears out build stuff from prior building as if you never tried compiling. Occasionally caches and the likes give problems so you just know clean them out and see if that helps

fluid cypress
#

i still get the same error

remote swallow
#

frostalf do you know what the validate phase is

fluid cypress
#

why does it say BUILD SUCCESS when deleting stuff

wet breach
remote swallow
#

i have a feeling that phase on the exec plugin might be causing it

wet breach
#

Its a phase to let you check and do stuff before compiling actually happens

fluid cypress
#

its just a python script

#

which modifies plugin.yml

wet breach
#

However do something wrong then and it can throw compiling off because it was expecting something that might not be there anymore

fluid cypress
#

and those placeholders

#

well, im going to sleep rn so, ping me if you have any idea of what to do and ill do it tomorrow morning

#

gn

quaint mantle
#

Is it possible replace other plugin`s command executor to mine?

ivory sleet
#

yes

#

altho Id say its probably discouraged in most cases to go down that route

quaint mantle
ivory sleet
#

PluginCommand#setExecutor just, no?

fresh timber
#

is there an event for a mob like piglin despawning

quaint mantle
remote swallow
#

set not get the executor

fresh timber
#

xD

ivory sleet
#

means the u never got the right command instance

wet breach
#

You should first check if its registered or check get to ensure not null

ivory sleet
#

?

#

Why

fresh timber
quaint mantle
remote swallow
#

copied?

fresh timber
#

drag click

#

lol

#

cool symbols ๐Ÿ‘

#

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ–ˆโ–ˆโ•‘
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ•”โ•โ•
โ–ˆโ–ˆโ•”โ•โ•โ•โ–‘โ–‘โ–ˆโ–ˆโ•”โ•โ•โ•โ–‘โ–‘
โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•

chilly obsidian
#

dose anyone know how to make explosion physics?

fallow valley
#

I have this in my code:

@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
``` but when I build on intellij I get this stupid error
#

cannot find symbol:12

remote swallow
#

?paste a full class or method

undone axleBOT
fallow valley
#

sure

fallow valley
#

I'm beginning to believe that something is wrong with my intellij

remote swallow
#

is that the correct place where the error is? nothing looks wrong with that

fallow valley
#

Exactly.

remote swallow
#

mind sending a ss of the error with the code its surrounding

fallow valley
#

can't send SS

remote swallow
#

?img

undone axleBOT
remote swallow
#

that works

#

does anything appear while hovering over the code or if you click on them where does it put you

fallow valley
#

nope

#

that's the thing

#

yk when u type like CommandExecutor and then it goes red and alerts u to import the class?

#

that didn't happen this time

remote swallow
#

just to check does anything appear in text at all anywhere when clicking on any of those

fallow valley
#

nope

remote swallow
#

im more confused

fallow valley
#

same here.

#

cus like building is done with Maven not intellij

#

so maven and intellij both hate me today?

remote swallow
#

?paste ur pom

undone axleBOT
fallow valley
#

shore y nawt

remote swallow
#

what

fallow valley
#

sorry

remote swallow
#

this just gets more and more confusing

fallow valley
#

Dangi t

wet breach
fallow valley
#

yeah didn't work

lime moat
#
target.getWorld().spawnEntity(target.getLocation(), EntityType.PRIMED_TNT);``` I currently have this, how could I make it explode instantly?
wet breach
fallow valley
#

I'm still getting that error

wet breach
#

Have you tried doing clean build on project?

fallow valley
#

should i run the mvn command from terminal?

#

yeah I was thinking

lime moat
#

Do I store the tnt to a variable, then set it? I am quite confused ๐Ÿ˜‚

river oracle
#

?basics

undone axleBOT
wet breach
#

You are using java 1.8

#

Need to update to java 17 for newer versions

lime moat
#

Storing it worked, I took a look at the TNTPrimed on the docs and there doesn't appear to be a way to set the power. Is this possible?

fallow valley
wet breach
#

Its in your pom at top. Java.version

fallow valley
#

Ohhhhh

#

Crud

#

I figured it used my default value

#

facepalm moment inc

#

Yeah thanks dude

#

appreciated

wet breach
fallow valley
#

is there like a karma system on here?

#

Seen some servers that have bots, you use a command on a member who helped you, does one exist here?

wet breach
#

You want setYield()

lime moat
#

Okay, I'll try it out!

wet breach
#

But no one checks that stuff or uses it here lol

lime moat
#

It worked, thank you!

wet breach
fallow valley
white root
#

and if you are using 1.16+ then just add this to your plugin.yml: ```yml
libraries:

  • org.jetbrains.kotlin:kotlin-stdlib:1.7.21 #Set the version you need
wet breach
#

Np

fringe hemlock
#

?di

undone axleBOT
fringe hemlock
#

for me

crisp forum
torn shuttle
#

how do people load html elements from other pages in single page applications in a way that is scalable and maintainable long term without using something like angular, just using vanilla js and html/css?

#

I've tried a few solutions before but they just don't feel right

#

best solution I've found thus far is basically just ajax which I really am unsure is a great idea

torn shuttle
native ruin
#

Not sure but Yea you can say that ig

torn shuttle
#

I've used them before and they're useful to an extent but it doesn't really feel scalable, I made a relatively basic webapp with them and that thing is sitting at like 3k lines with maybe a third of the features I wanted in it

#

I guess maybe I can offload them into different pages and load them in with ajax-like requests but then I'm just back to where I was

civic wind
#

Anyone help? My command just isn't returning anything, no errors at all...

peak depot
#

wrong bracket i think

civic wind
#

ahh yh I'll give it a go as i just realised the "remove" is working

peak depot
#

!timer.checkDoubleXP() you got it top without reversion

civic wind
#

ahh yh i need to add them then

#

wait i do, the setter

peak depot
#

and you never add them btw

civic wind
peak depot
civic wind
#

Yeahh? I'm checking if they are in the hashmap, and if they aren't. Am i missing something??

peak depot
#

is your guy on the timer list?

civic wind
#

yes and remove works. It's adding that doesn't

#

so when i type "add" as args it adds then straight away removes and spams the deactivate title

peak depot
#

yes but you at the point he executes "add" is he on the List or not

civic wind
#

nope

peak depot
#

can you send your new formatted code

civic wind
#

?paste

undone axleBOT
civic wind
peak depot
#

check if the add methode gets executed

civic wind
#

it does

#

I can see it for like 1 second, then it deactivates again

#

and i got a debug message for an event

#

its double xp

#

which broadcasts when i get xp in the hash

peak depot
#

yeah your deactivate title spams to much in order to see activated title

civic wind
#

Yeah i can see it and i use xp bottle straight away and it broadcasts

#

It is executing

civic wind
#

wait

#

It is putting me in the hashmap with the "add" but for some reason just spams that title??

#

so it is working

peak depot
#

you just said its executing so I guess

civic wind
peak depot
#

looks like it

civic wind
#

yeah

#

so why's it spamming the title? 0_o

peak depot
#

idk actually

hybrid spoke
civic wind
civic wind
#

?paste

undone axleBOT
formal bear
#

how to create falling block with material?``` BlockData blockData = Bukkit.createBlockData(Material.CHORUS_PLANT);

        Entity fallingBlock = projectile.getWorld().spawnEntity(projectile.getLocation(), EntityType.FALLING_BLOCK);
formal bear
#

Its deprecated isnt it?

hybrid spoke
#

โœจ click the link and see โœจ

formal bear
#

Ok its not with blockdata, confusing ;D

formal bear
#

Its depracted with material, with blockdata is not, i was just confused

wise pumice
#

Hello, I want to do Nametags on protocollib packets. However, when trying to join the server, I get an error.
Error:

Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 1 is out of bounds for length 1
    at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[?:?]
    at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:289) ~[?:?]

Code:

    public void createNameTag(Player player, Player other) {
        this.packetContainer = this.protocolManager.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);

        String playerName = player.getName();

        this.packetContainer.getStrings().write(0, playerName);
        this.packetContainer.getStrings().write(1, playerName);
        this.packetContainer.getStrings().write(2, getPrefix(player, other));
        this.packetContainer.getStrings().write(3, getSuffix(player, other));

        this.packetContainer.getIntegers().write(0, -1);
        this.packetContainer.getIntegers().write(1, 0);
        this.packetContainer.getIntegers().write(2, 1);

        this.packetContainer.getSpecificModifier(Collection.class).write(0, Collections.singleton(playerName));

        this.protocolManager.sendServerPacket(other, packetContainer);
    }

Anyone can help?

wise pumice
hybrid spoke
#

by not trying to access a field which isnt there?

wary harness
#

hey any one can tell me how do u get in that github editor

#

which looks like visual studio or something

#

like in browser

wary harness
#

when u are in git hub project

#

and u get your project open in visual studio

#

in browser

quiet ice
#

Also you are looking for GitHub codespaces. I Personally would recommend the usage of a dedicated IDE though. A Browser is Not meant to be used as an ide

#

Ah, english confused me again

wary harness
remote swallow
harsh totem
#

How can I create an explosion that destroys blocks but doesn't damage players?

hybrid spoke
harsh totem
#

ok

hybrid spoke
#

sup morice ||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹||||โ€‹|| _ _ _ _ _ _ @last temple

remote swallow
#

does he know

hybrid spoke
#

ยฏ_(ใƒ„)_/ยฏ

harsh totem
#

because it returns boolean

#

and I need the instance of the explosion

eternal oxide
#

use teh method that accepts an entity

#

then check in teh damage event for that entity so you know to cancel it

#

ie, if you pass the player as the explosion source entity

harsh totem
harsh totem
#

and all of these methods

harsh totem
#

still boolean

eternal oxide
#

you don;t need the return

harsh totem
#

I want to get the explosion as a variable and none of these methods return it

eternal oxide
#

you can;t get teh explosion as a variable

#

thats not how explosions work

#

pass the player as the source entity, then in the player damage event if the source is the player cancel the damage

harsh totem
#

I think I'll just summon an invisible creeper and force it to explode

eternal oxide
#

why?

buoyant violet
#

hello

daring maple
#

?ask

undone axleBOT
#

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

buoyant violet
#

38 to 40

daring maple
#

I mean, you wouldn't need to learn this specifically. Most important part is that you learn the basic principles of java and programming in general

buoyant violet
#

so i can skip it

#

lets gooo

#

i will start doing randomness

#

!

#

ty @daring maple

daring maple
#

CompareTo is really neat to use if you have sorting algorithms tho

#

But I highly doubt you'll need it in your case

buoyant violet
#

idk how to use it

#

i will learn it later

#

i dont think i really need it for plugins

river oracle
#

๐Ÿ’€

#

That's one way to go about it I guess

wary harness
#

what is your opinion

#

on this code

river oracle
#

My eyes

wary harness
#

should I put those click in array or set and then use for loop

#

instead on click

#

would that be better

buoyant violet
#

sorry wrong chat

river oracle
wary harness
#

well I could go with switch to

river oracle
#

That's pretty dope ngl

wary harness
#

but I don't like it

river oracle
#

My God it looks so much less aids

wary harness
#

would for loop have less preformance

river oracle
#

And you can have drop through

remote swallow
#

how

river oracle
#

I see no reason to use a loop here

daring maple
# wary harness

Couldn't you just have a generic handler method which itself handles the logic for which action does what

river oracle
#

You could use a Map<ClickType, Consumer>

#

And than it'd be o(1)

river oracle
wary harness
#

yeah it is one general handler

river oracle
#

Do a Map though if yoh want to clean it up

wary harness
#

I was planing to put it in map

river oracle
#

Not a loop and you can do computeIfPresent

#

check out stuff from java.util.function

wary harness
#

will do

river oracle
#

I think in your case Function<Void, ActionHandler> would work well

#

Void parameter with return of action handler

daring maple
#

How would a void parameter work?

#

Whats the point in specifying a parameter like that

river oracle
#

You just pass in null

#

Tho actually

#

You should use a supplier now that I think of it

river oracle
#

Iirc that's the one that returns

#

My brain died fir a second there

wary harness
#

you got any example tutorial of what you have in mind

tardy delta
#

would be useful

small current
#

how can i get source of EntityExplodeEvent or BlockExplodeEvent

opal juniper
#

getEntity and getBlock respectively

small current
#

no i mean the player who made the explosion happen

opal juniper
#

what like the person that lit the tnt?

pallid patio
#

Detect and create Optifine Dynamic Lights ?

opal juniper
#

dynamic lighting is just done automatically afaik

#

use a light block

remote swallow
#

yeah

small current
opal juniper
#

Take a look at ExplosionPrimeEvent

#

i think that is the one i forget tho

pallid patio
#

How to detect dynamic lights?

#

If a block is illuminated by a dynamic light

remote swallow
#

dynamic light is handled client side

opal juniper
#

see earlier message

chrome beacon
#

You need to include the driver in your plugin

humble tulip
#

^^

#

Use maven and shade it in

#

Btw sqlite vs h2?

chrome beacon
#

Seems to explain things pretty well

humble tulip
#

Ahh

#

So speed vs stability

#

Well robustness

chrome beacon
#

I'd go for SQLite since it's quite common and already included in Spigot

humble tulip
#

I'm guessing h2 is in memory and dumped to a file whereas sqlite is written each time?

chrome beacon
#

You need to shade it

remote swallow
#

with the maven shade plugin

#

one moment

#
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>com.h2database.h2</pattern>
                  <shadedPattern>your.package.name.h2</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
slim kernel
#

if I do this in the InteractListener :

private HashMap<UUID, Integer> buyingShopNumbers = new HashMap<>();
buyingShopNumbers.put(player.getUniqueId(), shopNumber);

//this prints out 2
System.out.println(buyingShopNumbers.get(player.getUniqueId()));

and then that in a different file:

InteractListener interactListener = new InteractListener();
if (interactListener.getBuyingShopnumbers().containsKey(player.getUniqueId())) {
}

why is the if statement false?

fluid river
#

cuz you create a new instance of interact listener

#

with own empty hashmap

slim kernel
#

okay and how do i fix it

fluid river
#

make your map accessible

#

with getter

slim kernel
#

but getBuyingShopnumbers() is the getter

fluid river
#

yeah

#

then you need to make your listener instance accessible

#

in main class for example

#
InteractListener interactListener;

public void onEnable() {
    interactListener = new InteractListener();
}

public InteractListener getInteractListener() {
    return interactListener;
}
#

and then you can use mainClassInstance.getInteractListener().getBuyingShopnumbers();

#

tho you'd better have map outside of listener class

#

put it to your main class or create util class for your maps and lists

slim kernel
slim kernel
fluid river
#

util class should be static

#

and all of the methods too

remote swallow
#

if you need a JavaPlugin instance add JavaPlugin plugin to the constructor

fluid river
#

or

#

use static JavaPlugin.getProvidingPlugin(thisClass);

remote swallow
#

that would also work

fluid river
#

but who the fuck does that ๐Ÿ˜‰

remote swallow
#

can confirm

modest current
#

Hello, I have absolutely no idea on why but for some reason my server is just printing "/Hello" instead of "Hello World!". Here is my code, if anyone can help:package com.example;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class CommandManager implements CommandExecutor{
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
String commandName = command.getName().toLowerCase();
if (commandName.equals("Hello") && sender instanceof Player){
Player player = (Player) sender;
Plugin.LOGGER.info("Hello World!");
System.out.println("Hello World!");
return true;
} else {
Plugin.LOGGER.info("Command not found!");
return false;
}
}

}

fluid river
#

heh

#

literally me

slim kernel
#

thx!

fluid river
fluid river
#

why

river oracle
#

You return x action for click type

remote swallow
fluid river
#

mvn update

modest current
#

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
if (command.getName().equalsIgnoreCase("Hello") && sender instanceof Player){
Plugin.LOGGER.info("Hello World!");
return true;
} else {
Plugin.LOGGER.info("Command not found!");
return false;
}
}

fluid river
#

this is better

#

a lot

modest current
#

yeah, but it still doesnt work

fluid river
#

what exactly is not working

quaint mantle
#

Why you need that?

remote swallow
#

you should never need to check the command

fluid river
#

have you registered your command in plugin.yml

modest current
#

So, whenever I type /Hello, it should print "Hello World!". It instead print /Hello

fluid river
fluid river
#

and through getCommand().setExecutor() in your code

modest current
#

public class Plugin extends JavaPlugin
{
public static Logger LOGGER=Logger.getLogger("demo");
private CommandManager commandManager;

public void onEnable()
{
LOGGER.info("demo enabled");
LOGGER.info("Hello World Pluggin Enabled");
commandManager = new CommandManager();
getCommand("Hello").setExecutor(commandManager);
}

public void onDisable()
{
LOGGER.info("demo disabled");
}
}

#

Here is my Plugin.java

#

my main

fluid river
#

and yml

#

?

modest current
fluid river
#

just remove it

modest current
#

My yml:

#

name: demo
main: com.example.Plugin
version: 0.0.5
api-version: 1.19
commands:
hello:
description: Make the world say hello!
usage:
/Hello
aliases: [H]

fluid river
#

your command is wrong

#

and plugin is printing usage

#

from yml

#

instead of what you have written in your code

modest current
#

Oh, ok?

river oracle
modest current
#

how do I fix that?

modest current
fluid river
#

when you run your code this thing is not getting processed

river oracle
#

Firstly remove the name check and make sure it returns true

fluid river
#

cuz your statement returns false

#

and then you print that command is not found

#

and your onCommand returns false

#

when onCommand returns false, server send you usage example from plugin.yml

modest current
#

That is true, in the server, it says that the command is not found

#

So how, do I make it return true?

fluid river
#

change your if statement

fluid river
#

maybe your sender is not a player

modest current
fluid river
#

or yeah, you might have errors in console

#

when your plugin enables

#

just change your if to this

modest current
fluid river
#

if (sender instanceof Player){

modest current
#

alright

fluid river
#

also check if you imported org.bukkit.entity.Player

modest current
#

Im going to try it right now

#

Yeah I did import that

fluid river
#

?learnspigot

#

?jd-s

undone axleBOT
fluid river
#

checkmybio

#

FREEJAVALESSONS

quaint mantle
#

Is it possible to replace EssentialX's command executors? It throws nullPointerExeption ๐Ÿ˜ฆ

modest current
#

It worked

#

but for some reason it is only printing in the console

#

and not in game

#

How do I make it log in game

fluid river
#

cuz you use sysoutprintln

#

instead of player.sendMessage()

#

or Bukkit.broadcastMessage()

quaint mantle
modest current
#

Oh, Alright

#

Logger doesnt work either?

fluid river
#

ofc

#

never use sysout and logger

#

๐Ÿ˜‰

remote swallow
#

they are pretty pointless

modest current
#

Alright

#

Thank you!

#

Im going to try it

fluid river
#

you have ConsoleSender.sendMessage(), Entity.sendMessage() and Bukkit.broadcastMessage()

quaint mantle
fluid river
#

full stack trace + your code

modest current
#

Thanks Guys! It finally worked

quaint mantle
fluid river
#

next time learn from normal mentor

#

(from me)

tardy delta
#

have fun

fluid river
#

is that still your mafs in code

#

some kind of calculator

tardy delta
#

yes

#

*again

#

looked at the old code and it was a piece of shit which was slow asf

fluid river
#

cool

cobalt thorn
fluid river
#

stack trace

#

what is not working

#

?ask

undone axleBOT
#

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

cobalt thorn
#

i don't know even i tried everything but doesn't work or the code getting called

fluid river
#

explain better please

cobalt thorn
#

i made the code tried it and doens't do nothing when i do the command with the Code to call the manager

quaint mantle
# fluid river next time learn from normal mentor
public class CountdownCommand {

    final MainPlugin plugin;
    @Nullable CommandExecutor commandexec;
    String command;
    ConfigurationSection commandSec;
    long interval = 20;
    int countdown = 10;
    ConfigurationSection BossbarConf = null;
    ConfigurationSection TriggerColorsConf = null;
    ConfigurationSection PlaySoundConf = null;

    public CommandExecutor getCommandexec() {
        return commandexec;
        
    }

    public String getCommand() {
        return command;
    }

    public long getInterval() {
        return interval;
    }

    public int getCountdown() {
        return countdown;
    }

    public ConfigurationSection getBossbarConf() {
        return BossbarConf;
    }

    public ConfigurationSection getTriggerColorsConf() {
        return TriggerColorsConf;
    }

    public ConfigurationSection getPlaySoundConf() {
        return PlaySoundConf;
    }

    public CountdownCommand(String cmd, MainPlugin i){
        command = cmd;
        plugin = i;
        commandSec = plugin.getConfig().getConfigurationSection("commands").getConfigurationSection(command);
        plugin.getServer().getPluginCommand(command).setExecutor(new CommandChanger(plugin, this));
        commandexec = plugin.getServer().getPluginCommand(command).getExecutor();
        BossbarConf = commandSec.getConfigurationSection("Bossbar");
        TriggerColorsConf = commandSec.getConfigurationSection("TriggerColors");
        PlaySoundConf = commandSec.getConfigurationSection("Playsound");
        interval = commandSec.getLong("Interval");
        countdown = commandSec.getInt("Countdown");

    }

}
cobalt thorn
#

and trying making player.sendMessage to get where the error is, is not doing nothing

fluid river
#

why are you creating new instance of KitManager everytime

river oracle
#

Safe to say he needs NukerFall free java lessons

fluid river
#

true

cobalt thorn
river oracle
#

๐Ÿ‘€

fluid river
#

learn OOP

#

Please

cobalt thorn
#

who op?

#

im confused

fluid river
#

...

remote swallow
#

oop

#

not op

cobalt thorn
#

oh

quaint mantle
fluid river
#

BRUH

#

ye ye

#

and stack trace

remote swallow
fluid river
#

you forgor

remote swallow
#

nuker get your jree fava lessons out

fluid river
#

i'm in a bus

#

going home

#

i can't use voice chat and screen cast

#

so, well, later

tardy delta
#

see you later alligator

fluid river
fluid river
remote swallow
#

you fucking what

fluid river
#

VirtualMachineMemoryAllocator

fluid river
remote swallow
#

minecraftworldgenerationalgorithm

round finch
#

Handlers wut

old jay
#

:|

quaint mantle
fluid river
#

ghostpinged

#

bruh

#

send stack trace

tardy delta
#

wheres jvm as pronoun?

fluid river
#

?

icy beacon
#

hey there, I'm seeking help with MockBukkit, I've sent this message to their support server a couple times but don't seem to get a response

Getting a weird error with XMaterial, basically parseItem uses XMaterial and for some reason server is null?

com.roughlyunderscore.enchs.TestUE.testParseItem1()  Time elapsed: 0.279 sec  <<< FAILURE!
java.lang.ExceptionInInitializerError
    at com.cryptomorin.xseries.XMaterial.<init>(XMaterial.java:1570)
    at com.cryptomorin.xseries.XMaterial.<init>(XMaterial.java:1579)
    at com.cryptomorin.xseries.XMaterial.<clinit>(XMaterial.java:69)
    at com.roughlyunderscore.enchs.parsers.action.ActionUtils.parseItem(ActionUtils.kt:119)
    at com.roughlyunderscore.enchs.TestUE.testParseItem1(TestUE.java:39)
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.Server.getVersion()" because "org.bukkit.Bukkit.server" is null
    at org.bukkit.Bukkit.getVersion(Bukkit.java:112)
    at com.cryptomorin.xseries.XMaterial$Data.<clinit>(XMaterial.java:2198)
    ... 19 more
@BeforeEach
public static void setup() {
  MockBukkit.mock();
  plugin = MockBukkit.load(UnderscoreEnchants.class);

  Bukkit.setServer(MockBukkit.getOrCreateMock());
}

private static UnderscoreEnchants plugin;

@AfterEach
public static void unload() {
  MockBukkit.unmock();
}

@RepeatedTest(value = 25)
public void testParseItem1() {
  final ItemStack item = parseItem("stone:3");
  assertTrue(arrayContains(arrayOf(new ItemStack(Material.STONE, 3)), item));
}
old jay
#

sorry i don't go by jvm

fluid river
#

server is null

tardy delta
#

wait Bukkit.setServer being a thing?

fluid river
#

no

#

i guess

round finch
fluid river
#

wait what

#

@quaint mantle are you alive

tardy delta
#

cannot be done if already set

quaint mantle
tardy delta
#

reflection time

fluid river
shell trench
#

Can I add tabs after a text in spigot? I tested \t but this just gave me a weird character

fluid river
#

depends

#

i don't think it's possible in chat

#

but probably possible in server name

#

hi

icy beacon
#

I'm trying to work with MockBukkit

#

it used to work

fluid river
#

Well now it doesn't

icy beacon
#

but now it errors that server is null

fluid river
#

and we are spigot-related here

icy beacon
#

basically MockBukkit.mock() should change it to NOT be null

icy beacon
#

not a fork of spigot

fluid river
#

then you probably placed your getOrCreateMock() or setServer() in wrong place

icy beacon
#

this is from the documentation

fluid river
#

Sad

icy beacon
#

but enhanced because it stopped working

#

basically MockBukkit.mock() and plugin declaration should be just enough

#

and the rest I added because maybe it'd work

golden turret
#

If I understand it right it will be like a Stream#map, right?

harsh totem
#

When I open my plugin project I see this on the side of the IDE and then 5 seconds later I only see this.
What is happening?

remote swallow
#

that happened to me

harsh totem
remote swallow
#

it cant find the build script or it wont register it

golden turret
#

hm

#

try using the reload

harsh totem
#

where

remote swallow
#

look on the maven tab and import the project

golden turret
#

obviously you will use maven

harsh totem
#

im using maven tho

remote swallow
#

do the same thing but on maven

#

do you have a maven tab

#

on the right

harsh totem
#

I don't see maven here

#

wtf

#

it was just there a moment ago

remote swallow
#

look on the right of the screen

#

what tabs do you see

harsh totem
#

nothing

remote swallow
#

right click pom.xml

delicate lynx
#

right click your pom.xml, should be able to reload it from there

harsh totem
remote swallow
#

do you have a maven option'

golden turret
#

if it dont work try using the add framework thing

harsh totem
#

i dont see maven option

remote swallow
#

one sec ill open intellij rq

harsh totem
delicate lynx
#

interesting?

harsh totem
#

Why don't I see maven

#

WTF

golden turret
#

maybe

harsh totem
#

WHAT IS HAPPENING

golden turret
#

backup your project

remote swallow
#

you literally have a "add as maven project"

golden turret
#

and create a new one

remote swallow
#

under the create gist

remote swallow
#

click add as maven project

harsh totem
golden turret
#

lol

harsh totem
#

Thank you so much

golden turret
#

blind moment

harsh totem
#

yeah

#

well it's 00:00 for me

#

I want a text to be gray and italic so I did this:
player.sendMessage(ChatColor.ITALIC + (ChatColor.GRAY + ("[Server: " + player.getName() + " is no longer a server operator]")));
and it is just gray and not italic. any ideas?

remote swallow
#

it most likely cant parse it

#

try ChatColor.GRAY.toString() + ChatColor.ITALIC + "[Server: " + player.getName() + " is no longer a server operator]"

harsh totem
#

then how would I make a text both italic and gray

#

i'll try

remote swallow
#

colour before formatting

#

and if you need to stack them .toString() on the first one

harsh totem
#

thx

tardy delta
dry forum
#

    @EventHandler
    public void onInventoryClick(InventoryClickEvent e) {
        Bukkit.broadcastMessage("clicked");
        Bukkit.broadcastMessage("title: " + e.getView().getTitle());``` tf? ```this.getServer().getPluginManager().registerEvents(new InteractListener(), this);``` nothing happens when i click in a gui
remote swallow
#

any errors

dry forum
#

no

quiet ice
#

Is the click canceled by any previous plugin?

dry forum
#

nope

#

only thing that could possibly effect it is this @EventHandler(priority = EventPriority.HIGHEST) public void onBlockClick(InventoryOpenEvent e) { if (e.getInventory().getType() == InventoryType.BEACON) { e.setCancelled(true); } } dont think it would though

quiet ice
#

Well, I have no idea what would produce this issue

eternal oxide
#

Is the inventory open and you are clicking somethign in it?

dry forum
#

yes to both

eternal oxide
#

then your event can;'t have been registered.

dry forum
wet breach
#

instead of showing us copied pasted code

#

how about showing us the actual class or something?

#

?paste

undone axleBOT
wet breach
#

obviously you are doing something wrong

#

but you keep showing us what you think isn't the problem so that doesn't really help

dry forum
eternal oxide
#

you have a wildcard import for all listeners, you don;t need the extra one. But thats not the issue

#

ah its under inventory

#

If that is trully the code it's fine. you can;t have updated the jar on your test server, or you are not building

humble tulip
#

Make sure you don't have 2 versions of the jar in your plugins folder

#

Can lead to an old one being loaded

dry forum
#

it only works when i drag an item from my creative inventory to my inventory

#

it doesnt work in the gui

eternal oxide
#

yeah, mentioning Creative would have told us all we needed to know

#

Creative is all client side and has minimal server side events.

#

They are all labelled "Creative" in the javadocs

wet breach
#

in other words, don't test your GUI while in creative

#

as it really won't work

#

you should also add checks to your plugin as well to check if there is players in creative opening the gui and prevent it

dry forum
#

i dont want it to be my inventory though? its a default bukkit inventory

#

ive never had an issue with me being in creative and ive used guis for like 6 months

#

also still doesnt work, still only happens when dragging in my inventory

eternal oxide
#

creative has its own interact event

dry forum
#

i dont want it to be a creative inventory

#

its just a normal bukkit inventory

eternal oxide
#

if YOU are in creative, those are the events you will see

dry forum
#

im just saying it only works when dragging stuff in my player inventory

remote swallow
#

/gamemode survival

dry forum
#

doesnt work in survival eather

#

*ether

eternal oxide
#

It will work fine in survival, IF you are building/updating the jar on yoru server

dry forum
#

im saying it ONLY works when i drag/drop in my player inventory but using the InventoryClickEvent but in a normal bukkit.createInventory gui it doesnt work

eternal oxide
#

It works fine for everyone, so long as YOU are not in creative

dry forum
#

in survival it still doesnt work

eternal oxide
#

Throw your PC out the window then as it works for everyone else

quaint mantle
#

it says "Error occurred while enabling Plugin (Is it up to date?)"

#

what did i do wrong

remote swallow
#

?paste the full error

undone axleBOT
chrome beacon
#

^

quaint mantle
chrome beacon
#

You probably forgot to register the command in the plugin.yml

quaint mantle
#

do i need to do that

tardy delta
#

yes

quaint mantle
#

i thought that was only for the "/help" command

tardy delta
#

or use some kind of command framework

remote swallow
#

its 1.8 so how many even exist

quaint mantle
#

ok thx

tardy delta
#

me writing an algorithm for 6 hours now and it's still full of bugs

quaint mantle
#

it is working

tardy delta
#

meanwhile jmh chillin'

#

๐Ÿ’€

wet breach
#

as I stated before, you can't expect help if you are not willing to show the code you are using

tardy delta
#

interesting

wet breach
tardy delta
#

jmh

#

so no

wet breach
#

ah good, because that wouldn't really work on the main thread

tardy delta
#

eastergg: Thread class will have Thread.onSpinLoop

wet breach
#

and there is no check in there to see if the runnable is on main thread either lol

#

well, actually it would work on main thread however that is only if you make the main thread sleep which as we all know is a bad thing anyways XD

tardy delta
#

the person who wrote this knows what hes doing XD

wet breach
#

oh I am sure they do lmao

tardy delta
wet breach
#

well at least it is being ran in a thread

#

but there should still be a check to ensure its not on main thread just in case

tardy delta
#

i should be looking into how to interpret benchmarks

wet breach
#

they are not usually difficult to look at

#

the hard part however is knowing the caveats

tardy delta
#

i once wrote this and i had no idea what i was doing

wet breach
#

and then having your parser select one at random to parse

tardy delta
#

hmm ig

wet breach
#

otherwise kind of hard to benchmark a simple expression lmao

tardy delta
#

the expressions that are rn in the file are of format "x * y" lol

#

ez

#

lets see what happens when i run it

#

ah fuck i left debug on and now its flooding the terminal

#

22k lines debug lmao

civic wind
#

Whats benchmark do

exotic matrix
#

Hello how can i get the nether wart block drops ? when i use block.getDrops() the collection is empty only for nether warts

remote swallow
#

it doesnt drop anything without silk touch iirc

sonic goblet
#

๐Ÿคจ

#

Might wanna double check that one

#

If youโ€™re talking about the actual block pretty sure you can do that by hand

tardy delta
#

i guess so

remote swallow
sonic goblet
#

Says you can do it by hand

tardy delta
#

things are fucking up

#

only seems to work with 3 operators

exotic matrix
#

im not breaking the block

tardy delta
undone axleBOT
sonic goblet
#

Lol

exotic matrix
#

there is a very large community in 1.8

#

Yeah, not you so just dont answer

tardy delta
#

thats a world name, not a pitch

sonic goblet
#

Also you have a comma after get yaw

exotic matrix
#

if you want a playable player from 1.8+ i use spigot 1.8 i don't see why you tell me that? Just don't answer i think ur trolling me but its ok

quaint mantle
#

?

sonic goblet
tardy delta
#

having fun debugging ๐Ÿ’€

hazy parrot
#

of course it will be red

exotic matrix
sonic goblet
quaint mantle
#

i tabbed the wrong shit

exotic matrix
tardy delta
#

believe i found the cause of my bug

remote swallow
pallid oxide
#

1.8 sucks in every way except peformance

quiet ice
#

Performance-wise it is especially trash-tier

exotic matrix
remote swallow
#

we know people play on it and that its just that not many small servers or the ones that wouldnt have their own devs exist so people dont make 1.8 plugins and dont remember how they were made back then

sonic goblet
#

That #getDrops() method he was asking about I think was even changed in 1.9-1.12 sometime to allow a itemstack parameter as an example

exotic matrix
sonic goblet
#

Maybe it was before that, perhaps that one was a bad example

exotic matrix
tardy delta
#

looks like it finally worked

#

wouldnt surprise me if others wont work

#

fuck i cant do math

#

whenever this one works, other ones wont work

#

this one works but some others dont

humble tulip
#

I'd like to have a look

#

To learn ๐Ÿ™‚

tardy delta
#

only my ancient code

#

i can make a quick push if you'd like

#

and ofc the push is rejected

humble tulip
#

Lmfao

fluid cypress
#

im getting this error when running mvn package

[INFO] --- specialsource-maven-plugin:1.2.2:remap (remap-obf) @ databaseinventories ---
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR]   supported. Please add the goal to the default lifecycle via an
[ERROR]   <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR]   remove this binding from your POM such that the goal will be run in
[ERROR]   the proper phase.
[ERROR] - You removed the configuration of the maven-jar-plugin that produces the main artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.859 s
[INFO] Finished at: 2022-11-30T23:25:53-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-obf) on project databaseinventories: Failed to create remapped artifact, project main artifact does not exist. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

pom.xml: https://paste.md-5.net/osujiwizak.xml

remote swallow
#

try mvn clean package

fluid cypress
#

i did

#

last night, remember?

remote swallow
#

ohhhh

#

whats the project structure just to check

fluid cypress
#

you mean

#

the folder structure

#

?

remote swallow
#

yeah

#

eg me.epic.plugin

fluid cypress
#
โ”œโ”€โ”€ AsyncExecutor.java
โ”œโ”€โ”€ commands
โ”‚   โ”œโ”€โ”€ GetInvCommand.java
โ”‚   โ”œโ”€โ”€ LoadPlayerCommand.java
โ”‚   โ”œโ”€โ”€ MigrateCommand.java
โ”‚   โ”œโ”€โ”€ OpenInvCommand.java
โ”‚   โ””โ”€โ”€ ReloadCommand.java
โ”œโ”€โ”€ database
โ”‚   โ””โ”€โ”€ Database.java
โ”œโ”€โ”€ DatabaseInventories.java
โ”œโ”€โ”€ events
โ”‚   โ””โ”€โ”€ DatabaseInventoriesEvents.java
โ”œโ”€โ”€ OfflinePlayerLoader.java
โ””โ”€โ”€ SerializablePlayerState.java
remote swallow
#

what about the main folders

fluid cypress
#
โ”œโ”€โ”€ pom.xml
โ”œโ”€โ”€ scripts
โ”‚   โ”œโ”€โ”€ check_commands.py
โ”‚   โ”œโ”€โ”€ post.sh
โ”‚   โ”œโ”€โ”€ pre.sh
โ”‚   โ””โ”€โ”€ project_version.py
โ””โ”€โ”€ src
    โ””โ”€โ”€ main
        โ”œโ”€โ”€ java
        โ”‚   โ””โ”€โ”€ io
        โ”‚       โ””โ”€โ”€ github
        โ”‚           โ””โ”€โ”€ misdocumeno
        โ”‚               โ””โ”€โ”€ databaseinventories
        โ”‚                   โ”œโ”€โ”€ AsyncExecutor.java
        โ”‚                   โ”œโ”€โ”€ commands
        โ”‚                   โ”‚   โ”œโ”€โ”€ GetInvCommand.java
        โ”‚                   โ”‚   โ”œโ”€โ”€ LoadPlayerCommand.java
        โ”‚                   โ”‚   โ”œโ”€โ”€ MigrateCommand.java
        โ”‚                   โ”‚   โ”œโ”€โ”€ OpenInvCommand.java
        โ”‚                   โ”‚   โ””โ”€โ”€ ReloadCommand.java
        โ”‚                   โ”œโ”€โ”€ database
        โ”‚                   โ”‚   โ””โ”€โ”€ Database.java
        โ”‚                   โ”œโ”€โ”€ DatabaseInventories.java
        โ”‚                   โ”œโ”€โ”€ events
        โ”‚                   โ”‚   โ””โ”€โ”€ DatabaseInventoriesEvents.java
        โ”‚                   โ”œโ”€โ”€ OfflinePlayerLoader.java
        โ”‚                   โ””โ”€โ”€ SerializablePlayerState.java
        โ””โ”€โ”€ resources
            โ”œโ”€โ”€ config.yml
            โ””โ”€โ”€ plugin.yml
#

target isnt necessary right?

remote swallow
#

in pom.xml on like 11 change the D to lower case

#

wait dont do that

#

imb lind

#

im more confused

#

just to test something, remove the exec plugin and the stuff that it has, and see if it will buiild

fluid cypress
#

comment from line 33 to 67 right?

remote swallow
#

yeah

fluid cypress
#

mmmh

#

seems like it works now

#

why is that?

remote swallow
#

i dont use maven or exec plugin so i have no idea what might cause that

fluid cypress
#

i need those scripts so

native nexus
#

The poms formatting is strange or is that just because of the pastebin?

fluid cypress
#

whats wrong about it exactly?

native nexus
#

Wait nvm I viewed it on phone, why its weird

fluid cypress
#

seems like the post execution is the one thats making it throw an error

<execution>
    <id>post</id>
    <phase>package</phase>
    <goals>
        <goal>exec</goal>
    </goals>
    <configuration>
        <executable>bash</executable>
        <workingDirectory>${basedir}</workingDirectory>
        <arguments>
            <argument>./scripts/post.sh</argument>
        </arguments>
    </configuration>
</execution>

the script:

mv ./target/databaseinventories*.jar ~/servers/Minecraft/plugin_dev/plugins/
#

if i comment that line in the script, and i leave just some printfs, it doesnt fail

#

so... why moving that makes it fail?

#

and apparently it was trying to move the plugin jar, and the plugin name + remapped-obf, what is that? there are 3 jars on target after mvn package, is that normal?

databaseinventories-3.0.1-SNAPSHOT.jar
databaseinventories-3.0.1-SNAPSHOT-remapped-obf.jar
original-databaseinventories-3.0.1-SNAPSHOT.jar
hazy parrot
#

It is normal, original- one is without shaded libraries and -remapped-obf is one with remapped nms code (assuming you are using nms in your plugin)

fluid cypress
#

yea

#

but which one is the jar that i need?

remote swallow
#

-remaped-obf

fluid cypress
#

thats the plugin now?

remote swallow
#

nms is normally obsufcated, special source remaps it and re obsfucats it for usage

fluid cypress
#

im getting NoClassDefFoundError: afh

#

`how am i supposed to find out what class is that?

#
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (args.length < 1) {
            sender.sendMessage("specify a player UUID");
            return true;
        }

        UUID uuid;

        try {
            uuid = UUID.fromString(args[0]);
        } catch (IllegalArgumentException e) {
            sender.sendMessage("invalid UUID");
            return true;
        }

        OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);

        if (!offlinePlayer.hasPlayedBefore()) {
            sender.sendMessage("that player has not played before");
            return true;
        }

        sender.sendMessage("loading player...");

        Player onlinePlayer = new OfflinePlayerLoader(plugin).loadPlayer(offlinePlayer);

        sender.sendMessage("player inventory:");
        for (ItemStack item : onlinePlayer.getInventory().getContents()) {
            if (item != null) {
                sender.sendMessage("" + item);
            }
        }

        return true;
    }

OfflinePlayerLoader class (i took it from the OpenInv plugin):
https://paste.md-5.net/kuniwogogo.java

#

uhhh

#

i just tried using the jar without -remapped-obf and now it works

#

wasnt i supposed to use the remapped-obf?

river oracle
#

no

#

you use the jar that has no extension

#

send your pom

fluid cypress
#

i havent modified it

river oracle
#

you should be good to go with that

fading spindle
#

nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.ABSORPTION, 200, 10))); when im setting the duration is it measured in ticks or seconds?

humble tulip
#

Ticks

fading spindle
#

Ok thanks

fluid river
#

hey guys

#

improve this

#

?paste

undone axleBOT
fluid river
remote swallow
#

what the actual fuck

#

get out

fluid river
#
1 1 2 3 3 1 3 2
1 2 3 3 3 1 1 1
1 2 3 3 1 2 1 2
3 1 2 1 3 1 2 2
3 2 2 1 1 1 1 1
1 2 3 2 1 2 2 3
3 2 1 3 2 1 2 1
1 2 3 1 1 2 3 3
Output:
0 1 2 3 3 1 3 2
0 2 0 0 0 0 0 0
0 2 3 3 1 2 1 2
3 1 2 1 3 1 2 2
3 0 2 0 0 0 0 0
1 0 3 2 1 2 2 3
3 0 1 3 2 1 2 1
1 0 3 1 1 2 3 3```
#

it's replacing all of sequences which are longer than 2 with zeros

#

both horizontally and vertically

#

for example

#

3 2 1 1 1 2 = 3 2 0 0 0 2

AND
= =
3 3
2 2
1 0
1 0
1 0
2 2

remote swallow
#

why do you need it

fluid river
#

i already made it

#

for one guy

#

can you beat this shit

#

and make it smaller

remote swallow
#

no

#

im going to bed

#

you broke my brain

fluid river
#

i made it smaller

#

Integer.valueOf((resulth.charAt(index) + ""))

#

is there like any way to optimize it

#

just cast one of the chars to int

#

without it giving you char + 42

humble tulip
#

Tick

#

Tock

fluid river
#

alr i made it

#

resultv.charAt(index) - '0';

gleaming grove
#

Why does file is empty? permissions HashMap contains 20 elements

fluid river
#

guess some of your if's are false

gleaming grove
#

both if conditions trigger configruation.set()

fluid river
#

also don't return

gleaming grove
#

omg thx

fluid river
#

๐Ÿ˜‰

gleaming grove
#

i should use continue

fluid river
#

i mean yeah

#

continue

#

cuz other way you stop the loop

gleaming grove
#

well, anyway it is not working

humble tulip
#

Print the permissions map

#

See what it contains

gleaming grove
#

file should contains permissions: but its empty

humble tulip
#

You set it to null though

#

You should use configuration.createSection

gleaming grove
#

yes thanks

#

And is it possible to make formmating like below?

worldly ingot
#

In theory you could, yes. You would have to change the delimiter

gleaming grove
#

what do you mean by delimiter?

worldly ingot
#

Something like getConfig().options().pathSeparator(';'), then you could set your values like getConfig().set("parent;child.with.a.dot;another.child")

gleaming grove
#

gr8

worldly ingot
#

Basically instead of separating children with dots, you're doing it with whatever you set the separator to

#

Bear in mind that will continue to be the case until it's changed again

#

That's not a temporary change

gleaming grove
#

thanks it works, and last question how can avoid {} at the end of each section?

worldly ingot
#

I don't think you can. That's just how Bukkit treats empty objects

gleaming grove
dry forum
#

how would i run a command using bungeeapi

night sapphire
#

What is a simple way of checking for inventory in InventoryClickEvent?

night sapphire
#

Nvm I got it

river oracle
#

i'm proud

remote swallow
#

Does vscode have tab complete

river oracle
#

yeah...

#

who tf would use it

#

if it didn't

#

I'm no masochist

remote swallow
#

Might check it out

river oracle
#

it requires configuraiton to do literally anything tho

#

it doesn't ship as a full blown IDE

#

I'd stick to IntelliJ if your already used to it

#

its "technically" better according to everyone on here. I personally don't see such a big improvement when using it, but thats cuz I'm a weirdo

remote swallow
#

Only problem i have with intelllij is the ram usagr

river oracle
#

how much does intellij use

remote swallow
#

Like 2gb on a normal project

river oracle
#

mine uses 3gigs but thats because I configured it to