#help-development

1 messages · Page 1195 of 1

chrome beacon
#

Sounds annoying

#

What if I don't want to update for example

#

or if it doesn't auto update then what if I want to

blazing ocean
#

the launcher was gonna be for minecraft events where players are usually not the smartest and usually only need to launch once

#

just a minimal thing

chrome beacon
#

bat file:

#

or sh for unix systems

#

curl/wget the prism launcher and then run it's CLI

ebon topaz
#
package me.carillon.foody.food;

import me.carillon.foody.ItemBuilder;
import me.carillon.foody.RecipeBuilder;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;

public class chicken_sandwich {
    ItemStack item = new ItemBuilder(Material.BREAD, 1)
            .setDisplayName("Chicken Sandwich")
            .setCustomModelData(1)
            .build();

    ShapedRecipe recipe = new RecipeBuilder("chicken_sandwich", item)
            .shape("B", "C", "B")
            .setIngredient('B', Material.BREAD)
            .setIngredient('C', Material.COOKED_CHICKEN)
            .build();
}

this is what my class is looking like

glad prawn
#

ChickenSandwich pls

chrome beacon
#

^^

#

The class name should be PascalCase

blazing ocean
young knoll
#

No im placing an order

glad prawn
#

Lol

young knoll
#

One ChickenSandwich please

blazing ocean
#

which

#

i love sandwhiches

ebon topaz
#

So a food item stack you can set the nutrition right?

chrome beacon
#

yes

ebon topaz
#

Cool

ebon topaz
chrome beacon
#

Yeah you'll need to register that recipe

ebon topaz
#

Can I register the recipe inside the recipe builder I made or in the class?

chrome beacon
#

The build method shouldn't do that

#

It should only build the object

#

Same goes for the constructor of an object

#

It should ideally only create the object

#

Not register it anywhere

#

Add a register method to your ChickenSandwich class

ebon topaz
#

Do I need to call this from my main class?

chrome beacon
#

yes

ebon topaz
#

What happens when I have like 20 of these?

chrome beacon
#

Yeah having one class per item probably isn't the best idea

#

You can have one class called Items

#

And then register everything there

ebon topaz
#

I just felt like having a really long file would be annoying to find a item if I want to edit something so I thought having multiple classes would be better

chrome beacon
#

You can do that if you want

#

but that'd probably be more annoying to deal with

ebon topaz
#

Ok maybe I’ll just do one class for all the items then

chrome beacon
#

It's up to you 🤷‍♂️

#

if you're looking for a specific item you can always use ctrl + f to search

tawny furnace
#

I have a strange problem. I am writing a plugin for an enchantment for a trident that will attract a victim to the attacking player when the trident hits the victim. I wrote to the mechanic, but ran into a big problem. The problem is that if the players are in survival mode, the enchantment does not work at all. For some reason, it does not attract at all. If both are creative, then it attracts very strongly. If one has creative, and one is survival, then it attracts as it should. But it should attract as it should if both are survival. I do not know what to do and what it depends on

#

@EventHandler
public void onHit(ProjectileHitEvent e) {
if (e.getEntity() instanceof Trident trident) {
if (e.getHitEntity() instanceof Player victim) {
Player shooter = (Player) trident.getShooter();
if (shooter != null) {
ItemStack item = shooter.getInventory().getItemInMainHand();
if (item.getEnchantments().containsKey(this)) {
double speedMultiplier = 6.0;
Vector direction = shooter.getLocation().toVector().subtract(victim.getLocation().toVector());
if (direction.length() != 0.0) {
Vector velocity = direction.normalize().multiply(speedMultiplier);
victim.setVelocity(velocity);
}
}
}
}
}
}

chrome beacon
#

The trident will already be thrown if you hit something

tawny furnace
#

@EventHandler
public void onHit(ProjectileHitEvent e) {
if (e.getEntity() instanceof Trident trident) {
if (e.getHitEntity() instanceof Player victim) {
Player shooter = (Player) trident.getShooter();
if (shooter != null) {
if (trident.getEnchantments().containsKey(this)) {
double speedMultiplier = 6.0;
Vector direction = shooter.getLocation().toVector().subtract(victim.getLocation().toVector());
if (direction.length() != 0.0) {
Vector velocity = direction.normalize().multiply(speedMultiplier);
victim.setVelocity(velocity);
}
}
}
}
}
}

drowsy helm
#

Use codeblock pls 😭😭

chrome beacon
#

?paste even better

undone axleBOT
tawny furnace
#

?paste

undone axleBOT
chrome beacon
#

Also

#

?tas

undone axleBOT
tawny furnace
#

I tried all possible options, it didn't help
I don't know what to do here
if the attacker is in creative, and the victim is in survival, then it works fine. and the delay also works
but if both are in survival, then it doesn't work at all
it doesn't get called, as if velocity is a vector of involuntary movement
It works in creative because they are in flight maybe
And when he is standing on the ground, velocity doesn't work
I don't remember exactly how to do this, but try to make a delay of 1 tick of this code
new BukkitRunnable {
public void run() {
//code
}
}.runTaskLater(Plugin.instance, 1L)
but this also dont work @EventHandler
public void onHit(ProjectileHitEvent e) {
if (e.getEntity() instanceof Trident trident) {
if (e.getHitEntity() instanceof Player victim) {
Player shooter = (Player) trident.getShooter();
if (shooter != null) {
ItemStack item = shooter.getInventory().getItemInMainHand();
if (item.getEnchantments().containsKey(this)) {
double speedMultiplier = 6.0;
Vector direction = shooter.getLocation().toVector().subtract(victim.getLocation().toVector());
if (direction.length() != 0.0) {
new BukkitRunnable() {
@Override
public void run() {
Vector velocity = direction.normalize().multiply(speedMultiplier);
victim.setVelocity(velocity);
}
}.runTaskLater(Plugin.getInstance(), 1L);
}
}
}
}
}
}

chrome beacon
#

....

#

Stop flooding the chat

#

I already told you what the issue is

tawny furnace
chrome beacon
#

?tas

undone axleBOT
tawny furnace
#

dont work..

chrome beacon
#

Yeah I know

drowsy helm
#

Have you tried debugging any values

chrome beacon
pure dagger
#

what does def stand for

worldly ingot
#

default

#

default is just a keyword, so you can't use it as a variable name

#

You'll often see either def or defaultValue

pure dagger
#

oh yeah

pure dagger
worldly ingot
#

Correct

chrome beacon
#

or klass

worldly ingot
#

That's cursed

blazing ocean
#

klass is typically used for KClass

worldly ingot
#

I guess it would be kursed

blazing ocean
#

it's used in a lot of places, including the kotlin stdlib, compiler, KGP and FIR

chrome beacon
blazing ocean
#

damn

worldly ingot
#

Seems like Hotspot uses Klass everywhere

#

Nothing in the stdlib though

blazing ocean
#

I've not looked at JVM impls >:(

chrome beacon
#

Don't remember it's been a while

#

Appears to be used in swing as well

#

oh well doesn't look consistent 🤷‍♂️

tawny furnace
#

I have a strange problem. I am writing a plugin for an enchantment for a trident that will attract a victim to the attacking player when the trident hits the victim. I wrote to the mechanic, but ran into a big problem. The problem is that if the players are in survival mode, the enchantment does not work at all. For some reason, it does not attract at all. If both are creative, then it attracts very strongly. If one has creative, and one is survival, then it attracts as it should. But it should attract as it should if both are survival. I do not know what to do and what it depends on

