#help-development

1 messages ยท Page 197 of 1

fluid river
#

who knows

#

it's not stated in the code

round finch
#

i do not have a ide open

fluid river
#

if only i knew why is the guy creating ItemStack item

#

which he don't use

round finch
#

yeah depends if he wanna make a new Item

#

and place it

fluid river
#

i have entire wolfram alpha in my head

round finch
#

@fluid river AF02heart

quaint mantle
#

And i gotta edit it still because its only using one workload god_cat

#

Delay moment

fluid river
#

sin + cos at your help

round finch
#

Deduction?!? too

fluid river
#

depends on your system

round finch
#

heheh ๐Ÿ˜›

fluid river
#

and axis to rotate

round finch
#

Now gimme your math to java learning!

fluid river
round finch
fluid river
round finch
round finch
fluid river
#

find determinant of 3x3 matrix given as double[][]

round finch
#

1 subject to another

quaint mantle
#

What did you mean by this

fluid river
#

nah

round finch
#

isn't that just a 2d array?

fluid river
#

yeah 2d array

ivory sleet
fluid river
#

[17 34 1]
[10 15 2]
[13 18 3]

#

find determinant

round finch
ivory sleet
#

A 2d array is less strict than a matrix

fluid river
#

?

round finch
quaint mantle
#

when i did this

ivory sleet
#

A matrix as by the mathematical definition

fluid river
#

show error

quaint mantle
#

just by adding itemInMainHand

round finch
ivory sleet
#

Thats a square matrix

quaint mantle
ivory sleet
#

But yeah

quaint mantle
#

it just filled with errors

#

but its mostly 22:40:44] [Server thread/ERROR]: Could not pass event ProjectileHitEvent to Coreplugin v1.0 org.bukkit.event.EventException: null at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callProjectileHitEvent(CraftEventFactory.java:1283) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.IProjectile.preOnHit(IProjectile.java:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.EntityArrow.k(EntityArrow.java:232) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.entity.projectile.EntityTippedArrow.k(EntityTippedArrow.java:112) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.a(WorldServer.java:827) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.level.World.a(World.java:658) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.lambda$9(WorldServer.java:422) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.world.level.entity.EntityTickList.a(SourceFile:54) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.level.WorldServer.a(WorldServer.java:402) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1290) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:394) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1013) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f] at java.lang.Thread.run(Thread.java:1589) [?:?] Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "org.bukkit.inventory.meta.ItemMeta.getLore()" is null at mission.coreplugin.events.telebowevents.onBowShoot(telebowevents.java:22) ~[?:?] at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?] ... 18 more

fluid river
#

you have no lore on the bow

round finch
#

So that is a Multiplayer array some sort?

fluid river
#

that's causing the error

quaint mantle
fluid river
#

my code not

#

it copies old lore and adds new line to it

quaint mantle
#

oh

fluid river
#

but item you use rn has null lore

quaint mantle
#

ah

#

ok

#

so

#

ok i figured it out

fluid river
#
List<String> newLore = meta.getLore() == null? new ArrayList<String>() : meta.getLore();```
#

try this

round finch
#

i'm not part of the high mind math society idk shet for real about math

fluid river
#

matrix is basically table

#

2 dimensional

round finch
#

but why the lines

quaint mantle
ivory sleet
#

Which lines?

quaint mantle
#

and whats the last bit

ivory sleet
#

The []?

round finch
#

i mean dots

fluid river
ivory sleet
#

To denote all the elements

fluid river
#

matrix can have any size

ivory sleet
#

Like a sequence

fluid river
#

it can be square or rectangle

#

and have any amount of elements in row or column

ivory sleet
#

1, 2, 3, โ€ฆ, n - 2, n - 1, n

fluid river
#
[a21, a22, a23]
[a31, a32, a33]```
ivory sleet
#

^ for a square matrix of order 3

quaint mantle
fluid river
round finch
fluid river
#

2x2 matrix determinant is a11 * a22 - a12 * a21

ivory sleet
#

thats to denote the elements diagonally

fluid river
#

and for 3x3 hard formula with 4 triangles and 2 lines

ivory sleet
#

Like A_11, A_22 all the way to A_nn

round finch
#

some like n....?

#

infinity loop

ivory sleet
#

No

round finch
#

oops

fluid river
#

cuz each matrix in mafs have a determinant

#

which is used to solve linear algebra equations

#

like move vector from one coordinate system X Y Z

#

to another X2 Y2 Z2

ivory sleet
# round finch

This means that u have a matrix by n rows and m columns

fluid river
#

And finding it's coordinates in this new system

round finch
ivory sleet
#

Its just notational to denote a general matrix

#

Just like if you were to use the sum formula of an arithmetic progression

fluid river
#

alos matrixes help solve Systems of Linear Algebraic Equations

round finch
#

I'm probably at low algebra

#

but i'm Autistic

#

so power up?

fluid river
#

go to university

#

half year and you are at high level

#

knowing linear algebra

#

i'm just having fun

round finch
#

Oh so it is linear algebra

#

i need to work on?

#

good to know

fluid river
#

for working with vectors and coordinates systems

round finch
#

I'm so unfamiliar with the subjects

fluid river
#

you need matrixes

#

which are part of linear algebra

#

for finding derivative or integral you need calculus

quaint mantle
#

um

#

im getting this error

round finch
#

i did barely any Math study for 9 grade

quaint mantle
#

when i did an event

