#help-development

1 messages · Page 2197 of 1

torn shuttle
#

yep just did that and it's good now

#

thanks

tender shard
#

np

torn shuttle
#

funny I was looking for that 15 minutes ago but I was browsing via intellij itself...

tender shard
#

😄 yeah I only found out about the vcs.xml too when I once broke something

torn shuttle
#

yeah for sure the kind of thing you only really learn about once something has gone wrong for you personally

tender shard
#

exactly lol

bold copper
#

there will be so many of them in the open world. I just said that going through all the possible mobs in the world is not the fastest option. And I sincerely believe that there is a faster solution.

torn shuttle
#

btw have you seen the hilarious process of installing gradle so you can build a gradle project from command line on windows?

#

I had to manually add environment variables, it was great

tender shard
#

yeah... I really dislike gradle for this and other reasons

torn shuttle
#

also not worth it, conversion broke more things than it resolved

tender shard
#

I mean it's indeed faster in building but that doesn't justify all the downsides it comes with

torn shuttle
#

ended up doing it manually regardless

#

the speed is really important to me but boy setting a project up is like getting your teeth pulled out

tender shard
#

one can also extremely speed up maven by telling it to use more than one thread

#
mvn clean package -T8
#

for example

torn shuttle
#

and you will never find any documentation for importing in a gradle format, it's always maven and the rest is left as an exercise to the reader

tender shard
torn shuttle
#

you bastard

tender shard
#

but tbh if someone decides to use gradle they are probably also capable of "translating" it

torn shuttle
#

see I don't provide either so I am helping

tender shard
#

I mean all you need is the repo, group id, artifact id and version

#

oh wait I just realize

torn shuttle
#

no it's not lol

tender shard
#

my repository manager shows gradle information

torn shuttle
#

there's plenty of exceptions when adding repos that result in really bad hacks that you have to do

#

hell even just shading something in is ugly

tender shard
torn shuttle
#

good

tender shard
torn shuttle
#

nope

tender shard
#

it requires a plugin that isnt even made by the gradle team

torn shuttle
#

yep

tender shard
#

but from some random github person

#

lol

torn shuttle
#

shadowJar

#

that's part of why adding maven stuff can be tricky, you need to manually relocate everything you want to shade so it's easy to forget

tender shard
#

I'll be stuck with maven for the rest of my life because I know how it works and I like how it works. gradle is probably totally fine too but I don't see any reason in switching over and relearning everything

torn shuttle
#

I'm a sucker for that 3< second compile time

#

I switched when I started hitting 40s with maven

tender shard
#

have you tried the -T switch?

torn shuttle
#

also I like streaming while I work on stuff and it would straight up freeze my stream every time lol, so adding more cores would just make it worse

tender shard
#

hmmm

torn shuttle
#

well BetterFood is now updated

#

poggers

#

automatically eat food in your inventory, now we are gaming in 2022

tender shard
#

one core: 41 seconds

torn shuttle
#

yikes

tender shard
#

now lets see how long it takes with 16

#

well

#

still almost 30 seconds

torn shuttle
#

yeah that's trash

tender shard
#

so the improvement is not really huge

torn shuttle
#

tbh

#

and idk how large your project is but I suspect it might be smaller than mine?

tender shard
#

idk it's my library that I use in all of my plugins. final jar is 258kb

torn shuttle
#

yeah

#

elitemobs is 4327kb rn

tender shard
#

but

#

I have to add

#

that most of the time that maven takes is generating javadocs

hybrid spoke
#

so exclude that

tender shard
torn shuttle
#

well maven was slow years ago for me, I'd guess it's worse now though after upgrading my cpu idk

hybrid spoke
#

isnt once enough

torn shuttle
#

what if the docs change

hybrid spoke
#

not your problem

tender shard
#

I like writing javadocs

torn shuttle
#

yeah that'll fix our issues

tender shard
#

sometimes when I'm bored I just open a project and write docs

hybrid spoke
#

let it be the docs problem

#

and you're fine

hybrid spoke
tender shard
#

or "1 döner per package"

torn shuttle
#

sure I'll do that mfnalex

urban kernel
#

how do i check if the args contain a player usernae

torn shuttle
#

please ignore the sound of me typing right now, I am not writing a script which bundles all of my classes into one class right now

#

alright so it's 62593 lines for 1 beer, what a great deal I did today

tender shard
hybrid spoke
#

a massive wucher

tender shard
#

oliver was kicked only a few days ago

tender shard
hybrid spoke
#

doesnt matter in this channel

#

optic is never here

urban kernel
tender shard
urban kernel
#

the*

torn shuttle
#

args is java not english watch out you'll get banned for language

hybrid spoke
#

what if my code is in german

urban kernel
#

BANNED

torn shuttle
#

if you posted code that's a ban, if you posted german code we will send the FBI to raid you

urban kernel
#

i hate how in css u have to use color not colour

hybrid spoke
#
public void istMfnAlexEinWucher() {
  return true;
}
torn shuttle
hybrid spoke
#

obv. i need help with this guys

torn shuttle
#

lots of people are gonna get banned today

tender shard
#

high quality code

urban kernel
#

why?

#

why would you do that

tender shard
torn shuttle
tender shard
#

ugh

torn shuttle
tender shard
#

okay what I sent was a joke but here I show you something that I actually use

torn shuttle
#

ok that's just objectively bad

#

mine are verbose, not documentation

hybrid spoke
#

descriptive name

#

literally

tender shard
#

in the final jar it will probably be called "if" or "goto" or sth like that

hybrid spoke
#

aha, leaked

torn shuttle
#

sure it gets obfuscated anyway but I still don't write entire bible verses as variables because it gets to a point where the autosuggestions get clogged

urban kernel
#

what does the update checker do if u use a version that isnt on spigot with a higher version number?

tender shard
urban kernel
#

ok

tender shard
#

it uses something like Maven's "ArtifactVersion" class to compare versions

urban kernel
#

ook

#

ook we are up to data

#

date

tender shard
#

I really wonder how many plugins use my update checker

#

probably not so many

torn shuttle
#

you have an update checker? I just made my own

#

actually sorry

tender shard
hybrid spoke
#

is it done with the spigot api?