#

@EventHandler
public void onHit(ProjectileHitEvent e) {
if (e.getEntity() instanceof Trident trident) {
if (e.getHitEntity() instanceof Player victim) {
Player shooter = (Player) trident.getShooter();
if (shooter != null) {
ItemStack item = shooter.getInventory().getItemInMainHand();
if (item.getEnchantments().containsKey(this)) {
double speedMultiplier = 6.0;
Vector direction = shooter.getLocation().toVector().subtract(victim.getLocation().toVector());
if (direction.length() != 0.0) {
Vector velocity = direction.normalize().multiply(speedMultiplier);
victim.setVelocity(velocity);
}
}
}
}
}
}

#

I tried all possible options, it didn't help
I don't know what to do here
if the attacker is in creative, and the victim is in survival, then it works fine. and the delay also works
but if both are in survival, then it doesn't work at all
it doesn't get called, as if velocity is a vector of involuntary movement
It works in creative because they are in flight maybe
And when he is standing on the ground, velocity doesn't work
I don't remember exactly how to do this, but try to make a delay of 1 tick of this code
new BukkitRunnable {
public void run() {
//code
}
}.runTaskLater(Plugin.instance, 1L)
but this also dont work @EventHandler
public void onHit(ProjectileHitEvent e) {
if (e.getEntity() instanceof Trident trident) {
if (e.getHitEntity() instanceof Player victim) {
Player shooter = (Player) trident.getShooter();
if (shooter != null) {
ItemStack item = shooter.getInventory().getItemInMainHand();
if (item.getEnchantments().containsKey(this)) {
double speedMultiplier = 6.0;
Vector direction = shooter.getLocation().toVector().subtract(victim.getLocation().toVector());
if (direction.length() != 0.0) {
new BukkitRunnable() {
@Override
public void run() {
Vector velocity = direction.normalize().multiply(speedMultiplier);
victim.setVelocity(velocity);
}
}.runTaskLater(Plugin.getInstance(), 1L);
}
}
}
}
}
}

chrome beacon
chrome beacon
#

I've already told you what the problem is

#

And you're just flooding the chat for no reason

chrome beacon
#

yes

tawny furnace
#

its doesnt matter

chrome beacon
#

...

#

Why does it not matter

ancient plank
ancient plank
#

fun fact someone can't be holding a trident if they don't have it

blazing ocean
#

wait really?!?

chrome beacon
#

and telling me that it doesn't matter

tawny furnace
#

fuck

#

sorry man

#

wait a secnd

#

okey i have problem

#

how i can check enchantment on trident

chrome beacon
#

You need to check the item not the entity

tawny furnace
#

ItemStack tridentItem = trident.getItem();

#

this?

#

if it work

#

thanks for all

humble sigil
#

can somebody help me compile clan mod into jar?

tawny furnace
chrome beacon
#

?services

undone axleBOT
humble sigil
#

just downloaded

chrome beacon
#

🤦‍♂️ It's already a jar file

#

Open the zip

humble sigil
#

I have opened and seen the source code

#

dont blame me, I am a begineer to java and spigot

chrome beacon
#

There is no source code in the zip

#

The zip contains two versions of the plugin jar as well as instructions on what to use

tawny furnace
#

guys

#

it work

#

wow

#

thanks guys

#

@chrome beacon

#

thanks

pure dagger
#

can block.getLocation() return location with pitch or yaw != 0?

proper cobalt
#

yo guys how do old servers like hypixel n stuff make custom items since PDC didnt exist?

young knoll
#

They just use NBT directly

#

Since pdc is just a wrapper for NBT

proper cobalt
#

isnt nbt weird in 1.8

#

like it can randomly dissapear

young knoll
#

Not that I know of

proper cobalt
#

so its persistent and no one can manipulate it

#

100% safe yea

young knoll
#

Yeah

#

There’s NBTApi to work with it

proper cobalt
#

coldd thanks

distant pendant
#

can someone help me? i want to add optional nbt item sytax but when i try to add the optional nbt on the item the code is not running.

but im remember if my old code is just working when i add optional nbt but when i see my old code on GitHub just the same i use now.
https://github.com/Phanisment/Item-Caster/blob/main/src/main/java/phanisment/itemcaster/skills/SkillActivator.java

GitHub

Cast MythicMobs Skill with NBT item. Contribute to Phanisment/Item-Caster development by creating an account on GitHub.

shadow night
#

Likely the most questionable code I've seen in a while

distant pendant
#

yeah, I've been desperate for more than 4 weeks to fix this 🗿

shadow night
#

Artifact:[{skill:"Noxious_Poison_Slash", activator: "left_click, cooldown: 10"}]

#

See the problem?

distant pendant
#

ah, i see

#

wait

#

so, what I've been trying to fix this whole week 🗿

shadow night
#

You should probably make a command for getting test items

wintry anvil
#

How would I give a player effects when having a specific armor equipped?

chrome beacon
#

Recommend using this ^^

wintry anvil
#

I'd need it to work between servers so there is not always an equip event. The player could join with the armor already equipped

distant pendant
young knoll
#

Join event

chrome beacon
#

If you really don't want to check the armor every couple of ticks

wintry anvil
#

yeah, ill try that, dont wont massive lags

quaint mantle
#

is there any way to get the block to what is wall sign attached to?

worthy yarrow
wintry anvil
#

Yeah, I did

worthy yarrow
#

Ok nw

timid berry
kind hatch
#

Probably need to run BuildTools for each version that it supports.

river oracle
#

^ you do

remote swallow
#

Why the duck do they depend on craftbukkit not spigot

#

Ur gonna need the --compile CRAFTBUKKIT flag too

kind hatch
#

Not necessarily

#

That flag just copies the craftbukkit jar from the work directory.
It already gets installed into the .m2 folder.

remote swallow
#

Bt doesn't compile craftbukkit without that flag at all anymore

#

Iirc anyway

kind hatch
#

It actually still does, but doesn't copy the final jar to the parent dir.

remote swallow
#

?stash

undone axleBOT
kind hatch
#

Also, it looks like that project uses a bunch of NMS, so it's somewhat understandable why they are depending on craftbukkit. (Since it goes all the way back to 1.8)

remote swallow
#

If compile craftbukkit flag isn't set it doesn't run them

#

I found it out a few weeks ago because that's how spigot bt was faster than mine

naive spire
naive spire
#

I have once again failed to build that PR

remote swallow
#

Hey llmdl

naive spire
#

can you believe I've gone this whole time without joining this discord

remote swallow
#

Idk how you survive without being in spigot

naive spire
#

I just dont use discord for anything outside of Towny so its not too much trouble

#

also its a good idea to just read the docs

remote swallow
#

It's full of really great people that you really want to talk to

#

Elgarl is here sometimes as well

naive spire
late sonnet
eternal oxide
#

I'm always here 😉

remote swallow
#

Speak of the devil

naive spire
#

yeah same error @late sonnet

#

If you can just sling me a jar I'd appreciate it @late sonnet, I don't really know how the allow_greifing rule factors into the issue. I was just hoping for teh proper event to be thrown so that the act of opening doors isn't invisible to protection plugins.

remote swallow
#

What's townys plan for the hard fork, been as it's such a largely used plugin

late sonnet
naive spire
#

that hard fork news right before Christmas, not something I can deal with right now