#
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callProjectileHitEvent(CraftEventFactory.java:1283) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.world.entity.projectile.IProjectile.preOnHit(IProjectile.java:157) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.world.entity.projectile.EntityArrow.k(EntityArrow.java:232) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.world.entity.projectile.EntityTippedArrow.k(EntityTippedArrow.java:112) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.level.WorldServer.a(WorldServer.java:827) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.world.level.World.a(World.java:658) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.level.WorldServer.lambda$9(WorldServer.java:422) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.world.level.entity.EntityTickList.a(SourceFile:54) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.level.WorldServer.a(WorldServer.java:402) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1290) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:394) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1197) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1013) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:293) ~[spigot-1.19.2-R0.1-SNAPSHOT.jar:3600-Spigot-89741d3-aaf484f]
        at java.lang.Thread.run(Thread.java:1589) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.contains(Object)" because the return value of "org.bukkit.inventory.meta.ItemMeta.getLore()" is null
        at mission.coreplugin.events.telebowevents.onBowShoot(telebowevents.java:22) ~[?:?]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        ... 18 more```
round finch
#

because of my systematic brain

fluid river
#

getLore is null

#

again

round finch
#

ez pass

fluid river
#

i'm on second university year

round finch
round finch
#

i wish i had some real study omfg

fluid river
#

i didn't pass second symmester calculus

#

two times

quaint mantle
# fluid river getLore is null
        if (event.getEntity() instanceof Arrow) {
            if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
                ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
                if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
                    Arrow arrow = (Arrow) event.getEntity();
                    arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));

                }
            }
        }
    }
}``` this is me code idk how to make it not null and stuff when i shoot with a bow that has a lore
round finch
#

i paided some dude for teaching me some algbra online
from fiverr funny enough

fluid river
#

if (itemInMainHand.getItemMeta().getLore() == null) return;

#

before your contains check

round finch
#

easy not null check != null

#

๐Ÿ™‚

fluid river
quaint mantle
#

how?

round finch
#

everybody should know

ivory sleet
#

He does

fluid river
#
if (!(event.getEntity() instanceof Arrow arrow)) return;
// now you can use arrow variable```
round finch
#

well Everybody should know how to land on the moon ๐Ÿ˜‚

ivory sleet
fluid river
#

i mean Arrow arrow

#

so he don't cast it and make code spaghetti

fluid river
quaint mantle
#

but

ivory sleet
#

Pattern matching is new

fluid river
#

which

quaint mantle
#

it works for the other thing

ivory sleet
#

Or well

quaint mantle
#

why doesnt it work for this one

ivory sleet
#

Kinda

fluid river
round finch
fluid river
#

if i'm not dumb

fierce whale
#

How can I modify file configuration with async scheduler?
May I get any sample code?

quaint mantle
#

ok

river oracle
#

I don't really get the point of modifying the FileConfiguration object asunc

quaint mantle
#

so i fixed the errors in my code

river oracle
#

its all in memory

quaint mantle
#

so now theres no errors

#

but the code doesnt wokr

river oracle
#

FileConfiguration is all memory there is no reason to use async for editing and retrieving from it

#

if your using FileConfiguration as data storage I'd suggest an alternative like SQLite or other databases

#

then the correct manner would be to edit those async as queries would halt the main thread

ivory sleet
#

Thats not the issue

#

The issue is if you save and load it concurrently

#

Which is rarely the case

#

But if it is, you probably wanna ensure your design is safe against memory reordering effects etc

river oracle
#

imo you should really only be loading configs on startup I see no reason to be doing it more than once

ivory sleet
#

But yes, anyway FileConfig was never really made for multithreaded purposes

#

Yeah

river oracle
#

I don't necessarily think it was built with data storage in mind anyways

ivory sleet
#

No not really

#

Just a measly glorified lhm with type safe getters and a sink and source functionality

river oracle
#

๐Ÿ’€ what have you been doing

fierce whale
#

Ummm... so I can't use FileConfiguration async. Is it right?

ivory sleet
#

You can

#

But its not smart

fierce whale
#

Ah...

ivory sleet
#

Or well, you can probably solve your problem in a better way

fierce whale
#

I heard better way to save data is using db

ivory sleet
#

Myeah

river oracle
#

that is the purpose of a db afterall

fierce whale
#

Um...

river oracle
#

I hope it stores data well

fierce whale
#

So I tried to use sqlite in the past

#

But many people said it's not smart way to save huge amount of data

quaint mantle
#

so

river oracle
#

what type of data are you storing though would be the main question

quaint mantle
#