torn shuttle
#

I made my own checker for things other than plugin version

tender shard
#

you can use Spigot API, Spiget API, Github releases, or provide a custom link

torn shuttle
#

otherwise checking if the plugin is up-to-date is pretty easy

hybrid spoke
#

for now i always used my own with a version file

torn shuttle
#

spigot provides a page for that

tender shard
#

I know that oraxen uses my CustomBlockData but no idea about any other plugins

torn shuttle
#

what's the resource icon recommended size again?

#

96x96?

tender shard
#

I think I always upload 256x256

#

they don't really recommend any size

sacred mountain
tender shard
#

the "rendered" size is 48x48 on all pages

torn shuttle
tender shard
torn shuttle
#

yeah I'll go 48 native then

#

thanks

tender shard
#

spigot itself sizes it to 96x96 but they always display it for 48 only

sacred mountain
#

what is intrinsic?

#

oh right

iron glade
#

Trying to add InventoryFramework to my pom

torn shuttle
#

as you can see I am a professional icon maker

#

get your premium quality icons here, only $99,99

tender shard
#

pls create an icon for my newest plugin

tender shard
torn shuttle
torn shuttle
tender shard
#

hm I only get 10€ for doing this plugin

#

so 999$ would be a bit high

torn shuttle
#

ah I see we have a loser who doesn't understand that you need to spend money to make money

#

hfbp

iron glade
#

Do I really have to shade InventoryFramework?

#

adds like 800kb

tender shard
#

you can try to use minimizeJar in the shade plugin's configuration

#

to reduce the file size

#

but it probably won't help much

iron glade
#

damn

tender shard
#

if you're on 1.16+ and the lib is on maven central, you can also use the library feature in plugin.yml

chrome beacon
#

You can also just fork it and remove all the code you don't need

tender shard
#

true but tbh - noone cares if a plugin is 1mb or 400kb

chrome beacon
#

The xml parsing should be taking a lot of space iirc

torn shuttle
#

that's why my plugins are 3tb

iron glade
tender shard
#

my newest plugin is 600kb and angelchest is even almost 2 mb, noone has complained yet

tender shard
iron glade
#

"IF is in the Central Repository, so you don't have to specify a repository."

#

I guess that's a yes

tender shard
#

aah

#

ok

#

then you can do the following:

#
  1. set the scope to provided and do NOT shade it
#
  1. in plugin.yml, add the following:
libraries:
- com.squareup.okhttp3:okhttp:4.9.0
#

obviously replace okhttp with inventoryframework

#

so groupid:artifactid:version

iron glade
#

alright I'll try that

tender shard
#

spigot will then download it when the server starts. but as said, this only works in recent versions of 1.16.5 and later

#

send the error msg

#

also why do you check the command's name?

#

that's useless

chrome beacon
#

Why are you casting everywhere

tender shard
#

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

tender shard
#

like why do you cast null to Object?

chrome beacon
#

Ah right you're the one who doesn't know Java

#

Trust me this is going to be easier if you just take some time and go through the java basics

#

I still don't understand why you refuse to do so

iron glade
# tender shard so groupid:artifactid:version
            <groupId>com.github.stefvanschie.inventoryframework</groupId>
            <artifactId>IF</artifactId>
            <version>0.10.5</version>
            <scope>provided</scope>
        </dependency>

