#help-development

1 messages · Page 1817 of 1

twin venture
#

iam downloading all ver i need

#

the problem is with

#

maven / intellij idea

eternal oxide
#

what problem?

twin venture
#

before you tell why i use old ver , i dont this is only for test .. :
i tried all version

#

same problem

#

the api is working and recognized my maven

#

but the spigot is not

eternal oxide
#

You can;t import both in the same pom. Theres no way for Intelij to know which API you want to use

#

oh api and spigot

#

did you run buildtools for 1.8.8?

twin venture
#

well its 1.8.8 isn't it ?

#

or 1.8.9?

quiet ice
#

188, 189 is clientside only

twin venture
#

i downloaded 1.12.2 , 1.13.2 , 1.16.5

eternal oxide
#

spigot 1.8.8 you get by running buildtools

twin venture
#

and i can't seems to use them ..

#

inside intellij idea

eternal oxide
#

api gets downloaded from spigot

twin venture
#

yes but sometime i need to use some nms

#

or packets

eternal oxide
#

run buildtools and build 1.8.8

quiet ice
#

In that case you need to build the package via buildtools

left crescent
#

hi did someone know a good tablist plugin?

#

for my smo server

twin venture
quiet ice
eternal oxide
#

oh my, are you ignoring me?

fringe latch
#

Distinguish 1.17 and 1.18 NMS (Maven)

quiet ice
undone axleBOT
twin venture
#

thank you anyway ..

quiet ice
#

Well you also need to run buildtools

twin venture
#

wait i have a question

quiet ice
#

With --rev 1.8.8

eternal oxide
quiet ice
#

^

twin venture
#

files are in

#

users

#

not in m2

#

not in here :

quiet ice
#

bt should also install the artifacts to maven local

twin venture
quiet ice
#

Are you sure that they are not there

twin venture
#

2 minutes ago

#

wait let me try ..

quiet ice
#

I don't see what the issue is - you know what you are doing so ???

twin venture
#

that seems to fix the issue thanks 😄

junior briar
#

would getHighestBlockYAt(x, z, HeightMap.WORLD_SURFACE) be out of ceiling of the nether?

rough basin
#

How to use .yml for saving data?

vale ember
#

how do i do that with maven?

red sedge
eternal oxide
quiet ice
#

If that is possible on maven it is def. possible on gradle

eternal oxide
#

maven uses teh specialsource plugin to remap

quaint mantle
#

Use paperweight...

vale ember
quaint mantle
#

what error

peak granite
#

is it possible to have a timespan like "5 minutes", "3 seconds", "2 hours" for a command arg

quaint mantle
#

Yes, but you'd need a parser

vale ember
#

"There was a failure while executing work items
A failure occurred while executing io.papermc.paperweight.tasks.FixJar$FixJarAction
Cannot invoke "String.charAt(int)" because "internalName" is null"

vale ember
quaint mantle
#

Aha

vale ember
#

but how can i make sure that api features on 1.18 will work on older versions?

quiet ice
#

I'd say it's an issue with the java version of 1.18

quaint mantle
#

Try using older paperweight version

#

Like 1.2.0

vale ember
#

i use 1.2.0

#

and it gives the error

#
  • in paper chat they said that it have no support for versions like 1.13
quiet ice
#

Yeah, mojmap is only there since 1.14

peak granite
vale ember
quaint mantle
#

yes, but spigot does not support it neither

#

special source works only on 1.17, right?

chrome beacon
#

1.16.5? (maybe) and 1.18.(1) should have it too

quiet ice
quiet ice
#

either way mojmap is rather new

junior briar
#

oof. is there any detail of HeightMap?

noble lantern
#

What do you mean and what are you trying to achieve?

vale ember
#

i'd like to have support for 1.13-1.18 or at least 1.16-1.18

#

how can i do that with gradle?

quiet ice
#

1.13-1.18 is impossible, that far is clear

quaint mantle
#

only nms right? use module man

#

module

vale ember
#

yes

quaint mantle
#

pom.xm- wait you use gradle idk

vale ember
#

yes

junior briar
quaint mantle
#

maven have each pom.xml for each module if you want lol

#

Well, you Just use spigot mappings on modules for 1.13,1.14.4 and mojang mappings on 1.17+

quiet ice
#

unless you'd go with spigot -> official -> searge -> mcp, but I don't know anything that exists for this

quiet ice
#

Well, perhaps minimappingsviewer has something for that

quaint mantle
#

Gradle has build.gradle for every module as well

#

well, spigot mappings arent too bad on > 1.17

junior briar
#

it's like, would there be more blocks above a WORLD_SURFACE?

vale ember
#

do i need to shadowJar nms?

#

or just include it as dependency?

quiet ice
#

nms should be compileOnly

peak granite
#

@quaint mantle

#

if i'm making a function

#

to convert it to a timespan

#

what would the returning type be

#

TimeSpan doesn't work

quaint mantle
#

Duration

peak granite
#

oh

drowsy sapphire
#

Is there a PersistentDataStorage for 1.8.8 plugins?

quaint mantle
#

No

#

Do not use 1.8.8

drowsy sapphire
quaint mantle
#

update

quiet ice
#

especially with the log4j bug people should not use that version

drowsy sapphire
#

can i run a 1.18 plugin on a 1.8 server

peak granite
#

obviously not

drowsy sapphire
#

bruh

quaint mantle
#

do you have a reason to keep the server on 1.8

#

You miss so much cool stuff

young knoll
#

Muh PvP

hoary pawn
#

how can i make autocomplete work for second args?

drowsy sapphire
twin venture
#

.. help?

young knoll
#

Streams moment

quiet ice
#

I'd avoid using custom data structures

twin venture
#

you mean use stream insted?

quiet ice
#

No, they imply that this issue is caused by the streams api

young knoll
#

Why have you made your own bimap

quiet ice
#

Which may very well be the case, but I would say that it is a programmer error on whoever coded #getEntry

twin venture
#

its working 100%

#

but

#

