#help-development
1 messages · Page 1269 of 1
youre not stupid lol
but youre trying to refrance the block that was broken before returning it
what is the block field
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);
}
}
}```
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
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
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
that could be a good idea
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
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?
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
what is this person asking for
i was just about to ask that lol
im curious if their scope is even fair
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
if youre getting stressed out i wouldnt mind writting that last method for you if you want
honestly, not a bad option if they just want to get it done and never touch progamming again lol
hell, I'd even use Skript for this if it being a plugin isn't a requirement
I wouldn't, it's poison for beginners
the issue is exactly that, a beginner doesn't know what questions to ask themselves
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
all you wanna do is change 'block' to 'brokenBlock'
yup if its just gray theres no need for it
done
youd wanna do this
ExperienceOrb orb = world.spawn(location, ExperienceOrb.class);
orb.setExperience(5);
> me when my whole IDE is gray

I honestly dont really understand spawning entities i almost never do it
okay so this should work
should i build it and test if it works?
yup that should work
also can i remove the wheat broken mesage
where is that even being said?
@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!");
}
}
why is that diffrent 😭
Not all crops age to 7. Some age to 4, some age to 6, etc.
thats what i thought
i have no idea why i didnt even think about that 😭
didnt work
wheat didnt drop anything exept seeds and wheat items
any errors in the log?
You've registered your listener too, yes?
Are you sure it's enabled?
wdym
Does this console have the enable message?
i dont see it
my other plugin works but this one doesnt
yeah its not in the terminal
Are you sure the plugin is in the /plugins/ directory?
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
id recommend putting some logger messages in the listener, and checking if it prints to the console
what does your code look like right now?
DEBUG
can you try what I sent instead
Can you use debug statements?
just comment out what you have right now by surrounding it with /* and */
i dont understand
why are you using Tag?
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
your confusing me
Just replace var with Block and Ageable
there's no need to do that
var has been a thing since java 11, if they're running 1.21.5 then they're at least running java 21
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
Please use pastebin
?
?paste
i dont know what thats used for
tags are just collections of things, in this case you'd use it with a Material yes
So why not get the brokenBlock as Material?
and then check if the material is wheat
He is?
they are not
They weren't
You were
.
ah yes I was
english is hard
Indeed
Can we all speak in spanish instead
Nop
i dont even know english well 😭
wait
te entedería mejor pero a que costo
Can you check BlockState instead of Ageable?!?
Hm?
Nevermind
@crude zephyr Can you try doing this?
Instead of using Ageable, get BlockState and getAge() with CropState
Holdon, lemme try this
Wheat is not a blockstate?
but you get the blockstate from the broken block?
i just want this to be fixed
i dont know how to finish this myself
Please go look up CropState my guy 😜
CropState is MaterialData stuff don't touch that
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
Cause of “legacy”
and even if one old plugin were to, it is likely that it'll have more issues than just using MaterialData lol
Well they hope it doesn’t 😅
do old plugins even load, given they don't assign api-version
api-version is post 1.13 ?
As legacy plugins yes
Bytecode manip too for the Material class
I'm to eepy to understand spigot
I just woke up
Are you flexing?!
Yes
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
Use customblockdata
?whereami
?customblockdata
how?
custommodeldata
Yeah
i want it to be placeable, breakable and act kinda like a dirt block
ok im going to get food
when i get back can somone help me what the issue is with my plugin
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
link sends me to a shop for some reason
hmm thanks
.
thats compleatly diffrent
How so
multiple var, i dont even know what that does
Nothing, basically just too lazy to write the proper type
all the tutorials on cusotm model data are on items not blocks. i give up
Yees, blocks do not have "custom model data" (or the newer item model component)
only items can have arbitary models with such freedom
So I can’t make a meat block
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.
well you can always try display entities, tho many of those would kill your fps
Mmmm I did try maybe it’s the code that’s the problem not the resource pack
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)
?blockpdc
Learn about CustomBlockData here:
https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
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
Not for custommodel shit, which was whqt i meant haha. No ? For that
not evne
Not evne?
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
i have some questions about this code
1, how much exp does it give
2, why is getMaximumAge red
“Dozens”
it’s like 1100
- wrong Ageable, you need https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Ageable.html
- I assume either 0 or 1 :D
You gotta set the experience, use the spawn method with lambda
sorry but i dont know how to do this
can you give an example or answer?
Example: world.spawn(location, ArmorStand.class, stand -> stand.setVisible(false));
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
?spoon
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.
idk if you know what im wanting but
plugin that gives one exp when a fully grown crop is broken
just replace the ArmorStand with ExperienceOrb, change "stand" var to "xp" for clear naming.
use xp.setExperience() to set the value
bit rude
ive been working on this all day
Not rude.
Probably because, by the looks of it, you do not even know Java. Just a hunch tho
You have taken all day because you don;t know java
yes exactly
i dont know what im doing
So learn. You will not learn by being spoonfed
i dont want to learn now
Then pay someone to do it for you
People are here to help those who wish to learn
im sorry
if you aren't gonna learn why even bother trying
this comment made my hardware get a lil software :(
im so fucking stupid i dont know how to do the simplest of things
Learn basic java first
i dont have time
You wasted a day on this so far. You could have learnt java basics by now
Then dont try?
Nothing comes to anyone who doesnt try
If you're only missing this then I'll 🥄
location.getWorld().spawn(location, ExperienceOrb.class, xp -> xp.setExperience(NUMBER));
i dont know how close i was
top one mine, bottom one yours
@crude zephyr Pay for a subscription to Claude
lowercase l
cant afford
quite far, but you do literally not know anything so understandable
get a job
im in Uni
im preparing for a job
then focus on uni
what r u tryna do anyways and why dont u get someone to do it for you
today was my day off
hence why i dont have time
because i made a promise
to?
ok buddy chillll
is it complex? and is it something someone else can js do for you?
do the action bars not even support emojis as BossBars?
'emojis' ?
And everything that renders text is the same, so whatever bossbar can do, action bar can do too
Emojis ---> ItemsAdder
summons exp but dosent increase level amount
Oh
😦
ItemsAdder
is this truly development relaterd
try higher number?
Are you sure the value is just too low that its not making a significant addition when already on 18 levels?
i tried it with 0 levels and it did nothing
It's not level, it's XP
Try setting it to 5.
i know how exp works
1, does nothing
5, too much
testing 2 now
not saying to USE 5, but can you test that 5 even does anything
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?
7 xp no ?
1 working now
idk why it wasnt before
Literally why
It's ad-riddled shithole of clearly incorrect information
BECAUSE it still overtakes mc.wiki on certain seo results
there's a browser extension to replace/remove those
👏 👏 👏
next time ima hire someone again
how you detecting what is and what isnt a crop? Do you have an enum?
hire me, free gang
using the tag, should theoretically be future proof
I guess pumpkin/melon might be a problem
lol yes
wait abb3v your free to hire
the ancient flowers are fine
id feel bad
Yeah, im eating right now, dm me though.
ill dm you if my client wants any other plugins
tempted to ?services rn :D
If you look for the pumpkin block directly, not the stem, then people could just break, place, break place, repeat
how tf u even find a client as a non-dev
yes, keep it that way, as abb3v said it would be too much to make it work as expected
thing is pumpkins can be automated unlike wheat (not inculding villagers)
wait do villagers spawn exp now?
you mean them breaking the crops ?
yes
they spawn XP when you trade with them, they have since like 1.14 I bet
based on your code... probably
"Called when a block is broken by a player. "
nvm no
unless docs are wrong just
?tas
docs did not lie \o/
Yes, if you see the screenshot that Steve sent, its outlined that the tag you're using, includes wheat, carrots, and melon stems.
but you can't afford claude 🤔
ooo thats cool
(which btw is a horrible suggestion, chat GPT would do just fine for something this simple)
tbf claude is 30$ a month, and only gives you double (not unlimited as with chatgpt) prompts as their free version.
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
yee we dont want that
im never using ChatGPT
dont like it
human art/code is way better
good
one of my classmates uses chatgpt regularly instead of making his homework himself
pathetic
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
Probably easier to mark ones that get manually placed
i was told not to use PDC for that kind of shit before
^
BY YOU
SO SHOULD I USE PDC OR NOT?? I STILL NEED AN ANSWER
thanks for the help
ill reach out if i need anything more
I mean the bitset is still the most efficient for this
A bitset for every block in the world?
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.
PDC or a database
PDC is easier but will take up a bit more storage than a proper database
The cigar is missing
too broke mate
a cigar is what, 30-40 for a single?
Idk
We're gonna win so much, you may even get tired of winning
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
it does not
Really? But the block state changes
Currently listening to BlockPhysicsEvent,PlayerInteractEvent,EntityInteractEvent and none of those capture non-attached tripwires
It triggers observers so I figured it would
yeah it's quite strange
onPlayerMove, if player.getLocation().subtract(0, 1, 0).getBlock() is tripwire type shit 😭
honestly i might just have to only used tripwire in attached state
but it doesnt even seem possible
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
was it definitely in attached:false state?
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?
oh maybe because im cancelling the event
bruh
okay cant u just now check for a blockstate change?
nerd
cancelling the event or not, visual update still happens
I have a feeling thats client-side
I shall do this brb
What's the new name of the ClientboundAddPlayer packet? xd
?mappings
Compare different mappings with this website: https://mappings.dev/
new versions use the entity add packet now
hi guys, how to disable chat color
i did set all perm .color to false in luckperm but still doesn't work
"disable chat color"?
i mean prevent members using color code &e &b
well, do you know what plugin is allowing that in the first place?
BetterJails
because that is not a vanilla spigot behaviour
there's my plugins
you would think to start with the obvious named plugin
EvenMoreFish
What's the packet called to rotate a head of an entity (NPC) in 1.21.4
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
BukkitAdapter
brush armadillo scute from armadillos, brush suspicious sand for loot
ooohh
also, wiki exists for this exact type of question
y wiki when u be wiki
/chocogpt whats a purpose of a brush
/emilygpt what's a purpose of a brush
can someone help me with the multiverse-core plugin??
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.
didnt not work 😭
even added screen and explanations to this
but decison was made towards buyer
Yea, there's never a 100% chance of either side winning. Just gotta do your best really
bump pls
Just store coords relative to the arena?
wtf were u reading My code...
no
that's a WE class too
and probably in most other multiplatform projects
Ah okay that's kinda smart
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)
DevNatan's inventory-framework or stefvanschie's IF are the ones I always recommend as they've passed the test of time
it looked fun to debug
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
I recommend using Triump GUI's strongly
I'm not a big fan of stef's IF
Never tried DevNatan's inventory-framework before
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
which parts
Making it work with configs and stuff was just tiring
but how is that related with the lib
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
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
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
Since we’re nerds we’ll gate-keep the answer.
Yea, so I need a run-time solution lol
I've heard of it before however I wouldn't recommend it over IF since it's too new
well, their 3.x is, it is been a thing for 5 years now apparently lol
time flies
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"
Average packet developer type ah answer
depending on what you're doing it might be wiser to try and narrow down your scope
Dealing with obf, which requires getting strings after they're loaded
Only other option is making an entire emulator which is.... Ehhh
Ye the only option i see too is using a profiler
Might just go with a JVM fork then since I can then work with them programmatically. Not gonna be easy to do though 🤔
well you could work with them programmatically with a rofiler too
I mean https://github.com/Lenni0451/MiniJVM exists but it's over-kill and the first commit still adds way too much nor are there docs outside of a few test classes kekw
I mean that does not seem to interpret indy
so it's not that useful in today's day and age
indy?
invokedynamic
you can just use the JDI protocol
run your application with the debug agent and then use JDI to grab all String instances
Yea, that projects a WIP
https://github.com/xxDark/SSVM is a more complete solution but rather finicky
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 😐
@vagrant stratus https://pastes.dev/bQhI7p7M72
worked fine, I used 100 instances just to test it though, don't know how well it scales with thousands of strings
interesting strings
Hey, for some reason my listener for my custom event is not being fired when this event is triggered:
https://pastebin.com/hQNVAT1A
The debug message after calling the event is executed, which means the event was successfuly called, but the code inside the listener is not executed.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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.
IF you are really registering your listener ok then there must be an issue in your event itself
We’d need logs, as well as the mainclass that handles creating the eventlistener
are you ever calling new LeagueEventsListener
my guess is that they forgot the handler list in their event class
@thorn isle I finished the menu abstraction over NMS
Compile the plugin with an older version of java
what version should i use? mi plugin is for 1.21.1
alr thanks
Are multi module projects supposed to have plugin.yml for each module?
if each module is a plugin id say so probably
I do not need to keep world edit in my pom if I am building against fawe right?
and I assume no code changes?
fawe depends on WE
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
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
you have your answer then 😉
so i guess that was not how to doit
FAWE depends on WE
its basically in its name
just because you depend on FAWE doesn't mean FAWE shaded WE.
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
only if a jar has shaded a dependency will the transitive dependency methods be available to you
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!```
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
here's my pom.. I followed the tutorial from fawe's docs
Yes, as I said everything is registered correctly
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
😠
I'm still gonna answer, thanos method time.
Remove 50% of plugins, see if your problem is fixed.
mh
oh
RealisticSeasons
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)
How do you know the world isn't loaded yet
Load your plugin postworld instead of before it?
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?
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()
declaration: package: org.bukkit, class: Location
What olivio said is also a thing too, in the plugin.yml you can specify to load post world
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
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
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/world/WorldLoadEvent.html also exists fwiw
declaration: package: org.bukkit.event.world, class: WorldLoadEvent
Except they want something for after the world is done loading
that event fires when it loads, but not necessarily when it is done
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
idk their specifics, just pointing out what it is they said and what they are wanting/needing
Sure 👍 as I said, that ought to work fine for them to read through worlds loaded later
Yeah, it should I agree
I hate Minecraft. The problem was simple: The chunks from the Armor Stands are not loaded yet
🫡
@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
I'll be damned
Rip
I thought discord let you view links even if you weren’t in a server
Maybe that’s only message links
who else would I be accepting it as
I wonder how much of that server deals with bukkit-style chunk generators
am I fast learner or what exactly 😎
here's the tutorial I followed
its pretty decent
Not a ton, but its a fairly abstract concept
Noise generation go brrr
No op
mojangsters make do with like 5 classes
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
is this up on github somewhere? i could take a peek at some point
Not for a while
oh i cant upload my code
mmm i suppose i should've known from everything being green lmao
fair enough
also I suffered for 2 hours because nms itemstacks are kinda mutable and I didn't expect
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
dupes? in MY nms? it's more likely than you think
no, they're in con's NMS
some don't
but I caught them somewhat early on
specifically remove()
hey can i get refund as the we cant get the dev help of that owner @ivory sleet
?support
if you are referring to a plugin on the resources page of spigotmc
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
can it have dupes? 😼
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
I just check the code
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
check the code
what even is a good project to analyze for world gen
its not like its unviewable
wait
Minecraft itself
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
or better question is
makes it far easier instead of always trying to deobfuscate lol
how do I do that without going crosseyed
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
but yeah, that is essentially what all the devs deemed pro's do is just read the code
what are you trying to do
like, what is your goal with world gen
they want to know how the world generation works apparently
which good luck I suppose
yeah but I assume they want to use that world gen for something specific and not just for the sake of knowing lol
its quite the mess
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
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
isn't that the one I cloned last week to debug an issue with some inventory handler being null
yes uwu
declaration: package: org.bukkit.generator, class: ChunkGenerator
doesn't sound that complicated of a generator
right which is why I think it's doable but still I'll need a few nights of studying
I dabled alone a lil and this is what I managed to do
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
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
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
I'm planning on making three levels of islands in higher and higher Y levels
iron islands Y level 100-ish
gold Y level 200
diamond islands Y level whateer
it's like drawing with math and I hate it.
but I gotta do it
well, that is still easy to do with a chunk generator if you are just doing something like skyblock but differently
that's a good way to describe it
sky block but better
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
I dont get it
but it's okay we'll take it a step at a time
I'll be here often lmao
just jump into the deep end and swim
or you could optionally choose to not swim, that has worked for a select few >>
is that what you meant by viewing minecraft's code?
no, it just happens that spigot has api for a chunk generator
yeah I get that
which is handy for smaller scale stuff to an extent. But it only works on ungenerated chunks but after the world is created
that is no problem. right now I copy random chunks from a pregenerated normal world for my games
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
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
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
I mean, there's a limit - if you can have the deobf sources I suggest go for it, they're far less energy taxing to read lol
what limit would that be?
no matter how obfuscated it will never change how java does stuff
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
sure easier, but a method is a method
is a method something different because there is obfuscation?
I never said it isn't, and I did say "it's less energy taxing" not "it's the only way"
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
@somber scarab https://bukkit.fandom.com/wiki/Developing_a_World_Generator_Plugin#Generate_the_chunk.27s_heights_and_blocks there's this
I don't think it is up-to-date but most of what it says applies
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
it behaves the same, but it's harder to read, because I() and i() are different methods but it's far harder to track them mentally than doSomething() and calculateOther()
your IDE can follow code, but it's not what needs to understand it. If you can make your life easier do it
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
that is rarely the only difference with heavy obfuscation
why open up a hex editor when you can go gradle genSources (ex. fabric) and have named code that you can read easier
yeah I don't think you got the
EXAMPLE. FABRIC.
part
and I am telling you it was a poor example to back your argument when I don't use such things
do you want me to list every single deobfuscator known to mankind?
examples exist
because
I don't understand what you would even do with an hex editor when it comes to jars, just read strings? Lol
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
also this
instead of relying on some other software that isn't always available to do it for them
Sometimes, but the layout of a jar is defined in terms where all the binary data should be at. So if I wanted to know how many classes there are, their names etc, there is predictable address points where they should be at
replace with notepad also does the trick :P
I'm just saying, you don't have to be all "look at me I'm so good I use a hex editor to read jar files" (which btw, is an obvious lie because the only thing you'd see are strings as @sly topaz said)
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
it's called .class file count, no need for a hex editor
- if you're reading class files there is this handy thing called javap
comes built in with java
javap -v classFile
or better
does javap have explorer integration?
javap -v -cp jarFile path
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
no, but why would you need explorer integration if you're reading a hex dump of a class? what are you? bad? lmao
I can just right click open a jar in hex and read it from there ike
^^
what is your issue?
it's that you're trying to look overly good by doing something excessively stupid lol
you hate the fact that there is people who don't need all the frills or something fancy to do stuff?
I have a feeling frostalf is looking for a fight >.<
I hate the fact that there are some people who can't stand looking like a normal person so they claim the most bs takes in order to put themselves on a pedestal of sand.
real
tbf it wasn't frost who started the argument, Ike was but welp
well I am not normal
Didn't start a fight
normal people don't do things that I have done 🙂
I ai t reading the 80dms
No everyone is going to fit in that image box of yours just fyi. Normal doesn't exist
I have a feeling both of them want to be right and can't accept the others opinion
it only exists in a group and only if that group agrees 😉
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.
hex editor is a normal tool
fair enough
I don't need to feel better about myself, but if you say what I have done is normal, alright tell me you been in war?
Hex editor is not a normal tool to read a class file, you can't deny that
Yes
Ever been constiz
Constipated
not you -.-
That's a fuckng war
No, because my government doesn't base itself off of being the big bad bear and spends hundreds of billions if not a trillion on war instead of the basic human needs of it's citizens which it exploits to fuel its war machine :P
it is, just you consider it not a normal tool because you wouldn't think to consider using it. Anyways hexeditor is beyond your time obviously
hex editors are useful, but if you think it's better to use one to read a class file instead of a tool specifically made for that you're delusional
oh, so I am not normal then
clearly not
because obviously you going to war and others around you isn't normal 🙂
Eh, if it comes down to java, javap is the common denominator
you're very much normal in your country :P
I'll consider myself a veteran after reading this convo
far from it
oh yeah? you seem very normal to me
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
Yeah you only know me from discord and text
This is starting to look like 2 children throwing shit at each other for no reason
if you want to take that to mean normal go for it
but as I also said earlier normal also doesn't exist
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
Sometimes I like to stoop down to the levels of the common American
It's very fun
I have done things others haven't
everyone has, it's called not being a single homogeneous entity.
I feel attacked as a fellow American by birth
it has been that way since the very beginning, nothing that frost said was particularly wrong, just maybe misguided for someone who is barely trying to understand world generation but alas. Ike also didn't say anything completely unreasonable in that regard, but it devolved into a discussion on whether frost is normal now lol
Ye idk bro
Looks like one of those fights a person with ADHD starts because they need entertainment and it's thrilling
anyways, ikes debate is getting pointless, they think I care about my lifestyle
and whether or not it is dull
It’d be a lot less dull if you helped me haul some shit in eve :p
yo bedless
Ye
Oh I'm just here for entertainment -- I genuinely do not care lol. I'm trying to get you to be madder so I can upkeep my free daily entertainment when procrastinating.
you will have to wait till this weekend where I have a lot of time
or maybe tomorrow night
It seemed to work for a bit
how u doin dude
I also have to re-activate my subs
long time
I don't get mad at things online
such a waste of energy over nothing
you seem to be defending yourself a lot tho
and that means mad?
Good HBU?
man kids these days don't understand emotions
Maybe ¯_(ツ)_/¯
It’s all good, still waiting to see if juf might actually drop to lawless, we’re getting pretty hammered with the insurgency
but it looks scary over there
with my big shiny ships
Not to these 40+ WT grid drops
lol
They pray you come out in something shiny
no the biggest issue is how long it will take to get my freighter there
its like 2-3 hours of straight jumping
Could always pull a red frog, name your ship for hauling and go autopilot kek
oh yeah and lose like 5 bil
#general
I mean
it's also just text on a screen.. you need annotations and sounds to understand alot more about emotion
my point was more or less, why get mad at something online when I can just literally close out or just ignore it if I really want
like what would anyone do or could do?
Nah you did not just pull the "kids these days" card, what are you 60?
since I have the control to not participate any moments notice, why bother getting mad?
little more then half that age
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
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
I think it needs to be a datapack for the client
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
ohh vanilla biome ye probs
what are you using WorldInitEvent for
exactly, I'm not sure where I should do that..
taking a look at BiomeProvider https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/generator/BiomeProvider.html#getBiome(org.bukkit.generator.WorldInfo,int,int,int)
the only thing I see is getBiomes()
declaration: package: org.bukkit.generator, class: BiomeProvider
because you should be using WorldCreator + ChunkGenerator mostly
biomes don't really matter that much for custom chunk generators
yeah but I thought what If I go ahead and just a massive world that is just a garden biome
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
I am not sure I get what you mean
you mean, you want to override the biome provider so that only one biome is ever generated?
just do that in your own generator
you can set the biome provider in the WorldCreator
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
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;
}
};```
so that it's a vnially world with just one biome
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
peak formatting
yeah but that means I need my own World Creator and by extention, waht I'm doing it making my own World Creator not Chunk Generator
if I understand correctly?
I only had to open my IDE as I already had it written 🙂
are you not creating a world?
because if you are, you are going to use WorldCreator
I guess I am lmao
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
actually it seems like Spigot does support setting the biome provider/generator of the default world, I just didn't know of it lol
huh??
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
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
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
try it and see
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
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
Are they not different blocks entirely?
If not, it's a block with a state, i.e. a Bukkit BlockData
they used to be, REDSTONE_LAMP_POWERED_ON and OFF or something but not anymore
great
Lightable lightable = (Lightable) block.getBlockData();
lightable.setLit(true);
block.setBlockData(lightable);
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
neat
i can't but what you think for this?
what's the number of blocks that are trying to fade that are loaded in block ticking chunks on average?
Most likely not
But depends on how many blocks yours talking about
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;
PlayerInteractEntityEvent
damn i thought thats an interafec
do i replace the PlayerInteractAtEntityEvent with it or keep both?
Replace
alrrr
seems to fix all issues except with item frames, ty!!
or rather only item frame breaking
HangingBreakByEntityEvent did the job :)
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.
hey how do I begin with making plugins?
100k
Learn Java basics, then follow Spigot tutorials
Send the error in a paste
?paste
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.
Yeah
Interesting
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]
The client and server do not like registries being modified while running
Yeah I know sadly...
The server is fixable with some reflection but you might have to kick the player
you can try un-freezing and then freezing the registry again but god only knows what the client will do
^
basically pretty early on in the startup sequence the registries are "frozen", preventing any modification to them
Registries are frozen to prevent people from writing to them
precisely because the clients (and possibly other internal state) might go out of sync if you modify them willy nilly
unfreezing is just a hack to make them writable again
which as vcs2 said can cause issues but it's your best bet
come to think of it, does /minecraft:reload kick clients back into the configuration protocol state to resync the registries?