libraries:
  - com.squareup.com.github.stefvanschie.inventoryframework:IF:0.10.5```
Is this correct?
tender shard
#

it will take even longer if you don't even try to learn it

chrome beacon
#

Yeah maybe. If you're in a hurry to get your plugin done hire someone

iron glade
#

Alrighty then, good to know that stuff like that is possible now

tender shard
#

the artifact isn't called "IF" is it?

#

send the link to the maven information pls

iron glade
tender shard
#

hm actually that should work fine

#

idk then D:

#

but tbh just shade it then

iron glade
#

oh no ;/

tender shard
#

800kb isnt much

iron glade
#

guess that's what I'll do

tender shard
#

as said some of my plugins are almost 2mb and noone ever compained

iron glade
#

Where do you sell your plugins btw? @tender shard

chrome beacon
#

If you're goal is to learn something then you have no reason not to start with learning Java

tender shard
#

peope be like "why my code not working" lol

tender shard
tender shard
#

I tried polymart once

#

but I only got one buyer

#

so I decided it's not worth it

#

I sold angelchest on spigot like 700 times and on polymart exactly once lol

chrome beacon
#

?learnjava Get started with a few of these links

undone axleBOT
tender shard
#

I'm constantly broke

iron glade
#

Well, you would be more broke if you didn't sell your plugins I guess

tender shard
#

that is true 😄

#

but yeah I'll soon have a proper job

iron glade
#

Nice, still making something on the side with plugins then

tender shard
#

I love method references

#
Tasks.async(main::saveConfig);
iron glade
#

Is there a way to prevent this?

#

I inspected in JD-gui and one class is there twice, one being named name.class and the other one name$1.class

#

in name$1.class there's only an import and the package lol

granite owl
#

🤔

#

and what has getting the single values off a map object to do with serialization

kind coral
#

How would I structure this database for my plugin:
I have a plug-in where there are spawners and the player that kills mobs spawned gets rewards tho he can do x kills per day, and there are many types of spawner, I was thinking about making a table for each spawner in the config and saving the uuid and kill count but that seems trashy, do you guys have any idea?

#

So like 3 pigs per day 10 zombies per day

granite owl
#

database as in sql?

tender shard
granite owl
#

well to be fair ive never looked into the bukkit wrapper for the java serializer

#

just used it because my non bukkit related serializer broke the objects

tender shard
#

it turns an object into a map or turns a map into the object

#

but tbh ConfigurationSerializable is shit

#

always causes errors

#

it sucks so hard

granite owl
#

and then the map gets serialized i suppose

#

xD

tender shard
#

usually I just do a toMap method and a constructor that takes a map. that at least works all the time

granite owl
#

i mean as a kid i thought "wow bukkit is god stuff how can someone even write this"

#

now im like

#

meh

#

another bug

#

xD

#

i have to work around

#

cough

#

RecipeChoice.ExactChoice

#

i still cant get over it that exactchoice isnt applied properly on shapeless recipes

tender shard
#

feel free to PR then 😛

#

the good thing about open source is that you can always tell people to fix it themselves 😛

granite owl
#

btw

#

why arent you directly doing like

#

this.x = (double) map.get("x);

tender shard
#

because the code used to be looking differently

granite owl
#

if anything id check if its null afterwards

#

right

tender shard
#

a null check on a double is pointless

#

it throws an NPE right when you assign it

#

because of auto unboxing

granite owl
#

i also dont understand why ppl say "dont check instances for null"

#

its unsafe

#

i mean hell no its not

#

if u dont screw it up

granite owl
#

i always just get the object i want and then null check it to see if its existing like for itemstacks

#

like

#

PrepareCraftEvent

#

ItemStack is = event.getInventory().getResult()

#

if (is != null)...

#

or something like that

tender shard
#

yeah but that will never be null IIRC

granite owl
#

it is

tender shard
#

it'd return an ItemStack of AIR with amount 0

granite owl
#

it returns null

tender shard
#

oh mb

#

yeah its weird

#

some methods return an empty itemstacks

granite owl
#

somehow

tender shard
#

others return null

granite owl
#

Material.Air

#

gets cast to null

#

🤔

#

even worse

#

if u say u want to get material.air itll always fail

#

but if u set the IS to null

#

it says cant be set to null

#

🤣🤣🤣

#

like to see if an item slot is empty u must check for null

#

but if u want to remove/delete it

#

u must set it to air

#

xD

granite owl
#

needs to be itemstack of air with amount of 1

#

idk why its kinda weird

granite owl
kind coral
granite owl
#

well first off id prob store the data of how many mobs someone killed in the sql database

#

and the limit for each mob type per day in a json, ini or whatever config file

#

u know front and backend programming

#

anyways ull have to ask someone else about the sql part

#

and dont forget to track the date somehow

#

as for updating dates/daily/kill ratio limit, probably only when someone logs in

twilit roost
#

How can I make movable ship?
Ik I should loop thru list of blocks and move them
but then it comes to "rotated" movement
Any ideas? Maybe WE?

tender shard
twilit roost
#

okk
But wont that result in some micro waiting times between rotating/moving?
From my experience with WE it always took few moments before filling/rotating blocks

tender shard
#

well worldedit (not those async forks) does it on the main thread

twilit roost
#

ok thats nice

quaint mantle
#

anyone here works with protocollib? it seems like entity id is unique, if i randomly use values, would it cause issues?

chrome beacon
#

It can cause issues yes

quaint mantle
#

then what should i do to get an id that won't conflict with existing ids?

slate mortar
#

is it actually safe (or even "possible") to cast like this?

Player target = (Player) Bukkit.getOfflinePlayer(UUID.fromString(args[0]));
tender shard
#

no

slate mortar
#

if it's definitely online i mean

#

or will it end up with an error

tender shard
#

you can use OfflinePlayer#getPlayer

#

to get the online player

slate mortar
#

ah i see

#

that should work as well

eternal oxide
#

OfflinePlayer has a getPlayer method, which will return null if they are not online

tender shard
#

lol

slate mortar
#

spigot be like

knotty meteor
#
    @EventHandler
    public void onBlockPhysicsEvent(BlockPhysicsEvent e){
        if(e.getChangedType().equals(Material.CROPS)){
            e.setCancelled(true);
        }
    }```
Someone knows why it doesnt grow anymore?
My only goal is to let it not break automaticly if it is on top of another block. Because i want to grow it on podzol
tender shard
#

because you always cancel the event

quaint mantle
tender shard
#

only cancel the event if the new material is different from the old material

slate mortar
#

target.toString().toString().toString().toString();
best

knotty meteor
#

But how can i check that? Because getblock and getchangedtype is the same block i figured

tender shard
#

yes exactly. only cancel the event if the old type and the changedtype are DIFFERENT

#

if both are, lets say Material.POTATO than it's just a crop growing

#

you don't wanna cancel that

knotty meteor
#

But if it breaks it goes to air so i dont get why its not working

harsh totem
tender shard
harsh totem
#

Oh

knotty meteor
#
    @EventHandler
    public void onBlockPhysicsEvent(BlockPhysicsEvent e){
        if(e.getBlock().getType().equals(Material.CROPS) && e.getChangedType().equals(Material.AIR)){
            e.setCancelled(true);
        }
    }```
I dont get why this is still breaking the seed tho
tender shard
#

print out the old and the new type

knotty meteor
#
    @EventHandler
    public void onBlockPhysicsEvent(BlockPhysicsEvent e){
        System.out.println("Old: " + e.getBlock());
        System.out.println("New: " + e.getChangedType());
    }```
Like this?
tender shard
#

yes

#

now see what it prints

manic furnace
#

How can I tell gson to not serialise a specific member? @Expose doesn't work

earnest forum
#

system.out.println 😳

tender shard
earnest forum
#

try running it on 1.18 and see if it works

#

still use logger

tender shard
#

?services

undone axleBOT
earnest forum
#

whenever i debug i just send a message to player

#

clear and easy to read

tender shard
#

there is no player in BlocksPhysicsEvent though

earnest forum
#

ah yeah

knotty meteor
#
[11:45:25 INFO]: New: CROPS```
Bruh it does air as old block, thats why it didnt work 😂
tender shard
#

that is weird lol

knotty meteor
#

Yep.. but now lets see if it works haha

tender shard
#

good luck 😄

knotty meteor
#

Thanks! :D

#
[12:01:24 INFO]: New: CROPS```
It also breaks because it does crops as old and crops as new 
But i cant cancel that because then it doesnt grow again
thorny dawn
twilit roost
#

World Edit paste doesn't seem to work

    public ShipLoader loader = new ShipLoader();
    public void loadSloop(Location loc){
        File file = new File(Pirates.getPlugin.getDataFolder().getParentFile() + File.separator + "/WorldEdit/schematics/sloop.schem");
        try {
            Clipboard cl = loader.loadSchematic(file);
            loader.pasteAt(loc,cl);
        } catch (IOException | WorldEditException e) {
            e.printStackTrace();
        }
    }
eternal oxide
#

yes

minor garnet
#

