#help-development

1 messages · Page 1269 of 1

crude zephyr
#

or am i fucking stupid

cosmic elk
#

youre not stupid lol

#

but youre trying to refrance the block that was broken before returning it

sly topaz
#

what is the block field

cosmic elk
#
    public void onDestroyCrops(BlockBreakEvent e) {

        if(Tag.CROPS.isTagged(Material.WHEAT)) {
            Ageable ageable = (Ageable) block.getBlockData(); // youre trying to get the age of the block before you set the object
            if (ageable.getAge() == 7) {
                String message = "Wheat Broken!";
                Block brokenBlock = e.getBlock(); // This is the block youre trying to get the age of
                Location location = brokenBlock.getLocation();
                World world = location.getWorld();
                world.spawnEntity(location, EntityType.EXPERIENCE_ORB);
            }
        }
    }```
sly topaz
#

well, the code is confusing, that if statement is checking if #crops contains wheat, which it does, always

#

you're meant to get the type of the broken block and then check if that is tagged, not a specific material

cosmic elk
#

so something like this

 String message = "Wheat Broken!";```
wont work because youre refrancing the object, *then* you create it, but Java works down line by line, so youll need to make the object then get the age data
sly topaz
#

I am going to be annoying one last time I strongly recommend you just do a java course

#

it really doesn't take long and should give you a better foundation than shooting darts in the dark like you're doing right now

#

if you do ?learnjava in #bot-commands, you'll see a few options, I personally recommend the Jetbrains course

crude zephyr
#

i cant fucking do it

#

i just want this one thing done

#

i dont understand what goes before what

#

i havent programed in 2 years

#

im fucking stupid

true cosmos
#

Okay not really for this but hear me out

#

vibe code

#

maybe if your desperate idk

cosmic elk
# crude zephyr im fucking stupid

dont be too hard on yourself like ive been coding since I was 10 and it took me a month at least to start understanding Java, id highly recommend forgetting about coding plugins for a bit and start with just Java, that video I sent is very good for explaining the basics and maybe following along in an online complier is worth trying yk?

crude zephyr
#

i just want this done then ill stop

#

my client wants this plugin for his server

#

and i said i can try do it for him

#

but its to fucking hard

true cosmos
#

what is this person asking for

cosmic elk
true cosmos
#

im curious if their scope is even fair

crude zephyr
#

the 4 ideas where,
a message that is sent in chat when someone joins the world
a pop sound when someone teleports
a death message when someone dies
and crops dropping EXP

cosmic elk
#

if youre getting stressed out i wouldnt mind writting that last method for you if you want

sly topaz
#

hell, I'd even use Skript for this if it being a plugin isn't a requirement

true cosmos
#

some lingo term i learned yesterday lol

#

id encourage using it to navigate docs

sly topaz
#

I wouldn't, it's poison for beginners

true cosmos
#

what import do i need for this event?

#

where do i put it?

sly topaz
#

the issue is exactly that, a beginner doesn't know what questions to ask themselves

true cosmos
#

we need both, you and i.

#

one for it one against

crude zephyr
#

okay im back
can we just find what i need to fix and then i stop coding

#

im not a coder

#

tiz exactly why im doing hadware servicing at uni

cosmic elk
crude zephyr
#

okay

#

done

#

but we havent set the exp amount

cosmic elk
#

true

#

just a sec imma look into how to do that

crude zephyr
#

also this error message

#

im asumming just remove that import line?

cosmic elk
#

yup if its just gray theres no need for it

crude zephyr
#

done

cosmic elk
worldly ingot
cosmic elk
#

I honestly dont really understand spawning entities i almost never do it

crude zephyr
#

okay so this should work
should i build it and test if it works?

cosmic elk
crude zephyr
#

also can i remove the wheat broken mesage
where is that even being said?

sly topaz
#
@EventHandler
public void onBreak(BlockBreakEvent event) {
  var block = event.getBlock();

  if (!Tag.CROPS.isTaggedIn(block.getType()))
    return;

  var data = (Ageable) block.getBlockData();

  if (data.getAge() == data.getMaximumAge()) {
    world.spawn(block.getLocation(), ExperienceOrb.class);
    event.getPlayer().sendMessage("Crop broken!");
  }
}
crude zephyr
#

why is that diffrent 😭

worldly ingot
#

Not all crops age to 7. Some age to 4, some age to 6, etc.

crude zephyr
#

thats what i thought

cosmic elk
crude zephyr
cosmic elk
worldly ingot
#

You've registered your listener too, yes?

crude zephyr
#

plugin not showing in game

#

FarmingEXP

#

this is all the code

quaint mantle
#

Are you sure it's enabled?

crude zephyr
#

wdym

quaint mantle
#

Does this console have the enable message?

crude zephyr
#

i dont see it

#

my other plugin works but this one doesnt

#

yeah its not in the terminal

quaint mantle
#

Are you sure the plugin is in the /plugins/ directory?

crude zephyr
#

found the issue

#

wait no i havent

sly topaz
#

do you have a plugin.yml in your resources folder

#

if not, create one

crude zephyr
sly topaz
# crude zephyr

well, if you see that message then it should definitely be seen in game unless an error popped up right after that

#

if you're unsure, send the logs here

#

?paste

undone axleBOT
crude zephyr
#

plugin working kinda

#

but no exp dropping when fully grown wheat crop destroyed

cosmic elk
sly topaz
#

what does your code look like right now?

quaint mantle
#

DEBUG

crude zephyr
#

i just want this to be done 😭

sly topaz
#

can you try what I sent instead

quaint mantle
#

Can you use debug statements?

sly topaz
#

just comment out what you have right now by surrounding it with /* and */

crude zephyr
#

i dont understand

quaint mantle
#

why are you using Tag?

crude zephyr
#

isTagged?

#

oh Tag...

#

idk

sly topaz
#
public class FarmingEXP extends JavaPlugin implements Listener {

  @Override
  public void onEnable() {
    getServer().getPluginManager().registerEvents(this, this);
  }

  @EventHandler
  public void onBreak(BlockBreakEvent event) {
    var block = event.getBlock();
  
    if (!Tag.CROPS.isTagged(block.getType()))
      return;
  
    var data = (Ageable) block.getBlockData();
  
    if (data.getAge() == data.getMaximumAge()) {
      var location = block.getLocation();
      location.getWorld().spawn(location, ExperienceOrb.class);
      event.getPlayer().sendMessage("Crop broken!");
    }
  }
}
#

this is all your class should have

quaint mantle
#

Sir

#

This is java

crude zephyr
#

your confusing me

quaint mantle
#

Just replace var with Block and Ageable

sly topaz
#

var has been a thing since java 11, if they're running 1.21.5 then they're at least running java 21

quaint mantle
#

Ah

#

I'm on 8 khajiit

#

Noted tho

crude zephyr
#