its make some lag after 1-2 day's of server running ..

quiet ice
#

You see, there is a difference between

Object o = map.get(key);

and

Object o = null;
for (Map.Entry<Object, Object> e : map.entrySet()) {
    if (e.getKey().equals(key)) {
        o = e.getValue();
    }
}
assert o != null;
#

this is my favourite example because I closely work with a codebase that uses latter approach far too often

twin venture
#

iam using the code above to check y , yaw and rotate an entity

#

armorstand in this case

young knoll
#

I’m still wondering why you’ve made your own bimap

quiet ice
#

Well, the important thing is what the bimap does

#

the impl of the bimap is at fault, not the caller code

twin venture
young knoll
#

Use the bimap from guava

quiet ice
#

^

#

It is baked in into minecraft so no issue using it

twin venture
#

or should i change the whole code?

#

the Bimap i use have 3 values

quiet ice
#

Also, I'd get rid of the asserts, that'd improve the performance by the factor 2

twin venture
#

ok

young knoll
#

You want a map with 1 key and 2 values?

#

Just use a normal map and make a class that holds the 2 values

quiet ice
#

Then use Map<K, Map.Entry<V1,V2>> instead

young knoll
#

That also works

quiet ice
#

I overuse the Map.Entry interface tbh

twin venture
#

for testing puprose like this : ?

quiet ice
#

Could I take a look at your Bimap class? I want to be sure that we are actually suggesting the right thing

twin venture
#

can i screenshare?

#

or?

quiet ice
#

?paste

undone axleBOT
twin venture
quiet ice
#

Otherwise you'd have 200 screenshots, those fellas can be enormous

twin venture
quiet ice
#

private List<Entry<K, V, V1>> data = new ArrayList<>();, well that explains the shoddy performance

young knoll
#

map.get doesn’t use a loop?

#

Lul

quaint mantle
#

lul

twin venture
#

can you explain a little bit why its bad?

