#help-development

1 messages Ā· Page 606 of 1

young knoll
#

You could

#

I would split the message at {hover-message} and then append the parts back together

edgy crystal
#

Hey Guys, i wanna create an API that sends the playerData from my Bungeecord to my Spigot Plugin, how to start?

dull schooner
#

hey, is there a way to change the repair count from an item? without changing the nbt

silver robin
umbral ridge
#

Conversion from colored string to an actual colored message

young knoll
#

TextComponent.fromLegacyText

#

Something like that

umbral ridge
#

Ohh rightt

silver robin
# dull schooner hey, is there a way to change the repair count from an item? without changing th...

I assume there would be a method if the repair count is saved differently in certain mc versions, but that doesnt seem to be the case

Check if ItemMeta is instaceof Repairable, and then use .setRepairCost

https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/Repairable.html

vivid cave
# edgy crystal Hey Guys, i wanna create an API that sends the playerData from my Bungeecord to ...

your solutions:

  • bungee proxy plugin (i don't like it personally cuz it makes you write another plugin from another library, even if it's lightweight)
  • redis (i don't like it personally cuz it synchronises stuff through a database iirc and i consider it as I/O delay even if people will advocate its negligible)
  • rabbitmq/postman/simialr (basically it relies on sockets but i don't like it because you have to keep a broker running seperatly from your plugin)
  • plugin messaging (native to spigot api, but i don't like it because it REQUIRES one player connection on each backhand server to relay between both (one sender, one receiver); which is sometimes bad when trying to relay "player leave" msg)
  • writing your own UDP sockets WITHIN your plugin: FEW CODE, easy to write, easy to understand. The solution i eventually opted for, i can send you code if you like
edgy crystal
vivid cave
#

mkay

#

?paste

undone axleBOT
warm mica
quiet ice
#

Do beware of the properties of UDP though

warm mica
#

And that it is a low level protocol that is prone to bugs when implemented manually. Why suffer when decent solutions already exist?

quiet ice
#

If you are not familiar at all with the TCP/IP stack, use TCP instead

vivid cave
#

no dependency

#

no broker

#

just simple stuff

eternal oxide
#

be aware udp has no error correction

silver robin
hazy parrot
#

also redis is in-memory, its not much of delay

warm mica
#

Just use Redis. You won't have to deal with opening ports and all that crap and it just works

vivid cave
#

redis is overkill

#

imo

silver robin
vivid cave
#

lots of setting up

vivid cave
warm mica
vivid cave
#

as u wish

quiet ice
#

If you use straight-up NIO sockets I'll raise an eyebrow

silver robin
#

I got sucked into the conversation I guess
I wanted to ask if I want to implement custom items (with events on left, right click etc) should I extend ItemStack or create a whole separate abstract class (CustomItem) then subclass it with items?

young knoll
#

Do not extend Bukkit classes

#

(Or interfaces)

quiet ice
#

Extending ItemStack is a big big no-no

sullen marlin
#

why is this coming up so much lately

young knoll
#

Add a pdc value to your item to identify it

quiet ice
#

Since CB already does that with CraftItemStack

young knoll
#

And use that as a key into a map or whatnot

sullen marlin
#

the "do not implement interfaces" warnings apparently needs to be "do not implement interfaces or extend classes"

warm mica
vivid cave
quiet ice
#

I wonder whether it would be possible to publish the spigot-api artifacts on the spigot maven with API classes that should not be extended being final?
Probably would break a few 3rd party projects though (such as glowstone)

eternal night
#

could just annotated everythin and their mother with ApiStatus annotations

#

so intellij screams like crazy when you try to extend

young knoll
#

Might take a while

hard socket
#

.

eternal night
#

good old @ApiStatus.NonExtendable

sullen marlin
worldly ingot
eternal night
quiet ice
#

BukkitRunnable should be nuked too

eternal night
#

idk if you can smack it onto the package level

worldly ingot
#

I made a conclusive list of everything meant to be implemented/extended too šŸ˜…

eternal night
#

every can be implemented until it cannot 5Head

warm mica
#

While we are already at it, we should just repackage it all from org.bukkit go org.spigotmc

vivid cave
#

SignChangeEvent
1 tick after he is out of the GUI.
(i think)
but idk if he didn't change the sign

worldly ingot
#

Damn that's straight facts

sullen marlin
#

what's on the list?

young knoll
#

Is there a tool to annotate everything :p

sullen marlin
#

all I can think of is BukkitRunnable and one of the PDC classes

eternal night
#

Player interface

eternal night
#

for fake players

#

oh right, the world gen

worldly ingot
#

MetadataValue is really the only one I was kinda iffy on but it's still technically extendable API

eternal night
#

conversation API KEKW

worldly ingot
#

Listen

#

It's useable

vivid cave
#

is CraftBukkit the sole impl of Bukkit ?

eternal night
#

glowstone exists

worldly ingot
#

No, Glowstone exists still

eternal night
#

🚤

vivid cave
#

what is that ?

worldly ingot
#

From-scratch server software

sullen marlin
#

MapFont, that's an interesting one

young knoll
#

No that’s a boat emoji

hard socket
worldly ingot
#

I think MapFont is implementable

#

At least imo it should be

vivid cave
worldly ingot
#

No

#

Hence "from-scratch"

vivid cave
#

damn

sullen marlin
#

list looks good though

vivid cave
#

wild

sullen marlin
#

ship it

eternal night
worldly ingot
young knoll
#

Find a tool to annotate every class

#

Go

worldly ingot
#

Shipped

quiet ice
worldly ingot
#

Custom fonts on maps? ;p

dull schooner
quiet ice
worldly ingot
#

It does

#

MinecraftFont

eternal night
#

custom fonts in inventory titles ?

#

if only component support in more places

worldly ingot
#

I'M TRYING

#

JAEIOSUDFYNhakwjsehjcawkefnvawz

sullen marlin
#

mapfont is a class

#

it doesnt actually need to be extended?

eternal night
#

I'll annoy you about it until the end of day choco

young knoll
#

Just one day?

sullen marlin
#

you just setChar for every sprite

young knoll
#

Or all days

worldly ingot
#

Oh it has a setChar() method

#

Didn't even see that

eternal night
#

eyo moderator on spigot suggesting implementing non extendable api class ?!?!?

worldly ingot
#

Lemme just edit that real quick

#

:)))

young knoll
#

Wtfbanned

eternal night
#

omg I keep forgetting about consumer

worldly ingot
#

It's okay

#

You can forget about it again

eternal night
#

lets hope tonights party is good enough for me to forget this eyes_zoom

young knoll
#

I found myself messing with some cb code for a plugin recently

#

And I encountered

#

Guava Function

carmine mica
eternal night
worldly ingot
#

Shoo

#

Go away

eternal night
#

smh machine just coming here to flame

worldly ingot
#