okay this is what i have
` @EventHandler
public void onDestroyCrops(BlockBreakEvent e) {

    if(Tag.CROPS.isTagged(Material.WHEAT)) {

        String message = "Wheat Broken!";
        Block brokenBlock = e.getBlock();
        Location location = brokenBlock.getLocation();
        World world = location.getWorld();

        Ageable ageable = (Ageable) brokenBlock.getBlockData();
        if (ageable.getAge() == 7) {
            world.spawnEntity(location, EntityType.EXPERIENCE_ORB);

            ExperienceOrb orb = world.spawn(location, ExperienceOrb.class);
            orb.setExperience(5);

        }

    }

}`

what do i change it to

quaint mantle
#

Please use pastebin

crude zephyr
#

?

quaint mantle
#

?paste

undone axleBOT
crude zephyr
#

i dont know what thats used for

quaint mantle
#

wait

#

uh @sly topaz

#

Isn't Tag supposed to be use with Material?

sly topaz
#

tags are just collections of things, in this case you'd use it with a Material yes

quaint mantle
#

So why not get the brokenBlock as Material?

#

and then check if the material is wheat

rotund ravine
#

He is?

sly topaz
#

they are not

quaint mantle
#

They weren't

rotund ravine
#

You were

sly topaz
#

ah yes I was

quaint mantle
#

Not them

#

The other person

sly topaz
#

english is hard

crude zephyr
#

so...

#

whats the issue

rotund ravine
quaint mantle
#

Can we all speak in spanish instead

rotund ravine
#

Nop

crude zephyr
#

i dont even know english well 😭

quaint mantle
#

wait

sly topaz
quaint mantle
#

Can you check BlockState instead of Ageable?!?

rotund ravine
#

Hm?

quaint mantle
#

Nevermind

quaint mantle
#

Holdon, lemme try this

rotund ravine
#

Wheat is not a blockstate?

quaint mantle
#

but you get the blockstate from the broken block?

crude zephyr
#

i just want this to be fixed
i dont know how to finish this myself

rotund ravine
quaint mantle
#

Aj

#

Okay

sly topaz
#

CropState is MaterialData stuff don't touch that

quaint mantle
#

AH

#

I forgor spigot

sly topaz
#

I am amazed at the fact MaterialData hasn't been removed yet even though there's probably not a single plugin which depends on it nowadays

quaint mantle
#

Just cause you mentioned that

#

I'm gona make a plugin w MaterialData

rotund ravine
#

Cause of “legacy”

sly topaz
#

and even if one old plugin were to, it is likely that it'll have more issues than just using MaterialData lol

rotund ravine
sly topaz
#

do old plugins even load, given they don't assign api-version

quaint mantle
#

api-version is post 1.13 ?

rotund ravine
#

Bytecode manip too for the Material class

sly topaz
#

ah right, no api-version just triggers legacy material support

#

fun

quaint mantle
#

I'm to eepy to understand spigot

rotund ravine
#

I just woke up

quaint mantle
#

Are you flexing?!

rotund ravine
#

Yes

sly topaz
#

I flex on the morning when I wake up too, it's good for your joints

#

runs

random compass
#

Hi guys. I am trying to develop a plugin and resource pack to make blocks of meat. im wondering if this is even possible. ive tried using noteblocks but the texture kept changing back to normal notebloks

rotund ravine
#

Sure

#

What version my guy

random compass
#

1.21.4

#

paper

rotund ravine
#

Use customblockdata

sly topaz
#

?whereami

rotund ravine
#

?customblockdata

random compass
rotund ravine
#

Not a thing?

#

Oh wiah that’s not what it’s called

#

Uhh

sly topaz
#

custommodeldata

rotund ravine
#

Yeah

random compass
#

i want it to be placeable, breakable and act kinda like a dirt block

crude zephyr
#

ok im going to get food
when i get back can somone help me what the issue is with my plugin

rotund ravine
sly topaz
#

it is possible, however you'll have little luck asking about resource packs specific questions here, we can only help achieve the logic from the plugin side

#

or maybe you're lucky and rad wakes up by the time you start working on it

#

they're the only person I know here that deals with resource pack stuff and plugins

random compass
sly topaz
#

here I forwarded it

crude zephyr
#

ping me if you can help
im having a brake

crude zephyr
#

thats compleatly diffrent

rotund ravine
#

How so

crude zephyr
#

multiple var, i dont even know what that does

rotund ravine
#

Nothing, basically just too lazy to write the proper type

random compass
#

all the tutorials on cusotm model data are on items not blocks. i give up

smoky anchor
random compass
#

So I can’t make a meat block

smoky anchor
#

I see you already tried noteblocks.
You have to do a bit more there, cancel the update events if it's your custom block and such.

smoky anchor
random compass
#

Mmmm I did try maybe it’s the code that’s the problem not the resource pack

smoky anchor
#

Ye, most likely the code.
It's not as simple as "slap custom model on noteblock and be done"
If you care about survival you gotta solve that too somehow (I just made tuning fork item and forbid all but one noteblock state to begin with)

echo basalt
#

?blockpdc

undone axleBOT
echo basalt
#

smh

random compass
#

That’s informative

#

But I still have no clue how to do it

#

I think it’s a bit complex for a beginner like me

rotund ravine
echo basalt
#

not evne

rotund ravine
echo basalt
#

not even

#

custom model data doesn't apply for blocks

#

You could give it a go with display entities but you'll still need a base for them to be breakable

#

You could go for barrier blocks but they don't crack even with packets

#

People just use note blocks with some funky hacks

#

You have dozens of combinations and each one of them can be textured

#

You'll still have to track the block itself in space and that's what blockpdc is for

#

except worldedit support big L

crude zephyr
young knoll
#

it’s like 1100

smoky anchor
crude zephyr
smoky anchor
crude zephyr
#

im sorry but i dont know how to do this
this is harder than expected, can you please supply me with the answer