remote swallow
#

Fair

late sonnet
#

A strange day for make mucho work xd

remote swallow
#

Make warrior deal with it kekw

naive spire
#

my kids have a week of school left, I have a week of IRL work left, got teh in-laws coming next weekend

#

have to patch a hole I put into my wall while wiring a tablet onto the wall for a home-centric panel

#

I think the real question is how will Spigot and its developers deal with the hard fork

remote swallow
#

I'm guessing a load of plugin devs will probably move over once breaking changes start

naive spire
#

I had to add paper-api to the towny pom recently and it showed me all the things that Towny uses which is considered deprecated in Towny. About 233 instances. Mostly ChatColor, but also other things which are Strings in Towny but Components in Paper.

#

We already have some Nice Things™️ that Warrior added giving us Bukkit/Paper/Folia centric things.

remote swallow
#

Does towny use adventure/minimessage yet? Might be something to look into to give admins more customisability

naive spire
#

We do but we currently shade it into Towny

#

some of the addons rely on Towny's shaded-in version.

#

In that way we can do spigot and paper and not require admins to get Adventure in some other way

remote swallow
#

Could libraries it and transitive dep

#

But that's like 1.17+

naive spire
#

Towny is only developing against 1.19+ now

remote swallow
#

Oh could def library it in future

naive spire
#

yeah idc

remote swallow
#

I saw that the other week, is it compatible with old vault or does it have breaking stuff

naive spire
#

it has teh old vault in it

river oracle
#

its just a fork Epic so it should work

#

I'd imagine they'd avoid breaks to create better adoption rate

naive spire
#

So you can do both and it doesn't matter which plugin is asking about vault or vault2

remote swallow
#

Sounds cool

naive spire
#

Vault plugin will talk to you using the vault package, vault2 plugin will talk to you using the vault2 package, you respond to both with your one back end

#

It is mainly the PRs I never got accepted into VaultAPI, with some other Nice Things™️

remote swallow
#

Need to convince essx to move to it so more people know about it

river oracle
#

is vault a dead project?

#

i've always wondered

naive spire
#

They ask you to make changes but never merge

remote swallow
#

Yes and no I'd say

naive spire
#

Pretty dead imo

remote swallow
#

It's not dead in doesn't work but it doesn't get anything new

eternal oxide
#

|Dead but never really needs any update

naive spire
#

I had a pretty good case for an update

eternal oxide
#

I remember I did too, but the PR was refused

naive spire
#

Anyways now we have VaultUnlocked and if you're not using it, you should.

remote swallow
#

I think the last pr merge was choco making the readme not say to use mojank logger

naive spire
#

I had some things merged into Vault and VaultAPI semi recently but it was mostly dropping the old abandoned plugin jars from it

#

But as for making significant changes that need to happen for everyone's sake, not so much

remote swallow
#

Imagine if that 1.14 bukkit dep was removed

naive spire
#

all our IDEs crying out in relief

pseudo hazel
#

if it aint broke, dont fix it

naive spire
pseudo hazel
#

epic nesting

naive spire
#

.

```
code
```

blazing ocean
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
worthy yarrow
#

@blazing ocean can we send the thing

blazing ocean
#

please

#

i saw something worse earlier

worthy yarrow
#

That git commit I don’t have handy

blazing ocean
#

I mean @naive spire made that pr lmao

worthy yarrow
#

Kek

naive spire
#

look at that huh

worthy yarrow
#

The amount of times we’ve had to crack down on people and their crazy nesting behavior

late sonnet
#

@naive spire ok im in PC now xd
not sure if you can add me.. but check the issue in buildtools looks like a strange java instalation because i run the command with not issues using the JDK provided by microsoft and added to the PATH

nova notch
#

why have you sent this twice with no explanation as to whats not working

#

ok WHAT doesnt work

#

unfortunately telepathy does not exist in this world

pliant topaz
#

?nowork

#

sad, idk the command anymore

remote swallow
#

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

naive spire
naive spire
late sonnet
wet breach
naive spire
desert aspen
#

Anyone have the 1.17 spigot jar file? in the bukkit website doesn't let me download it

blazing ocean
#

?bt

undone axleBOT
wet breach
#

Where was the last time I seen you? Well would have been here naturally, and then before here would most likely have been when I was still bukkit dev staff

naive spire
#

I don't think I've ever been in here

late sonnet
naive spire
wet breach
naive spire
#

I think the only time I interact with spigot is when I find a stupid bug in the API that is never any fun to fix.

wet breach
#

Indeed, believe that was the reason you were here a couple years ago lol

naive spire
#

I would be considered a bad omen in the olden days

wet breach
#

lol

frail steppe
#

hello

#

I was trying to compile a plugin

wet breach
#

and I assume you encountered a problem?

frail steppe
#

correct

#

vc?

wet breach
#

well I assume you wouldn't be here otherwise 😉

eternal oxide
#

Thanks for letting us know

frail steppe
#

you're welcome

naive spire
#

You are no longer trying to compile a plugin. I am up to date.

frail steppe
#

someone can help me in vc?

eternal oxide
#

If I were you I'd state your issue 🙂

#

?paste any error

undone axleBOT
frail steppe
#

ok

eternal oxide
#

?img or for pictures

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

naive spire
#

my VC rates are pretty high do you have a budget

frail steppe
#

when i put jar into server

eternal oxide
#

wrong java version for the compiled class

frail steppe
#

so what do I needo to do

#

i'm new to javaa

eternal oxide
#

holy, what java are you on? Future version

frail steppe
#

21

#

jdk 21

naive spire
#

java.lang.IllegalArgumentException: Unsupported class file major version 25888
brother is on java 2099

blazing ocean
#

I've achieved that before

naive spire
#

java levels over 9000?

blazing ocean
frail steppe
#

what file I need to modify?

#

or what I need to do?

eternal oxide
#

what are you compiling in maven or gradle?

frail steppe
#

with nothing

#

buildtools only

eternal oxide
#

so not a plugin then

frail steppe
#

oh

wet breach
#

to get the major version that high, means the class file was manipulated either by something like lombok or some other thing. Findbugs I think does the same thing if its outdated or fails scanning.

frail steppe
#

I used visual studio code

#

i don't know nothing about java

blazing ocean
eternal oxide
#

Seeing as the name of the plugin is MySiteAuthPlugin, I'm going to assume you are doing some asm manipulation

sullen marlin
#

I think enabling preview java features can also give weird versions

frail steppe
eternal oxide
#

basically your ASM is blowing up and creating a bad class

#

um

#

Its also paper so this is not really the right place to ask. Test against Spigot and let us know if the error persists

frail steppe
#

i am downloading intellij

wet breach
white magnet
#

Hey! I'm working on a minigame network. I just setup my BungeeCord proxy and a singular "Lobby" subserver in Spigot 1.8. While in 1.8, logging to the proxy in-game causes this error being spammed in the Lobby: https://paste.md-5.net/luxowiqeji.sql
This doesn't happen in new versions (1.13+) but I really need the servers to use 1.8. How can I fix it?

#

I have the latest BungeeCord version btw

prime reef
#

There a way to tell if your server is running from code? I'm bundling a configuration tool/custom documentation generator into this library that lets the .jar file be run as a standard application (in addition to serving as a plugin), but obviously you won't be able to get Plugin objects that way if you're not running this through a server (would have to get the actual plugin .jar instead)

#