dont worry about that, is just because i want make a procedual locations algorithm

#

i just want make the armor stand head pose, rotate like the player head

hybrid spoke
#

why are you using NMS for it

hybrid spoke
#

and since you mulitplicate it, to the future like you can see in the video?

minor garnet
#

And Euler angle too

minor garnet
#

I Just want know why the armor stand yaw is not right

hybrid spoke
#

just like i said

#

thats probably the cause

minor garnet
#

let me try just the vector from the player direction then..

eternal oxide
#

myListener = new YourListener()

round finch
#

i'm trying to save entity to config but it gives Craft-SomeEntity

eternal oxide
#

unregisterAll(myListener)

#

it takes an instance

#

same

round finch
eternal oxide
#

Entities are not serializable

round finch
#

sadge i could do that with location

round finch
misty current
#

what should I do to check if a PlayerMoveEvent is about position movement and not yaw/pitch movement?

misty current
#

you can save it

round finch
misty current
#

what do you mean with store?

round finch
#

yes

misty current
#

stuff like armor, PDC?

round finch
#

*saving my entity data to config

#

everything

misty current
#

not sure if there is a built in way to do it

#

pretty sure you have to do it yourself

#

only thing that comes to my mind is using nbtapi to get the nbtcompound of the entity and saving that, then creating the entity from the compound

#

not sure if you can do that either

vocal pine
#

Idk if im just dumb or what, first time making custom entity in NMS, i can't summon it ingame and can't find a tutorial as to why? Class seems to work and it has the correct constructor but the game just doesn't recognise it i guess?

#

like minecraft:?? is not a thing

chrome beacon
#

Don't register your entity that way

#

The client won't understand it

opal sluice
#
        final EntityAreaEffectCloud areaNMS = new EntityAreaEffectCloud(craftWorld.getHandle(), centerLocation.getX(), centerLocation.getY() + lineOffset, centerLocation.getZ());
        areaNMS.a(0f); // setRadius
        areaNMS.a(new ParticleParamBlock(Particles.c, // Block Particle Param
                                         Block.a(0))); // AIR block data / setParticles
        areaNMS.b(999999999); // setDuration
        areaNMS.d(true); // setSilent
        areaNMS.a(IChatBaseComponent.a(line)); // setCustomName
        areaNMS.n(true); // setCustomNameVisible
        lines.put(areaNMS, line);

        for(Player viewer : viewers)
        {
            ((CraftPlayer) viewer).getHandle().b.a(new PacketPlayOutSpawnEntity(areaNMS));
            System.out.println(viewer.getName() + " has been notified of a new line.");
        }```
#

I have a little issue with this code... The entity is spawned

#

But the properties are not taken in count

#

So, the raidus, the particles, and the custom name, aren't changed :/

#

I don't really understand why

#

Should I use Datawatcher instead of the the builtin methods?

misty current
#

you need to send a metadata packet

eternal night
opal sluice
misty current
#

after

opal sluice
eternal night
#

ah lemme get the spoon

misty current
opal sluice
#

oh ok, so I have to manipulate datawatchers 😭

eternal night
#
public static EulerAngle directionToEuler(final Vector dir) {
    final double xzLength = Math.sqrt(dir.getX() * dir.getX() + dir.getZ() * dir.getZ());
    final double pitch = Math.atan2(xzLength, dir.getY()) - Math.PI / 2;
    final double yaw = -Math.atan2(dir.getX(), dir.getZ());
    return new EulerAngle(pitch, yaw, 0);
}
#

based on some random math exchange post

minor garnet
#

...

misty current
#

so you don't have to make your own

opal sluice
eternal night
#

don't get the data watcher if you can

#

use the methods on the entity itself that internally mutate the data watcher

minor garnet
#

.

#

i think the player yaw is 360 some think like that

vocal pine
#

What is MinecraftKey & EntityTypes supposed to be now? I have NMS but I can't import specifically those and I can't find what its meant to be

misty current
minor garnet
#

I remember something like that, I had to convert the player's yaw

#

why notch had developed yaw different from normal vectors

#

I just don't remember where I saw this on a forum...

opal sluice
misty current
#

nice, remember to send the packet each time you update something

opal sluice
#

If someone need to get the official map

#

That helps a lot when working with nms ^^

#

So far, AreaEffectClouds to make holograms looks way better than using armor stands 😮

round finch
#

.

Can I save entity data by saving NBT data?

lost matrix
lost matrix
round finch
#

Trying to save entity data to config

#

😅
Sorry for confusion

lost matrix
#

So an entire entity? Including attributes, location, world, persistentdatacontainer etc

round finch
#

Yeah everything

lost matrix
# round finch Yeah everything

You need NMS for that. Create a new NBTCompound, call the save(NBTCompound) from Entity and then serialize the compund to a base64 String.
Its quite the hustle.

frail sluice
#

how can I make a custom item not show its name in a item frame?

misty current
#

i suggest using nbtapi if there's the option to get the compound from and entity and vice-versa

round finch
#

Both sounds great thank you

#

I'm not a professional developer
Spigot and java coding is just a hobby for me

#

I'm not advanced

lost matrix
frail sluice
#

is there a tag that hides it?

iron glade
#

Anyone experienced with InventoryFramework?

lost matrix
iron glade
# lost matrix Whats your concern?

I'm trying to put some "Last page" and "Next page" buttons, the last page button only appears when there is a last page, next page button only when there is a next page, however let's say I'm on page 1 and go to page 2, the "last page" button is not appearing. Also their name is noch changing to like "Return to page " + getPage() - 1)

lost matrix
iron glade
#

?paste

undone axleBOT
iron glade
lost matrix
opal sluice
iron glade
#

Do you use Triumph?

lost matrix
iron glade
#

I'll give it a try

humble tulip
#

@iron glade skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer(all.getName()));

#

Just pass player since player extends offlineplayer

lost matrix
native falcon
#

The world exists

humble tulip
#

Can we see game class?

lost matrix
native falcon
#

Oh I see thx

lost matrix
tender shard
lost matrix
#

Are you still struggling with this?
Honestly if you would just go ahead and read up on the math you would have created a whole library for this by now.

minor garnet
#

i'm trying to make the armor's head rotate according to the player's head position, the pitch is all right, now or yaw no, I noticed that I split this value works a little better

lost matrix
#

Probably just an atan2 problem.

minor garnet
#

and seriously do i really need math for this? Is there a very simple way to solve this? ...

humble tulip
#

Does mojang use radians or degress for yaw and pitch?

minor garnet
lost matrix
#

You always need math for everything in programming.
Especially if you are working with dimensions, orientations and vectors.

minor garnet
eternal night
#

didn't I already provide some code ? what did not work for you with it

humble tulip
#

So it is in radians

eternal night
#

ye ?

minor garnet
#

see this video

river oracle
humble tulip
#

It's not my problem lol

harsh totem
#

how do I check if an inventory is a crafting table?

humble tulip
humble tulip
minor garnet
river oracle
#

Wrong reply xD

humble tulip
harsh totem
#

what's enum

river oracle
#

O.o

#

InventoryType is an enum

humble tulip
#

Can we see ur direction to euler method?

#
private static EulerAngle convertVectorToEulerAngle(Vector vec) {
     
        double x = vec.getX();
        double y = vec.getY();
        double z = vec.getZ();
     
        double xz = Math.sqrt(x*x + z*z);
     
        double eulX;
        if(x < 0) {
            if(y == 0) {
                eulX = Math.PI*0.5;
            } else {
                eulX = Math.atan(xz/y)+Math.PI;
            }
        } else {
            eulX = Math.atan(y/xz)+Math.PI*0.5;
        }
     
        double eulY;
        if(x == 0) {
            if(z > 0) {
                eulY = Math.PI;
            } else {
                eulY = 0;
            }
        } else {
            eulY = Math.atan(z/x)+Math.PI*0.5;
        }
     
        return new EulerAngle(eulX, eulY, 0);
     
    }

#

@minor garnet from forums

#

Test it

humble tulip
#

?

minor garnet
#

this code literally do this

humble tulip
#

I'm pretty sire it doesn't but I'm gonna test it

tall dragon
#

yea they produce different results

rapid cargo
#

Can someone tell me how I can let a Mob (or specifically a horse) run to a certain location?

humble tulip
#

@minor garnet

#

it's different

#

2.313476202573401,2.860360451671498,0.0
-0.7426798757785043,-0.2812322019182953,0.0

#

those are reuslts from the same vector

rapid cargo
#

do you have a snippet for me?

minor garnet
#

but the code your send, the vector to euler maths is diferrent

#

but do the same thing

iron glade
humble tulip
#
  1. It does not do the same thing
#
  1. Yes it is different
#

try the method i sent instead of urs

rapid cargo
minor garnet
humble tulip
#

just try the method and see if it works

#

then u can try to figure out what you're doing wrong

lost matrix
iron glade
twilit roost
#

WorldEditAPI:
How to adapt world and location?
Im using worldedit-core dependency

#

BukkitAdapter doesn't exist

eternal night
#

you need the bukkit dependency

#

core itself won't be enough

tender shard
#

if bukkitadapter doesnt exist, then youre missing the proper dependency for bukkit

eternal night
#

I think bukkit should include core ?

#

so yea, switch from core to bukkit

twilit roost
#

When i use Bukkit
(screen will be sent soon)

tender shard
#
        <dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.5</version>
            <scope>provided</scope>
        </dependency>```