quiet ice
#
    public void replace(K key, V value1, V1 value2) {
        if (!getEntry(key).isPresent())
            return;

        Entry<K, V, V1> entry = getEntry(key).get();
        entry.setValue1(value1);
        entry.setValue2(value2);

        this.data.set(getDataIndex(key), entry);

the this.data.set[...] is useless here

twin venture
#

i didnt make that class , a friend i know did make it and he told me that i can use it .

vale ember
#

anyone here worked with spigradle? if yes, how to change debugSpigot mc version?

quiet ice
#

I'd avoid using that class, it is an optimisation nightmare

#

There are major cardinal sins that were committed here

twin venture
young knoll
#

We already told you

quiet ice
#

Anything with a complexity of O(1)

twin venture
#

Map<K, Map.Entry<V1,V2>>

#

i tried that

#

gave me more errors xd

#

more i tried to fix more new errors apear

quiet ice
#

The other solution would be to rewrite the bimap class to have a runtime complexity of close to O(1), should be rather straightforward

young knoll
#

The name is weird

#

It’s not a bimap

quaint mantle
#

Damn why not just Multimap

young knoll
#

Don’t those require the values to be of the same type

quaint mantle
#

oh right

quiet ice
#

public interface Multimap<K, V> { yep

young knoll
#

Just make a class to hold the two values

quaint mantle
#

^^

young knoll
#

Or use something that already exists to hold 2 values

#

Like a pair

quiet ice
#

Or map.entry

quaint mantle
#

generics are ugly so

quiet ice
#

Ah yes, using highly specialised records

arctic moth
#

any way to change the damage ticks

#

ive seen it before

#

on those pvp servers

#

they have it so like every damage registers

#

no invincibility period

young knoll
#

Sounds horrible

#

.setNoDamageTicks and .setMaxNoDamageTicks

twin venture
#

what is the best way that won't cause any lag ?

#

i tried to use packets / to spawn / rotate entity but it didn't work out well for me ..

young knoll
#

We already told you to fix your data structure

quiet ice
#

The importance of the proper data structures are underrated by many for some reason

arctic moth
twin venture
#

thanks will do

arctic moth
#

ik this is more an intellij thing, and ik its simple, but why does it remove the ability to add a class when the pom.xml is added? its super annoying. also, it doesnt highlight text in those classes

fading lake
#

thats odd

arctic moth
fading lake
#

full screenshot, i.e where you're clicking

#

the entire explorer window

arctic moth
#

its just right clicking package

fading lake
#

can you show me your project window?

#

if you wanna keep it private, DM me it

#

seems like a maven loading error

arctic moth
fading lake
#

yeah thats a maven loading error

arctic moth
#

wait

#

why is there 2 imls

#

xD

fading lake
arctic moth
#

il

#

its never happened before

#

i did it exactly the same

fading lake
#

yours doesnt have the main or java directories 🤔

arctic moth
#

o

fading lake
#

try forcing them in and see if it fixes itself

#

yeah because there's supposed to be a resources folder for your pluginyml too, it might be better just making a new project with maven from the start so it creates the directories properly

arctic moth
#

normally i dont need a main or java folder

fading lake
#

thats... not good

arctic moth
#

wait so how would the whole thing look if it was set up correctly

#

ik about the blue classes

#

but like whats the structure

arctic moth
#

o

#

k

#

ill try that

fading lake
#

eagerly awaiting sirionblatt's essay

noble lantern
#

how have you survived without a main or java folder

#

xD

rich inlet
#

Hey, I have a question!
I use IntelliJ to make a plugin and now I'm trying to make one using Spigot 1.18.1. The problem is, that somehow IntelliJ does not recognize it or something, because none of the Classes and methods can be used (like JavaPlugin or Player and so on), it just says that this does not exist.
Any help?

fading lake
arctic moth
noble lantern
#

imagine having to use build tools

fading lake
#

imagine

rich inlet
#

No buildtools and my SDK is Java 17

noble lantern
#

ive only ever used it for NMS, other than that my ide auto imports it from the repo

#

weird

#

invalidate caches?

young knoll
#

What are you depending on

#

Inb4 bootstrap jar

fading lake
#

spigot or spigot-api

rich inlet
#

spigot

fading lake
#

aight you need buildtools for that

solar plinth
#

Extract resources from unknown directory structure

rich inlet
#

but with spigot 1.17 it works

noble lantern
#

^

#

iirc spigot is the NMS jar and api is the actual api

#

i could be wrong

young knoll
#

Correct

fading lake
#

does anyone know off the top of their heads what the intarray is for on 1.8 PacketPlayOutEntityDestroy? It takes an int..., is that for multiple entity ids or something else?

arctic moth
#

btw would the path in plugin.yml be any different with the main and java

#

im assuming it would be the same

rich inlet
# noble lantern

Uhm I am not really that advanced in Plugin developing, what should I do with this?

noble lantern
#

just follows package path

noble lantern
fading lake
#

maven best

hoary pawn
#

how would i convert collection<players> to arraylist?

rich inlet
#

Currently not but I heard it is really useful

noble lantern
#

or

#

new ArrayList<>(Arrays.asList(thatCollection));

hoary pawn
#

ahh lol

fading lake
#

you could do it via iteration, but people who do that are psychopaths

hoary pawn
#

feel kinda dumb know

noble lantern
fallen thunder
#

Hello I have a problem with my plugin. So I want create one file for each arena if in the config the multi arena is allow. But when the file default.yml is created I want add a defaults config with a arena.yml files the ressources of the plugin. I have a Null pointer exeption why ? Can u help me plz...

My main class EBuild:
https://www.toptal.com/developers/hastebin/disuveroya.typescript

noble lantern
#

so you can pass a List of soemthough through it

rich inlet
#

Is there a way without maven? Just use spigot-api for the library?

noble lantern
#

gradle?

#

You know what

#

imma hook you up with something

#

its gonna save you life

#

File -> Settings

rich inlet
#

okay?

noble lantern
#

look for this plugin

#

and just remake your project, you can just put your old class files into that new project

fading lake
# hoary pawn feel kinda dumb know

dw I spent literally 5 mins yesterday being confused why the following was throwing an error, and ive been using java for 2 years
byte = 5 >>> 1

arctic moth
#

whats one dark theme lol

hoary pawn
#

lol

noble lantern
#

that plugin automtically import spigot-api in gradle or maven

noble lantern
rich inlet
#

Thats cool, ill try it, thanks

arctic moth
#

whats the difference

#

is it darker

#

lol

fading lake
#

dark mode is darker than white mode yes

noble lantern
fading lake
#

the psychopath intellij theme

noble lantern
#

i need to add my goku backgroun to intellij again

#

i used to have goku as my backgroun untill i had to reinstall intellij cause new nvme

fallen thunder
#

Hello I have a problem with my plugin. So I want create one file for each arena if in the config the multi arena is allow. But when the file default.yml is created I want add a defaults config with a arena.yml files the ressources of the plugin. I have a Null pointer exeption why ? Can u help me plz...

My main class EBuild:
https://www.toptal.com/developers/hastebin/disuveroya.typescript

fading lake
#

what the fuck is that link

rich inlet
#

@noble lantern so with this plugin do I have to have the extern spigot library or should I just leave it?

arctic moth
noble lantern
hoary pawn
fading lake
#

whats toptal

noble lantern
fading lake
#

ah

fallen thunder
hoary pawn
arctic moth
sharp saffron
#

would it be possible to code plugins / mods in python?

arctic moth
#

lol

hoary pawn
#

WHY NOT

sharp saffron
#

ok thanks

rich inlet
noble lantern
rich inlet
#

oh ok

noble lantern
#

and then choose "Minecraft"

#

it will be on the right

#

and then just transfer all your class files to that new project

hoary pawn
noble lantern
#

and from now on use that plugin when you create then

noble lantern
#

you first need to convert the Collection of player to a List of Strings

#

Cause List<String> isnt List<Player>

hoary pawn
#

is there a way to do that without a loop?

noble lantern
#

you can use lambdas and use method referances (::)

#

thats about as short as you can get

hoary pawn
#

then i just need to learn da fuk that is

#

maybe it is better to use a loopå

noble lantern
#

idk if theres a built in way but thats how i always convert my Lists

arctic moth
#

i feel bad for anyone that joins this server lol

rich inlet
noble lantern
hoary pawn
arctic moth
noble lantern
noble lantern
young knoll
#

Who on earth would actively encourage an auto clicker like that

arctic moth
hoary pawn
young knoll
noble lantern
# rich inlet okay thanks!!

You can also just fill in jibberish and then edit the packages and main class yourself i do that because its naming is a little weird

arctic moth
#

rip people that dont have autoclickers

noble lantern
#

i dont like com.burchard36.plugin.Plugin as my package class which is what it does normally

#

fun fact

#

My IGN is buchard36, but i made a typo when signing up on spigotmc

#

so im buchard37 to the spigot community lmfao

hoary pawn
noble lantern
young knoll
#

getName?

hoary pawn
#

not sure if that was mc related

noble lantern
#

last week i tried out a class extending YamlConfiguration and i think im in love

#

so damn awesome to just this.getString

#

instead of having to referance a YamlConfiguration object

fallen thunder
#

no one can help me -_-

noble lantern
fallen thunder
#

I create a discussion fil

royal vale
#

How would I set a block to andesite in spigot 1.8? On 1.8 the block id is stone:5.

hoary pawn
#

im getting this error now, i think i know how to fix it but im not sure if there is a better way

String result = new String()M
if(keys.size() == 0) {
            result = players;
        }
        else if(keys.size() == 1){
            result = keys;
        }
return result
young knoll
#

Iirc setTypeAndData

young knoll
#

Or null if you want

noble lantern
#

or just return players

#

^

#

Initialize
process
return

#

You should make a static getter in your main class to

#

getOnlinePlayerNames

#

why do i feel like thats a default method but ik its not

young knoll
#

It’s not

#

Bukkit.getOnlinePlayers is

fallen thunder
hoary pawn
red sedge
#

how can I like display the enderpearl cooldown on other items

noble lantern
red sedge
#

like the thing thats on shields aswell

noble lantern
noble lantern
red sedge
#

like the white bar htat scales down

#

when using an enderpearl

noble lantern
#

oh i see

#

hmm

#

Coll ^?

#

ide assume probably some type of packet manipulation

hoary pawn
#

lol

arctic moth
#

how do you make entities hit faster

#

cuz if i have 0 max damage ticks

#

they kind of just hit slowly anyways

red sedge
young knoll
#

There’s a method for it in modern versions

red sedge
#

it was p.setCooldown

hoary pawn
noble lantern
#

^

#

fr

#

just use packets with reflection and machine code scripts

red sedge
#

thats no fun

#

just remake minecraft in machine code

hoary pawn
#

even better, just rewrite minecraft with the changes you want

noble lantern
#

i wanna make my own server jar so bad

#

but im so bad

#

:sadge:

hoary pawn
#

it cant be that hard can it?

red sedge
noble lantern
#

no ones made one yet written from raw java with mc protocol

#

so, its kinda hard

#

not that hard

#

but kinda hard

vale ember
#

best way to make item glow like its enchanted 1.13+

noble lantern
hoary pawn
vale ember
noble lantern
#

yes

noble lantern
#

but a public one i mean

hoary pawn
#

ahh

red sedge
noble lantern
#

shit your right

#

Aregcraft ^

red sedge
#

wait

hoary pawn
red sedge
#

isnt there a empty enchant nbt

red sedge
noble lantern
hoary pawn
stone sinew
noble lantern
#

add enchant, add item flag

stone sinew
red sedge
noble lantern
#

i mean chances are that shiny item is just going to be used as a gui item

#

or some type of item that isnt usable like that

hoary pawn
noble lantern
#

unbreaking on a flower wont hurt no one

noble lantern
#

maybe tbh

arctic moth
#

whats the spigot 1.8.9 maven import btw

noble lantern
#

they never sleep anywhere

red sedge
young knoll
#

1.8.9 is a client only version

arctic moth
noble lantern
#

which isnt possible to do iirc (flow enchants transfered to sword)

stone sinew
hexed hatch
#

The most they could get from it is a small amount of xp with a grindstone

noble lantern
#

ah i forgot about grindstones

arctic moth
stone sinew
arctic moth
#

k

#

would group be spigotmc or bukkit lol

#

on the website its bukkit

stone sinew
#

Not sure on that. Might just have to go look at the pom

hoary pawn
#

uhmmhmmmm

arctic moth
#

but the website is ro1

#

so idk if its outdated

#

for the maven

noble lantern
arctic moth
#

lol

noble lantern
#

sorry, you cant add air slots like that

#

xD

hoary pawn
#

UHMMM FFS

arctic moth
#

i was about to say that

noble lantern
#

honestly i hate when my error is shaped like that

#

it always fumbles me

hoary pawn
#

i thought it was something usefull

noble lantern
#

im used to looking at the top for my error not near the bottom

red sedge
#

i hate that when getting an item air is null

#

like yeah it makes sense

#

but why

noble lantern
#

or how there can be null InventoryClickEvents

#

Like yeah im 100% gonna wanna know when someone isnt clicking an item

stone sinew
hoary pawn
#
public class CommandCustomGiveTabCompleter implements TabCompleter {
    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
        List<String> keys = new ArrayList<String>(SplyMain.getHashmap().keySet());
        List<String> players = new ArrayList<String>();
        Bukkit.getOnlinePlayers().forEach(player -> players.add(player.getName()));
        if(keys.size() == 0) {
            return players;
        }
        else if(keys.size() == 1){
            return keys;
        }
        return null;
    }
}
``` this code should be making the second arg the list keys right?
#

BUT IT IS NOT

hoary pawn
#

that is the worst troubleshooting

#

when you dont have a error

noble lantern
#

im cursed

#

i rarely get errors (not to flex)

#

so im just stuck sitting for hours writing debug logs

hoary pawn
#

that is sad

noble lantern
#

my latest plugin has like 200 lines of debug logs

hoary pawn
#

xd bruh

noble lantern
#

so much spam starting or doing actions on my server

#

sec watch this

red sedge
#

are you okay?

noble lantern
#

100% okay

#

its perfectly fine mkay

red sedge
#

especially if it was 7am

noble lantern
#

i would go insane without it

#

you should see-

#

how do you

#

tf

red sedge
#

?

noble lantern
#

oh wait my log time

red sedge
#

LMAO

noble lantern
#

LMAO

#

i was like howtf did you know my time

red sedge
#

nah im just watching you

#

from outside of your window

#

dont look

noble lantern
#

i think thats queue to go to bed though if i dont recognize 7pm on thee

#

i almosed dox'd myself too

#

i was just gonna strait up send my latest.log file

#

._.

#

im off to bed before i send my chrome cookies lmfao

red sedge
#

._____________.

arctic moth
#

ooh fun

noble lantern
noble lantern
arctic moth
#

btw does onEnable work in listener class

#

just wondered

#

lo

noble lantern
#

i was gonna show the generation logs but

#

nowhere let me upload theyre too big LMAO

noble lantern
arctic moth
#

idk

#

can u use onenable outside the main class

hoary pawn
noble lantern
#

you can but

#

you shouldnt

stone sinew
arctic moth
#

lol

hoary pawn
noble lantern
noble lantern
#

2mb logfile

#

pog

#

LMAO

hoary pawn
#

that was because i wrote splyfof instand of the item lol

noble lantern
#

ah

#

if im being deadass honest

#

ive never done tab completors

#

so i couldnt help you with those

hoary pawn
#

ya know who has?

noble lantern
#

Im sure Adelemphii or Conclure has, i saw edgar in here too and coll

#

one of those 4 will know maybe

#

they prolly lurkin

#

Optic too maybe

#

but hes mobile L

heavy void
#

How can i put data on items? (Obs: Spigot 1.8.8)

red sedge
#

but how will i run my server without using a 6 year old version!!111

hoary pawn
vale ember
#

how can i register custom enchantment without nms 1.13+

peak granite
#

doesn' twork

#

trying to make something like this

#

doesn't work as expected

#

so basically

#

if their health is above 1

#

it just shows all dark red

#

if it's elss than 0.5

#

it shows all light red

#

and else it shows all gray

#

it doesn't work properly

zealous osprey
#

Could someone explain to me pls how #rotateAroundNonUnitAxis works, since Im getting some weird and unexpected results

peak granite
#

why does

glossy scroll
#

Where is that function and what are you trying to do

#

@zealous osprey

peak granite
#

getMaxHealth returns their max possible health, how do i get their true max health currently

glossy scroll
thorny python
#

how can I put some jar files in final plugin jar using maven?

glossy scroll
thorny python
#

I tried directly put those jar files in "resources" it just broken after build x

#

hm I am checking it out

zealous osprey
# glossy scroll Where is that function and what are you trying to do

Im trying to create a circle out of particles in the direction the player is looking in with a certain radius and distance from the player.
And I've been delving in the realm of matrices and such, then I found #rotateAroundNonUnitAxis, but instead of that Im now using #rotateAroundAxis(Vector, Angle)
But the issue is still there that it rotates around ~0,0,0 cause Im using the direction the player is looking in, gotta set it differently

glossy scroll
#

I would use a polar change of coordinates

peak granite
glossy scroll
#

Wdym

peak granite
#

it doesn't work?

glossy scroll
#

thats not helping me

#

Whats not working

peak granite
#

i can't send pic

#

can i send in dms

hoary pawn
#

@noble lantern i got it to work lol, the problem was that i was changing the list based of keys when it should have been args

zealous osprey
# glossy scroll Wdym

Welp, it seems that I was just an idiot, I had some "remnants" of my previous attempts in my code, like a crossproduct where there shouldnt have been one, whoops

#

Nvm still F'ed

glossy scroll
#

I have code that does something similar

#

Just trying to remember

#

Youre trying to make a circle from a vector thats normal to it

zealous osprey
#

Well that was my original idea, to have a line, take a point from it, create a normal vector and rotate it, while always taking the tip of the vector as a point to spawn a particle, yet that doesnt seem to work in any way.
Now I've been trying to understand #rotateAroundAxis(Vector, Angle)

glossy scroll
#

Heres some mathematica code

#

You might be able to use this

sterile token
#

Its really annoying

foggy estuary
#

import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class BlocksRemoving extends JavaPlugin implements Listener {

    
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
         if (cmd.getName().equalsIgnoreCase("start")) {    
         Player player = (Player) sender;
         if (sender instanceof Player) {
             Block blockloc = player.getWorld().getBlockAt(-1, 65, -155);
              
              if ( blockloc.getType() == (Material.IRON_BLOCK)) {
                  blockloc.setType(Material.AIR);``` anyone know why the block isnt setting to air?
glossy scroll
#

?paste

undone axleBOT
glossy scroll
#

Btw player.getDirection or smt gives the unit normal

#

So you need to multiply it or whatever to get a distance

thorny python
#

uh sorry but I still unclear about how to use maven shade plugin

zealous osprey
thorny python
#

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${project.basedir}/libs/a.jar</include>
<include>${project.basedir}/libs/b.jar</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
It probably no the right way but I dont know what's the problem

vale ember
#

how do i add attribute modifiers to itemstack in 1.13?

glossy scroll
#

That’s the equation

zealous osprey
#

that looks familiar or rather doable

glossy scroll
#

Your biggest issue will be finding the zenith and azimuth angle, but you can use the dot product rule with some vectors to get andles

#

The projection of û onto î and û onto k

zealous osprey
#

Could you send the link to the site you're on, cant seem to find it

glossy scroll
#

So i downloaded the file

sterile token
#

Hi! How are you?

I want to know why im having the error "Unhandled exception: MalformedURLException" on the throws of my method? When im throwing a custom exception that extends "MalformedURLException"


**Method where error its shown**
  
  public void load(File file) throws LoadException {
    ClassLoader loader = URLClassLoader.newInstance(new URL[] { plugin.toURI().toURL() });
  }

Exception class:

public class LoadException extends MalformedURLException {

    public LoadException() { }

    public LoadException(String text) { super(text); }
}

Any ideas why happen?

glossy scroll
#

And put it into the wolfram player

zealous osprey
#

cause I was looking trough the sphagetti of it

glossy scroll
#

Idk why they use that notation for zenith and azimuth angles

#

Should be phi for zenith and theta for azimuth

zealous osprey
#

Well if I figure it out or not, thx for being so helpful <3

quiet ice
glossy scroll
#

You need to catch the MalformedURLException and throw your LoadException

quiet ice
#

This is because MalformedURLException does not extend RuntimeException, which is why you need to explicitly catch it

#

(or just pass the exception along with a throws)

sterile token
glossy scroll
#

I think they want their own exception to appear instead of MalformedURLException but i cant be sure haha

quiet ice
#

Then you need a try-catch block

sterile token
#

I want to use the throws and then when you use the library you try catch the method

quiet ice
#
try {
abc
} catch (Exception e) {
     throw new MyException(e);
}
sterile token
#

Thats why i didnt use that

quiet ice
#

Always use the ctor that accepts an exception/a throwable. Do NOT invoke toString on the exception

glossy scroll
sterile token
#

So its not possible to extend an exception, to then using it with "thorws ExceptionClass"?

glossy scroll
#

correct

sterile token
#

Omg thats why i prefer cs

glossy scroll
#

Because the JVM doesnt know how to convert the exception to your type

#

Its a very simple OOP

sterile token
#

OOP?

glossy scroll
#

Object oriented programming

sterile token
#

Ahh ok

glossy scroll
#

You cannot convert from Class A to Class B without providing instructions

#

Unless Class B is super class A

sterile token
#

Are u sure there is no way to do that?

#

Like change an exception name?

glossy scroll
#

There is, we’ve told you

sterile token
#

Because i want to throw that exception but with diff name

glossy scroll
#

Right, we literally told you

sterile token
#

Yeah but i cant use try catch

glossy scroll
#

Yea you can?

sterile token
#

Because its a library

glossy scroll
#

try catch isnt a library?

#

Theyre keywords in the jdk

sterile token
#

In my library people should try catch the methods themselves

glossy scroll
#

They still will

#

Because youre throwing an exception

sterile token
#

The message you cant change it

quiet ice
#

and your exception does not extend RuntimeException

glossy scroll
#

You can still use “throws MyException”

sterile token
#

Because the same error occur

quiet ice
#

Your exception cannot extend RuntimeException if it extends MalformedURLException

glossy scroll
#
public void myMethod() throws MyException {
try {
abc
} catch (Exception e) {
     throw new MyException(e);
}
}
arctic moth
#

how do u add an effect with hideparticles

glossy scroll
#

-.-

sterile token
arctic moth
#

ambient doesnt do anything

#

lol

fading lake
quiet ice
arctic moth
#

🥄 🥄 🥄

stone sinew
glossy scroll
glossy scroll
quiet ice
#

Your exception can extend anything.

sterile token
#

But it need to extends MalfromURL?

stone sinew
quiet ice
#

Throwable, Exception, Error, RuntimeException whatever you please

glossy scroll
#

this might be a

#

?xy

undone axleBOT
sterile token
quiet ice
#

Also, for god's sake, use Java's library for exception and not your own

glossy scroll
#

Not sure what the purpose of using your own exception is

#

Not very good practice in general

quiet ice
#

Exactly, and I don't understand why 100% of libs do not use things that already exist in the standard JVM

#

So don't be one of the 100%

#

It's just a pure waste of time

sterile token
#

Are you saying that im idiot?

#

whydm?

glossy scroll
#

Thats a whole new sentence dawg

#

We saying it doesnt make sense to use your own exception

sterile token
#

Im not native speaker btw

#

I dont understand to much english

glossy scroll
#

People will not understand what LoadException means

quiet ice
#

Always these excuses

glossy scroll
#

They will understand what MalformedURLException means

sterile token
#

No sense

glossy scroll
#

I dont think spigot does?

sterile token
quiet ice
#

?jd

sterile token
# glossy scroll I dont think spigot does?
public class InvalidDescriptionException extends Exception {
  private static final long serialVersionUID = 5721389122281775896L;
  
  public InvalidDescriptionException(Throwable cause, String message) {
    super(message, cause);
  }
  
  public InvalidDescriptionException(Throwable cause) {
    super("Invalid plugin.yml", cause);
  }
  
  public InvalidDescriptionException(String message) {
    super(message);
  }
  
  public InvalidDescriptionException() {
    super("Invalid plugin.yml");
  }
}
#

There u have sir

quiet ice
#
    java.lang.Exception
        org.bukkit.event.EventException
        org.bukkit.configuration.InvalidConfigurationException
        org.bukkit.plugin.InvalidDescriptionException
        org.bukkit.plugin.InvalidPluginException
        java.lang.RuntimeException
            org.bukkit.plugin.AuthorNagException
            org.bukkit.plugin.messaging.ChannelNameTooLongException
            org.bukkit.plugin.messaging.ChannelNotRegisteredException
            org.bukkit.command.CommandException
            org.bukkit.plugin.IllegalPluginAccessException
            org.bukkit.plugin.messaging.MessageTooLargeException
            org.bukkit.metadata.MetadataConversionException
            org.bukkit.metadata.MetadataEvaluationException
            org.bukkit.plugin.messaging.ReservedChannelException
            org.bukkit.plugin.UnknownDependencyException

Not too many exceptions

glossy scroll
#

Oh yea youre right

#

They use their own exceptions because you would not be able to interpret the original exceptions

quiet ice
#

Well, you can use IllegalStateException in 80% of the time, but eh

zealous osprey
#

@glossy scroll
I'm pretty sure I messed something up, or geogebra is just being weird

Cause that doesnt look like a circle.

glossy scroll
#

That cross symbol looks odd to me

#

I dont think thats cross product

zealous osprey
#

Geo says it's the cross

glossy scroll
zealous osprey
glossy scroll
glossy scroll
eternal oxide
#

This draws a half circle, just increase to 2*Pi ```java
public static void halfHorizontal(Player player) {

    double radius = 3, secRadius = 4;
    double every = Math.PI / 30;
    Location loc = player.getEyeLocation();

    for (double rad = 0; rad <= Math.PI; rad += every) {
        double x = radius * Math.cos(rad);
        double y = secRadius * Math.sin(rad);

        double rotateX = Math.toRadians(loc.getPitch() + 90);
        double rotateY = Math.toRadians(-loc.getYaw());

        Vector rotate = new Vector(x, y, 0);
        rotate.rotateAroundX(rotateX);
        rotate.rotateAroundY(rotateY);

        Location finalLoc = loc.clone().add(rotate);
        player.spawnParticle(Particle.FLAME, finalLoc, 1, 0, 0, 0, 0);
    }
}```
glossy scroll
#

Not sure if thats what we want

#

We want a circle around any given normal vector

eternal oxide
#

a circle around a point, a vector has no location

glossy scroll
#

Its a fixed orientation

eternal oxide
#

simple, just use teh location you want the circle instead of the players eye location

glossy scroll
#

We want any orientation

eternal oxide
#

surely he'd want it in a single plane

glossy scroll
#

A circle that is given by a normal vecotr

#

I dont think so

glossy scroll
#

Instead of nxu

sterile token
#

Do i need to use reflections for looping inside a jar to check it any classes extends a custom class?

true perch
#

I'm having a hard time understanding which Libraries I actually need, I updated my server from spigot 1.17.1 to paper 1.18.1.
Do I need to add the paper 1.18.1 library here?
Do I need to remove anything?
https://imgur.com/a/0BK44ZP

glossy scroll
#

@zealous osprey also remember that P(t) is from R to R3

ember estuary
glossy scroll
#

You get 3 outputs

zealous osprey
glossy scroll
#

Is there any way to send that geogebra to me?

ember estuary
#

or u just want the circle to be rotated

glossy scroll
#

Thats what we want

#

We have the math

#

Just trying to fix the geogebra

sterile token
zealous osprey
glossy scroll
#

ok gimme a sec to copy

quiet ice
#

?paste

undone axleBOT
quiet ice
lean gull
#

can anyone help me make some simple worldgen?

quiet ice
#

Technically you do not need the classnode (ClassReader suffices to obtain basic metadata about a class) for that but eh

quiet ice
#

Oh actually, that code has a few issue so you wont be able to copy&paste it, but the general gist of loading a classnode is there

glossy scroll
#

nmv

zealous osprey
#

brb

quiet ice
#

0xCAFEBABE is a magic header present at the start of each class

sterile token
#

They are the class identifier

quiet ice
#

not really, it just junk data for our purposes - a bit like hashbangs but the OS does not care either

#

(just note that this is a gross oversimplification - the header has it's uses)

drowsy sapphire
#

if I have a config.yml file that has this:

test:
  test2: 'hello!'

how do I access the value of test2

#

wouldnt it be getConfig().getString('test.test2')?

sterile token
#

"test.test2"

drowsy sapphire
sterile token
#

getConfig()#getString("test.test2")

#

Use this one

#

""

drowsy sapphire
#

bruh it worked

#

why does it specifically have to be "

crude hound
#

cast an ItemStack to a custom class

drowsy sapphire
#

that's dumb

sterile token
quiet ice
#

Because ' is for chars

drowsy sapphire
quiet ice
#

Basically 16-bit integers

sterile token
#

geol can you help me?

#

I get stucked btw

quiet ice
#

You cannot really represent "test.test2" as a 16 bit integer, which is why it does not compile

sterile token
#
  public void load(File jar) throws MalformedURLException {
    ClassLoader loader = URLClassLoader.newInstance(new URL[] { jar.toURI().toURL() });
  }

I have already made a loop of the directory now i need to loop inside the jar?

#

I get stucked there

#

Amazing java syntax not working btw

quiet ice
#

||It looks like this is something the service API can handle||

sterile token
#

No

#

Because i want to load custom jars only if they extend a custom class

#

Thats why btw

quiet ice
#

So exactly something the service API was meant to be used for!

sterile token
#

SeriveAPI?

#

Does java java one?

quiet ice
sterile token
#

I dont think its exists on jdk 1.8

quiet ice
#

Oh yes, it does

sterile token
#

Really?

quiet ice
#

Yes, though given that it requires a descriptor file it may not apply for your usecase, but perhaps it does, which is why I put it in a spoiler initally

glossy scroll
#

@zealous osprey i got it working but geogebra is dumb so i just used mathematica again

#

it doesnt know how to interpret vector multiplication which gives a parametric curve

zealous osprey
#

So the maths provided from the link should work as intended?
If I may ask, since I am somewhat confused, im assuming that the angles define the vector which then creates a normal vector of length r, right?

#

So it's using pitch and yaw

#

But in radians

lunar schooner
#

Hey folks, I'm looking to decrease the amount of NMS code in my plugins. The 1.17 and 1.18 posts mentioning opening PRs to add to the Bukkit API where one would currently need NMS. Are there situations where it definitely would not make sense to put things in the API, but rather keep them NMS only, or is everything welcome? Currently using NMS to spawn particles for only one player, spawn invisible magma cubes for only one player and to modify a player's GameProfile.

glossy scroll
#

Correct, so the azimuth angle will be the yaw and the zenith angle will be the pitch

#

if im not mistaken

#

just whatever pitch and yaw correlate to this

#

also be careful because minecraft's angles are slightly different from real world angles

#

AND that minecraft is Y-up, not Z-up

quaint mantle
glossy scroll
#

so you'll need to swap the Y and Z values in the functions provided

zealous osprey
#

👍

glossy scroll
#

Minecraft's angles go clockwise and not anticlockwise i believe

#

idk

zealous osprey
#

Making some food rn, Ill test it out in like 30 mins or so

glossy scroll
#

you can put in the code

#

and see what happens

#

im just saying you may have to swap some sins and cosines

#

i can help with that once you get there

#

otherwise your cirlces may be displaced by 90 degrees :)

lunar schooner
glossy scroll
#

@zealous osprey if you need to know the cross product with respect to the zenith and azimuth angles, here you go

#

{-Cos[[Theta]] Cos[[Phi]],-Cos[[Phi]] Sin[[Theta]],SuperscriptBox[RowBox[{"Cos", "[", ":03b8", "]"}], "2"] Sin[[Phi]]+SuperscriptBox[RowBox[{"Sin", "[", ":03b8", "]"}], "2"] Sin[[Phi]]}

#

oops

#

where theta is the azimuth and phi is the zenith

zealous osprey
#

Javas vectors have an inbuilt crossproduct method

glossy scroll
#

oh of course

#

thats right

#

actually minecraft vectors haha

#

java vectors are collections

#

for whatever reason

zealous osprey
#

Well yea, bukkits vectors

unreal quartz
glossy scroll
#

i dislike that

quiet ice
#

The vector class predates the collection api

#

which is why it is highly interesting

quaint mantle
#

What executor should i use for I/O?

glossy scroll
#

@zealous osprey !

zealous osprey
#

wow, wth

mellow gulch
#

is jansi not in spigot anymore?

sterile token
#

I would never miss him <3

quaint mantle
#

who is jansi

mellow gulch
#

it's just console coloring, was it replaced with something else or just removed?

#

(org.fusesource.jansi)

quaint mantle
#

oh

hollow hill
#

hey, could anyone help me with my location?

#

I'm sure I'm doing it wrong

#
@Override
    public void onActivate(Player shooter, Integer level, Location loc, World wrld) {
        double xAxis = loc.getBlockX();
        double yAxis = (loc.getBlockY() + 1);
        double zAxis = loc.getBlockZ();

        Location newLoc = (wrld, xAxis, yAxis, zAxis);
    }
#

I get an error for every variable in newLoc

#

(wrld is defined correctly but I'm not sure about the xyz cords)

mellow gulch
#

add new Location before the '('

hollow hill
#

thanks ;D

young knoll
#

Also why are you using the wrapper type integer

mellow gulch
#

i'd assume because it might be null sometimes

#

int can't be null afaik

young knoll
#

Mmm maybe

glossy scroll
#

@zealous osprey there we go

#

good vizualisation

zealous osprey
#

Im done eating, gonna see if I can code it up now

zealous osprey
ionic hatch
#

Problem with client sided blocks, let me thread this as not to clog this channel up

glossy scroll
#

@zealous osprey yep!

#

actually

#

the theta and phi are swapped on my end

#

because i prefer that notation

#

I think this is more accurate to minecraft

hardy lagoon
#

Hello guys, I'm looking for a way to disable the built-in vanilla night skipping mechanism (the message "1/2 players sleeping"). Does anyone know if this is possible? If it's not possible, would it be possible to disable the message, maybe programmatically with a plugin? The thing is, we use our own sleeping system and the vanilla message is very misleading.

zealous osprey
#

seems like it's rotating on 2 axis ?

glossy scroll
#

oh yea youre right

#

let me see

#

OK

#

@zealous osprey this is the minecraft equation

#

all you need to do is swap Y and Z

zealous osprey
#

btw what's t, Im assuming it's the change in time, but it cant be

glossy scroll
zealous osprey
glossy scroll
#

t is "time"

#

really

#

its just the step size

#

so at each t you get one point

#

depending how many points you want, you have a different amount of ts and you increase t by increments

#

t goes from 0 to 2pi

#

if you want 12 equally distributed points

#

you would make a for loop

#

t increments by 1/6 pi each time

#

and you would do that 12 times

#

ignore the phi

#

i just wanted to see it combined haha

crisp arch
#

do BukkitTasks stop when the player does /reload ?

#

im debugging my plugin, but ive just realized that every time i /reload, im not stopping my runTaskTimer

#

will that cause memory leaks?

onyx shale
#

Afaik yes they do

glossy scroll
atomic shard
#

Is there a list of playable sound effects to listen to?

zealous osprey
#

oooh

#

Btw what I wrote down now is the following, I hope I got the order of operations right, since I've noticed that they are sometimes funky:

crisp arch
atomic shard
zealous osprey
crisp arch
young knoll
#

I mean the playsound command has tab complete

buoyant viper
#

fuk corcles

crisp arch
zealous osprey
#

signum ?

glossy scroll
#

its in ur n method

glossy scroll
#

im not sure if youre exactly right

zealous osprey
#

Still have to add the timesteps aswell, but I dont know what signum is or means/represents, maybe I know it, but under a different name, since the defined names seem to vary alot between german and english

crisp arch
#

do i need to stop BukkitRunnables on plugin disable? im doing /reload to debug my plugin, but im afraid the BukkitRunnables might cause memory leaks

glossy scroll
#

@zealous osprey im saying your code has Signum

#

when it shouldnt

zealous osprey
#

oh I see it

#

thx

glossy scroll
#

phi is the circle with the vertical line

#

theta is the circle with the horizontal line

mellow gulch
glossy scroll
#

hopefully thats clear

zealous osprey
#

yea, the zenith and the azimuth as you showed somewhere above

glossy scroll
#

also remember t just represents a point on the circle

#

its not an actual time

zealous osprey
#

yup, so I need to increment t as it is the steps between the points

glossy scroll
#

correct

mellow gulch
#

but not quite because i forgot about values >0 and <1 when i typed that

vale ember
#

help, it says Caused by: org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.Event. Static getHandlerList method required!
but i declared that method

mellow gulch
#

x==0?0:x/Math.abs(x)

zealous osprey
# glossy scroll correct

Seems to work wonderfully, just need to change C to the current possition of the player, or rather a point on the line following the eyeDirection()

Thx <3

undone light
#

I have a plugin for skipping night when not everyone is sleeping, only a percentage have to be in bed to skip. However when I change the time with the plugin it causes the day cycle to get stuck. This is code im using to set time, is there a different I should be doing this?

mellow gulch
#

why are you doing it in a task?

glossy scroll
#

So wherever you want that to be

#

Id love to see a screenshot in action :)

zealous osprey
#

I think I still am messing up some of the directions, but it's definitley a lot closer than I cam using a sphere and a plane

glossy scroll
#

Make sure you swap y and z

undone light
#

I have touch this plugin in about a year

#

*I havent

vale ember
#

help plz Caused by: org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.Event. Static getHandlerList method required!

zealous osprey
mellow gulch
mellow gulch
undone light
vale ember
undone light
mellow gulch
#

oh ok, didn't know it was a custom event

vale ember
#

i have this class which i use with custom event:

#
package com.aregcraft.customstevechaos.event;

import com.aregcraft.customstevechaos.CustomSteveChaos;
import lombok.NonNull;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;

import java.util.function.Consumer;

public class EventListener<T extends Event> {
    @NonNull private final Listener listener;

    private EventListener(@NonNull Consumer<T> handler) {
        listener = new Listener() {
            @EventHandler
            public void on(T event) {
                handler.accept(event);
            }
        };
    }

    public static <T extends Event> EventListener<T> create(@NonNull Consumer<T> handler) {
        return new EventListener<>(handler);
    }

    public void register() {
        Bukkit.getPluginManager().registerEvents(listener, CustomSteveChaos.getPlugin());
    }

    public void unregister() {
        HandlerList.unregisterAll(listener);
    }
}
#

maybe it's the problem?

mellow gulch
vale ember
#

it literally have that method

smoky oak
#

Why does ENDER_PEARL into Material.getMaterial(args[0]) results in null?