I suppose Bukkit.getServer() would be null and my IDE is just wrong lmao

hazy parrot
#

You would get compile error, because spigot classes would not be present at runtime

#

Runtime error*

#

Why not distribute 2 jars

#

And make a multimodule project, where common module would have most of the logic

prime reef
#

I've noticed people tend not to download anything more than they absolutely have to

#

oh well, I can do the documentation generation from within the plugin anyway by just letting someone run a command

shadow silo
#

Whats the best way to create a lot of items for a GUI? I'm thinking about creating a class to make one (regular way is pretty verbose), and then having a static class to access them? That feels wrong on many levels though. Was just wondering if there's a better way, or perhaps a more accepted way of making a ton of different item stacks?

chrome beacon
prime reef
prime reef
#

you'll need to store the information for those items somewhere

prime reef
#

you could do it through config if you'd rather avoid doing it in code, which would also make it easier to tweak and customize on the fly (this is why a lot of modern GUI APIs use some form of markup language, like XAML or FXML)

shadow silo
#

I'm using InventoryFramework atm

prime reef
#

yeah I know nothing about that, sorry, I only use my own library tbh

#

bad habit from being a C++ developer

shadow silo
#

lol

prime reef
#

oh IF actually looks good at a glance

#

i'd use this

#

oops, wrong link

#

he's got documentation for creating GUIs with XML on the wiki

shadow silo
prime reef
#

you might be able to hybridize them, not sure

#

Maybe you can create a custom widget with this framework and use that to display the model data or something

#

(I don't know much about that, haven't really done spigot for a while and getting back into it lmao)

torn shuttle
#

certified classic unity moment, can you spot the problem?

hazy parrot
#

i like the part where i followed the instructions below

torn shuttle
#

yeah me too

hybrid spoke
#

sup guys, design question: i have an api, engine and bukkit module. the api module defines a BlockInformation interface, which is used in filters which are passed to the engine. for good bukkit related filtering, the BlockInformation has to contain informations like Material and BlockState, which cant be initially given by the interface, since neither the api nor the engine know what bukkit is. i could just go by inheritance and make a BukkitBlockInformation in the bukkit module, but the user of the lib would have to downcast (ugly approach). another would be, that the BlockInformation has properties stored in a map <String, Object>. my last approach would be to have a delegate. does anyone have any other, better, ideas?

finite patrol
young knoll
#

RecipeChoice choice = new RecipeChoice.ExactChoice(ItemStack)

finite patrol
# young knoll RecipeChoice choice = new RecipeChoice.ExactChoice(ItemStack)

Hmm, I dont think this is what I am looking for. I need to create a new custom RecipeChoice that is the same as ExactChoice but it would also check the amount of each ingredient. (if a recipe requires 5 diamonds to be put in one slot) For that I assumed I need to "copy" the inside of the ExactChoice and modify it. I chose the ExactChoice because I need to check if the NBT of the input item is the same as the ingredient

young knoll
#

You can’t do that

#

Custom recipe choice implementations won’t work

finite patrol
#

So is there a way to check if the NBT and amount is correct without using event listeners?

young knoll
#

No

finite patrol
#

Damn, well its time to rewrite the plugin ⚰️

ebon topaz
#
ItemMeta meta = item.getItemMeta();
FoodComponent food = meta.getFood();
food.setNutrition(nutrition);
meta.setFood(food);
item.setItemMeta(meta);

is this how you set the amount of hungry bars that is replenished by food?

young knoll
#

I think you need a meta.setFood

ebon topaz
#

i have that there

inner mulch
ebon topaz
#

yeah and it seems to just be the same as it was "bread"

inner mulch
#

how much nutrition did you give it?

ebon topaz
#

10

inner mulch
#

hmm

ebon topaz
#

what is the range on this?

inner mulch
#

idk

ebon topaz
#

i was assuming 1 - 10

inner mulch
#

your code looks correct

#

i think its 1-20

young knoll
#

Should be 1-20

#

Well

#

0-20

#

Hold the item and run /data get entity @s SelectedItem

ebon topaz
#

well it is set to 10

#

ok hold on

young knoll
#

Yeah that looks right

ebon topaz
#

ok it seems to be working 👍
i was initially working under the assumption that it was a range of 0 - 10

#

thank you guys for your help

mortal vortex
#

Has anything changed between 1.21.1 and 1.21.3 in terms of totems?

#

Not sure whats changed, but we have an event in our plugin EntityResurrectEvent, and it works perfectly fine on 1.21.1, but fails to work on 1.21.3

kind hatch
#

Show code

mortal vortex
# kind hatch Show code

public class EntityResurrectListener implements Listener {
    private final LifeStealZ plugin;