#
    public void onBreak(BlockBreakEvent event) {
        var block = event.getBlock();

        if (!Tag.CROPS.isTagged(block.getType()))
            return;

        var data = (Ageable) block.getBlockData();

        if (data.getAge() == data.getMaximumAge()) {
            var location = block.getLocation();
            location.getWorld().spawn(location, ExperienceOrb.class);
            event.getPlayer().sendMessage("Crop broken!");
            
        }
    }```
#

e.g. please edit this

smoky anchor
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

crude zephyr
#

idk if you know what im wanting but
plugin that gives one exp when a fully grown crop is broken

smoky anchor
crude zephyr
eternal oxide
#

Not rude.

nova notch
eternal oxide
#

You have taken all day because you don;t know java

crude zephyr
#

yes exactly
i dont know what im doing

eternal oxide
#

So learn. You will not learn by being spoonfed

crude zephyr
#

i dont want to learn now

eternal oxide
#

Then pay someone to do it for you

crude zephyr
#

i prefer hardware over software

#

i was just trying it out

eternal oxide
#

People are here to help those who wish to learn

crude zephyr
#

im sorry

nova notch
#

if you aren't gonna learn why even bother trying

crude zephyr
#

well i wanted to learn before

#

but now im over it

mortal vortex
crude zephyr
#

im so fucking stupid i dont know how to do the simplest of things

random compass
#

Learn basic java first

crude zephyr
#

i dont have time

eternal oxide
#

You wasted a day on this so far. You could have learnt java basics by now

mortal vortex
#

Nothing comes to anyone who doesnt try

crude zephyr
#

ive been trying all day

#

i dont want to fight
this was more than i can chew

smoky anchor
#

If you're only missing this then I'll 🥄
location.getWorld().spawn(location, ExperienceOrb.class, xp -> xp.setExperience(NUMBER));

crude zephyr
#

i dont know how close i was
top one mine, bottom one yours

mortal vortex
#

@crude zephyr Pay for a subscription to Claude

smoky anchor
#

lowercase l

smoky anchor
mortal vortex
crude zephyr
#

im in Uni
im preparing for a job

mortal vortex
#

then focus on uni

#

what r u tryna do anyways and why dont u get someone to do it for you

crude zephyr
#

today was my day off
hence why i dont have time

mortal vortex
#

quit gooning on ur other days off then

#

lock in

crude zephyr
mortal vortex
#

to?

smoky anchor
mortal vortex
#

is it complex? and is it something someone else can js do for you?

ocean gorge
#

do the action bars not even support emojis as BossBars?

smoky anchor
#

'emojis' ?
And everything that renders text is the same, so whatever bossbar can do, action bar can do too

ocean gorge
#

Emojis ---> ItemsAdder

crude zephyr
mortal vortex
#

ItemsAdder
is this truly development relaterd

smoky anchor
mortal vortex
crude zephyr
#

i tried it with 0 levels and it did nothing

smoky anchor
#

It's not level, it's XP

mortal vortex
#

Try setting it to 5.

crude zephyr
#

i know how exp works
1, does nothing
5, too much
testing 2 now

mortal vortex
#

not saying to USE 5, but can you test that 5 even does anything

crude zephyr
#

"5, too much"

#

2 seems alright but alittle much

#

idk why 1 dosent work

smoky anchor
#

Wanna spawn orb with 2 only 50% of the time ?

#

would "solve" that problem

mortal vortex
#

But its weird though.. that 1 exp isnt being rendered?? level 0, needs 17 xp to get to level 1. and there are 18 segmetns in the XP bar. going from 0xp to 1xp would change the first bar surely?

smoky anchor
#

7 xp no ?

crude zephyr
#

1 working now
idk why it wasnt before

smoky anchor
#

smh does not even remember level xp values

mortal vortex
#

kek im still using fandom

smoky anchor
#

Literally why
It's ad-riddled shithole of clearly incorrect information

mortal vortex
#

BECAUSE it still overtakes mc.wiki on certain seo results

smoky anchor
#

there's a browser extension to replace/remove those

crude zephyr
#

7 crops = 1 level up (level 0 to level 1)

#

okay the plugin is finished

smoky anchor
#

👏 👏 👏

crude zephyr
#

next time ima hire someone again

mortal vortex
#

how you detecting what is and what isnt a crop? Do you have an enum?

#

hire me, free gang

smoky anchor
#

using the tag, should theoretically be future proof

mortal vortex
#

okay hang on lol

#

have u made sure that tag doesnt include bamboo?

smoky anchor
mortal vortex
#

where someone could place, and farm bamboo

#

okee good

smoky anchor
#

I guess pumpkin/melon might be a problem

mortal vortex
#

lol yes

crude zephyr
#

wait abb3v your free to hire

smoky anchor
#

the ancient flowers are fine

crude zephyr
#

id feel bad

mortal vortex
crude zephyr
#

ill dm you if my client wants any other plugins

smoky anchor
#

tempted to ?services rn :D

mortal vortex
mortal vortex
crude zephyr
#

youtuber :P

#

i said i would try

crude zephyr
smoky anchor
#

yes, keep it that way, as abb3v said it would be too much to make it work as expected

crude zephyr
#

thing is pumpkins can be automated unlike wheat (not inculding villagers)

#

wait do villagers spawn exp now?

smoky anchor
#

you mean them breaking the crops ?

crude zephyr
#

yes

smoky anchor
#

they spawn XP when you trade with them, they have since like 1.14 I bet

smoky anchor
#

"Called when a block is broken by a player. "
nvm no

#

unless docs are wrong just

#

?tas

undone axleBOT
crude zephyr
#

i like that man

#

little man

#

villagers do not summon exp

smoky anchor
#

docs did not lie \o/

crude zephyr
#

okay abb3v ill dm you if i need anything else made

#

and i will be paying

#

:)

mortal vortex
smoky anchor
#

but you can't afford claude 🤔

smoky anchor
#

(which btw is a horrible suggestion, chat GPT would do just fine for something this simple)

mortal vortex
mortal vortex
# crude zephyr ooo thats cool

yeah so melon stems and melons arent the same, as i said, if you included melons themselves, you could break and get EXP, but then replace it, and keep farming

crude zephyr
#

yee we dont want that

crude zephyr
#

dont like it

#

human art/code is way better

smoky anchor
#

good

crude zephyr
#

one of my classmates uses chatgpt regularly instead of making his homework himself

#

pathetic

smoky anchor
# crude zephyr yee we dont want that

they way to solve that would be to: when the blocks grow, remember them
when you break those blocks, check if they are in the PDC, spawn XP and remove from PDC
For this you'd use Alex's blockPDC
Leave this on abb3v tho if you want this

young knoll
#

Probably easier to mark ones that get manually placed

mortal vortex
#

^

#

BY YOU

smoky anchor
#

I KNOW

#

SHUSH

mortal vortex
#

SO SHOULD I USE PDC OR NOT?? I STILL NEED AN ANSWER

crude zephyr
#

thanks for the help
ill reach out if i need anything more

floral marlin
smoky anchor
young knoll
#

A bitset for every block in the world?

mortal vortex
#

To jog your memory, or if you werent present. I want to detect if a block was placed by a player, or if it was naturally occuring.

young knoll
#

PDC or a database

#

PDC is easier but will take up a bit more storage than a proper database

mortal vortex
#

a cigar is what, 30-40 for a single?

real lagoon
#

Idk

warm mica
drowsy helm
#

Anyone aware of a method/event that I can listen to to detect a tripwire getting depressed thats NOT connected to a tripwire hook. Cant seem to find anything for this

young knoll
#

Technically the physics event probably fires

drowsy helm
#

it does not

young knoll
#

Really? But the block state changes

drowsy helm
#

Currently listening to BlockPhysicsEvent,PlayerInteractEvent,EntityInteractEvent and none of those capture non-attached tripwires

young knoll
#

It triggers observers so I figured it would

drowsy helm
#

yeah it's quite strange

mortal vortex
drowsy helm
#

honestly i might just have to only used tripwire in attached state

mortal vortex
#

tripwires without tripwire hooks are effectively decorative and do not emit redstone signals or cause block state changes.

#

Try it by connecting an observer

#

even if there was an API method to detect something, where would still have to be that something to detect

drowsy helm
#

I'll be damned

#

Youre right

young knoll
#

Wot

#

But I know people have used that before

#

Did Mojang change it?

drowsy helm
mortal vortex
#

afaik, always been like it

#

you know how using a debug stick u can place certain blocks? can you place a trippable tripwire without hook?

young knoll
drowsy helm
#

oh maybe because im cancelling the event

slender elbow
#

bruh

young knoll
#

lol

#

It's likely client prediction that is making it still change

#

¯_(ツ)_/¯

mortal vortex
#

okay cant u just now check for a blockstate change?

young knoll
#

There is no magical block state change event

#

Closest would be the physics event

mortal vortex
#

nerd

drowsy helm
#

cancelling the event or not, visual update still happens

#

I have a feeling thats client-side

smoky anchor
#

time to check packets :D

#

or better yet, unplug your internet

drowsy helm
winter jungle
#

What's the new name of the ClientboundAddPlayer packet? xd

smoky anchor
#

?mappings

undone axleBOT
winter jungle
#

I guess that will save my life

#

thank you

drowsy helm
#

new versions use the entity add packet now

cinder epoch
#

hi guys, how to disable chat color

#

i did set all perm .color to false in luckperm but still doesn't work

slender elbow
#

"disable chat color"?

cinder epoch
#

i mean prevent members using color code &e &b

slender elbow
#

well, do you know what plugin is allowing that in the first place?

umbral ridge
#

BetterJails

slender elbow
#

because that is not a vanilla spigot behaviour

umbral ridge
#

BetterJails is causing it

#

fix it Emily XD

slender elbow
#

xDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

#

no

cinder epoch
#

there's my plugins

wet breach
#

you would think to start with the obvious named plugin

umbral ridge
#

EvenMoreFish

cinder epoch
#

hmm

#

i did find a better way to prevent that

#

also thank u guys

winter jungle
#

What's the packet called to rotate a head of an entity (NPC) in 1.21.4

grand flint
#

Hey guys if I need to have a location where the player for example receives an item to use while in it, how can I define it?

#

Can't be cords because I spawn the arena in

dawn flower
#

how do i turn a fawe world into a bukkit world

#

nvm

blazing ocean
#

BukkitAdapter

umbral ridge
#

whats a purpose of a brush

#

can blocks be dirty?

smoky anchor
#

brush armadillo scute from armadillos, brush suspicious sand for loot

umbral ridge
#

ooohh

smoky anchor
#

also, wiki exists for this exact type of question

worldly ingot
#

y wiki when u be wiki

slender elbow
#

/chocogpt whats a purpose of a brush

remote swallow
#

/emilygpt what's a purpose of a brush

wicked estuary
#

can someone help me with the multiverse-core plugin??

silent slate
#

Hey, do any of you recommend any sort of Inventory Management API, theres a lot of them and i dont really know what is the most used/best.

tranquil ferry
#

didnt not work 😭

#

even added screen and explanations to this

#

but decison was made towards buyer

vagrant stratus
#

Yea, there's never a 100% chance of either side winning. Just gotta do your best really

chrome beacon
grand flint
#

Hm

#

How would I store the initial cords

chrome beacon
#

Just as relative coords

#

Assume one corner of the arena is at 0,0

buoyant viper
blazing ocean
#

no

buoyant viper
#

damn

#

literally had just refactored my code n one of my classes is BukkitAdapter

blazing ocean
#

that's a WE class too

thorn isle
#

and probably in most other multiplatform projects

grand flint
primal vector
#

enemy.setFireTicks(3240) does anyone know why I can't set the fireticks to an insane value? the fire just stops after 4 seconds
I tried enemy.getMaxFireTicks() and it returns 1 so idk what's going on
(tested on a iron golem)

sly topaz
echo basalt
#

I should release my new one some day

#

debugging it rn it's real real fun

blazing ocean
#

it looked fun to debug

echo basalt
#

Still debugging

#

For some reason items kinda lose tracking when I'm trying to detect an update

#

and if I call forceUpdate when an update happens it duplicates old items

paper viper
#

I'm not a big fan of stef's IF

#

Never tried DevNatan's inventory-framework before

echo basalt
#

I tried triumph just found some parts of it wacky

#

and I don't think there are any libs rn that have all the BS restrictions mine has

#

mine also doesn't have all the features tbf

paper viper
echo basalt
#

Making it work with configs and stuff was just tiring

paper viper
#

but how is that related with the lib

echo basalt
#

It isn't it just didn't fit my use case

#

And still doesn't even by old standards

#

I find it quite basic but that's by design

echo basalt
#

?services

undone axleBOT
vagrant stratus
#

Y'all a bunch of nerds so you might have an answer to this.

How would I go about getting all of the loaded strings? I know that one can just read the byte code and get the LDC values, but I don't feel like making a jvm emulator lol

alpine urchin
#

Since we’re nerds we’ll gate-keep the answer.

thorn isle
#

that'd only get the compile time constant strings

#

what are you doing?

vagrant stratus
sly topaz
#

well, their 3.x is, it is been a thing for 5 years now apparently lol

#

time flies

thorn isle
#

short of altering the String constructor, the gc string deduplication code, or taking + inspecting a heap dump i don't really see any sane way of "getting all the loaded strings"

grand flint
thorn isle
#

depending on what you're doing it might be wiser to try and narrow down your scope

vagrant stratus
#

Dealing with obf, which requires getting strings after they're loaded

#

Only other option is making an entire emulator which is.... Ehhh

urban cloak
#

Ye the only option i see too is using a profiler

vagrant stratus
#

Might just go with a JVM fork then since I can then work with them programmatically. Not gonna be easy to do though 🤔

urban cloak
#

well you could work with them programmatically with a rofiler too

vagrant stratus
dry hazel
#

I mean that does not seem to interpret indy

#

so it's not that useful in today's day and age

vagrant stratus
#

indy?

dry hazel
#

invokedynamic

sly topaz
#

run your application with the debug agent and then use JDI to grab all String instances

vagrant stratus
dry hazel
vagrant stratus
#

That's even more over-complicated kekw

#

Hmm. Gonna have to re-go through the various obf I have and see wtf to do from there

#

like ldc "TestUser" is super easy to deal with. It's just an LdcInsnnode in Objectweb ASM

but then there's stuff like this deobf

        final int iterationCount = 19;
        final byte[] salt = { -87, -101, -56, 50, 86, 53, -29, 3 };
        try {
            final KeySpec keySpec = new PBEKeySpec(key.toCharArray(), salt, iterationCount);
            final SecretKey secretKey = SecretKeyFactory.getInstance("PBEWithMD5AndDES").generateSecret(keySpec);
            final AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, iterationCount);
            final Cipher cipher = Cipher.getInstance(secretKey.getAlgorithm());
            cipher.init(2, secretKey, paramSpec);
            final byte[] decrypted = cipher.doFinal(Base64.getDecoder().decode(encryptedText));
            return new String(decrypted, StandardCharsets.UTF_8);
        }
        catch (final Exception e) {
            e.printStackTrace();
            return null;
        }
#

It's be easier to just get that return string instead of re-implementing that entire deobf 😐

#

or one which is just replace & base 64 decrypt

#

There's a bunch which rely on stacktraces & such too 😐

sly topaz
#

worked fine, I used 100 instances just to test it though, don't know how well it scales with thousands of strings

ivory sleet
#

interesting strings

brisk estuary
#

Both the task and the listeners are registered correctly. Also, the event is not being cancelled. I have no idea why the listener isn’t being triggered, I’d really appreciate some help.

eternal oxide
#

IF you are really registering your listener ok then there must be an issue in your event itself

rotund ravine
#

We’d need logs, as well as the mainclass that handles creating the eventlistener

echo basalt
#

are you ever calling new LeagueEventsListener

sly topaz
#

my guess is that they forgot the handler list in their event class

echo basalt
#

@thorn isle I finished the menu abstraction over NMS

desert aspen
#

this error show when i start the serv

#

what should i do

young knoll
#

Compile the plugin with an older version of java

desert aspen
#

what version should i use? mi plugin is for 1.21.1

young knoll
#

21

#

You’re currently using 22

desert aspen
#

alr thanks

quaint mantle
#

Are multi module projects supposed to have plugin.yml for each module?

buoyant viper
#

if each module is a plugin id say so probably

somber scarab
#

I do not need to keep world edit in my pom if I am building against fawe right?

#

and I assume no code changes?

wet breach
#

it just depends what you are doing, there might be some methods you need from WE or maybe not. But if there is, you need WE

#

as long as you are not shading WE or FAWE which you shouldn't be, it doesn't hurt to keep it in the pom

somber scarab
#

hmm well coincidentally I just got this from removing world edit Could not find IQueueExtent from `com.sk89q.worldedit.bukkit.BukkitWorld` instance for entity retrieval, OncePerChunkExtent will not work.

#

I had removed any trace of world edit and replaced it with fawe

wet breach
#

you have your answer then 😉

somber scarab
#

so i guess that was not how to doit

wet breach
#

FAWE depends on WE

#

its basically in its name

#

just because you depend on FAWE doesn't mean FAWE shaded WE.

somber scarab
#

yea. I just didnt know how much fawe really replaces world edit? or maybe I don't exactly understand how fawe works with world edit

wet breach
#

only if a jar has shaded a dependency will the transitive dependency methods be available to you

somber scarab
#

hm yea makes sense

#

FAWE is calling me dumb

** 
** A plugin developer has included a portion of 
** FastAsyncWorldEdit into their own plugin, so rather than using
** the version of FastAsyncWorldEdit that you downloaded, you
** will be using a broken mix of old FastAsyncWorldEdit (that came
** with the plugin) and your downloaded version. THIS MAY
** SEVERELY BREAK FASTASYNCWORLDEDIT AND ALL OF ITS FEATURES.
**
** This may have happened because the developer is using
** the FastAsyncWorldEdit API and thinks that including
** FastAsyncWorldEdit is necessary. However, it is not!```
#