this is enough
twilit roost
#

oh theres 7.2.5
imma try that one

eternal night
#

I guess you need to figure out where they grab bstats from

#

or just exclude it from the dependency

tender shard
twilit roost
#

nope

lost matrix
twilit roost
#

but 7.2.5 is working now

#

*so far
Downloading of dependecies is still going

#

Yep no errors
imma try that BukkitAdapter

#

yep thx
works

glass mauve
#

do I need to create a MapRenderer for each Image? or can I make one MapRenderer for each player, which got a list of images?

tender shard
#

you can use the same renderer everytime

glass mauve
#

I currently have this:

public class ImageRenderer extends MapRenderer{

    private final Player player;
    private final BufferedImage image;
    private boolean done;

    public ImageRenderer(Player player, BufferedImage image) {
        super();
        this.player = player;
        this.image = image;
    }

    @Override
    public void render(@NotNull MapView mapView, @NotNull MapCanvas mapCanvas,
                       @NotNull Player player) {
        if (done)
            return;
        mapCanvas.drawImage(0, 0, image);
        mapView.setTrackingPosition(false);
        this.done = true;
    }
}
#

if I can use one instance of this class for each map, how does it know which BufferedImage to render on which map

tender shard
#

well in this case if you need different images, obviously you have to use different instances

#

I thought you wanted to render the same image to all players or sth like that

#

so yeah use one renderer per image

glass mauve
#

ok thanks

hybrid spoke
#

gif it

glass mauve
#

should I make some Cache thing? bc there is a chance that some people get the same image

hybrid spoke
#

most likely

#

map operations are expensive

glass mauve
#

is there a way to check if two BufferedImage are the same? equals method works?

hybrid spoke
#

check the pixels

tender shard
#

equals is the same as == for BufferedImages

glass mauve
#

hm ok that doesnt work then

tall dragon
#

you could check the size first. if that doesnt equal thats an easy false

#

then check the pixels yea

tender shard
#

where do you get the image from?

glass mauve
#

the size is always 128x128

tender shard
#

for example if it's by file name, you could just do a map that maps the file name to the bufferedimage

hybrid spoke
#

if you have the images hardcoded you can easily compare them by ==

#

since it will always be the same instance for the same image

glass mauve
#

ok so let me explain what Im doing and what I try to do

hybrid spoke
#

if you load it from somewhere you will need to check the pixels

tender shard
#

it's probably a crack cocaine simulator

glass mauve
#

lmao

hybrid spoke
#

a mirror for the lines

tender shard
#

lol

digital rain
#

heey, how do i get the damage value of an itemstack

hybrid spoke
tender shard
#

then do getDamage

glass mauve
#

with Packets:

  1. I create a wall of 5x3 itemframes
  2. then I load an Image of size 640x384
  3. I split this BufferedImage to small 128x128 parts
  4. render each part to its correct itemframe, so I create a big image
  5. this wall should be clickable and change on click etc // not implemented