🫳 🫳

wet breach
young knoll
#

No just my IDE telling me to use the java function class

#

LIKE SORRY BUT I CANT

worldly ingot
#

I still need to update my component patch I'm just waiting on some other changes to make their way in first which will inevitably require me to rebuild my patches again anyways

#

So I sit and wait PES3_AngerySitSip

#

Sip on my juicy box

#

Waiting on that too

eternal night
#

I mean

#

keep the limit

#

add component support to scoreboards

#

profit

worldly ingot
#

I DID ALREADY

eternal night
#

See that way, when phoenix screams about a limit on that

#

you can tell him to use the component methods stonks

worldly ingot
#

Now it's incentive

eternal night
#

exactly

#

gotta promote components over legacy text

worldly ingot
#

I wanna promote you to lead cutie PES2_LovePat

young knoll
#

It’s not legacy for the people that still use 1.8

quaint mantle
#

Is there a quick way to know how many food points an ItemStack/Material gives through eating?

eternal night
#

🄰 pepe_hand_heart

worldly ingot
#

Not yet. API to come

young knoll
#

Let me guess

worldly ingot
#

:))

young knoll
#

Enum removal first

worldly ingot
#

YESSIR

eternal night
#

Lets goooo

eternal night
#

marvin gonna die from stress when that fucker hits

worldly ingot
#

Poor guy

quaint mantle
young knoll
#

There’s actually a lot of things I’ve seen that I’ve wanted to expose

#

But then it’s like ā€œOh wait it would be way easier if… shitā€

worldly ingot
#

We should seriously be pushing developers to test the experimental stuff

young knoll
#

Just disable building anything else with buildtools

river oracle
worldly ingot
#

There is now already

#

There's a datapack API

young knoll
#

Will @MinecraftExperimental ever be used again tho? Only Mojang knows that :p

worldly ingot
river oracle
#

I thought it was done

worldly ingot
#

Nah, whole API is component-ified

#

Exception to the chat event

#

That thing's a mess

eternal night
#

yes

#

our impl had to rip it all out

worldly ingot
#

Yeah... I didn't wanna touch it

river oracle
young knoll
#

Would you do it for a Scooby snack

eternal night
#

especially with chat signing

#

mhmmm

worldly ingot
#

I would like to eventually have the chat event support it, but I just didn't have the energy to do it

young knoll
#

Hey we don’t deprecate them

#

Unless…

eternal night
#

šŸ˜

young knoll
#

I saw paper started using @Obsolete

#

Which is nice

eternal night
#

I don't recall a single obsolete annotation šŸ˜…

kind hatch
#

I just want @Since to be added the documentation.

young knoll
#

Uhhh

eternal night
#

deprecated for removal ?

young knoll
#

I think it was on Bukkit.broadcastMessage

worldly ingot
young knoll
#

Or player.sendMessage

river oracle
#

Yeah I had to use paper api for a server I worked on and it's a pain suppressing depreciation

young knoll
#

One of those

worldly ingot
#

And not only that, some blames aren't accurate because of the annotation changes

#

So you'd have to use the Stash history

young knoll
#

Get to work then

worldly ingot
#

not enough benefit

young knoll
#

Chop chop

worldly ingot
#

Doubt it would be merged

#

We just would prefer people use modern API

young knoll
#