here's my pom.. I followed the tutorial from fawe's docs

chrome beacon
#

Time to rebuild

#

You probably built it without the provided scope on FAWE

brisk estuary
#

It turned out the obfuscation of the plugin jar was the cause of the issue xd

#

Even though the obfuscation was properly configured, I don't know what went wrong, because I set it up to exclude the custom event classes from being obfuscated

ocean gorge
#

😠

smoky anchor
# ocean gorge 😠

I'm still gonna answer, thanos method time.
Remove 50% of plugins, see if your problem is fixed.

ocean gorge
#

mh

winter jungle
#

Hey, I'm currently having a bit of a mental problem with my code. So in the orange area I load the world with the name "world" (this will be changed later)

And in the red area I use my ArmorStand handler to register locations, the problem is only at this point the world is not fully loaded yet.

So what is the best way to wait until the world is fully loaded before I use my ArmorStand Handler? Unfortunately I have not found a WorldLoadFinished event (only in NMS)

chrome beacon
#

How do you know the world isn't loaded yet

winter jungle
#

Beautiful drawings i know

chrome beacon
#

Load your plugin postworld instead of before it?

winter jungle
#

Oh, I didn't know that was possible. But how does it work with worlds that are loaded afterwards, i.e. non-standard Minecraft worlds?