Before i added the checks if (((Arrow) event.getEntity()).getShooter() instanceof Player player) { ItemStack itemInMainHand = player.getInventory().getItemInMainHand(); if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) { no matter what item i was holding and stuff the bow would always fire at full power no matter the item of course i didnt want this to be for all items so i added the checks above and now it doesnt work.

fierce whale
#

Im making dialog and quest plugin now

quaint mantle
#

as in doesnt work it doesnt insta fire the bow

river oracle
fierce whale
#

So I need to save player data which contains dialog read and completed quest etc

river oracle
#

generally I'd leave it up to the server owner and support multiple DBs

quaint mantle
river oracle
#

if your making this for yourself I'd say gage where you are at in terms of players etc and determine whats best for you based on your servers playercount

quaint mantle
#

Before i added the checks

            ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
            if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {```
 no matter what item i was holding and stuff the bow would always fire at full power no matter the item of course i didnt want this to be for all items so i added the checks above and now it doesnt work. so maybe i copy pasted the thing wrong
#

or something

#

becuse now my thing is broken

fierce whale
#

But is there big difference using between db and fule confuguration?

quaint mantle
#

breh

#

im getting Could not pass event EntityShootBowEvent to Coreplugin v1.0
org.bukkit.event.EventException: null

#

wtf

#

whyyy

river oracle
#

Databases are built for storing data thats their whole purpose

#

FileConfiguration is meant for config of your plugin and smaller scale things

fierce whale
#

Ahha...

#

okay thanks for your advice

round finch
#

(event.getShooter() instanceof Player)

#

Checks for the Shooter

#

also you can add AND as &&

quaint mantle
#

ok

quaint mantle
#

i just put it there and no more error

#

also

#

now im not having anymore errors

#

but

#

the thing doesnt do like it supposed to

#

like it builds and stuff

#

it just doesnt multiply the velocity by 3 anymoer

#

it just does nothing

round finch
#

setVectory?

#

idk lemme see

quaint mantle
#
    public void mlbbowshoot(EntityShootBowEvent event) {
        if (event.getEntity() instanceof Arrow arrow) {
            if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {
                ItemStack itemInMainHand = player.getInventory().getItemInMainHand();
                if (itemInMainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
                    arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));
                    }
                }

            }
        }
    }```
quaint mantle
#

i mean the code SEEMS fine

#

but it isnt

round finch
#

4 line seems very uncleaned and cursed

#

if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {

quaint mantle
#

idk what it does

#

saw it on spigot

#

copy pasted it

#

worked for my first enchant

round finch
#

getProjectile()

#

ez

quaint mantle
#

huh

#

but i was to be able to do things with the player

round finch
#

event.getProjectile() instaceof arrow

quaint mantle
#

how would you re word if (((Arrow) event.getEntity()).getShooter() instanceof Player player) {

#

but what about player?

river oracle
#

oh lord no

#

ohhhh noo

round finch
#

Check if Shooter is player first

quaint mantle
#

why is it red

round finch
#

ok pup

river oracle
undone axleBOT
quaint mantle
#

-_-

river oracle
#

please learn java before coding with spigot it'll save you so much time

#

even if its just the very basics

#

please do it for yourself

round finch
#

i know i wanted to say the same but i would try...

river oracle
#

thats why I'm a bad spigot dev

#

I can't dance like that :(

round finch
#

me too ๐Ÿ˜ฆ

#

i just can't dance in general

quaint mantle
#

when i type

round finch
#

i'm allow to spoon feed?

quaint mantle
#

event.getEntity().getShooter and i pres tab it auto does (((Arrow)

river oracle
#

no don't they will just come back

#

please if your going to do anything teach them java

round finch
#

well copying isn't learning

#

i guess

#

you need to remember the stuff and meaning

#

my past with learning

#

so much source reading

#

still look up stuff

river oracle
#

I learned java through spigot purely through reading source code

#

granted I already had basic programming experience in python

round finch
#

hell

river oracle
#

I didn't know how to read docs at the time

#

I just knew how to wield the most powerful tool on earth

#

google

quaint mantle
#

im just special in the head

round finch
#

cast after check

quaint mantle
#

see

round finch
#

else error

river oracle
#

should also probably check if shooter is null

quaint mantle
#

it wont let me check if the shooter if player

#

because it adds the arrow thingy

fluid river
#

why do u escape everything normally with \\

#

but to escape ' you need single backslash

river oracle
#

I realized my error ๐Ÿ’€ this is why I quit coding minigames

fluid river
#

char singleQuote = '\'';

round finch
#

\\ life

quaint mantle
#

see to get the event.getShooter

#

i need

fluid river
#

()

quaint mantle
#

event.getEntity()

fluid river
#

at the end of the method

quaint mantle
#

stop

#

let me explain

#

so

#

when i type

#

event.getEntity()).getSh and press tab right

fluid river
#
if (!(arrow.getShooter() instanceof Player player) return;```
quaint mantle
#

it auto does

#

if(((Arrow) event.getEntity()).getShooter())

#

for some reason

#

it just wants arrow

fluid river
#

you have arrow variable already

#

use it

round finch
quaint mantle
#
           if(event.getEntity() instanceof Arrow) {
               if(((Arrow) event.getEntity()).getShooter())```
fluid river
#

cringe

quaint mantle
#

-_-

#

dude

#

it wont let me

#

type that

#

oml

#

whyy

fluid river
#
int boolToInt(boolean bool) {
    return bool == true? 1 : 0;
}```
quaint mantle
#

it just has to add (((arow)

quaint mantle
#

like why does it have to add

#

the arrow thing

#

im just genuinly confused at whats happening

#

oh wait

#

im just special

#

i can just do

round finch
#

C++ variables?

quaint mantle
#

arrow.getShooter()

river oracle
#

take NukerFall free JAVA TUTORIAL LESSONS

quaint mantle
round finch
#

@quaint mantle do you understand the basic computing?

quaint mantle
round finch
#

and logic states

fluid river
#

copy + paste -> shut up -> learn java

@EventHandler
public void onArrowShoot(EntityShootBowEvent event) {
    if (!(event.getEntity() instanceof Arrow arrow)) return;
    if (!(arrow.getShooter() instanceof Player player)) return;
    var mainHand = player.getInventory().getItemInMainHand();
    if (!mainHand.hasItemMeta() || mainHand.getItemMeta().getLore() == null) return;
    if (mainHand.getItemMeta().getLore().contains(ChatColor.LIGHT_PURPLE + "RARE! " + ChatColor.BLUE + "MegaLongBow III")) {
        player.sendMessage("ITS WORKING");
        arrow.setVelocity(arrow.getVelocity().normalize().multiply(3));
    }
}
round finch
#

he will come back dude

#

not learned anything

fluid river
#
int* arrayOfTenInts = (int*) malloc(10 * sizeof(int));```
round finch
#

c++ makes me die inside a little

round finch
#

to say i'm a noob to it

fluid river
#
~MyClass {
    free(myThings);
}```
fluid river
#

?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.

quaint mantle
#

im typing

#

It doesnt multiplly the velocity of the arrow like its supposed to

#

and instead it just

#

normal arrow

fluid river
#

print a debug message when shooting

quaint mantle
#

like how its supposed to here

round finch
quaint mantle
#

wait

#

did i not .getforce

round finch
#

?spigotdoc

fluid river
#

you can not set force to event

#

only get it

#

and force is from 0.1 to 1.0 afair

#

not connected to actual arrow velocity

#

i mean partly connected

quaint mantle
#

it worked before though

fluid river
#

what

quaint mantle
#

wdym what

#

like the thing used to work

#

before i added all the checks

fluid river
#

i guess you messed up the lore part

quaint mantle
#

probaBLY

#

but i copy pasted it from the command that sets the lore

fluid river
#

why do you actually put checks as lore

#

why not PDC

river oracle
#

"Whats PDC?"

quaint mantle
#

whats pdc

fluid river
#

are your enchantments lore-based too

#

ahahah

quaint mantle
fluid river
#

LMAO

river oracle
quaint mantle
#

idk what it stands for

river oracle
#

they are

quaint mantle
#

but i know what it is

fluid river
#

PersistentDataContainer

river oracle
#

Persistent Data Container good sir

quaint mantle
#

arent those like really complex

fluid river
#

no

river oracle
#

๐Ÿ˜จ hopefully not

quaint mantle
#

how do you use them

fluid river
#

itemMeta.getPersistentDataContainer().set(key, PersistentDataType.BYTE, (byte) 1);

quaint mantle
#

wht the link for the docs

fluid river
#

if (!itemMeta.getPersistentDataContainer().has(key, PersistentDataType.BYTE)) return;

#

where byte value represents level of enchantment

#

or you can switch to int

#

if level 127 is not good enough for you

#

?jd-s

undone axleBOT
fluid river
#

byte level = itemMeta.getPersistentDataContainer().get(key, PersistentDataType.BYTE);

quaint mantle
#

the problem isnt the lore...

#

i made the lore hi

#

like

#

litterally same hting

#

and it didnt work

round finch
#

whats? PersistentDataType<T,Z>

#

set(NamespacedKey key, PersistentDataType<T,Z> type, Z value)

#

also confusion

quaint mantle
#

i think im going to go to bed

#

see you guys

#

ty for the help

round finch
#

man poor soul scared away

#

good rest!

#

take care

#

@fluid river explain PersistentDataContainer?

quaint mantle
round finch
#

yeah

#

but the variables

quaint mantle
#

Works perfectly fine for me

quaint mantle
river oracle
#

They bit off more than they could chew you could say

round finch
#

what is <T,Z>

#

type

river oracle
#

Generics

round finch
#

value

quaint mantle
#

^

river oracle
#

T is the java value Z is what its turned into

#

Z is just going to be a byte array though

#

atleast in terms of PDC as far as I've seen is all translated into byte arrays

round finch
#

example what you do?

#

oh nbt

#

so you can make a namespacekey

#

put it first

silk burrow
#

Im using mojang-remap to see function names of nms objects, but the fields/classes are becoming invalid when I use them in a plugin depending on the first:
CorePlugin:FakeSnowballEntity extends net.minecraft.....Entity
GamemodePlugin:Hookshot extends Core.FakeSnowballEntity <-- functions like kill() become obfuscated again

anyone else run into this issue? do I need to add something to the specialsource-maven-plugin?

quaint mantle
#

how would i cancel a Runnable?

#
public class WorkloadRunnable implements Runnable {

    private static final double MAX_MILLIS_PER_TICK = 2.5;
    private static final int MAX_NANO_PER_TICK = (int) (MAX_MILLIS_PER_TICK * 1E6);

    private final Deque<Workload> workloadDeque = new ArrayDeque<>();

    public void addWorkLoad(Workload workload) {
        this.workloadDeque.add(workload);
    }

    @Override
    public void run() {
        long stopTime = System.nanoTime() + MAX_NANO_PER_TICK;

        Workload nextLoad;

        while (System.nanoTime() <= stopTime && (nextLoad = this.workloadDeque.poll()) != null) {
            nextLoad.compute();
            if (workloadDeque.isEmpty()); // cancel runnable
        }
    }
}```
#

or will it automatically do it?

#

i not smart

dense fjord
#

Hmm what does source code mean and can i recrate a plugin using its source code?

#

*recreate

civic wind
#

Source code is the actual code for the plugin, src code. Yes, if you have the source code you can edit, amend etc etc the plugin

dense fjord
round finch
#

The person is being sus

dense fjord
#

hm

civic wind
#

Yeahhh

dense fjord
#

I do have amongus pfp

#

But srsly how do i edit it

#

xD

round finch
dense fjord
#

XD

round finch
#

Sure...

dense fjord
#

I srsly wanna know

civic wind
#

If you dunno what src code is and you dunno how to even open it in ide then you got no business coding and amending it lol

dense fjord
#

Uh

round finch
#

Source code is the code

dense fjord
#

i know what src means but i got confused with the thing

round finch
#

Not compiled by pc

dense fjord
#

no Like ik what src short form means but i got confused with the source part of the full form of source code

glad prawn
#

๐Ÿ’€

round finch
#

Lamb source okay

dense fjord
#

..

round finch
#

English

dense fjord
#

Yes fine

civic wind
#

Lol

dense fjord
#

My intentions r sus

#

ok?

civic wind
#

We know

dense fjord
#

know what?

round finch
#

It self explanatory

civic wind
#

Whos code are you decompiling ๐Ÿ˜ณ

dense fjord
#

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

Idk

civic wind
#

Whos lamb source you got

dense fjord
#

urs

civic wind
#

I write shitty code

#

So thats fine

dense fjord
#

TELL ME HOW TO OPEN

#

AHA

round finch
dense fjord
#

Just tell me pls

round finch
#

Cus you always sus amongus

#

Like the game hehe

dense fjord
#

PLEASE
TELL ME

#

I BEG

round finch
#

Java decompiler

civic wind
#

Lol jdgui

round finch
#

Yeah

dense fjord
#

I feel like tht a rickroll

#

no

#

i wont open xD

civic wind
#

Alr then

round finch
#

Not really

#

You asked

#

I helped

#

But ... || rick got you ||

dense fjord
#

ive been rickrolled tooo many times

round finch
#

Read it

dense fjord
#

its not a rr

#

i opened

round finch
#

Kinda is

dense fjord
#

hm

round finch
#

But sadly not gud

dense fjord
#

Alright im off to find leaked plugins XD

civic wind
#

This guy

round finch
#

Hmm sus person

#

There is stuff to prevent

dense fjord
#

I cant code and im broke so tf am i supposed to do

civic wind
round finch
#

Decompiling

dense fjord
#

Ok so off to find leaked plugins

#

Dont ask me what im getting from the websites

round finch
#

Just get gud

dense fjord
#

ill try

round finch
#

I guess learn programming and java

#

Is the battle itself

dense fjord
#

Yes it is ig?

round finch
#

But don't get discouraged

#

For playing around

mighty pier
#

@dense fjord you asked for help and when it was given you "felt like it was a rickroll"

#

go away then

dense fjord
civic wind
round finch
#

What are you saying

#

Do not bait me

civic wind
#

Bruh

round finch
#

Sus

civic wind
#

U watch anime ?!??

#

Hunter x hunter

round finch
#

That

#

I know

dense fjord
#

I used to

round finch
#

The anime

civic wind
#

Whats ur fav anime ?

round finch
#

But never watched it

civic wind
#

Watch it

#

I know an app that has loads of, english dubbed

round finch
#

My pf is vtuber Amelia watson

civic wind
#

Crunchyroll on ios

#

Tons of animes english dbbed hd quality

mighty pier
dense fjord
#

Ah i want tht plugin so bad but im broke

round finch
#

I'm a practice deductionist

mighty pier
#

is there any staff that could kick him?

round finch
dense fjord
round finch
#

@dense fjord don't listen

mighty pier
#

he is hypixel player

round finch
#

To that's dood

mighty pier
#

you gave him help

#

he didnt take it

#

his fault

round finch
#

He is nice

civic wind
#

Lol

mighty pier
#

no

#

hypixel monkey

civic wind
#

Deductionist?

round finch
#

Yea

mighty pier
#

trying to make a server

round finch
#

He is

civic wind
mighty pier
#

penis deobfuscator

civic wind
#

Bruh

#

Seductionist????

mighty pier
round finch
#

His practices

civic wind
#

Im so confused

round finch
#

Deducing different things

#

Basically it

#

You can make sense of things about people and objects

civic wind
#

Ahhh

#

I thought you meant seducing ๐Ÿ˜‚

round finch
#

Robort green

tall dragon
#

1.5.2??

worn tundra
#

xdd

quaint mantle
#

why is the string removing "::"?

#

idk what i've done

eternal night
#

You might want to elaborate as to what is happening ๐Ÿ˜…

#

E.g. what code is running

quaint mantle
#
      for (int i = 0; i < STARTING_VARIABLES.length; i++) {
            String[] split = STARTING_VARIABLES[i].replace("||", "@@").split("@@");
            String name = split[0] + spliter + uuid;
            VariableAPI.getVariableorCreate(name, split[1]);
        }```
```java
    public static Variable getVariableorCreate(String name, Object value) {
        return new Variable(name, (VariableSave.getJson().get("storage." + name) != null ? VariableSave.getJson().get("storage." + name) : value));
    }```
#

i've debugged and the first code puts the spliter in between

#

but second one removes it

#

๐Ÿคทโ€โ™‚๏ธ

#

halp

#

it shouldn't be removing it at all

#

stupid java

iron palm
#

I've seen people that are using a custom build in gradle or maven which not only compiles the plugin it also runs minecraft with minecraft server.
Im wondering how should i do someth similar like that?

ivory sleet
#

You can define a task that runs a jar file

iron palm
#

damn

#

ty

ivory sleet
#

Meh depends

#

Gradle has a steep learning curve fs

iron palm
#

i must stop using maven in 2022

eternal oxide
#

why? Maven is the best

ivory sleet
#

Arguably not

tame steppe
#

Just build stuff with shell scripts ๐Ÿ’€

crimson terrace
#

next thing we know we are back in the dark ages or using the windows text editor to code

zealous osprey
#

god I love coding in the text editor

bright cedar
#

Hey, do player attributes exist in 1.8 ?

glad prawn
#

I think there is no

warm mica
bright cedar
#

Yes, but I'd like to give a specific percentage of strength to a player and I don't know how ๐Ÿ˜•

worn tundra
ornate mantle
#

how do i remove the cyan colour from an item after enchanting

river oracle
ornate mantle
#

after enchating

river oracle
ornate mantle
#

i have nms in my project

#

using it for something else

river oracle
#

Oh uhm I'd look but I honestly cbf to get up from bed rn

#

Sorry

ornate mantle
#

lol

river oracle
#

I'm too comfy

crimson terrace
#

I found this

ornate mantle
#

i dont want to remove the glow

#

i want to remove the cyan item name

compact haven
#

thatโ€™s easy

crimson terrace
#

then set the name

compact haven
#

just set the display name on ItemMeta

crimson terrace
#

the colors is just extra characters in the name which are interpreted

ornate mantle
#

Utilities.nameItem(newItem, ChatColor.RESET + this.name);

#

i have this here

#

this is added when the item is created tho

#

not refreshed after enchanting an item

crimson terrace
#

then use an enchant listener or something

ornate mantle
#

would chatcolor.reset work

crimson terrace
ornate mantle
#

just say you dont know ๐Ÿ’€

crimson terrace
#

just did

#

I just find it a fancier way of saying "I dont know and I dont wanna google it rn"

ornate mantle
#

splendid

fluid river
#

Good afternoon comrades

#

Where are newbies

#

show me

fluid river
#

yes

#

thank you

crimson terrace
#

what's toy

fluid river
#

sadly TYU are near

#

right from them all

#

YOU -> TOY

fluid river
#

BALLS

#

big ones

ornate mantle
#

this shall be the most ambitious project i have ever embarked on

shadow night
#

Is it better to store the config in variables and update when the config is reloaded or get it directly using config.get()?

fluid river
#

use bukkit's getConfig()

#

and reloadConfig()

#

and saveConfig()

shadow night
#

Uhmm

#

I mean when getting config values

fluid river
#

you can just use config.get("key")

crimson terrace
#

I would always just get them from the config freshly

shadow night
#

Hmm, okay. I was told once I shouldn't do that

crimson terrace
#

dont store them in your variables, it makes custom reload methods hell

fluid river
#

depends

shadow night
fluid river
#

if you need to get the value multiple times in the method, you'd better store it to variable

crimson terrace
#

the config is a HashMap, its not much more work than anything else

fluid river
#

why would i even need old data

shadow night
crimson terrace
#

the reason its old data is that it shouldnt be used anymore

shadow night
#

For example if the new data is invalid you can set it back to the old

crimson terrace
#

doing too much

fluid river
#

if new data is invalid i just stop the plugin

#

or send message omg you dumb nibba you have to manually fix what you did

crimson terrace
#

ye. cant have these server owners thinking they can just fuck with configs without knowing what theyre doing

shadow night
#

Hmm

#

Sure

crimson terrace
#

theyd get used to that and stuff

shadow night
#

Eh makes sense

fluid river
#

remember editing PeX config ๐Ÿ™‚

#

permissions.yml it was

#

good old days

shadow night
#

Premissions, ah yes

#

I have no idea if thats a typo

fluid river
#

?

#

oh i see

shadow night
#

Because pre-missions is a possible meaning too

fluid river
#

fixed

#

PermissionsEx

shadow night
#

Eh lol

#

Hmm, I just remembered my old idea of making a server side modding core using texturepacks, I wonder if thats possible

crimson terrace
#

everythings possible, just gotta know how much work it would be

molten hearth
#

is there a way to use reflection to achieve enum#valueOf

crimson terrace
#

why would you wanna use reflection instead of the perfectly working enum#valueOf()?

molten hearth
#

because it aint working lol

#

Cannot resolve method 'valueOf' in 'Material'

#

yet I can clearly see Material.STICK and stuff

fluid river
#

wdym

crimson terrace
#

then somethings broken... enums have that by default

fluid river
#

Material has valueOf

crimson terrace
#

thats java, not that exact enum

molten hearth
#

oh this is a sealed interface

fluid river
#

Material is class tho

#

it's not an enum

molten hearth
#

yeah I thought ti was

#

looks the exact same

#

so how do I commit valueOf on a sealed interface

crimson terrace
#

?

molten hearth
#

no im not using bukkit this is a java question

eternal oxide
#

why do you want to use reflection?

molten hearth
#

because there seems to be no mentally sane way to obtain the STICK for example from Material

fluid river
molten hearth
#

yet I can access it with Material.STICK

eternal oxide
#

Material.STICK, Material.valueOf("STICK"), both valid

molten hearth
#

well not on a sealed interface apparently

crimson terrace
eternal oxide
#

You are not explaining yourself very well

crimson terrace
#

Material is bukkit

#

that may be your problem

molten hearth
#

wdym im asking how to achieve something like enum#valueOf from a sealed interface

eternal oxide
#

Why reflection at all when you have the Enum itself?

molten hearth
#

because this isnt an enum

fierce whale
#

I wanna use PlayerInteractEntityEvent to get rightclicked entity.
But It doesn't works ๐Ÿ˜ฆ
Is there any problem on this Listener?

public class dialogEvent implements Listener {
    private final main plugin;
    public dialogEvent(main plugin) {
        this.plugin = plugin;
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    public void OnInteract(PlayerInteractEntityEvent e) {
        System.out.println("A");
    }
}
eternal oxide
#

What?

molten hearth
#

I thought it was until approximately 30 seconds ago

#

but its not

crimson terrace
#

what would you use the stick for

fluid river
#

fuck

#

you

#

even

molten hearth
#

lmao

fluid river
#

omg

molten hearth
#

๐Ÿ˜‚

fierce whale
#

aha

molten hearth
#

its just for a config option

#

I store like

#
"material": "STICK"```
fierce whale
#

sorry... ๐Ÿ˜…

crimson terrace
#

yeah but what is the config option for

molten hearth
#

and I build a menu using Material.STICK

crimson terrace
#

what are you trying to ultimately achieve

fluid river
#

before method

molten hearth
#

building a menu from a config

eternal oxide
#

then Material.valueOf("config.get"material")

molten hearth
#

bro

fluid river
#

true

molten hearth
#

I dont think

#

you are understanding

fluid river
#

what

crimson terrace
#

alright, and since youre not using bukkit, as you said, what are you using

molten hearth
#

valueOf is not an option

#

im using Minestom

eternal oxide
#

why not?> its a part of Material

round finch
#

Tru no @Eventhandler

molten hearth
#

because

round finch
#

There

molten hearth
#

this is a sealed interface that has nothing to do with bukkit's Material

crimson terrace
molten hearth
#

its just a coincidence

#

so im wondering if I can do it with reflection somehow

eternal oxide
#

Yeah I'm out. You are not explaining your issue at all

molten hearth
#

bruh

#

I think you're just not undertanding

eternal oxide
#

bruh

#

yes, you are not conprehendable

crimson terrace
#

if the api youre using has no way to get the materials, youre gonna have to find someone who knows the api

molten hearth
#

I have explained about 5 times im

  1. not using an enum
  2. not using bukkit
  3. I need to do something similar to enum#valueOf with a sealed interface
#

seems comprehensible to me

crimson terrace
#

this is a bukkit/spigot/paper thing afaik

eternal oxide
#

You say you want to use valueOf to get a Material, but you can;t use Material Enum so you want to use reflection because its some sealed interface. It's all incomprehensible

crimson terrace
#

most people here dont know many other apis

molten hearth
#

Ask other questions here

crimson terrace
#

cuz its not bukkit

eternal oxide
#

Then he can;t get a Material end of

molten hearth
#

I dont think thats how it works cheif

crimson terrace
#

and I think the way to get you that material is between you, google and god

molten hearth
#

๐Ÿ˜‚ true

eternal oxide
#

You can't get a Material if you don;t have the Material Enum

molten hearth
#

but I quite simply can

crimson terrace
#

then do it

molten hearth
#

I can do Material.STICK and it gives me a stick material

#

but my issue is

#

Material["STICK"] for example

eternal oxide
#

Then you are lying and you DO have the Material Enum

molten hearth
#

its not an enum doe its a sealed interface

eternal oxide
#

if you cna use Material.STICK you have access to the Enum

crimson terrace
#

afaik interfaces dont have static attributes

#

and arent enums

molten hearth
#

idk it does here

#

but I dont think its static

#

wait

#

or is it

crimson terrace
#

so the syntax Material.STICK shouldnt work for an interface

#

if youre about to tell us you have bukkit as a dependency ima yeet you in the sky

molten hearth
#

I dont

#

its just

#

I do Material.WHATEVER and I get the item I want

#

fromNamespaceId is actually a scam

#

oh I think its cause it extends Materials

#

I didnt notice that lul

#

anyhow

#

that was probably the issue

#

actually

#

I cant use it

#

thats unfortunate

quaint mantle
#

bro ๐Ÿ’€ why is it removing "::" from the string

river oracle
#

Cuz

quaint mantle
#

i must be dumb or something

#
        for (int i = 0; i < STARTING_VARIABLES.length; i++) {
            String[] split = STARTING_VARIABLES[i].replace("||", "@@").split("@@");
            String name = split[0] + "::" + uuid;
            VariableAPI.getVariableorCreate(name, split[1]);
            Bukkit.broadcastMessage(name);
        }```
#

broadcasts with the correct name

#
public static Variable getVariableorCreate(String name, Object value) {
        return new Variable(name, (VariableSave.getJson().get("storage." + name) != null ? VariableSave.getJson().get("storage." + name) : value));
    }``` and this removes the "::"
#

so the name is correct for the first time, but then "::" get's removed

molten hearth
#

alright well Material.fromNamespaceId("minecraft:" + this.item_type.toLowerCase()) works

#

I was hoping to like

#

not do that

#

because minecraft: is ugly

#

but its fine

crimson terrace
#

is that the thing youre outputting?

#

honestly I cant see what youre broadcasting or what youre trying to reach

quaint mantle
#

i found the problem, it was just me being dumb

#

forgot to add the "::" in some places

#

which lead to that

#

thanks tho

echo basalt
#

did you get it sorted yet?

quaint mantle
#

how can I store a list of (locations matched to strings) matched to players

opal juniper
#

you mean a map?

crimson terrace
#

I think they mean a map

quaint mantle
#

yeah but how do i map a map to a player

#

its not a persistent data type

crimson terrace
#

you use a map

quaint mantle
#

but it would get reset when the server reboots

crimson terrace
#

oh you want it to persist

#

use a yml config

#

or a database

#

depending on your needs

quaint mantle
#

whichever one is easier :/

crimson terrace
#

the good thing about yml here is that Location is already ConfigurationSerializable

#

which means you can just do YamlConfiguration#set(Path, Location) and deserialize it easily

quaint mantle
#

like on config.yml?

crimson terrace
#

yeah, you can make other yml files aswell tho

#

in case you dont want that data in the config.yml

#

need a tutorial?

quaint mantle
#

and I'm guessing I would just copy paste that into a new java class

crimson terrace
#

should work, youre gonna have to test it yourself

quaint mantle
#

sounds good

dull whale
#

are hashcodes always unique? is it safe to store the hashcode when all I need is to compare equality?

crimson terrace
#

not sure if the standard Hash method in java is safe

#

but you shouldnt have problems

quaint mantle
echo basalt
#

basically a hashcode should be an algorithm that is derived from the internal values

#

where 2 equal inputs make the same hashcode

#

and 2 different inputs always make different hashcodes

#

So yeah you can store hashcodes for equality

#

but if the hashcode method changes for your given option then it invalidates all inputs

dull whale
#

thanks

echo basalt
#

Asking us for advice regarding copypasting an answer from spigot isn't really something I'd recommend

#

Like it's fine to research your problems and all

#

But researching, coming to a conclusion and asking us to comment on that conclusion just invalidates all your research

quaint mantle
#

true

#

anyone know a good forum post or something that talks about how to get player input using signs?

#

or using anvil renaming

#

hi guys

summer agate
quaint mantle
#

Hypixel does it ๐Ÿ’€ can't get the source code

echo basalt
#

there was an api for that

quaint mantle
#

never used protocolLib but I noticed its not preinstalled... how do I install it?

#

just dump into plugins folder?

#

I think i found that out nvm

#

yes it works now

#

though intellij doesnt seem to think so lol

#

but maven agrees

summer agate
#

If you use intellij and just changed a maven file there should be a reload button on the right top ish of the text editor, which causes intellij to update it's stuff

quaint mantle
dire marsh
dire marsh
# quaint mantle

it uses protocollib, you need to install the protocollib plugin

quaint mantle
#

i thought u just needed it locally. huh

summer agate
dire marsh
#

@quaint mantle you can just use Player#openSign these days actually

quaint mantle
dire marsh
#

probs didnt use latest dev build

#

but as I mentioned it's better to use the player open sign method

quaint mantle
tardy delta
#

Reload command goes brr

quaint mantle
#

fr

#

Caused by: java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.Map (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @18769467; java.util.Map is in module java.base of loader 'bootstrap')

#

idk how to make it work

ivory sleet
#

how does the config look like

echo basalt
#

๐Ÿคฆ

#

no comment.

quaint mantle
#

so it should be etting bedLocations to a map

#

and pConfig is {playerUUID}.yml

#

?learnjava

undone axleBOT
quaint mantle
#

its just casting Object to Map is that so hard?

#

Can you store maps in .yml or not

serene sigil
#

is there any event or way to check if the dragon egg teleported?

#

like on right/left click

smoky widget
#

I would like to make a system where my player's data (life, speed, etc via my custom system) are stored in my mongodb database, can updating it every time it changes make lag if for example the player changes a lot of times his stats what would be the best?

tardy delta
#

update it async

#

dunno how long it takes to update stuff in nosql databases

quaint mantle
#

Hi guys, Can I create worldborder per player in one world?( on 1.19.2)

icy beacon
smoky widget
quaint mantle
echo basalt
quaint mantle
icy beacon
quaint mantle
tardy delta
echo basalt
#

Pretty much

#
public class TimeProfiler {

    private final GraphingDatabase database;
    private final String profileId;
    private final long startNanos;

    private final Map<String, String> fields = new ConcurrentHashMap<>();

    public TimeProfiler(UniversityPlugin plugin, String profileId) {
        this.database = plugin.getDatabaseManager().getGraphingDatabase();
        this.profileId = profileId;

        this.startNanos = System.nanoTime();
    }

    public TimeProfiler addField(String name, Object value) {
        fields.put(name, value == null ? "null" : value.toString());
        return this;
    }

    public void outcome(String name, Object value) {
        outcome(name, value, TimeUnit.MICROSECONDS);
    }

    public void outcome(String name, Object value, TimeUnit unit) {
        addField(name, value);
        finish(unit);
    }

    public void finish(TimeUnit measurementUnit) {
        long endNanos = System.nanoTime();
        long difference = endNanos - startNanos;

        long time = measurementUnit.convert(difference, TimeUnit.NANOSECONDS);

        Point point = Point.measurement(profileId)
                .time(System.currentTimeMillis(), WritePrecision.MS)
                .addField("time", time);

        fields.forEach(point::addField);

        database.write(point);
    }
}
tardy delta
#

String.valueOf(value) :)

echo basalt
#

:)

#

but yeah it just measures stuff and pushes it to my graphing database

tardy delta
#

ah its writing stuff to ya graphing db

echo basalt
#

I hate the java 8 forEach I'm doig but it's much simpler

#

basically I can run a mongodb stress-test and have graphs for it all

tardy delta
#

:o

#

college weird

echo basalt
#

and I use it everywhere

tardy delta
#

we had to co-program or whatever its called

#

two people on one laptop :/

echo basalt
#

oh yeah I had to do that last year at school

#

where we had a trello board

#

each person made a lil game

#

with no shared codebase

#

we all just made individual programs and mashed it all together

tardy delta
#

we had to make a bank account class

#

i was the guy on the pc and did all the stuff

#

so basic things

#

found my webdev teacher smh

river oracle
#

Pdbvives

#

Only one repo

tardy delta
#

i have only one repo on my gh acc for school too

ornate mantle
#

if i want to use paper as a dependency do i have to use paper as my server jar?

#

everyone who reacted likes watching gay men kissing

hazy parrot
ornate mantle
river oracle
ornate mantle
#

no

#

have fun watching gay men kissing#

vagrant hound
#

I want to add an other plugin to my plugin to use their classes. I use intelliJ and I added the jar to my libraries, But I can't use the classes. Can someone help me adding a jar file as a dependency?

hazy parrot
#

use proper dep manager like maven or gradle

ornate mantle
#

are you using maven or gradle

river oracle
ornate mantle
#

i need to use the PrepareResultEvent from paper

#

but my server's running spigot

hasty prawn
#

If you use Paper API from that dependency then you have to run paper on the server.

vagrant hound
#

I'm using maven, but I only have a jar file from github ๐Ÿ˜„

river oracle
#

Your going to need the paper jar think about it paper stuff wouldn't be in spgito server

hasty prawn
#

Then yes you need Paper on the server.

river oracle
rotund pond
#

Hey everyone !
I'm trying to check if a player is using a monster egg, but I'm now using spigot 1.17...

First (and single) time I did it was in 1.8 and I used this to check the type:

if (!(event.getItem().getType() == Material.MONSTER_EGG))
  return;

Now, MONSTER_EGG is deprecated (it's nos LEGACY_MONSTER_EGG) and all eggs have a different type...

How can I do it without using a deprecated material please ?

ornate mantle
#

event.getitem().gettype().tostring().contains("EGG") i think