    public EntityResurrectListener(LifeStealZ plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onEntityRessurect(EntityResurrectEvent event) {
        if (!(event.getEntity() instanceof Player)) return;
        Player player = (Player) event.getEntity();

        if (!WhitelistManager.isWorldWhitelisted(player)) return;

        if (plugin.getConfig().getBoolean("preventTotems")) event.setCancelled(true);
    }
}
kind hatch
#

Have you done any debugging?

kind coral
#

anyone know how to change Hibernate's ORM classloader?

#

like provide my classloader

remote swallow
#
var configuration = new Configuration(new BootstrapServiceRegistryBuilder().applyClassLoader(this.getClass().getClassLoader())()).setProperties(properties);
fossil ridge
#

What do I use to get the length of a piston in BlockPistonExtendEvent#getLength if it's deprecated?

kind coral
remote swallow
#

let me guess, librarying hibernate?

kind coral
#

yeah

fossil ridge
kind coral
#

like i searched on stackoverflow for like an hour

#

asked chatgpt too that mf costs me 20$ a month and cant even help

mortal vortex
kind hatch
#

Are you sure you registered your event?
Put some print statements in there to see what is happening.

Also make sure you are holding the totem when testing.

mortal vortex
fossil ridge
#

and why is BlockPistonRetractEventgetRetractLocation deprecated since 1.8 without any reason as to why, and yet the same rules that the method does still apply in 1.21.4

kind hatch
young knoll
#

Because in the past a sticky piston could only retract one block, the one directly attached to it

remote swallow
#

but muh slime blocks

young knoll
#

Now it can retract multiple with slime blocks, so it doesn’t really make sense to have a single retract position

fossil ridge
#

so then how do I do get the retract location(s)

#

since no length is provided (would probably be deprecated too and used by non-deprecated method lmfao)

young knoll
#

Loop through all the blocks and offset them by the direction

fossil ridge
#

so basically like the extend does with using the deprecated method?

remote swallow
fossil ridge
#

so I got code here and idk what it does and if it should be ported to the same event

young knoll
#

What

fossil ridge
#

https://pastes.dev/MO6dPRgOKs so basically I am making a claim system and I need to detect when a block is trying to get pushed out/in into/of a claimed chunk

young knoll
#

For each block in the list

#

The starting position is its current position

#

The ending position will be block.getRelative(event.getDirection)

fossil ridge
#

but what about slime blocks, there is no length provided by one event

young knoll
#

You don’t need length?

#

Every block is only moving 1 block in at a time

bitter rune
young knoll
#

Event fires once for each hand

bitter rune
#

ooh

sharp bough
#

but he has a check for action type

#

right click

#

its firing twice so check if you are registering the listener twice

#

if not, print the event, send that

young knoll
#

Doesn’t matter

#

It’ll fire the right click action for both hands

glad prawn
bitter rune
#

have 1.21.4 server in my plugin, anyone know what this method was replaced with? Method moveTo = navigation.getClass().getMethod("a", double.class, double.class, double.class);"

bitter rune
#

so i messed with nms, and i now understand i am not ready for nms lol

undone axleBOT
chrome beacon
#

Also it'd probably be easier if you didn't use reflection

ivory sleet
ebon topaz
#

whats the material for a bottle of water

mortal vortex
ebon topaz
#

ahhh

brittle geyser
mortal vortex
#

plus, they asked for the "Material"

#

"bottle of water" isn't an Enum

mortal vortex
#

You'll find WATER here on the list

brittle geyser
#

oh

#

minecraft:potion{Potion:water}

mortal vortex
brittle geyser
#

It is nbt

#

potion is material

mortal vortex
brittle geyser
#

Then water is potion type

mortal vortex
brittle geyser
#

yes

mortal vortex
#

@ebon topaz. By default, I think Potion might fall back to "Bottle of Water" anyways, but it might also be that weird potion called "Uncraftable Potion". Try just:

ItemStack waterBottle = new ItemStack(Material.POTION);

if it works, otherwise you can implicitly set it to be water:

ItemStack potion = new ItemStack(Material.POTION);
PotionMeta potionMeta = (PotionMeta) potion.getItemMeta();
// may want to ensure its not null before this, i dont see why but yeah

potionMeta.setBasePotionData(new PotionData(PotionType.WATER, false, true))

potion.setItemMeta(potionMeta);
ebon topaz
#

thank you

#

um so question can i turn a itemstack ive made into a material so i can use it in crafting recipes

sly topaz
sly topaz
#
var potion = new ItemStack(Material.POTION);
var meta = (PotionMeta) potion.getItemMeta();
meta.setBasePotionType(PotionType.WATER);
potion.setItemMeta(meta);

should do

mortal vortex
reef wagon
#

hi, does anyone know how to solve this problem?

repositories {
    mavenCentral()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
    compileOnly("net.md-5:bungeecord-api:1.21-R0.1-SNAPSHOT")
}```
mortal vortex
#

oh yeah kek

sly topaz
#

tbf the bungeecord maven wiki doesn't mention it so it should just work but eh

#

apparently you need the mojang repo for that one, so add https://libraries.minecraft.net

short pilot
#

what are some things in spigot that could be implemented using Graphs?

#

i was trying to play around with faction alliances but then i realized you could just do that with sets

short pilot
#

as in the data type

#

the stuff you learn in algorithms

sly topaz
#

ah, thought you meant some specific technology since you capitalized it lol

short pilot
#

nahh

sly topaz
#

anything that deals with b-trees is a graph

#

most common thing would probably be regions, or at least that's how WG does it

ivory sleet
#

Oh I thought it used octrees

sly topaz
#

faction alliances are also just a type of graph. If you think about it, most things can be interpreted as a graph

sly topaz
ivory sleet
#

:’)

short pilot
#

hm im trying to use some other data structures in my plugin but nothign is really needed

ivory sleet
sly topaz
#

I was also wondering how are faction alliances even defined

ivory sleet
#

^^

short pilot
#

first naive approach is just when two factions make an alliance, each one of them keeps a set of allied factions assuming each faction has a unique ID

#

and honestly idk that might be all that's needed

#

just check against it if faction allied, give like extra HP boost or something

ivory sleet
sly topaz
short pilot
#

yea that's wut ive been doing anyways for recruiting and all

#

leetcode is the grind ;-;

#

i meann i do think maybe something related to distances between allied faction capitals coud be modeled using graphs if you want to do some fun stuff depending on how far each is

sly topaz
#

so you are just looking for ways to use them in practice, that's a good thing

#

leetcode excercises only get you half-way to understanding, applying it into real problems is where one gains comprehesion

#

that said, graph as a concept is rather broad so anything goes really lol

short pilot
#

yea

#

i dunno

#

plugin development delves more into concurrency and data management which are important too

#

the whole single threaded thing

sly topaz
#

it isn't so much of a way to define data but to visualize it, then there's more specific data structures that handle the implementation part

ivory sleet
#

But yea there’s a lot of data management, but most devs I see just stick with super basic non-normalized schemas

short pilot
#

like wut

#

ive just been using sqlite all this time and it has served me well for this project but might look into trying other databases in the future

#

is there anywhere a priorityqueue could find use

ivory sleet
#

a lot

short pilot
#

lowkey the most useful implementation of graphs in minecraft i can think of is just intuitively, distance related operations

ivory sleet
short pilot
#

true true

ivory sleet
#

Like you can see it in a graphing perspective

short pilot
#

ic ic

ebon topaz
#

how hard would it be to make custom crops?

inner mulch
ebon topaz
#

doesnt have to be exactly this but for example,
rice can only be planted in 1 high water and grows like wheat maybe?

inner mulch
#

I would add somr crop conditions that are checked when the player olaces them and for growing you can just tick them every tick and have a rng decide if it grows or not

ebon topaz
#

ok so should be too hard to make some custom textures and do some checks to make it place in one block high of water and grow it in plugin every tick with a rng to decide if it grows

#

whats the rng like for the vanilla crops?

young knoll
#

They get random ticks

#

And then decide from there

sly topaz
#

it's open source

#

well not the most pretty code base I've seen but it seems to do what it is supposed to do lol

mortal hare
#

ok im going crazy

#

how would you implement event handling in a Entity Component system

#

Bukkit api seems to do much circular referencing in such cases by pointing Player reference to an event

#

which is not really optimal

naive spire
#

idgi

blazing ocean
#

what does that mean

mortal hare
#

basically you have Entity as a class and every functionality is splitted of into separate parts called Components

#

something like minecraft does

#

Entity has bunch of components

blazing ocean
#

i know what an ecs is

worldly ingot
#

"I don't get it"

blazing ocean
#

ah

river oracle
#

I mean if you wanted to make an ecs you should be building off of nms not bukkit

worldly ingot
#

Are you asking how to write an event system if you have an ECS?

#

Yeah. You would ideally start from the ground up lol

#

Bukkit (and really, vanilla) is hierarchical, so ECS just doesn't work

blazing ocean
#

bukkit isn't ideal in general

#

its a mess

mortal hare
#

if i want to pass Entity to an event, i have to do circular reference or pass entity id

pseudo hazel
#

nothing is ideal

mortal hare
#

so how tf can i pass update event for a component but reference entity

#

without risking of circular reference

worldly ingot
#

What circular reference are you concerned with? I don't understand

blazing ocean
mortal hare
#

but you can also pass shadow reference to the event i guess

mortal hare
# worldly ingot What circular reference are you concerned with? I don't understand

lets say i have entity component A, i need to dispatch an event when component A changes, but also I need to pass down the entity to that event which has the component. I can do that by dispatching event from component A, but then I need reference to Entity. Due to how you get the component A from Entity, if you pass Entity to the component A, you will get circular reference

eternal night
#

the component itself is immutable and doesn't change itself tho no?

mortal hare
#

Entity -> State Component (Stateful data about trait related things for entity) -> Trait Component (Stateless data)

river oracle
#

I mean is there any reason you need an event on property sets

#

That's just asking for trouble especially if you call state changes

sly topaz
#

every event happens on property modification if you think about it

#

is this Ike's secret alt

#

they're the only ones I've seen trying to integrate an ECS into minecraft's codebase lol

eternal night
#

kekwhyper maybe mental delusions of ECS just spread to fast

river oracle
#

Listen to a state change to change state to listen to the state change

mortal hare
#

i can move State Component into entity, but then i lose the ability to hold State data for particular trait outside of the entity

eternal night
#

this still just smells like you are calling the event from the component being changed

#

which would be wrong anyway

river oracle
#

^ cyclical in nature

mortal hare
#
Entity entity = ...
EntityDamageableState state = entity.getState(Damageable.class)
state.setHealth(150); // set the 150 of entity's damageable state and fire EntityHealthStateChangedEvent

state.getTrait().getMaximumHealth(); // 1000
#

smth like this

eternal night
#

mutable components in ECS omegaroll

mortal hare
#

traits are not mutable, states are

eternal night
#

Yea but I mean

#

in this case, you'd call EntityHealthStateChangedEvent before the state.setHealth call

#

i don't see the problem

river oracle
mortal hare
proven gulch
#

Good time of day. Tell me how to get a sign when inserting a schematic.

In more detail, I insert a schematic at the command, there is a sign in this schematic (within its limits).
My task is to scan the entire schematic (each block) to get a plate and work with it. I tried to implement this in several ways:
1)

 private void processSchematicBlocks(Location loc, Vector3 min, Vector3 max, World world) {
        for (int y = max.getBlockY(); y >= min.getBlockY(); y--) {
            for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
                for (int z = min.getBlockZ(); z <= max.getBlockZ(); z++) {
                    Block currentBlock = world.getBlockAt(x, y, z);
                   
                    if(currentBlock.getType() == Material.OAK_SIGN) {
                        plugin.getLogger().info("test");
                    }
private void processSchematicBlocks(Location loc, Vector3 min, Vector3 max, World world) {
        for (int y = max.getBlockY(); y >= min.getBlockY(); y--) {
            for (int x = min.getBlockX(); x <= max.getBlockX(); x++) {
                for (int z = min.getBlockZ(); z <= max.getBlockZ(); z++) {
                    Block currentBlock = world.getBlockAt(x, y, z);
                    
                    if(currentBlock.getState() instanceof Sign) {
                        plugin.getLogger().info("test");
                    }

Nothing worked, the conditions do not work, because there is no output to the console. And I need to work with the lines on the plate. Please help me)

pseudo hazel
eternal night
#

why would state be responsible for calling events about itself changing

pseudo hazel
#

just do it out here

river oracle
pseudo hazel
#

like where is that code located

river oracle
#

Personally 1 seems ideal but hey booleans could cut it

mortal hare
worthy yarrow
#

@river oracle nerd

river oracle
worthy yarrow
#

God damnit my phone

pseudo hazel
blazing ocean
#

hello kat

pseudo hazel
#

like where is that code

worthy yarrow
#

Oh hi rad

mortal hare
sly topaz
#

signs are tiles, so you could just get all the tiles in the chunk

#

or if the schematic plugin you're using allows for it, do it from the schematic itself as it should save that information

pseudo hazel
proven gulch
worthy yarrow
#

Do you know java at least a little bit?

#

It’s gonna be quite hard to make a plugin with minimal java experience

proven gulch
worthy yarrow
#

We have a bunch of helpful links, do you want them?

proven gulch
proven gulch
worthy yarrow
#

Go to #bot-commands and type ?learnjava

sly topaz
river oracle
sly topaz
#

though this said, is there any reason you can't just edit the schematic itself? Is the sign text dynamic?

worthy yarrow
#

But uh I feel like you’re probably working with world edit or something similar which in all honesty doesn’t have great docs also, to try and figure out the spigot api as well as the schem plugins api is just gonna be a huge pain for you

proven gulch
#

Sorry for the incorrect words, I'm from Russia and I use Google translator

proven gulch
worthy yarrow
sly topaz
#

either way should work, use what sounds the easiest to you

worthy yarrow
#

We can give you the logic behind the implementation but you still have to actually implement it which I don’t think you’ll have an awesome time with, however it’s a good learning experience to try and figure stuff out yourself. That being said id still go through some of those java links

proven gulch
#

I can't write down every coordinate of the plate relative to the schematic, I have 90 of them.

worthy yarrow
#

World edit?

proven gulch
worthy yarrow
sly topaz
#

FAWE is WE API compatible so that shouldn't be an issue

worthy yarrow
#

Honestly didn’t think so but wasn’t sure

pliant topaz
#

worked with it before, the docs are a bit, weird explained

worthy yarrow
#

Yeah we docs are not great

pliant topaz
#

and very little, but it covers the basics

proven gulch
worthy yarrow
#

You could also join their discord and ask there

proven gulch
worthy yarrow
proven gulch
worthy yarrow
#

Sure!

#

If I had to guess they’d probably know better than most people here, still we are here to help if you need it

mortal hare
# pseudo hazel like where is that code

man you just opened my eyes, maybe really this is not the place where you should call events. Maybe you're right, you should call events from outside. These are just too small instances to be called from

#

Model classes should not be riddled with events, algorithms around them should be

#

it wouldnt make sense to call Entity health changed from state class that i've mentioned because you could just construct your own state object outside of Entity and it would fire that event, even if the component is not directly hooked to the entity, unless you runtime checked that the entity has that particular state

#

its bad design

echo basalt
#

With an ECS you need to make the distinction between "components" and "systems"

#

Which you call algorithms

#

The "systems" are responsible for logic, "components" mostly hold data

#

Systems call the events and manipulate data

#

For example the "health system" is responsible for handling damage, regenerating health etc while the HealthComponent just tracks the entity's health and max health

mortal hare
#

well it sounded great to have events at low level changes, allowing to have single root source of event dispatch, but then i got stopped with such issues

sly topaz
#

I provided an admittedly wrong solution, and wiz didn't like that at all

worthy yarrow
#

Yeahhhh last time I went there for help they dogged on me for not using paper… almost as if the issue was just that (it wasn’t kek)

pseudo hazel
warm mica
#

Attribute👍

pseudo hazel
#

what more info do you need

blazing ocean
#

Attribute.

#

editSession.replaceBlocks(region, SingleBlockTypeMask(editSession, BlockTypes.OBSIDIAN), BlockTypes.AIR) is this not the way to replace all obsidian blocks with air in worldedit

sly topaz
#

did you commit?

blazing ocean
#

and sure isn't doing anything

#

that was recording purple's stream audio lmao

sly topaz
#

that's what I meant by commiting

blazing ocean
#

should i be creating a new one for each region I'm removing

#

because it is currently shared, probably not a good idea

sly topaz
#

I am unsure what's the best approach there, I'd imagine you would indeed do that

#

you could also just call EditSession#commit and see if you can keep using it lol

#

does WE do chunk batching by default on edit sessions or do you have to call EditSession#setBatchingChunks manually in case it's a big region

blazing ocean
#
suspend fun breakObsidianWall(teamIdx: Int) = withContext(GameServer.asyncDispatcher) {
        val bound = instance.cachedMap.map.bound(OBSIDIAN_WALL_CARDINAL_NAMES[teamIdx]) ?: instance.exit(Reason.INVALID_MAP)
        val region = bound.worldEditRegion()
        instance.debugAnnouncer.announce(buildText("Min: ${region.minimumPoint} Max: ${region.maximumPoint}"))

        val session = newEditSession()
        session.replaceBlocks(region, SingleBlockTypeMask(session, BlockTypes.OBSIDIAN), BlockTypes.AIR)
        Operations.complete(session.commit())
        session.close()
    }

seemed to work

reef wagon
#

can i use minimessage from adventure api in bungeecord?

blazing ocean
#

i like these announcers

sly topaz
blazing ocean
#

right

blazing ocean
#

true

chrome beacon
#

right kotlin

sly topaz
#

closing automatically commits btw

sly topaz
#

it looks nice with pastel colors

blazing ocean
#

the "the first combat phase" is coloured wrongly

sly topaz
#

that purple also resembles my favorite color, #c390d4

blazing ocean
#

that's actually #d2b4fa

sly topaz
#

yeah, it looks blue-y

sly topaz
remote swallow
#

any nerds here know of an a* pathfinding impl in java or kotlin, not mc just standalone (would love if its mit so i can just steal it)

chrome beacon
#

The search part of it isn't too coupled to Spigot

#

Also what are you making 👀

remote swallow
#

the solution to todays aoc

chrome beacon
#

🔫

remote swallow
worldly ingot
#

Does it need to be MIT if you're just using it locally?

#

Or are you uploading to GitHub?

fossil ridge
#

Is there an event for when an individual block explodes? BlockExplodeEvent triggers for a list of blocks, but I need to detect when a block itself explodes without cancelling all the explosions.
Context: Given that you have Chunk A B (next to eachother), B has explosions disabled, but A has them enabled. I want it so when you explode something in B it explodes the blocks in A but on B it does nothing.

eternal oxide
#

Only beds blocks explode

#

Most explosions are caused by Entities

fossil ridge
#

yeah, tnt in this case

chrome beacon
fossil ridge
#

I saw that some other plugins are able to do it (I don't know their name though), but idk how it is done

eternal oxide
#

EntityExplodeEvent

fossil ridge
#

if I cancel that the entity doesn't explode at all

#

I need it to explode but only do damage in A if it was placed on the edge of A and B

eternal oxide
#

remove teh blocks from getBlocks that you don;t want to explode

chrome beacon
fossil ridge
chrome beacon
#

Yeah clear getBlocks

eternal oxide
#

the block list is modifiable for removal, not addition though

fossil ridge
#

that's great, thanks!

#

do I need to make a copy of the block list since I am directly removing them in the loop for CME?

eternal oxide
#

no

#

iterate

chrome beacon
#

You can use removeIf

fossil ridge
#
@EventHandler
    public void onBlockExplode(BlockExplodeEvent event) {
        event.blockList().removeIf(block -> {
            ClaimData claim = this.controller.getClaim(block.getLocation());
            return claim != null && !claim.isExplosionsEnabled();
        });
    }```
so like this
chrome beacon
#

Yeah that should work

fossil ridge
#

thanks 🙂

remote swallow
worldly ingot
#

Ah okay

shadow night
eternal oxide
#

You can remove Blocks from the returned list and they will not be destroyed, but you can't add new Blocks

shadow night
eternal oxide
#

no I believe it will error

#

If I remember correctly

shadow night
#

?????

#

wtf

slate pendant
#

Does anybody know why is it deprecated?

#

Should we just create maps every time it needs to be itinialized, until it reaches the limit

pseudo hazel
#

its fine

#

you can still use it

remote swallow
#

Magic Value

pseudo hazel
#

magic value means it could change any moment basically or the values are hard to predict

#

but like

#

its still usable

slate pendant
#

ok

lofty tinsel
#

Hey guys, so I’m really bad at math and equations…however, I’m trying to make these equations increase 1% for each job level. Is there anyone that could help me with it? The equations are listed below;

leveling-progression-equation: 10*(joblevel)+(jobleveljoblevel4)

income-progression-equation: baseincome+(baseincome*(joblevel-1)0.01)-((baseincome+(baseincome(joblevel-1)0.01)) ((numjobs-1)*0.05))

experience-progression-equation:
baseexperience-(baseexperience*((numjobs-1) *0.01))

blazing ocean
#

is that some latex shit

lilac dagger
#

experience + (levels * (experience * 0.01))

#

i think it's this?

#

wait

#

this should work no?

slender elbow
#

sure (I have no clue what you're talking about)

lilac dagger
#

this should give you the experience for each level if it increases by 1%

#

if level is 0 there is no extra experience given

#

yup, i'm pretty confident it's like this

lofty tinsel
lilac dagger
#

alright, good luck 😄

#

1% is very little tho

#

you might wanna increase it

#

but it also depends on the base experience

lofty tinsel
#

Well I’m making experience and income increase by 1% too.

lilac dagger
#

you'll figure out all the variables 😄

#

i suggest to keep experience static(not changing) and play with the percentage

chrome beacon
#

Tried calling setPowered on it?

#

No idea if it'll work but it's worth a try 🤷‍♂️

earnest girder
#

I have the Minecraft Development plugin installed in my Intellij project, and I have the newest version of corretto-21 installed, but it doesn't know Spigot API. What could the possible issues be?

chrome beacon
#

Make sure Intellij is up to date

earnest girder
#

it seems to be up to date

chrome beacon
#

How did you import Spigot to your project?

earnest girder
#

I dont know, I did it a while ago

#

it works fine on my PC, im on my laptop right now and having the issue. I thought simply installing the Minecraft Development plugin was all I needed to do

chrome beacon
#

The Minecraft Development Plugin is entierly optional

earnest girder
#

hmm

earnest girder
chrome beacon
#

It has some useful features like helping create Spigot projects easier

#

but it's not required and you can just setup the pom.xml or build.gradle files yourself

earnest girder
#

ah ok

#

so how do I properly import spigot?

chrome beacon
#

You add it as a dependency in the pom.xml or build.gradle

earnest girder
#

oh I bet the version im pom.xml is wrong

chrome beacon
#

Depending on if you have a maven or gradle project

chrome beacon
earnest girder
#

I have 1.21-R0.1-SNAPSHOT
its maven

chrome beacon
#

Send the entire pom

#

?paste

undone axleBOT
eternal oxide
#

?maven

undone axleBOT
earnest girder
eternal oxide
#

Wrong java version for 1.21. Pretty sure you can;t build with 1.8

chrome beacon
#

You can

#

as long as the JDK is 21

eternal oxide
#

ah okies

#

is his jdk 21?

earnest girder
#

yeah corretto

chrome beacon
#

Your maven plugins however don't support Java 21

#

You should update them

earnest girder
#

okay, how do I do that

chrome beacon
#

You simply replace the old version number with the new one

#

You can usually find the new versions on the apache maven website

#

or on maven central

earnest girder
chrome beacon
#

yes

#

3.13.0 would be the latest version

#

and 3.6.0 for the shade plugin

#

Also I do recommend changing the Spigot version to 1.21.4

#

but if you really need to use 1.21.1

earnest girder
#

okay, where do I find the 1.21-R0.1-SNAPSHOT part for 1.21.4?

chrome beacon
#

Replace 1.21 with 1.21.4

#

When you've done that click the reload icon in the top right

earnest girder
#

ok

#

is it a problem that I have java 1.8 here

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

and I'm using corretto-21?

chrome beacon
#

Should work fine but if you want to you can change it to 21

#

If you're going to make a plugin for 1.21.4 you might as well

#

No need to miss out on all the new Java features

earnest girder
#

are you sure 1.21.4-R0.1-SNAPSHOT is correct?

blazing ocean
#

it is

#

have you reloaded maven changes?

earnest girder
#

yes

blazing ocean
#

what do you mean by "I'm still not getting anything"?

earnest girder
#

the IDE doesnt know spigot API

blazing ocean
#

what version of IJ are you using?

#

make sure you're using 2024.1+ and java 21

earnest girder
#

I think its the newest, how can I check?

blazing ocean
#

help -> about or something

earnest girder
#

2024.1.4

#

yeah

#

updating to 2024.1.7

chrome beacon
#

If you open the project view (where your files are), at the bottom there should be a dependencies section

#

External Libraries*

#

Can you expand that and see if Spigot is listed

slender elbow
#

java.version should be 21, not 1.21

chrome beacon
#

Yeah that too

earnest girder
chrome beacon
#

And you reloaded your pom?

earnest girder
#

yes, I did have to change java 1.21 to 21 just now tho

chrome beacon
#

File > Invalidate Caches

#

And restart

slender elbow
#

try repair ide before nuking all caches

earnest girder
#

welp I nuked it

#

just got this Plugin 'Minecraft Development' (version '2024.3-1.8.2') is not compatible with the current version of the IDE, because it requires build 243.16718 or newer but the current build is IU-241.19416.15

#

I still just have corretto in my external libraries

slender elbow
#

mm either update intellij or uninstall the minecraft dev plugin

earnest girder
#

already updated intellij, updating minecraft dev rn

chrome beacon
#

Does Intellij Ultimate update slower than community edition then?

slender elbow
#

no, they have the same release cycle

chrome beacon
#

My Intellij community edition is at build 243 just like the mcdev plugin expects

chrome beacon
slender elbow
#

bingo

chrome beacon
#

...

#

Yeah

#

It was the first thing I asked you to check :sadge:

earnest girder
#

huh

slender elbow
#

isn't jetbrains toolbox a wonderful thing

earnest girder
#

I did update intellij a few minutes ago

#

to 2024.1.7

chrome beacon
#

2024.3.1 is latest

river oracle
#

that's not latest

chrome beacon
#

Keep updating

earnest girder
#

oh

#

why wouldnt it update to the latest

chrome beacon
#

I forgot Intellij doesn't do that without toolbox

river oracle
#

it doesn't??

#

wow life without toolbox must suck

chrome beacon
#

It updates one version at a time it's up to you to run it multiple times

#

or grab the installer

earnest girder
#

huh

#

ok

#

updating

chrome beacon
#

Keep an eye out for the update icon in the top right of Intellij

#

Should be a blue arrow there when ever an update is available

earnest girder
#

there isnt for me for some reason

chrome beacon
#

They might have moved it 🤷‍♂️

#

It was there before the UI change no idea where it is now

earnest girder
#

yeah this UI is different from what im used to

chrome beacon
#

I just use Toolbox to manage all my IDEs

#

Keeps them up to date for me and helps me login to all of them

#

so I don't need to do so for each one

earnest girder
#

guess I'll get toolbox then

sly topaz
#

I hate toolbox

pliant topaz
#

in IJ 2024 there's a little dot in the top right on a settings icon i think, dont remember how it was excactly

sly topaz
#

it is just an updater but it works like shit and takes resources like a maniac

sly topaz
pliant topaz
#

oh fr?

#

i knew it didnt update major versions but i thought minor versions would be updated

sly topaz
chrome beacon
#

?

earnest girder
#

okay so I updated to the actual newest version of intellij, still no libraries

chrome beacon
#

Nuke cache again and see if it works better now

earnest girder
#

ok

chrome beacon
#

if not close project and delete the .idea folder

#

and then open it back up again

earnest girder
#

ok

chrome beacon
#

Should cause Intellij to auto detect the poms presence

earnest girder
#

for invalidating caches, do I select any of the optional stuff?

chrome beacon
#

You can try the file system cache

#

Top one

earnest girder
#

kk

#

deleting .idea and reinstalling minecraft dev plugin did the trick

#

thanks for all the help yall

proper cobalt
#

what do i use as like a cuboid

#

i have a custom block that when placed should place a 3x3 of blocks i specify

#

but what "wrapper" do i use for the 3x3 to check if its empty for example

chrome beacon
#

?

proper cobalt
#

what

chrome beacon
#

There's no existing wrapper for that

proper cobalt
#

isnt there like a cuboid

chrome beacon
#

Not really

#

or are you using the WorldEdit API?

proper cobalt
#

i mean i could do

#

i just want to check if the 3x3 where the player places the custom block is empty

chrome beacon
#

You'd just have to for loop and check isAir

proper cobalt
#

thats not my strong point so iwas wondering if t here was an easy way thru

chrome beacon
#

I recommend just opening a creative world and placing down some blocks to visualize it

#

Should help you figure it out

proper cobalt
#

yeah ig, wouldnt the code be mad messy too

#

idk ill think of something

chrome beacon
#

It would be 3 for loops

#

nested but yeah

proper cobalt
#

also if i have pdc on a block then place it, then break it, it will lose that pdc right

#

im tryna have my printing press still work after being broken and then placed

chrome beacon
#

Might have to attach it after placing

proper cobalt
#

wym

chrome beacon
#

The PDC tag I mean

#

Same goes for breaking you'll probably need to add it to the item

proper cobalt
#

hm is there a better way

#

ig i could store the custom class with a location

#

and check if that location block is broken

chrome beacon
#

That's not persistent

proper cobalt
#

save it to a file

#

or sum

chrome beacon
#

Save it to the PDC

proper cobalt
#

bro the pdc just goes away i dont think it works on blocks

chrome beacon
#

?blockpdc

undone axleBOT
proper cobalt
#

fair scat limitations

chrome beacon
#

The CustomBlockData lib stores your NBT in the chunk instead of the block for you

#

So it works on non-tile entities

proper cobalt
#

swear if the block gets pushed by a piston or smth its ggs

chrome beacon
#

It does check for that

proper cobalt
#

na f that

chrome beacon
#

Not much you can do about it

#

You won't be able to work around checking that

proper cobalt
#

may do it the map location way

chrome beacon
#

That will still break if someone uses a piston

proper cobalt
#

true say

#

this that bs 🤦‍♂️

#

how has the game been out for 18 years and there isnt a good fix

remote swallow
#

18?!

proper cobalt
#

idk were a guess

remote swallow
#

?howold rd-132211

undone axleBOT
chrome beacon
#

wdym there isnt a good fix

proper cobalt
#

there isnt

#

is there

chrome beacon
#

You can just use the lib

proper cobalt
#

hows it done in legacy then g

chrome beacon
#

It will check what you need to for it

remote swallow
#

you use nbt and have to do it urself

#

much easier to update

young knoll
#

(You can’t store NBT in chunks without PDC)

proper cobalt
#

is the library foolproof 100% working no bugs

remote swallow
#

afaik yes

proper cobalt
#

type beat'

remote swallow
#

if you find a bug you report it and it gets fixed

proper cobalt
#

handy job

#

gonna have printing presses now cheers

young knoll
#

Well, it won’t handle stuff that doesn’t have events

#

Like /setblock

remote swallow
#

hey jish

#

you should add a block setted event

young knoll
#

Or plugins doing block.setType

proper cobalt
#

shouldnt be using dam ones

#

wouldnt*

#

worldedit?

#

will that fuck shit up