wet breach
# winter jungle Hey, I'm currently having a bit of a mental problem with my code. So in the oran...

if you are needing something on server start you should use serverloadevent. It fires when the server is finished loading including loading up any worlds on start up. If you are just needing something that is a bit more dynamic like a world could be loaded later etc. Then here is this method https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Location.html#isWorldLoaded()

#

What olivio said is also a thing too, in the plugin.yml you can specify to load post world

winter jungle
#

The funny part is, this method works on 3 different subservers, but in the fourth its not working anymore. Idk if its the map, but its so weird

wet breach
#

so you have a few options. You can even go old school and that is just set a timer in the onEnable where you just wait a bit of time before doing anything

#

everyone is always impatient and believes everything must be done immediately the moment their plugin loads/enables

#

I am a fan of the timer method just fyi as it is simple and doesn't rely on anything

eternal night
wet breach
#

that event fires when it loads, but not necessarily when it is done

eternal night
#

Except the world is loaded perfectly fine at that point in time

#

The event already exposes a World instance

#

in terms of e.g. bukkits WorldCreator, this event is the last bit that is executed in the loading logic

wet breach
eternal night
#

Sure 👍 as I said, that ought to work fine for them to read through worlds loaded later

wet breach
#

Yeah, it should I agree

winter jungle
#

I hate Minecraft. The problem was simple: The chunks from the Armor Stands are not loaded yet

#

🫡

somber scarab
#

@wet breach do you know anything about world generators?

#

<.<

#

or where I can learn about them? I'm trying to generate sky islands for my floor is lava minigame

#

so far this is my prograss following that one tutorial made my coolJWB

young knoll
#

Oh boy where’s that article

#

Hmm can’t find it, but I can provide some links

sly topaz
#

I'll be damned

young knoll
#

Rip

#

I thought discord let you view links even if you weren’t in a server

#

Maybe that’s only message links

sly topaz
#

who else would I be accepting it as

#

I wonder how much of that server deals with bukkit-style chunk generators