tender shard
#

and where do you obtain the images from?

glass mauve
#

from a .png file

tender shard
#

i'd then just cache them by their file name

#

Map<String,MapRenderer> or sth

#

where the string is the file name

glass mauve
#

but I draw stuff on the BufferedImage, which depends on the player and what he is currently doing

tender shard
#

oh ok then you have to use a new maprenderer everytime

digital rain
glass mauve
#

👍

tender shard
glass mauve
#

can I edit an Image of a Map which got send by packets? can I edit it by using the same EntityID?

iron glade
#

Guys sorry for the dumb question, but how do boss bars work in 1.18? Last time I used them was years ago and iirc back then it was very complicated

tender shard
#

Bukkit.createBossBar

iron glade
#

fr?

tender shard
#

yes

#

lol

iron glade
#

but is it right that it was not that easy in like < 1.13?

tender shard
#

I think it was added in 1.13 but not sure

tall dragon
#

that method wont let you do per player boss bars tho iirc

tender shard
#

you can decide what players get shown which bossbar

tall dragon
#

oh yea u can

#

nvm

iron glade
#

Well glad it's that easy now

tender shard
#

just create a bossbar and then you can use addPlayer or sth like that on it

glass mauve
#

nvm

#

yea just saw that

#

you can first remvoeAll and then add player

tender shard
#

when you create a new bar, noone is added to it anyway

#

I always just cache all bossbars in a map and create one per player

    public BossBar getBossBar(Player player) {
        BossBar bar = bossbars.computeIfAbsent(player.getUniqueId(), __ -> {
            NamespacedKey key = main.getKey("bossbar/" + player.getUniqueId());
            BossBar existing = Bukkit.getBossBar(key);
            if (existing != null) {
                Bukkit.removeBossBar(key);
            };
            return Bukkit.createBossBar(key, null, currentContest.getBossbarColor(), BarStyle.SOLID);
        });
        if (!bar.getPlayers().contains(player)) {
            bar.addPlayer(player);
        }
        return bar;
    }
iron glade
#

Good to know, thanks

echo basalt
main dew
#

how I can change placed block in BlockPlaceEvent?

opal juniper
#

cant

#

cancel the event and place a new one

main dew
opal juniper
#

get the block, and err place it?

main dew
#

but in Bukkit scheduler?

main dew
opal juniper
#

me speaking

#

just do it in the event

#

you shouldnt need to delay it as far as i know

main dew
opal juniper
#

sure, but you might cause a stack overflow

#

idk if setting the type will cause a BlockPlaceEvent

tall dragon
#

no

#

it will not

opal juniper
#

should work then

main dew
#

placed block miss and don't change to stone

tall dragon
#

did you register the listener?

main dew
#

all placed block was replace to AIR

humble tulip
#

Schedule it to be placed

#

May be something weird with blockplaceevent

main dew
minor garnet
#

does anyone have any idea how to get the direction of the player's body or armor stand, getDirection returns a vector based on the player's pitch and yaw, not the exact direction of the body

tall dragon
#

what ru trying to accomplish

#

well ya cant

#

the body is entirely client controlled

#

as far as i know

minor garnet
#

this complicates my life a lot

#

i notice this is the problem causing my yaw issue

humble tulip
main dew
#

I can check

#

it is working xD

iron glade
tall dragon
#

wow

iron glade
#

Is there any way to make the boss not that "dark" or behind the inventory?

tall dragon
#

thats actually such a cool idea for bossbar

iron glade
#

finally got it working like this

tall dragon
#

and no

iron glade
#