But modern api doesn’t work on my 1.8 server :(

eternal night
#

honestly, I can see the benefit ngl

carmine mica
eternal night
#

oh ?

carmine mica
#

gonna change it to Deprecated at some point in the future

#

for CommandSender#sendMessage

eternal night
#

why did my grep not find it

carmine mica
#

@worldly ingot why did you add duplicate component methods to everything in your PR

kind hatch
worldly ingot
#

Maybe your grep was wrong EmbarrasedAsk

eternal night
#

I see

#

it was

carmine mica
#

what's the point of having method(BaseComponent) and method(BaseComponent...)

eternal night
#

I was in the wrong dir

worldly ingot
#

idk. If md wants I can just not do that lol

young knoll
#

Slime is here

#

Run

sullen marlin
carmine mica
#

having the ... method is dumb

#

because you can do this.something(), with no components and that doesn't make sense in a lot of places

young knoll
#

When do we get regex varargs

worldly ingot
#

You could also do this.something(new BaseComponent[0]) and that also doesn't make sense

#

You could argue either way

carmine mica
#

yeah, that's why you don't do that

young knoll
#

Component+++

#

1 or more

carmine mica
#

you do method(BaseComponent, BaseComponent...)

worldly ingot
#

ĀÆ_(惄)_/ĀÆ

carmine mica
#

that pattern is all over for vararg stuff

#

so you can't pass in nothing, or something that doens't make sense

young knoll
#

Huh

#

Makes sense

carmine mica
#

well this is putting aside how annoying it is that BaseComponents has arrays to begin with

worldly ingot
#

Old API

eternal night
#

opens adventure merge PR

river oracle
#

PR your patches

#

Do it

young knoll
#

Paper pushing upstream?

#

What are you drunk

worldly ingot
#

I mean hey, it's pretty early on in your line of patches. Patch is already ready

eternal night
#

eyo owen got PRs in

carmine mica
worldly ingot
#

Stash be silly

eternal night
#

waiting for the day we see gitlab or something 😭

carmine mica
#

not like there are extensions you can write, or other source control systems

eternal night
#

yikes

young knoll
#

What language is it

#

Inb4 php

eternal night
#

atlantis software barely touchable with a stick

young knoll
#

Gitlab would be kinda nice

river oracle
#

Wonder how expensive it would be to setup and use gitlab though

young knoll
#

/shrug

#

Can’t be much different than stash can it?

river oracle
#

ĀÆ_(惄)_/ĀÆ

kind hatch
#

Not that expensive if you are only going to be hosting like one thing.

eternal night
#

I mean, depends on whether you need enterprise support KEKW

kind hatch
#

Bandwidth would be your biggest problem if you want it to be quick.

cloud cipher
#

Just a quick question, does anyone know if its possible to change the order in which tab complete options show up? Right now it's sorted alphabetically and i would prefer if it would Not do that

young knoll
#

Client sorts it afaik

#

So you’re outta luck

cloud cipher
#

whomp whomp

#

i will just cope i guess

sullen marlin
#

it's not so bad in 1.13, but pre-1.13 tab completion in non alphabetical would be confusing af for users

young knoll
#

Oh right there was tab completion before brigadier

cloud cipher
#

i kinda forgot about that

river oracle
young knoll
#

I kinda wiped anything pre 1.13 from my brain

eternal night
#

just don't transition accounts

kind hatch
#

Past that, wouldn't be all that hard to transfer things.

young knoll
#

Are you volunteering

eternal night
#

migrate accounts by hand

river oracle
#

Shadow is suffering looking at BuildTools code rn

kind hatch
#

Facts

young knoll
#

Shh

#

It’s only a bit spaghetti

river oracle
#

Method ()
{

{
Go m_HeadBang

young knoll
#

And MD only has slightly cursed formatting

kind hatch
#

That formatting hurts me.

young knoll
#

Maybe his true calling is C#

#

And he’s coping

river oracle
#

The formatting actually makes it hard to write code

young knoll
#

I mean you can just format it to something else

#

And then format it back later

river oracle
#

That requires rffort

young knoll
kind hatch
#

That's how I currently do it to make it manageable.

#

Just about the only silver lining to it.

young knoll
#

On todays episode of bullying MDs style choices

river oracle
#

The first thing I do when I get home from the airport tomorrow is fucking code

#

I'm literally addicted

#

The first 3 days I seriously couldn't stop thinking about coding

young knoll
#

Do you dream in code

kind hatch
#

Then figure out how to pass in the dark mode to the modals. I'm at a loss here.

river oracle
young knoll
#

Why do the modals not already use it

#

Oh wait they are in the child process aren’t they

kind hatch
#

Yep

young knoll
#

Mmm

river oracle
young knoll
#

I think you can set environment variables with ProcessBuilder

kind hatch
#

Not only that, but FlatLaf doesn't let you just use itself.
You have to use FlatLightLaf or FlatDarkLaf.

quaint mantle
#

I remember having a JS test back in the day. Most of my friends didn't know how to do it but the issue was that obviously the teacher was going to check each test in case we shared/plagiarized code. I figured out that it was not an actual IDE, it was just a text block like pastebin.com so I wrote everything normally and then just removed all "\n" so it was all inside a single line. Then I shared the same line to all my fellows through hastebin.com (back in the day it kept its dark background before the toptal thing) and we basically cheated.
Then the teacher attempted to check but I still don't know why he didn't just copy each line and reformat it online... We kept telling him it might be a bug and he said "if system says you all set then yall set"

kind hatch
young knoll
#

What the plagiarism checker couldn’t handle a single line?

quaint mantle
#

No. The teacher himself had to check if we did plagiarize

young knoll
#

Ah

#

Lul

quaint mantle
#

The system only checks if the code we wrote had the right functions and such

kind hatch
young knoll
#

See our school had a fix for that

#

Fuck you write code on paper

young knoll
quaint mantle
#

🦦

young knoll
#

Idk how system.getEnv works

#

Can’t say I’ve ever used it

#

Version?

#

Oh boy

#

Set the data value to 1

#

Iirc it’s the byte in new ItemStack(material, int, byte)

#

Mhm

kind hatch
young knoll
#

Not really?

#

I’m talking about it using it to pass the selected theme into the child process

#

I’m sure there are other ways to pass data to the child process as well

#

Aside from environment and arguments

kind hatch
#

I'll fuck around with the environment stuff.

jagged sky
#

that's one of the reasons I'm ditching this republic college and going to go to a private one next year

#

(also that we learn XML/Soap instead of JSON/REST)

river oracle
#

Writing java on paper with no shortcuts allowed was one of my most painful highschool experiences

#

And college smh

jagged sky
#

We had to use Eclipse on the machines

#

and the default was the bright theme

#

kekw

river oracle
#

Same

jagged sky
#

So yeah nawe

river oracle
#

Its so archaic

jagged sky
#

I also entered applied software dev.

#

and

#

we legit learn about the 'distribution of fluids' as a fucking class

river oracle
young knoll
#

Now that you mention it idk what java ide they had us use

#

I think it was netbeans

jagged sky
#

and one of the exam questions: For what is pipe cleaning fluid used for? To clean the inside of pipes or the outside of pipes

young knoll
#

Idk I had my own laptop

jagged sky
#

ThinkPad baby

river oracle
#

I'm still in HS smh the worst is still ahead can't wait to take Black Culture in Mississippi In the 1940s class when going for Software Engineering

young knoll
#

I mean I can probably sum that up for you

#

Racism, a lot of it

jagged sky
#

I once had to argue during a defence of a project that I should use my own laptop because I fucked around to make a:
VPN + Driver for a SIM card + SSH server running on windows to connect to a remote WSL system over a 100Km's away

Because it's not fair towards the other students as the PCs provided on the college won't fucking compile the code because it's so borked (the system like windows 7 or something)

jagged sky
#

but it's an average Balkan moment IG

young knoll
#

Sounds like a high quality highschool

river oracle
#

I took my first college class last school year and I wrote one of my entire projects with annotations the professor gave me extra credit lmfao. Legit had @Loop at the top of the class

jagged sky
#

You say you but I saw 2 Hungarian kids holding a 3rd Hungarian kid and slamming his head as a ram to a coffee vending machine so they could get free coffee

young knoll
#

Damn why didn’t I think of that

jagged sky
#

and then for the whole week the floor was sticky due to the sugar being everywhere

young knoll
#

We already had to write full javadocs so why not

young knoll
jagged sky
#

I did write javadocs on C++ code cuz why the fuck not but there's not extra credits

#

(3rd year rn but again ditching it)

river oracle
young knoll
#

Hey

#

Fuck you

#

:)

river oracle
#

Haha

young knoll
#

Not that I had to pay much for college so I can’t complain

jagged sky
#

eh my college was free but I still had to get a job to pay for an apartment and food

young knoll
#

But the poor people that did, F

jagged sky
#

Thankfully spigot legit taught me how to code so now I have a webdev position for 4-5 years already

echo basalt
#

I just make plugins part-time for a living

river oracle
# young knoll Fuck you

I have a friend who'll be a 3rd year in HS next year and will graduate college at the same time as me cuz he's starting college rn xD

#

Its getting out of hand

jagged sky
#

I never managed to sell a plugin, I was scammed most of the time

river oracle
jagged sky
young knoll
#

That’s acceptable

jagged sky
#

Just ruby on rails code and elixir phoenix code

jagged sky
river oracle
young knoll
#

That’s why you get paid before they launch

#

At least partially

jagged sky
#

ĀÆ_(惄)_/ĀÆ

#

Never had good experience with that but oh well

young knoll
#

I made some custom enchants for a server, server lasted like a month but I got my money

#

:p

river oracle
jagged sky
#

yeah I made shitty decisions but I did learn how to code properly, use git, dependency tools like maven etc

young knoll
#

Hey

#

Knowledge is almost as good as money

#

almost

jagged sky
#

ye but I was like 16-17 at that period

#

so, eh

#

welp I don't really earn that much money internationally even now but that's because I'm in a country which is economically meh, so I'm search for oversea jobs

undone axleBOT
jagged sky
#

but proportionally w/ my rent it's around, oof

#

one sec

#

let me get the data online to not be biased

#

it's around 5k euros proportionally ig

#

that's the minimum at least

young knoll
#

For rent?

jagged sky
#

rent is like

#

400 euros a month

young knoll
#

Ah okay

jagged sky
#

i'm talking about proportional income

#

underpaid in the world but more than enough money 'ere to live a normal live, not too extravagant but enough to buy nice shit when I want nice shit

#

also getting a new apartment for my brother to move in w/ me so he can focus on college

#

ĀÆ_(惄)_/ĀÆ

young knoll
#

€5k/month sounds decent

#

I think

jagged sky
#

(proportionally)

#

it's around 1.6k a month currently

young knoll
#

I see

jagged sky
#

but the average monthly wage here is like

echo basalt
#

Hmm I'm struggling to name this one java class

jagged sky
#

400 euros?

young knoll
#

Name it George

echo basalt
#

hm no

young knoll
#

Welp I’m all out of ideas

echo basalt
#

I have this complex network system and I'm thinking of making a "network type" setting where if you set it as single-instance it skips all of that and just acts like a basic plugin

#

And if you set it as multi-instance it does crazy communication

jagged sky
#

ConnectionManager

#

idfk

echo basalt
#

SkyblockNetworkStructure maybe

jagged sky
#

doesit need the skyblock in it though?

#

can't you just put it in the package path?

echo basalt
#

I like to prefix class names

young knoll
#

NetworkType seems fine

#

NetworkingType

#

Idk

echo basalt
#

NetworkType could refer to as like TCP/UDP

#

So the prefix helps

jagged sky
#

lookiing at it atm

hazy parrot
#

tbh i've never seen shorter and more messed up code lol

jagged sky
#

does cancel just terminate the future without actually waiting for the response? @quaint mantle ?

hazy parrot
#

yes

jagged sky
#

I mean if you only see true that means it should only say tru instead of the Future ended as you didn't close it gracefully

#

but idfk

hazy parrot
#

don't take it personal lol

jagged sky
#

idk if it messes it up because it's in the same class

#

can you try to make a difference class and the initialize it?

#

the code above is an anonymous function so it might behave because of that differerntly idk

undone axleBOT
dull schooner
#

hey, is there a way to increase max stack size only in a certain slot of an inventory?

jagged sky
#

Hm maybe the executor service needs to be bound by the main process?

ivory sleet
#

You should test this properly to begin with

#

That test code there is not reliable

dull schooner
ivory sleet
#

Usually you wanna try to properly dispatch everything at the same time, so I’d say use a cyclicbarrier or semaphore or phaser

#

(Maybe just a countdown latch)

echo basalt
#

Countdown latches are goated

ivory sleet
#

Yeah fr

echo basalt
#

Just make them with a size of 1

#

Much easier to understand than locks

ivory sleet
#

Well locks are technically more reusable than a single latch, but ye

jagged sky
#

can you remove the shutdown on the executor service?

#

@quaint mantle

ivory sleet
#

That shouldn’t matter

jagged sky
#

nvm I'm stuck on the while loop now (which is progress)

#

but I think that's the issue

#

that it just kills all of it without gracefully handling it

ivory sleet
#

Since it just closes the service for any new tasks to be submitted

#

No

jagged sky
#

@quaint mantle

import java.lang.Runnable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Main implements Runnable {
    private static final ExecutorService exe = Executors.newSingleThreadExecutor();

    public static void main(String[] args) {
        new Main();
    }


    private Future<?> f;

    public Main() {
        start();
        stop();
    }

    private void start() {

        f = exe.submit(this);
    }

    private void stop() {
        System.out.println("Calling an interrupt");
        System.out.println(f.cancel(true));
        exe.shutdown();
    }

    @Override
    public void run() {
        try {
            System.out.println("And this is something");
            while (!Thread.currentThread().isInterrupted()) {
                System.out.println("Still not interrupted!");
            };
        } finally {
            System.out.println("Future<?> Ended");
        }
    }
}
``` this only calls the ended rarely, that means that the shutdown kills the process before it goes to the finally block
#

it can give

#

or

#

but also this

#

same code just it happens by luck that the process lives long enough to get to the interrupt handler

ivory sleet
#

Yes because you guys aren’t really testing it properly

jagged sky
#

Ye I did say this at the start that it's just the process is killed to fast

ivory sleet
#

And like wtf why isInterrupted() infinite loop if u have a try finally

jagged sky
#

to be there until the statement is changed probably

#

I gave you the output above, it's the exact same code, you're killing it too fast

#

remove the shutdown and it should show the interrupt, it won't end the main thread but it will show the interrupt

#

probably because the executor is in the instance of the same class you're trying to run

ivory sleet
#

No the shutdown literally doesn’t matter

jagged sky
#

it guarantees that it will get the interruption memo with the current code

ivory sleet
#

Zastrix it doesn’t matter

#

All shutdown does is to prevent new tasks from being submitted

jagged sky
#

Did you run the code? I did, and it behaves vastly differently

ivory sleet
#

You’d have to have some sort of loop or wait method to await the termination of the main thread

jagged sky
#

without the exe.shutdown it will always get the finally block memo, while with it, it can skip it (with the current implemention)

#

but eh, I don't write in Java or similar languages cause I don't want to have headaches about threads

#

ĀÆ_(惄)_/ĀÆ

ivory sleet
#

Instead of just removing shutdown, use awaitTermination

#

That awaits submitted tasks to finish

echo basalt
#

fuck you copilot

worldly ingot
#

Not very nice

#

This is how the AI revolution starts

#

Insults

echo basalt
#

copilot refuses to work if I cuss in a comment

ivory sleet
#

Try this instead, have ur executor service, submit this type of code
sout(ā€œsubmittingā€)
var f = submit(
try {
for (int i =0;true;i++){
sout(i);
}
} catch (InterruptedException e) {
sout(ā€œinterruptedā€);
}
)

thread.sleep(1000)
f.cancel(true);
f.get(); //catch cancel exception also

and then just future.get() to await it

#

I think

#

On my phone but yeah

#

@quaint mantle

#

In a proper test we would use a countdownlatch to remove even more indeterminacy

#

strength can be null

young knoll
#

It will be

ivory sleet
#

so effectively you might call null.getId()

#

and whoops

young knoll
#

The name is INCREASE_DAMAGE

#

Because yes

#

Use getByKey and a namespaced key

#

NamespacedKey.minecraft(ā€œstrengthā€)

#

Pretty sure that’s for the key

ivory sleet
#

Yes but the variable name is increase damage

young knoll
#

You’d have to look at the rest of the class

#

getByName for anything generally uses weird old names

#

And getByKey should be preferred

ivory sleet
#

Ah

young knoll
#

That’s not how it registers it

ivory sleet
#

Anyway DirectPlan, problem still is that getByName or getByKey can return null, so usually u wanna comfort that out by a null check

young knoll
#

Notice that it’s an abstract class, and getName is an abstract method

#

And the fields refer to another class, PotionEffectTypeWrapper

#

I believe this also involves a craftbukkit impl

#

Yep there it is

carmine mica
#

well sure there is

#

just iterate over them, get the name and key

young knoll
#

And populate them into a map

quaint mantle
#

Anyone know what im doing wrong calculating the x and z for a chunk section there is a couple blocks that are shifted a few blocks away


                val relativeX = abs(it.first.x % 16)
                val relativeY = abs(it.first.y % 16)
                val relativeZ = abs(it.first.z % 16)

                chunkSection.set(relativeX, relativeY, relativeZ, Block.BLOCK_STATE_REGISTRY.getId(it.second))
carmine mica
#

well yeah, put them in a map, but you fill the map by iterating over them instead of hardcoding them

young knoll
#

Just do it at startup with a nice loop

#

Also covers future additions

pseudo hazel
#

nice I wish statistics had this feature too

#

unless im blind again

carmine mica
#

Statistic has a getKey and name(), but they are incorrect for like 5 of them

quaint mantle
echo basalt
#

I'd use the bitwise AND

#

And not abs it

#

But you already have the chunk section position so you can just subtract

quaint mantle
echo basalt
#

&

#

single

echo basalt
quaint mantle
#

Do you know how to do bitwise it in kotlin

pseudo hazel
#

why bother, just do it the normal way

quaint mantle
#

& doesn't work in kotlin

pseudo hazel
#

assuming you mean you have a block position in the world and wanna know what block inside a chunk that is

#

use %

quaint mantle
#

Thats what I was using before

pseudo hazel
#

subtract the chunks position from your total position

#

which would leave you with a position relative to the chunks origin

quaint mantle
#

Wouldn't that leave a very small number

pseudo hazel
quaint mantle
#

wwhat about y?

pseudo hazel
#

idk

#

idk what a chunk section is

quaint mantle
#

16x16

#

x16

#

instead of 16x256x16

pseudo hazel
#

well

#

then also multiply by 16

#

seems trivial to me

dull schooner
#
 @EventHandler
    public void acquiringTrade(VillagerAcquireTradeEvent event) {
        MerchantRecipe recipe = event.getRecipe();
        if(recipe.getResult().getType() == Material.ENCHANTED_BOOK) {
            Random random = new Random();
            //if (random.nextInt(2) == 1) {// fifty/fifty
                //Enchantment
                EnchantUtils enchantUtils = new EnchantUtils();
                ItemStack book = recipe.getResult();
                EnchantmentStorageMeta enchantmentStorageMeta = (EnchantmentStorageMeta) book.getItemMeta();
                Map<Enchantment, Integer> enchantments = enchantmentStorageMeta.getStoredEnchants();
                int oldLevel = 0;
                int newLevel = 0;
                System.out.println("book before: "+EnchantingItemsOrBooks.getEnchants(book));
                for (Enchantment enchantment : enchantments.keySet()) {
                    String enchantName = enchantment.getKey().toString().replace("minecraft:", "");
                    oldLevel = enchantments.get(enchantment);
                    newLevel = Math.min(oldLevel * 2, enchantUtils.ENCHANTS.get(enchantName).getCap());
                    EnchantingItemsOrBooks.addEnchant(book, enchantment, newLevel);
                }
                EnchantingItemsOrBooks.formatEnchantLoreText(book);
                System.out.println("book after: "+EnchantingItemsOrBooks.getEnchants(book));
recipe.setIngredients(ingredients);
                System.out.println("result: "+EnchantingItemsOrBooks.getEnchants(recipe.getResult()));
                event.setRecipe(recipe);
_______________________________________________________________________________________
[22:42:16 INFO]: [pluginzin] [STDOUT] book before: {Enchantment[minecraft:piercing, PIERCING]=1}
[22:42:16 INFO]: [pluginzin] [STDOUT] book after: {Enchantment[minecraft:piercing, PIERCING]=2}
[22:42:16 INFO]: [pluginzin] [STDOUT] result: {Enchantment[minecraft:piercing, PIERCING]=2}
#

what's wrong?

#

i really dont know why

#

both event and recipe doesnt have a .setResult() method, im really confused

young knoll
#

Make a new recipe

#

And setRecipe

dull schooner
#

why changing the original doesnt work?

young knoll
#

It returns a copy

dull schooner
#

oh ok

#

but what bothers me is that the emeralds are changed, but the book isnt

young knoll
#

Because you used setIngredients

#

But as you have said there is no setResult

rigid otter
#

Hi do you think which is faster? (To get a list of player names)

return Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList());
List<String> list = new ArrayList<>();
for (Player player : Bukkit.getOnlinePlayers()) {
    list.add(player.getName());
}
return list;
sullen marlin
#

Second

rigid otter
#

Ahh, I see. Thank you

sullen marlin
#

Doubt it matters though

young knoll
#

Streams are fairly optimized in modern jvms

dull schooner
young knoll
#

Unless this is an extremely hot piece of code I doubt it matters

rigid otter
#

Do you think this even faster or not?

Collection<? extends Player> players = Bukkit.getOnlinePlayers();
List<String> list = new ArrayList<>(players.size());
for (Player player : players) {
    list.add(player.getName());
}
return list;
placid moss
#

its like no difference

#

just use whatever you want

rigid otter
#

the initial capacity of the list

placid moss
#

i mean the amount of resources minecraft uses

#

is like so high compared to these tiny things

rigid otter
#

Yeah

placid moss
#

that you will notice nothing even if you call it like 1000 times per second

rigid otter
#

Huhha I see

young knoll
#

Yes technically pre sizing the list is faster

#

But these are basically micro optimizations

dull schooner
#

i want to reset the villager trades when someone energizes his workstation, but idk where to start

young knoll
#

Resetting recipes should be easy enough

#

Not sure about the workstation part

dull schooner
#

yep, i just need to get the Merchant Recipes

#

BlockRedstoneEvent should be called when something is energized, i think

#

but from the block i cant find the villager, or can i

young knoll
#

I don’t see anything in the api for that, no

#

But I could be missing something

dull schooner
#

maybe i limit for a 1 block distance

#

if there's a villager with the profession equivalent to the workstation, i reset it

#

another method would be allowing pistons to move all workstations, but idk how to do that either šŸ˜…

young knoll
#

We don’t talk about that

dull schooner
#

complicated to do too?

young knoll
#

Do you like manipulating bytecode

dull schooner
#

no?

#

i mean, i dont even know what that means

young knoll
#

That should probably tell you the answer then :p

dull schooner
#

i can check if a piston is energized, see if there's a workstation where the piston is facing, set the type of the workstation to something that can be moved, like air, check if there's nothing on the end side, and tp the ghost block with the workstation texture while the air block is beeing moved, than i place it on the end

#

the tp thing i dont know how to do, maybe a custom event?

keen orchid
#

Hey! I'm currently looking for a dev that can work on some lightweight/medium level plugins! (I'm recreating a server and it would be GREATLY appreciated if anyone could help!) Shoot me a DM, thanks!

young knoll
#

?services

undone axleBOT
keen orchid
#

ah ok

distant ridge
#

I have an economy plugin that hooks into vault but other plugins are loading before mine so they think there's no economy

#

Anyone know how I can fix that?

carmine nacelle
carmine nacelle
echo basalt
#

oh god not the bee

distant ridge
#

My plugin is acting as Essentials would

carmine nacelle
echo basalt
#

yes

carmine nacelle
#

me too..

distant ridge
#

I was able to fix it by doing a loadbefore: in my plugin.yml

carmine nacelle
#

finally got my otehr one updated fully, now this ones having issues

young knoll
#

loadbefore for every plugin that requires economy sounds… painful

#

But idk the correct way to go about that

echo basalt
#

Probably depend on Vault and inject

distant ridge
#

its not every plugin, just the ones that disable themsleves when they can't find an economy through vault on start up

#

which isn't an ideal way to handle that anyway

echo basalt
#

I'd probably load before essentials and inject a dummy eco

distant ridge
#

my plugin is an essentials replacement so essentials wouldn't be there

young knoll
#

Well do you register the recipe at startup

sullen marlin
#

Sounds like your spigot isn't Mojang mapped

carmine nacelle
#

😮 is that THE md_5

#

ayo

young knoll
#

Because obviously all recipes are gone when the server shuts down

echo basalt
sullen marlin
#

Wdym created before server startup

young knoll
#

It’s possible the item data has somehow changed through saving and loading?

sullen marlin
#

Is the recipe added each time the server starts

young knoll
#

I don’t see why it would tho

sullen marlin
young knoll
#

Oof

sullen marlin
#

Int will load fine but it's saved back as a short

young knoll
#

I’ve never tried it with heads but I imagine they might be particularly volatile due to how they work

carmine nacelle
#

What's the new method of registering custom entities?

public class CustomEntityRegistry {

    public static EntityType<Bee> CUSTOM_BEE_TYPE = registerCustomBee("custom_bee", EntityType.Builder.of(CustomBee::new, MobCategory.MISC).sized(0.5f, 0.5f));

    public static <T extends Entity> EntityType registerCustomBee(String id, EntityType.Builder type) {
        return (EntityType) Registry.register(Registry.ENTITY_TYPE, id, (EntityType<T>) type.build(id));
    }
}

This is giving me "cannot resolve symbol ENTITY_TYPE now, used to work in 1.19

young knoll
#

Im surprised that worked on 1.19

#

Stupid registry freezing

carmine nacelle
#

(dont know if it worked, but it didnt error LMAO)

#

I had issues with my custom bees despawning/changing to normal bees

young knoll
#

It shouldn’t be any different

#

Unless the registry name changed from ENTITY_TYPE

carmine nacelle
#

these are the new options

#

put java after the ``````

distant ridge
#
234```
neon nymph
#

Hello! I can't seem to use BuildTools to build me 1.20.1, 1.20, or even the latest stable 1.19.4 for that matter. Where can I seek support for this? Here is the log file: https://pastebin.com/fztWGL2v

distant ridge
carmine nacelle
#

try again

#

lol

#

no spaces between the ticks and java

#

screenshot ur message and send the screenshot

carmine nacelle
#
Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R1.CraftWorld cannot be cast to class net.minecraft.world.level.World (org.bukkit.craftbukkit.v1_20_R1.CraftWorld and net.minecraft.world.level.World are in unnamed module of loader java.net.URLClassLoader @1ed6993a)
        at com.squallz.cadiabees.objects.CustomBee.<init>(CustomBee.java:20) ~[?:?]
        at com.squallz.cadiabees.managers.BeeManager.spawnBee(BeeManager.java:46) ~[?:?]
    public CustomBee(Location location, String beeName, Boolean isBaby) {
        super(EntityType.BEE, ((Level) location.getWorld()).getWorld().getHandle());
        this.setCanPickUpLoot(false);
        this.setPos(location.getX(), location.getY(), location.getZ());
        getBukkitEntity().setCustomName(ColorUtil.color(beeName));
        getBukkitEntity().setCustomNameVisible(true);
        getBukkitEntity().setPersistent(true);
        getBukkitEntity().setGlowing(true);
        if(isBaby) {
            getBukkitEntityBee().setBaby();
        }
    }

(lines 19-30)

vital yacht
#

```java
Your code here
```

carmine nacelle
umbral ridge
#

In the client, if you press ESC while in the game and go to Advancements, why is there a black box saying "There doesn't seem to be anything here..." what's causing that

kind hatch
#

It means you haven't unlocked the root advancement for any category.

umbral ridge
#

Ohh

#

right yeah I see now, thanks lol

carmine nacelle
#

So...why are beehives no longer in spigot 1.20.1 mojang mappings?

umbral ridge
carmine nacelle
#
import org.bukkit.*;
import org.bukkit.Material;
import org.bukkit.block.Block;
#

these are my bukkit imports.

remote swallow
#

do you have vault api

carmine nacelle
remote swallow
#

yeah, do you have it as a dep in pom

carmine nacelle
#

yeah but what would that change?

buoyant viper
#

oh, does Vault depend on an older Spigot api

remote swallow
#

vault have 1.14 bukkit api as a transitive dep

buoyant viper
#

pre bees

umbral ridge
#

I'm using spigot 1.20.1 api and I see BEEHIVE

carmine nacelle
#

wait, this worked fine before though..?

#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>
remote swallow
#

thats correct

umbral ridge
#

download the shaded version of an API

remote swallow
#

that doesnt matter

carmine nacelle
#

why..?

remote swallow
#

its vault

#

add this in vaults dependency tags

<exclusions>
    <exclusion>
        <artifactId>org.bukkit</artifactId>
        <groupId>bukkit</groupId>
    </exclusion>
</exclusions>
umbral ridge
#

thank god I don't have these problems lol, I'm in eclipse

remote swallow
umbral ridge
remote swallow
#

it has a transitive dependecy of 1.14 bukkit api

carmine nacelle
#
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>org.bukkit</artifactId>
                    <groupId>bukkit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
remote swallow
#

ah, bukkit doesnt use that

#

one sec

#
         <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>org.bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
carmine nacelle
remote swallow
#

use the first thing and reload maven

carmine nacelle
#

Material.BEEHIVE works fine in another project using mojang mappings in vault, without the exclusions tag

#

i think somethings just broken in my project

remote swallow
#

does it work if you manually type beehive

carmine nacelle
#

Sound.BLOCK_BEEHIVE_EXIT this also doesnt work

#

its like the project is specifically hating beehives.

remote swallow
#

no clue then, thats about the extent of my maven knowledge

carmine nacelle
#

damn

buoyant viper
#

u know who knows maven

#

@tender shard get over here

umbral ridge
#

You could do Material.valueOf("BEEHIVE") xD

carmine nacelle
#

nooo

buoyant viper
#

just use reflection to access BeeHive classes

umbral ridge
#

yes

carmine nacelle
#

TileEntityBeehive, BEEHIVE material, hive sounds, honey particles ALL BROKEN

umbral ridge
#

xD

carmine nacelle
#

this project just HATES bees

umbral ridge
#

are you for sure using 1.20.1

#

or the api with the bees in it

#

1.15+

carmine nacelle
remote swallow
#

huh

#

hastebins ssl cert expired

umbral ridge
#

reported

#

hacker

#

xD

carmine nacelle
#

works for me

umbral ridge
#

Yeah idk much about maven. how far are you with the project? create another one and copy&paste the code in the new one?

#

maybe that'll fix it

carmine nacelle
#

just a little invested.

umbral ridge
#

Hm

carmine nacelle
#

my project has a bee allergy..

umbral ridge
#

.... Material.valueOf("BEEHIVE")

#

xd

carmine nacelle
#

n o

echo basalt
#

bee allergy

umbral ridge
#

easy fix

echo basalt
#

rhymes with ptsd

carmine nacelle
#

does it

#

i have a bee allergy and even im not this fussy

echo basalt
#

p, t, d, are all words that rhyme with bee, not hard to see

carmine nacelle
#

it started complaining about this after I removed my 1.19 dependency

#

cause previously i accidentally left the 1.19 in with the 1.20.1

#

after removing 1.19 it started doing this.

wraith dragon
#

can anyone help me figure out how to spawn my custom mob using a custom pattern? for example spawning a custom zombie using 4 dirt blocks and a pumpkin head and all placed in the same manner as if you were making an iron golem

echo basalt
#

uhh multiblock

#

p a i n

umbral ridge
echo basalt
#

I had a multiblock util somewhere

wraith dragon
echo basalt
#

Feel free to nuke all the worldedit stuff

carmine nacelle
#

@echo basalt any idea why maven is being a hoe

echo basalt
#

You'll also need ChunkPosition which is just a basic class

#

that goes a little like this

echo basalt
umbral ridge
carmine nacelle
#

at a loss rn

wraith dragon
#

oh

#

no embed

#

bruh

echo basalt
#

yeah that vid's just basically telling you to hardcode shit

neon nymph
#

Hello! I'm fairly new to NMS, and I'm trying to create a custom NPC. I think I've managed to create one and now I have an EntityPlayer object, now I think I just have to teleport it to my location. I tried EntityPlayer#teleportTo(CraftWorld, Position) but I get an Illegal Entity Teleport Exception. Can anyone guide me how I could successfully spawn in and teleport the EntityPlayer to my location?

echo basalt
#

I'd make a structure and see if it matches

echo basalt
#

although my multiblock structure system isn't the best

echo basalt
#

I remember redempt had one

wraith dragon
echo basalt
#

somewhat yeah

echo basalt
#

The "easy" annoying way is to check each block manually

#

The proper way is to make a class that represents a structure and implementing checks

wraith dragon
#

thanks for the help bro

#

šŸ™

carmine nacelle
#

but my other project is also using the exact same dependency and it doesnt do this

remote swallow
#

put ur spigot dep at the top of the list and add the exclusion to the vault api

echo basalt
#

damn I just found out that chunk snapshots are easier to create than I thought

#

I was looking at the impl and it's just a bunch of array copies

carmine nacelle
# remote swallow put ur spigot dep at the top of the list and add the exclusion to the vault api
 <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>org.bukkit</artifactId>
                    <groupId>bukkit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.squallz</groupId>
            <artifactId>CadiaCore</artifactId>
            <version>2.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>
#

its still trolling me

remote swallow
#

thats at the bottom

#

spigot dep at the top

carmine nacelle
#

OH

#

nah..still nothing :/

#

one of these things is not like the other..

umbral ridge
#

With wifi

#

šŸ˜‚

carmine nacelle
#

ur missing the best one..

buoyant viper
#

yeah, who tf would look that one up

carmine nacelle
#

CHILD CUSTODY

umbral ridge
#

Help please my minecraft server is shutting down my neighbour's wifi

carmine nacelle
#

my minecraft server is making me lose custody of my child

buoyant viper
carmine nacelle
#

happens

buoyant viper
#

i told her to get over it and install EssentialsX for me

carmine nacelle
#

lmao

#

bro

#

im gonna lose it

#

WHY THIS NO WORK

echo basalt
#

average maven/gradle issu

umbral ridge
#

Material.valueOf(schnitzel )

carmine nacelle
#

can I delete all my external libraries and redownload them??

umbral ridge
#

schnitzel can fix it

#

All hail to

buoyant viper
#

Heil Schnitzel

carmine nacelle
#
    <dependencies>
        <!--This adds the Spigot API artifact to the build -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.20.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>5.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
#

pom from my other plugin, WORKS FINE HERE!!

buoyant viper
#

is spigot above vault in your problematic project too?

carmine nacelle
#

yes

#

šŸ¤”

#

ones in onedrive..?

#

wtf

#

invalidated caches, checked ALL options, restarted and nothing

umbral ridge
#

what if you go back to 1.19 api?

#

then it works?

#

if it does then it's the jar problem. BEEHIVE is a part of spigot api jar

carmine nacelle
#

FINALLYYYY JESUS CHRIST

umbral ridge
#

what was it

carmine nacelle
#

moved to desktop, deleted pom.xml and .git folder, re-imported to idea, re-imported the project, made a new pom.xml and pasted in my old pom.xml contents

#

then it did something

#

moved project back to original location..works fine.

umbral ridge
#

huh

carmine nacelle
#

yep

umbral ridge
#

I would love to use IntelliJ but it's all so much work, a bunch of xml files.. I don't even have to worry about that in Eclipse

remote swallow
#

== for enums

carmine nacelle
#

now im getting this,

public class CustomBee extends Bee {
    private CraftBee bukkitEntity;


    public CustomBee(Location location, String beeName, Boolean isBaby) {
        super(EntityType.BEE, ((CraftWorld) location.getWorld()).getHandle());
        this.getBukkitEntityBee().setCanPickupItems(false);
        this.setPos(location.getX(), location.getY(), location.getZ());
        getBukkitEntity().setCustomName(ColorUtil.color(beeName));
        getBukkitEntity().setCustomNameVisible(true);
        getBukkitEntity().setPersistent(true);
        getBukkitEntity().setGlowing(true);
        if(isBaby) {
            getBukkitEntityBee().setBaby();
        }
    }
#

any ideas :/

sullen marlin
#

Why is any of this nms?

carmine nacelle
#

I cant get this super to work right.

carmine nacelle
#

I believe the nms one gives more options...?

shadow night
#

All instances of a class have something like an ID, right? Something like org.bukkit.inventory.ItemStack@abc123d

hazy parrot
shadow night
#

I remember I've used some kind of method to get the slot an ItemStack is in, I think it was something like first()? Would that apply to there so I only get the exact ItemStack I need?

#

(It was copilot so Idk lol)

thin isle
#

where do i get 1.19 / 1.20 craftbukkit maven repository

remote swallow
#

it doesnt exist

#

you run buildtools for it

thin isle
#

cant i use it with maven

remote swallow
#

you can

thin isle
#

how?

remote swallow
#

run buildtools

#

?bt

undone axleBOT
thin isle
#

yeah i will get a jar but idk how to connect with maven

remote swallow
#

you dont need to to anything else

#

it adds the jars to your maven local

thin isle
#

Then I will need a dependency?

remote swallow
#

run buildtools, add the correct deps and reload maven (if on ij)

#

remove the -api from the group id

thin isle
#

ok i will try

remote swallow
#

its all explained on

#

?nms

silver robin
# silver robin I got sucked into the conversation I guess I wanted to ask if I want to implemen...

so apparently my question from yesterday got a lot of answers,
I'm wondering why is it not preferred to extend bukkit classes?
apparently Slimefun does it https://github.com/Slimefun/Slimefun4/blob/master/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java#L44
But on the other hand I've seen some plugins which have some items (for example custom enchantment books) which don't interact with ItemStack in such way

remote swallow
#

slimefun does it but you never should, slimefun shouldnt do it either

#

bukkit api classes should only ever be implemented/extended by server software, not plugins or plugin apis

ivory sleet
#

Yeah unless stated its fine, don’t implement those interfaces and classes

patent quarry
#

Hello everyone, I search a way to cancel Horn interactions, so my first idea was to cancel PlayerInteractEvent but it seems not working, the horn still play its sound and still receive a cooldown.

Has anyone by chance ever tried to cancel the horns interactions ?

ivory sleet
#

It should work no?

silver robin
#

alright, thanks for the response earlier
my guess is I'll have to stick with an abstract base class for customitem and then extend it too, and have a method to get an ItemStack from my customitem

patent quarry
# ivory sleet It should work no?

Okay after more test, it works for the other players BUT the player who interacted with the Horn still receive the sound and cooldown, I think its something client side

umbral ridge
patent quarry
umbral ridge
#

You'd need to send a custom packet to the player's client to cancel the sound, that's how I'd do it

ivory sleet
#

Using sth like the adapter design pattern is way better

stable dawn
#

Is there anyway to open a horse inventory for a player?
Tried with the normal Player.openInventory() but i get Unsupported custom inventory size 2

silver robin
# ivory sleet Using sth like the adapter design pattern is way better

I was thinking of having one central event listener class (for player interact events such as left and right clicks), in which I would get the item in player's hand, and if it's a custom item (i.e. has some sort of "ability"), get the function that this item has implemented and call it, also passing the event. However, the player.getInventory().getItemInMainHand() returns an ItemStack, while the example onRightClickAir event listener is registered in a class SomeCustomItem which represents that item. Since type casting is obviously not possible, how would I get my way to it?

silver robin
ivory sleet
quaint mantle
#

In a ServerBoundPlayerDigThingy packet is there a way to tell if they break a block because it has the action as FINISHED_DIGGING when it breaks but when u instabreak the block with haste / efficiency it only sends the start digging thing

thin isle
#

how can i make org.bukkit.player to net.minecraft.world.entity

quaint mantle
#

((CraftPlayer) player)

remote swallow
#

((CraftPlayer) player).getHandle will return you an EntityPlayer

thin isle
#

How can I register a new entity?

short raptor
#

What's the name of that really loud and long level up sound that plays after you kill the enderdragon

#

Not the one of the enderdragon decaying but the dun dun duuuuuuuuuuun one

#

I can't find the name for the life of me

silent steeple
#

how 2 block pdc?

eternal oxide
#

?chunkpdc

#

shoudl be a link by now 😦

umbral ridge
short raptor
#

Maybe I'm imagining this sound and it isn't even real

umbral ridge
#

hmm

short raptor
#

OH

#

its achievement sound

umbral ridge
#

oh the xp orbs?

#

after defeating the enemies in the raid in the village

#

Im not sure

#

Its also advancement sound

short raptor
#

ui.toast.challenge_complete is the one I was after

umbral ridge
#

minecraft:ui.toast.challenge_complete ?

short raptor
#

YEP

#

We found it at the same time lol

umbral ridge
thin isle
#

How can I register a new custom mob

tender shard
icy beacon
undone axleBOT
silver robin
remote swallow
#

tag the block with a byte, lowest value you can store

warm mica
#

(or a boolean)

silver robin
remote swallow
#

its a library that uses the chunks pdc to store data to blocks

umbral ridge
#

But is it persistent through reboots/reloads?

eternal night
#

yes

umbral ridge
#

that's perfect

eternal night
#

it just gives you a fancy wrapper for a child element in the chunks PDC of the block

#

for block 3/10/3, chunk 0/0 would have a PDC entry with a key similar to like, "plugin:3-10-3" and a value of the PDC you recieve from the library

#

if that makes sense

umbral ridge
#

I could use it it to detect which blocks player have placed right?

eternal night
#

yea if you mark all player placed ones with a PDC entry

umbral ridge
#

Would that be okay for performance?

#

Eg. 10000 blocks?

#

It doesn't affect chunk loading right

eternal night
#

well

#

it has to load that data when it loads the chunk

umbral ridge
#

But it is better than saving all the block locations to yml/json?

eternal night
#

It is 100% better than a single file yml

umbral ridge
#

Okay perfect

remote swallow
#

does github have anyway (not using the app) for me to sync branches, eg i push something to master and i want to also merge it onto other branches, bc the website is fucking shite

eternal night
#

there are probably some github actions for that

#

not that that is always safe to do anyway, the changes might conflict obvs

remote swallow
#

just found the most hidden thing in intellijs git thing to merge it

eternal night
#

the fuck has intellij to do with auto merging branches KEKW

remote swallow
#

i didnt wanna auto merge

#

i just wanted to merge branches

#

and for some fuckin reason it isnt on the website

eternal night
#

I mean

#

that would be a pull request KEKW

remote swallow
#

not necessarily

#

like if i have 2 feature banches i havent touched but need to merge a commit i had on master to

#

knowing it wouldnt break anything

eternal night
#

you'd open a PR from master to the feature branches ?

remote swallow
#

why open a pr when i can just merge

eternal night
#

I-

#

you were asking for a way to do that on github ? KEKW

#

Or you could just, have PRs open for the feature branch

#

and click the "update branch" button which does a rebase

remote swallow
#

i hadnt gotten the prs open yet

remote swallow
eternal night
#

yea I mean obviously lol