somber scarab
#

here's the tutorial I followed

#

its pretty decent

young knoll
#

Noise generation go brrr

echo basalt
#

it was not simple

#

I had to write quite a bunch woeisme

drowsy helm
#

Nerd

#

Whats a noop

echo basalt
#

No op

thorn isle
#

mojangsters make do with like 5 classes

echo basalt
#

Eh

#

a lot of it is me wanting flexibility

#

Mojang does it with inheritance and strong typing, I don't get that luxury

#

I did get to write like 3-4 layers of abstraction to get away from nms as much as possible and that allows me to have nms-like control without having to rewrite all of it if mojang decides to update

thorn isle
#

is this up on github somewhere? i could take a peek at some point

echo basalt
#

Not for a while

still pollen
#

oh i cant upload my code

thorn isle
#

mmm i suppose i should've known from everything being green lmao

echo basalt
#

There's a bit more to it tbf

#

nothing too wild

slender elbow
#

all that for a List<ItemStack>

#

depressing

echo basalt
#

:(

#

has logic to it

#

and I did the good ol' cookie clicker

slender elbow
#

fair enough

echo basalt
#

also I suffered for 2 hours because nms itemstacks are kinda mutable and I didn't expect

thorn isle
#

yeah it's incredibly ass

#

everything relies on the fragile prayer that any accessor who grabs an itemstack and modifies it calls ::update on the slot they grabbed it from

#

i'm surprised there are only dozens rather than hundreds of dupes in the game

quaint mantle
#

Dupes are caused by nms?!

#

🧐

slender elbow
#

vanilla minecraft contains dupes, yes

#

shocking 😱

thorn isle
#

dupes? in MY nms? it's more likely than you think

blazing ocean
#

no, they're in con's NMS

echo basalt
#

but I caught them somewhat early on

#

specifically remove()

somber scarab
#

dupes from namespaces?

#

item dupes?

floral fern
#

hey can i get refund as the we cant get the dev help of that owner @ivory sleet

pseudo hazel
#

?support

undone axleBOT
wet breach
#

then you will have to contact paypal for that

#

spigotmc has nothing to do with payments other then just integrating payment processor for ease of use

somber scarab
#

what do you guys do in order to learn about a thing that has very few resources on learning it?

#

like

#

custom world generation

#

I feel like my last resort is to either dig up some other plugin and dig through all its code.
or ask AI.

and I feel like one of those answers is the right one and it's drawing very close.. almost too close. my ADHD won't handle

sly topaz
#

seeing examples help, but as long as you understand the problem space it shouldn't be hard to deduce from the implementation of the API

#

well, in most cases anyway, this being spigot that proves to be rather convoluted as it's kind of a mess of patches and decompiled code which doesn't make for a pretty experience

wet breach
somber scarab
#

what even is a good project to analyze for world gen

wet breach
#

its not like its unviewable

somber scarab
sly topaz
#

Minecraft itself

somber scarab
#

minecraft code itself

#

👭 how do I do that

wet breach
#

granted however some of us here don't actually require the code to be deobfuscated to read/understand it which I Recommend you getting used to

somber scarab
#

or better question is

wet breach
#

makes it far easier instead of always trying to deobfuscate lol

somber scarab
#

how do I do that without going crosseyed

sly topaz
#

if you want to read vanilla code I personally recommend Parchment as mappings flavor as they got javadocs for some methods as well as parameter names which is useful

wet breach
#

but yeah, that is essentially what all the devs deemed pro's do is just read the code

sly topaz
#

like, what is your goal with world gen

wet breach
#

which good luck I suppose

sly topaz
#

yeah but I assume they want to use that world gen for something specific and not just for the sake of knowing lol

wet breach
#

its quite the mess

somber scarab
#

okay

slender elbow
#

world gen :despair:

#

it's all about understanding noise

sly topaz
#

you don't even have to understand it tbh, just take a noise generator and modify its parameters enough to match whatever you want

#

unless you're Jish and you're making a dungeon generator or something

somber scarab
#

I have, on my hands two things..

  • junior level software developer experience
  • the most polished Floor is Lava UFC minigame out there

I just need to make it fun and fresh all the time.

that's why I need to learn world gen in order to incorporate my own world parameters

  • like ensuring wood and trees are abundant
  • my floor level is always around Y 40 - 60
  • I have custom naturally generating sky islands with ores (to allow ppl to get ores without diving towards the lava rising from the bottom)

so I thought about making my OWN world generation tool so I can make custom plots of land while still making it look like "minecraft"

#

just look here and ull get it

sly topaz
#

isn't that the one I cloned last week to debug an issue with some inventory handler being null

somber scarab
#

yes uwu

wet breach
sly topaz
somber scarab
#

I dabled alone a lil and this is what I managed to do

sly topaz
#

what I'd do is take a ChunkGenerator, then iniside of it use a noise generator of your choice, Bukkit has SimplexOctaveGenerator and PerlinNoiseGenerator if I rememeber correctly, you could also just take a library instead of using bukkit defaults

wet breach
#

chunk generator is probably ideal for skyislands, however in the image above if you wanted a sky region instead chunk generator isn't that ideal

sly topaz
#

then to limit the height you'd have to take the generated noise, multiply it by some factor then add (min_height + max_height) / 2 to it

somber scarab
somber scarab
#

but I gotta do it

wet breach
#

well, that is still easy to do with a chunk generator if you are just doing something like skyblock but differently

somber scarab
#

sky block but better

sly topaz
#

as for the sky islands, inside the same noise, use the random given by the ChunkGenerator and just generate a random number, if it is more than x%, then generate a sky island within the Chunkdata

#

for the decorations you'd use block populators

#

decorations being things like trees, not necessarily ores as you'd handle that inside the noise generation

somber scarab
#

but it's okay we'll take it a step at a time

#

I'll be here often lmao

wet breach
#

just jump into the deep end and swim

#

or you could optionally choose to not swim, that has worked for a select few >>

somber scarab
wet breach
#

no, it just happens that spigot has api for a chunk generator

somber scarab
#

yeah I get that

wet breach
#

which is handy for smaller scale stuff to an extent. But it only works on ungenerated chunks but after the world is created

somber scarab
wet breach
#

You would want a world generator for larger scale though, like it affects the entire world space and even the dispersion of ores and biomes

somber scarab
#

well.. no I just want a small plot for each game. it can have slight variations but as long as it's not 1 for 1 like the previous game that's fine

wet breach
#

then chunk generator is fine for you and you don't even need to bother looking how MC does generation

#

just plug in some numbers and tweak till you are satisfied really

rough drift
wet breach
#

no matter how obfuscated it will never change how java does stuff

rough drift
# wet breach what limit would that be?

If you're trying to read a really, really complex method it's easier to read it deobfuscated so your mind doesn't tire on mentally deobfuscating and you can instead just focus on reading the actual logic

wet breach
#

is a method something different because there is obfuscation?

rough drift
wet breach
#

or does it still behave like any other method? the only difference is you have to deal with names I suppose which you can change if it really bothers you that much

#

my IDE has no problems following code

sly topaz
#

I don't think it is up-to-date but most of what it says applies

wet breach
#

fun fact, I use a hex editor when there is heavy obfuscation to know what is going on or if I am too lazy to open up the jar with my IDE

rough drift
#

there is no need to not use deobfuscation when it is available

#

it takes like <2 minutes

#

I think you're just not understanding the energy taxation required to understand obfuscated code at a fundamental level

sly topaz
rough drift
#

why open up a hex editor when you can go gradle genSources (ex. fabric) and have named code that you can read easier

wet breach
#

because hexeditor is far quicker

#

and I don't use gradle

rough drift
#

fabric projects do usually but yk

#

ex (example)

wet breach
#

I don't use fabric obviously

#

or even remotely do anything with it

rough drift
wet breach
#

and I am telling you it was a poor example to back your argument when I don't use such things

rough drift
#

examples exist

#

because

sly topaz
#

I don't understand what you would even do with an hex editor when it comes to jars, just read strings? Lol

rough drift
#

they are

#

EXAMPLES

wet breach
#

anyways, my recommendation still stands that if they want to look at stuff like obfuscated mc sources they should get used to being able to read obfuscated code

wet breach
#

instead of relying on some other software that isn't always available to do it for them

wet breach
rough drift
wet breach
#

some stuff is in string format to read, typically stuff like class names etc

#

but the actual methods themselves in what they do are in bytecode format

rough drift
#
  • if you're reading class files there is this handy thing called javap
#

comes built in with java

#

javap -v classFile

#

or better

wet breach
#

does javap have explorer integration?

rough drift
#

javap -v -cp jarFile path

sly topaz
#

class names would be obfuscated so they wouldn't serve any use and they are not in predicatable address point in any heavily obfuscated software as they randomize the file structure in order to avoid people from guessing

rough drift
wet breach
#

I can just right click open a jar in hex and read it from there ike

wet breach
#

what is your issue?

rough drift
wet breach
#

you hate the fact that there is people who don't need all the frills or something fancy to do stuff?

vast ledge
#

I have a feeling frostalf is looking for a fight >.<

rough drift
sly topaz
#

tbf it wasn't frost who started the argument, Ike was but welp

wet breach
#

normal people don't do things that I have done 🙂

vast ledge
wet breach
#

No everyone is going to fit in that image box of yours just fyi. Normal doesn't exist

vast ledge
#

I have a feeling both of them want to be right and can't accept the others opinion

wet breach
#

it only exists in a group and only if that group agrees 😉

rough drift
# wet breach well I am not normal

I can tell, few people are going to tire themselves and be so confident they're better than everyone because they don't use normal tools :D

Also saying "I am not normal, normies don't do what I did" is exactly what someone who has done nothing spectacular would say to feel better about themselves.

eternal night
#

ike got rage baited

#

get rekt

rough drift
#

I mean idm

#

anything to procrastinate

eternal night
#

fair enough

wet breach
rough drift
vast ledge
#

Ever been constiz

#

Constipated

wet breach
vast ledge
#

That's a fuckng war

rough drift
wet breach
rough drift
slender elbow
#

clearly not

wet breach
#

because obviously you going to war and others around you isn't normal 🙂

sly topaz
#

Eh, if it comes down to java, javap is the common denominator

rough drift
eternal night
#

I'll consider myself a veteran after reading this convo

wet breach
rough drift
sly topaz
#

an hex editor would've more useful with anything native, though not by far as when it comes to native + obfuscation it is even more cryptic

wet breach
vast ledge
#

This is starting to look like 2 children throwing shit at each other for no reason

wet breach
#

if you want to take that to mean normal go for it

#

but as I also said earlier normal also doesn't exist

rough drift
#

You're the extremely common over-confident American who claims to know everything because they've "done things others have not" just to feel special in their otherwise dull lifestyle :P

#

Met a few dozen already

rough drift
#

It's very fun

wet breach
rough drift
vast ledge
sly topaz
vast ledge
#

Ye idk bro

#

Looks like one of those fights a person with ADHD starts because they need entertainment and it's thrilling

wet breach
#

anyways, ikes debate is getting pointless, they think I care about my lifestyle

#

and whether or not it is dull

worthy yarrow
#

It’d be a lot less dull if you helped me haul some shit in eve :p

somber scarab
#

yo bedless

vast ledge
rough drift
wet breach
#

or maybe tomorrow night

rough drift
#

It seemed to work for a bit

somber scarab
wet breach
#

I also have to re-activate my subs

somber scarab
#

long time

wet breach
#

such a waste of energy over nothing

rough drift
#

you seem to be defending yourself a lot tho

wet breach
#

and that means mad?

vast ledge
wet breach
#

man kids these days don't understand emotions

rough drift
worthy yarrow
wet breach
#

with my big shiny ships

worthy yarrow
#

Not to these 40+ WT grid drops

wet breach
#

lol

worthy yarrow
#

They pray you come out in something shiny

wet breach
#

no the biggest issue is how long it will take to get my freighter there

#

its like 2-3 hours of straight jumping

worthy yarrow
#

Could always pull a red frog, name your ship for hauling and go autopilot kek

wet breach
#

oh yeah and lose like 5 bil

rough drift
#

#general

worthy yarrow
#

I mean

somber scarab
wet breach
#

like what would anyone do or could do?

vast ledge
wet breach
#

since I have the control to not participate any moments notice, why bother getting mad?

wet breach
somber scarab
#

any way to set the biomes list of the Biome Provider during WorldInitEvent?

#

look at me asking the good questions

#

oh wait it's an abstract method

#

ahhh

somber scarab
#

no.. I don't know...

this is weird BlockPopulator.getBiomes() needs WorldInfo as a parameter.

but during generation, I don't have the WorldInfo when Listening for WorldInitEvent

grand flint
#

I think it needs to be a datapack for the client

somber scarab
#

how so? can I not create a world that only has the one vanilla biome I want?

#

that's what I'm trying to do

grand flint
#

ohh vanilla biome ye probs

sly topaz
#

what are you using WorldInitEvent for

somber scarab
sly topaz
#

because you should be using WorldCreator + ChunkGenerator mostly

#

biomes don't really matter that much for custom chunk generators

somber scarab
#

yeah but I thought what If I go ahead and just a massive world that is just a garden biome

sly topaz
#

unless you want to register a custom biome for your generator, which you can do but since there is no API for it, it isn't really worth the effort

sly topaz
#

you mean, you want to override the biome provider so that only one biome is ever generated?

somber scarab
#

yes

eternal oxide
#

just do that in your own generator

sly topaz
#

you can set the biome provider in the WorldCreator

somber scarab
#

im yet to make my own generator

#

okay.. so I make a class MyBimeProvider extending BiomeProvider and pack it into a WorldCreator with a copy() of the normal world's options

eternal oxide
#

set teh provider as Javier said in the WorldCreator```java
BiomeProvider biomes = new BiomeProvider() {

    @Override
    public List<Biome> getBiomes(WorldInfo worldInfo) {

        return Collections.singletonList(Biome.DESERT);
    }

    @Override
    public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {

        return Biome.DESERT;
    }
};```
somber scarab
#

so that it's a vnially world with just one biome

sly topaz
#

Elgar beat me to writing the example lol

#
public SingleBiomeProvider extends BiomeProvider {
  public static final BiomeProvider INSTANCE = new SingleBiomeProvider();

  private final Biome biome;
  private final List<Biome> biomes;

  public SingleBiomeProvider(Biome biome) {
    this.biome = biome;
    biomes = List.of(biome);
  }

  public SingleBiomeProvider() {
    this(Biome.PLAINS);
  }

  @Override
  public Biome
getBiome(WorldInfo worldInfo, int x, int y, int z) {
    return biome;
  }

  @Override
  public List<Biome> getBiomes(WorldInfo info) {
    return biomes;
  }
}

...
var worldCreator = new WorldCreator("some_world")
  .biomeProvider(SingleBiomeProvider.INSTANCE)
  .createWorld();

I was about finished

blazing ocean
#

peak formatting

somber scarab
#

if I understand correctly?

eternal oxide
#

I only had to open my IDE as I already had it written 🙂

sly topaz
#

because if you are, you are going to use WorldCreator

somber scarab
sly topaz
#

if you are trying to set the biome provider of the default world(s), you'd do it at world init the same way, though you'd have to use NMS as Spigot doesn't have API for modifying an existing world's biome provider

somber scarab
#

NameSpace?

#

whats NMS

sly topaz
#

it is short for net.minecraft.server

#

but it really just refers to minecraft internals

somber scarab
#

ah I see

#

nah I'll just make a new world

sly topaz
#

actually it seems like Spigot does support setting the biome provider/generator of the default world, I just didn't know of it lol

somber scarab
#

huh??

sly topaz
#

you just have to override JavaPlugin#getDefaultBiomeProvider in your plugin I believe

#

though I am unsure of how that works with multiple plugins overriding it

somber scarab
#

either way it is not what I want since I don't want my plugin to destroy anyone's servers

#

but ima try it anyways now

outer elk
#

is canceling to block fade event will do lag?
example i have a map and i have tons of a coral blocks outside of water

thorn isle
#

i do recall some people running into performance issues after using worldguard to prevent leaves on some custom map from despawning

#

but worldguard has to actually check whether something intersects a region before it can cancel it, and iirc that does a nonnegligible amount of memory allocation

#

so just blanket-cancelling all fade events on certain block types should perform better

umbral ridge
#

how do you get the blockstate from a Block?

#

im trying to make the redstone lamp powered on / off

#

i guess i have to go for blockState right to achieve this right

#

Hi Choco

worldly ingot
#

Are they not different blocks entirely?

#

If not, it's a block with a state, i.e. a Bukkit BlockData

umbral ridge
#

they used to be, REDSTONE_LAMP_POWERED_ON and OFF or something but not anymore

worldly ingot
umbral ridge
#

great

worldly ingot
#
Lightable lightable = (Lightable) block.getBlockData();
lightable.setLit(true);
block.setBlockData(lightable);
umbral ridge
#

ty very much

#

im making a bank system where player can join a bank and an actual vault is generated for them, physically in the world, harry-potter style XD

#

and there is 1 switch to turn all vault lights on and off, to light up an entire cave and enterance to the vaults

#

each player vault has its own switch too

thorn isle
#

neat

outer elk
thorn isle
#

what's the number of blocks that are trying to fade that are loaded in block ticking chunks on average?

drowsy helm
#

But depends on how many blocks yours talking about

robust helm
#

what event do I cancel to disallow placing/breaking item frames?

#

also for interacting with chest minecarts

#

for the minecarts im cancelling PlayerInteractAtEntityEvent rn but that doesnt seem to work;

young knoll
#

PlayerInteractEntityEvent

robust helm
#

damn i thought thats an interafec

#

do i replace the PlayerInteractAtEntityEvent with it or keep both?

young knoll
#

Replace

robust helm
#

alrrr

#

seems to fix all issues except with item frames, ty!!

#

or rather only item frame breaking

#

HangingBreakByEntityEvent did the job :)