:( sadge

#

I guess as long as it's still visible somehow

humble tulip
#

OH that bossbar idea is cool

tall dragon
#

well u can

humble tulip
#

I'm stealing that

tall dragon
#

close the inventory xD

iron glade
#

xD

#

im removing the boss bar when closing the inv tho :/

iron glade
humble tulip
#

So whatever other plugin is doing bossbar stuff can have its bossbar back

iron glade
#

oh that's a good point

#

didn't think about that

golden kelp
#

yo guys got a plugin idea?

main dew
tender shard
# golden kelp yo guys got a plugin idea?

a tax authority plugins that makes you pay taxes, have to file your income tax declaration every other minecraft day and if you forget it, you'll get fined and jailed

golden kelp
#

ey thats a sick one

#

stupid enough for a yt vid, ty

tender shard
#

lol np 😄

iron glade
tall dragon
#

i need to sub to this man of culture

golden kelp
tender shard
#

i demand answers too. if you actually do the tax plugin, I wanna see it lol

tall dragon
#

if theres more of that

#

sure

golden kelp
#

i syuck at edituing so it takes an eternity

#
public static String[] ideas = {
        //TODO: Will do later
        "Minecraft but it tweets whenever you complete a advancement.",
        "Minecraft but everytime you break a block, a villager spawns and says Sun Tzu quotes near you",
        "Minecraft but touching grass kills you.",
        "Minecraft but taking damage gives you [SURPRISE]",
        "Minecraft but taking damage gets you a random item. [GC]",
        "Minecraft but you cant mine or craft",
        "Minecraft but you can mix water to make wet water",
        //TODO: In the video
        "Minecraft but theres no Minecraft",
        //TODO: Will do later
        "Minecraft but if you look at baby villagers, they gang up and kick you in the balls",
        //TODO: Will do later
        "Minecraft but every mob teleports like an Enderman",
        //TODO: Will do later
        "Minecraft but Signs can run code",
        //TODO: In the video
        "Minecraft but to defeat the ender dragon, You have to rap battle with it",
        //TODO: Will do later
        "Minecraft but a chicken controls your movement",
        //TODO: Will do later
        "Minecraft but you have friends",
        //TODO: Will do later
        "Minecraft but cows create Lava",
        //TODO: Will do later
        "Minecraft but only cats",
        //TODO: Will do later
        "Minecraft but you can only eat raw meat [GC]",
        //TODO: Will do later
        "Minecraft but when you stare a sheep, it starts glowing & levitates with the _jeb effect"
    };

the ones i have rn

tall dragon
#

lmao

iron glade
golden kelp
#

[GC] is github copilot

golden kelp
#

nice that u found my vid tho

iron glade
#

lol nice one, liked!

tall dragon
#

Minecraft but there is no minecraft

#

thats interesting

golden kelp
#

just black screen

iron glade
#

"Minecraft but you can mix water to make wet water"

#

what is wet water

tender shard
#

duh

golden kelp
#

Yea

golden kelp
#

or is it too much

tender shard
#

it's okay if you're actually hot

#

otherwise not

golden kelp
#

yea i aint

tender shard
#

hmm

iron glade
#

🧢

tender shard
#

I think you can use it nonetheless

iron glade
#

Just use it

golden kelp
#

ok nice

iron glade
#

you get more comments because of it I bet

golden kelp
#

xd

iron glade
#

there are people out there talking trash in like every video for all of the video xd so it should be fine

golden kelp
#

yea

young vigil
#

Hello, the JavaDocs are down ?

eternal oxide
#

no

opal juniper
#

yeah they are

young vigil
#

403 Forbidden
nginx

opal juniper
#

i get an nginx error

#

you probs have them cached

young vigil
#

Then it's a matter of wait

digital rain
#

simplest way to check for nighttime?

eternal oxide
#

yep, refreshed, 403

opal juniper
#

the whole hub is down

lost matrix
humble tulip
eternal oxide
#

💣 md_5

tardy delta
#

Kaboom

tender shard
#

I bet md_5 finally updates from jessie

#

to experimantal 🧠

digital rain
#

oohhhh youre right

#

hub is down

#

:(

dire trench
#

Hello, when will spigot updated to 1.19?

tender shard
#

july 7th

#

maybe july 6th

lilac condor
dire trench
lilac condor
#

Yes it is

tender shard
#

as said: july 7th

dire trench
lilac condor
#

Everyone just keeps asking for an ETA

tender shard
#

it gets funnier the more people participate

#

because when someone asks "when" and everyone answers "july 7th" then they'll think that it's actually true lol

lilac condor
#

Ill just tell them august 2021

golden kelp
#

uhm guys, is there a way u can get a player's ip by plugins. It does log the ip on player join so?

lilac condor
#

:)

granite steppe
golden kelp
#

yea

#

i want to get them through code i wonder how

#

does Player have a method for that?

#

or does this require nms?

crisp steeple
#

the AsyncPlayerPreLogin event has a method to get a player ip address

golden kelp
#

o sick

#

ty

crisp steeple
#

idk, maybe theyre the same

somber matrix
tall dragon
#

it appears to be down

barren tree
#

Yeah, hub is down.

lament swallow
#

how would I wait for 3 seconds before doing something else?

tall dragon
#

?scheduling

undone axleBOT
golden kelp
#

Just add Thread.sleep

tall dragon
#

oh yea thats a greaaat idea

hardy kelp
#

is bungee for 1.19 out yet or is this still under work.

tall dragon
#

it appears to be out

glad hedge
#

INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project spigot: Could not resolve dependencies for project org.spigotmcspigotjar:1.19-R0.1-SNAPSHOT: Failure to find org.spigotmc:minecraft-server:jar:1.19-R0.1-SNAPSHOT in https://libraries.minecraft.net/ was cached in the local repository, resolution will not be reattempted until the update interval of minecraft-libraries has elapsed or updates are forced -> [Help 1]

brittle lily
#

Hey Guys! How Can I set ItemStack on config

tall dragon
#

depends. do you want to preserve all data about the item?

brittle lily
#

I wanna make Kit Plugin When Player write /createkit kitname get Player Inventory and set on config

#

Just Items is enough

golden kelp
#

1.19 released today (or will)

#

Spigot needs weeks making the jar for 1.19

#

So wait

chrome beacon
#

It's already out

tall dragon
#

ya it is released

golden kelp
#

the spigot jar released as well?

chrome beacon
#

Yes

golden kelp
#

da heq

#

how so fast?

chrome beacon
#

They've been working on the snapshots

vocal cloud
#

1.18 to 1.19 not a lot of changes under the hood

golden kelp
#

ohhh

#

my bad

tall dragon
golden kelp
brittle lily
tall dragon
#

yep

#

but i cant rlly recommend yml for storing data either

brittle lily
tender shard
#

nice! not a single change needed in any of my code. just switching from 1.18 to 1.19 mappings is enough :3

tall dragon
glad hedge
#

Im using VPS to build spigot. It is okay? 😄

brittle lily
tall dragon
#

uh i would first get familiar with files if youve never done either

#

and data storage doesnt have much to do with spigot

#

thats more general java knowledge

brittle lily
#

But I can use json and maybe later I can use database.

tall dragon
#

yea i guess indeed.

lament swallow
tall dragon
#

👍

golden kelp
harsh totem
#

Idk why this is false when I click in a crafting table, any ideas?
event.getClickedInventory().getType() == InventoryType.CRAFTING

midnight shore
#

Try checking if it’s instanceof CraftInventory or CraftingInventory idk

limber owl
#

how can I delete worlds folder?

#

and how can I siables spawn chunk from loading? I have custom populators and when that chunk is made I can't modify them

tender shard
golden kelp
#

fr

limber owl
tender shard
#

the folder is named exactly as the world is

limber owl
#

not working, already tried that

tender shard
#

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

frail sluice
#

do Listeners need to be public, or can they be package-private?

limber owl
#

it just doesn't work, what you suggested, and I asked question about how to delete it

limber owl
eternal night
#

they do ?

frail sluice
#

just to clarify, I am asking about the class itself, not the methods

limber owl
#
public void destroyWorld() {
        try {
            Bukkit.unloadWorld(world, false);
            world.getWorldFolder().delete();
        } catch (Exception e) {
            Bukkit.getLogger().log(Level.SEVERE, e.getMessage());
            if(plugin.getConfig().getBoolean("debug"))
                e.printStackTrace();
        }
    }
``` this is what I'm using and it doesn't work
eternal night
#

Well, a public one would be better for you (especially on paper servers) as invokation of your listener methods is easier

limber owl
eternal night
#

that does not mean they cannot be package private wat

tender shard
#

you have to recursively delete the contents too

eternal night
#

could just be in the same package as your java plugin child

tender shard
#

or use a nexisting method like FileUtils.removeDirectory or however it's called

frail sluice
eternal oxide
limber owl
limber owl
tender shard
eternal night
#

iirc unload world does not flush IO

#

e.g. the files may still be open

tender shard
eternal oxide
frail sluice
eternal night
#

technically yes, again I would not recommend that

frail sluice
#

I am only listening to spigot events

coarse elk
glass mauve
limber owl
tender shard
#

but it definitely exists 😄

limber owl
#

what's their dependancy on maven?

tender shard
#

it's included in spigot

#

add "spigot" as dependency instead of "spigot-api"

limber owl
limber owl
#

it doesn't recognize my build tools 😐

tender shard
#

it's definitely included in recent versions of spigot

tender shard
limber owl
#

but I have them downloaded

tender shard
#

oh

#

1.8

#

that version is SO EXTREMELY old

limber owl
#

wow

tender shard
#

you have to shade commons io yourself then

limber owl
#

this again

tender shard
#

just click on 2.11.0 and it'll tell you the dependency information

limber owl
#

thanks

tender shard
#

you also have to add the maven-shade-plugin if you haven't already done so

#

and then set the <scope> of all dependencies you do NOT want to shade to "provided"

glass mauve
#

just use current versions 💀

limber owl
limber owl
humble tulip
#

delete what?

#

the world?

#

delete the world after it's unloaded lol

tender shard
limber owl
#

okay

#

thx

#

[19:38:55 ERROR]: Unable to delete file: .\game\region\r.0.0.mca
[19:38:55 WARN]: java.io.IOException: Unable to delete file: .\game\region\r.0.0.mca

#

bruh

eternal oxide
#

You have to wait. Unloading is not instant

limber owl
#

?

eternal oxide
#

what about that do you not understand?

limber owl
#

what that has to do with fileutils not being able to delete folder?

eternal oxide
#

because its not fully unloaded the world yet

stiff dune
#

Hey Guys! Can anyone help me? How can I make color gradients in chat messages (player#sendMessage)? I can't find any point in the docs

limber owl
limber owl
eternal oxide
stiff dune
#

No, not normal color codes

limber owl
#

hex?

stiff dune
limber owl
#

Bukkit.unloadWorld(world, false);
FileUtils.deleteDirectory(world.getWorldFolder());

#

I use this in a single core plugin

eternal oxide
limber owl
#

how so, and how can I make it unload before deleting it?

brittle lily
#

Guys Are there any downsides to using the API?

humble tulip
#

try saving the chunks

eternal oxide
#

You are also telling it to unload the world, while holding a reference to the World.

#

You tell it to unload, wait a few seconds, then loop while testing if you can delete.

humble tulip
#

it sounds counterintuitive but maybe if u try unloading without saving it may just remove the world from memory and deal with closing file streams after?

#

now sure how bukkit does it

#

in 1.8

eternal oxide
#

Do not hold a reference to the unloading world, just get a File reference

limber owl
#

like this?

            File worldFile = world.getWorldFolder();
            String worldName = world.getName();
            world = null;
            Bukkit.unloadWorld(Bukkit.getWorld(worldName), true);
            FileUtils.deleteDirectory(worldFile);
eternal oxide
#

close but no

#

you still have to delay deleting the world and test if it fails so you can repeat x number of times.

humble tulip
#

i thought world loading and unloading happened sync in 1.8 tho?

eternal oxide
#

Not as far as I remember

humble tulip
#

ah ok

#

well u probably have to schedule a repeating task to delete the world until the folder no longer exists

shadow gazelle
#

Do custom items as an exact choice break the crafting book?

eternal oxide
#

pretty sure it will not start to attempt to unload until the next tick

shadow gazelle
#

It's saying I can't craft this even though I have the exact items it's looking for and I can craft it manually by dropping everything in

eternal oxide
#

are any of your items damaged?

shadow gazelle
#

no, they can't even be damaged

#

It's three brown stained glass with the luck enchantment for the glow and a custom name

#

and a netherite ingot with a custom name and luck

limber owl
#
        File worldFile = world.getWorldFolder();
        String worldName = world.getName();
        world = null;
        Bukkit.unloadWorld(Bukkit.getWorld(worldName), true);
        int task = Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
            try {
                FileUtils.deleteDirectory(worldFile);
            } catch (IOException e) {
                Bukkit.getLogger().log(Level.SEVERE, e.getMessage());
                if(plugin.getConfig().getBoolean("debug"))
                    e.printStackTrace();
            }
        }, 20);
        Bukkit.getScheduler().cancelTask(task);
``` @eternal oxide like this? sorry for late response
shadow gazelle
#

the recipe for the brown stained glass works in the recipe book and it's glass plus eight renamed and enchanted soul sand

eternal oxide
stiff dune
#

Can anyone tell me how to use hex colors? And maybe how to use color gradients?

tall dragon
#

you could use the adventure framework

stiff dune
#

I take a look

quaint mantle
#

Does anyone know a good way to set nearby ground on fire and then remove it aftre 5 seconds? Like 10 blocks in x and z from the clicked block to fire
Current code
int r = 10; // Loop through all blocks within the radius (cube, not sphere) for(int x = (r * -1); x <= r; x++) { for(int y = (r * -1); y <= r; y++) { for(int z = (r * -1); z <= r; z++) { // Grab the current block Block b = (Block) loc.getWorld().getBlockAt(loc.getBlockX() + x, loc.getBlockY() + y, loc.getBlockZ() + z).getRelative(BlockFace.UP);

tardy delta
#

?scheduling

undone axleBOT
tall dragon
#

this method requires the land to be completely flat

tardy delta
#

(r * -1) -> -r

tender shard
eternal oxide
#

?paste

undone axleBOT
eternal oxide
misty current
#

can you execute code when a world has finished generating?

lost matrix
humble tulip
#

or chunkloadevent

misty current
quaint mantle
misty current
tall dragon
humble tulip
#

dont go gethighestblockat

quaint mantle
#

Thanks man

tender shard
tall dragon
#

you might need to go 1 more block

humble tulip
#

if theyre in a building it wont work

#

get all blocks in the radius, if it's air check if it has a block below

#

and set it on fire

tall dragon
#

ya what if the terrain goes up next to you