fathom dirge
#

Any NMS gods here that could help me out? I'm creating a plugin to let the user create custom vanilla enchantments. It works fine, but on reload I'm getting some errors that I don't know how to fix/interpret. Any help would be greatly appreciated! Can't send any code or errors here so just let me know if anyone can help i'll send you the errors over.

wispy egret
#

hey how do I begin with making plugins?

fathom dirge
chrome beacon
#

?paste

undone axleBOT
fathom dirge
#

So this is the client error i get when i reload the server and a player tries to join afterwords: https://paste.md-5.net/bivojizowa.sql

And this is the error i get in the server when reloading: https://paste.md-5.net/foberohamo.bash

When i didn't reregister my plugins in the Registries on reload the enchantments actually kept working and most other functionality as well, but when a player logged out and back in he did get the first client Network Protocol Error posted above.

umbral ridge
#

that's a new thing

chrome beacon
#

Yeah

umbral ridge
#

Interesting

fathom dirge
# fathom dirge So this is the client error i get when i reload the server and a player tries to...

The problem is probably the exclusive sets not begin registered again, but I dont know how i would go about doing that:
minecraft:root/minecraft:enchantment: Unbound tags in registry ResourceKey[minecraft:root / minecraft:enchantment]: [minecraft:exclusive_set/excavator, minecraft:exclusive_set/lumber, minecraft:exclusive_set/replenish, minecraft:exclusive_set/sneak, minecraft:exclusive_set/telekinesis]

chrome beacon
fathom dirge
#

Yeah I know sadly...

chrome beacon
#

The server is fixable with some reflection but you might have to kick the player

thorn isle
#

you can try un-freezing and then freezing the registry again but god only knows what the client will do

chrome beacon
#

^

fathom dirge
#

What does freezing and unfreezing actually mean btw?

#

Like what does it actually do

thorn isle
#

basically pretty early on in the startup sequence the registries are "frozen", preventing any modification to them

chrome beacon
#

Registries are frozen to prevent people from writing to them

thorn isle
#

precisely because the clients (and possibly other internal state) might go out of sync if you modify them willy nilly

chrome beacon
#

unfreezing is just a hack to make them writable again

#

which as vcs2 said can cause issues but it's your best bet

thorn isle
#

come to think of it, does /minecraft:reload kick clients back into the configuration protocol state to resync the registries?