#help-development
1 messages · Page 626 of 1
I hate most games that perform physics calculations. They rarely get it right
They mess up especially when there is any acceleration of time.
Well I'd prefer something more like the linked video over just hardcoded animations kek
They always forget to account for the accelerated time and apply an incorrect force
.
k
video more or less shows what I'm talking about, although it would be different given it's ya know, mc
sometimes I hate working with futures
I really like Verlet because it can do that and it's lightweight, all you need really is a block display entity that can display X model, and then have corresponding "vertices" and "connections" for those vertices to plug into verlet, then every once in a while get the position of all those vertices and rotate the model such as it conforms to those rotations more or less
per fragment
though verlet is cheap asf, you also need to pass in the surrounding blocks as "walls" which you can do by using more sticks
or you can use Euler if you want
overcomplicating shit
The thing is this would be done w/ real blocks, unless they all got replaced w/ display entities real-time instead of falling blocks
If you want rot then you need to use display entities
rot?
rotation
it helps make code simple
If you want them to be hit and rotate you need to simulate that
ah, so I assume real-time replacement then?
Yep
As well as if you want them to interact with the world you need to pass the entity bounding boxes & block bounding boxes
cant u use streams for that
Yea, pretty much.
It would also have to calculate anything those blocks hit as well, and do the proper physics there as well
You can just use some simple collision detection & resolution for that
IkePhysics when kek
If a point is inside a point push each out by 1/2 of the intersection distance
If a point is inside a stick push the point back out 1/1 of the intersection distance
if a stick is inside a stick push it back to the nearest time it wasn't inside
y
using sub-steps (running phys 1/8th of the speed for 8 times) improves the collision resolution and doesn't really lag
For one you can't stream a mongo finditerable
Optic Physics
It could have issues w/ regular building, so something would have to be done there as well 🤔
for two I'm anti-stream and generally dislike the API as it often loops through the collection multiple times for something basic
no it doesn't? lol
also wtf is this code
?
That's java's streaming code for you
u havent seen java regex code then
Looks uggo
sez u
streams can do things for loops can't, or at least not easily
If it takes forever to do something with a for loop and streams end up looking much nicer sure, we use streams
But in most cases a for loop does a perfect job
https://www.youtube.com/watch?v=H1eEFfAkIik @molten hearth
Learn the basics of the SvelteKit - a metaframework that can fetch data and render Svelte web applications on the server. Find out how it compares to other fullstack tools like Next.js for React and Nuxt for Vue.
#webdevelopment #javascript #100secondsofcode
🔥 Get the full SvelteKit Course https://fireship.io/courses/sveltekit/
Upgrade at h...
co
its a tad sus
??
ill have a look ty
https://cdn.discordapp.com/attachments/1012398682668281928/1131287677296185385/image.png
Does any one know how there are displaying player Heads in scoreboard. Is not in the Resourcepack?
Custom resourcepack
happyhud iirc
nope, looked up the whole resource pack there aren't any Skin head included here, and that can't be changed dynamically.
looks pretty but nothing in that gives me information haha
fair
damn, how did they do it then, gotta check out happyhud then
just a bunch of pixels with weird offsets
and they send like a character for each pixel in your face
related to shaders
likely
idk how
but then every pixel/color would also have to be included in the resource pack.
which parameter would that be then?
It's.. not a parameter
You know how color codes work yeah?
So in 1.14+ you can send rgb messages in the chat and scoreboard
what if.. you have a character that's just a pixel
and you send that character with some rgb colors
I thaught as much, what a hassle
ye
when we open a file with java, do we have to close it?
does that file close when the program closes?
and when run over and over with the code, does it open more than one file or does it not open because only 1 is open?
formatting text to lineup with anything is a pain
Yes
Hmm, but then one pixel would have to be contained in the resource pack?
1 at each height
let me see
shaders 100%
which one yes? 😄
When you open files
You're reading the contents through a file stream
You gotta close the stream
typically just use a try-with-resources
but after program close
opened files is closing ?
and i run my code for open files
do the files overlap?
if do this i don't need close
Yeay, im think you are right 😄
https://cdn.discordapp.com/attachments/805171844452843549/1131290401387593830/image.png
I got no clue what you're talking about at this point
alright
Did somebody mention cake
no
Ok bye
thanks for the ping
there are cakes
paper loves the deprecated annotation
Hi ! someone know why in the BlockBreakEvent, the getDrops.clear() doesn't work ?
have you seen spigot tho? backwards compability, right?
well the class wont return true when there's an annotation present
and idk why
it's something i was wondering too
there is no getDrops() method in BlockBreakEvent
a
private static @NotNull Field[] getAnnotatedFields(ConfigClass configClass) {
List<Field> fields = new ArrayList<>();
Class<?> clazz = configClass.getClass();
for (Field field : clazz.getDeclaredFields()) {
if (field.isAnnotationPresent(ConfigValue.class)) {
fields.add(field);
Bukkit.getLogger().info("Found annotated field: " + field.getName() + ", Value: " + field.getAnnotation(ConfigValue.class).value() + ", Type: " + field.getType().getName());
}
}
return fields.toArray(new Field[0]);
}```
pretty sure there is
There is not
is
and then the class:
@Config
public class ConfigExample implements ConfigClass {
@ConfigValue("test-testing")
@Comments({"line 1 of comment", "line 2 of comment"})
private final String test = "test";
@ConfigValue("testing-value")
private final String testing = "ew";
}```
declaration: package: org.bukkit.event.block, class: BlockBreakEvent
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
see, no getDrops() method there
just do setDropItems(false) ez
is there a spawner event ?
xd
event.getBlock().getDrops().clear() exist
i made my own annotation config system 😄
nice, now how do i fix this
idk
it just wont work
i've debugged it
and it only gets the @Config
don't work it make Error on the serveur
yes but that does not represent the actual drops, and it's especially not related to this specific BlockBReakEvent
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
maybe don't make the fields null and use setaccessible
not sure if you get to that step yet
ah alr
this is mine
it's a bit different since i wanted to get the Setting's information in 1 go
you can't just check if getModifiers == Modifier.FINAL
nope
you should rather check if Modifier.isFinal(field.getModifiers())
it's just an int, if it's e.g. public and static and final, then the getModifiers() is the result of Modifier.PUBLIC + Modifier.FINAL + Modifier.STATIC
yeah value is null
(or sth like that)
private static @NotNull Field[] getAnnotatedFields(ConfigClass configClass) {
List<Field> fields = new ArrayList<>();
Class<?> clazz = configClass.getClass();
for (Field field : clazz.getDeclaredFields()) {
ConfigValue value = field.getAnnotation(ConfigValue.class);
Bukkit.getLogger().info(value.toString());
if (value != null && !Modifier.isFinal(field.getModifiers())) {
fields.add(field);
Bukkit.getLogger().info("Found annotated field: " + field.getName() + ", Value: " + field.getAnnotation(ConfigValue.class).value() + ", Type: " + field.getType().getName());
}
}
return fields.toArray(new Field[0]);
}```
the annotation is Retention.RUNTIME
oh yeah, now that you say it it makes sense
what exactly isn't printing?
the annotation is null
but it shouldn't be
because its clearly there
@Config
public class ConfigExample implements ConfigClass {
@ConfigValue("test-testing")
@Comments({"line 1 of comment", "line 2 of comment"})
private String test = "test";
@ConfigValue("testing-value")
private String testing = "ew";
}```
ConfigValue annotation
Bukkit.getLogger().info(value.toString()); i see you use to string
do you get null pointer?
ye
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "value" is null
show the config value @annotation
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface ConfigValue {
String value() default "";
}```
or print configClass's getCanonicalName
what is the attribute to armorstand so i can break blocks through it
it exists but it doesnt
Why add a default, that could lead to issues. Make sure they HAVE to add a string
if someone forgets to write an id it could lead to clashes
print the field's names
Is there any way to remove every player's advancements without using an iterator object? I can't find something like player.removeAdvancements()
yeah i don't know
well wtf
deobfuscate the jar and look for the annotations
the Retention is RUNTIME tho?
very weird
how does Comments look like
maybe target?
whoops
yep works now
Hello, someone have a tutorial/ecemple for pagnited menu/gui (no library)
TYPE_USE is for generics or something iirc
e.g. List<@NotNull String> for a list of not-null strings
Type use if for everything where a type is involved INCLUDING methods and fields.
This causes the infamous issues with jetbrains-annotations because they have not yet figured out that also making use of METHOD and FIELD makes 0 sense
?paste
Does anyone know why I only get the following output?
Am i maybe using the iterator wrongly?
yeah but it's only checking the first element
(its 4 times repeated bcs its called 4 times)
The dark oak log could be caused by coercing a tag as a material
For why it is only printed once: See the break and return
It’s a MaterialChoice
Or well coercing a MaterialChoice as a single material - same thing
If you want to get the input -> output of every smelting recipe I have code for that
that's why I stick to annotations-java5 lol
I'll eventually PR a fix to eclipse so they fix their stupid auto-completion taking some things a bit too much at face value
i'd appreciate that, i've been looking for a while
Thank you
I'm trying to smelt all items in a container
Exact choices are said to only work for shaped recipes
However I do believe you can use them for smelting
I personally use https://github.com/Geolykt/EnchantmentsPlus/blob/837382a9084ffeb003eefc403061e977eea06a20/src/main/java/de/geolykt/enchantments_plus/util/RecipeUtil.java for caching smelting recipes.
Though eh, that class has a few issues I haven't come around to resolving yet (mostly concerning performance/code quality).
So I shouldn't use Furnacerecipe but instead cookingrecipe?
If you also want to include recipes included in the blaster, campfire, smoker and standard furnace
I will take a look at this
Do you have a general rule on when to use getSmeltedVariantCached and when to use getSmeltedVariant
Generally always use the cached variants unless you want to explicitly refresh the cache
The caching is a bit bork though given that it depends on Material - but using ItemStack would be a bit too computationally expensive
Does it automatically convert for example 54 ore to 54 ingots?
out.setAmount(out.getAmount()*input.getAmount());
why not out.setAmout(input.getAmount)?
unless out is 1 which it doesn't matter then
but still it asks for bugs
I implemented this class in a rather paranoid way just in case some datapack does not return itemstacks of size 1
Do beware that you need to split itemstacks if they go over the maximum stack size.
Unless you don't care
Since I always drop the items to the world I never bothered to handle this case
Are there recipes where you get more output then input?
In vanilla no - but I would not be suprised if that is a thing with datapacks
The beauty of java
Just use EnumMaps
No in the furnace though
yeah
oh
No bad
okay thanks
hi, my plugin dont save the config: "config.getC().set("kit." + kitname + ".item." + slot + ".Enchant", listen);" listen is a List but dont save it.
Why
Message is not material - besides, you know I would never suggest that these days :P
you have to now do YamlConfiguration.save(file)
or sum like this
The material refractor
i do but dont go
wdym
then show us the whole code
Material Factor?
Material is soon no longer an enum
if (item.getItemMeta().hasEnchants()) {
Map<Enchantment, Integer> enchantments = item.getItemMeta().getEnchants();
List<String> listen = new ArrayList<>();
for (Enchantment enchantment : enchantments.keySet()) {
int level = enchantments.get(enchantment);
String enchString = enchantment.getName();
int lvl = level;
listen.add(enchString + ":" + lvl);
}
for(String e : listen){
p.sendMessage(e);
}
config.getC().set("kit." + kitname + ".item." + slot + ".Enchant", listen);
config.save();
config.reload();
} else {
config.getC().set("kit." + kitname + ".item." + slot + ".Enchant", null);
config.save();
config.reload();
}
Eventually™️ a lot of enums in spigot will be replaced with classes
I want to write a firend system...It will be Bungeecord plugin...How can I make the Bukkit plugin communicate with my Bungee plugin?
I want to make a GUI
That being said it is irrelevant for you in this case
Imma stick with enums i like em
You also really don't get any benefit whatsoever from an EnumMap
The Material enum is too large
HashMaps are probably going to end up being faster and use less memory
Also, I tried to find out earlier but I didnt really get an answer, is it possible to give my custom item a max stack size of 1. I have wands with a stick material, and i want to prevent them from ever stacking. If i create the wand they get assigned a random UUID, but when copied, they can still stick. Is there any way to prevent this?
give them a custom uuid in there lore
or add a uuid somewhere
it will make them a nonstackbale item
Yeah but if you copy it in creative mode it still stacks
Put it in pdc
That works?
I did
Are you using the same UUID?
but copy in creative mode for example it still stacks
Sure
At which point eh, you did everything you could
You cant do much abt that
Nothing you can do about creative mode
Well if there is a duplicate it stacks
Yes
Most of the problem is for example if players want to use shops
You have to randomize the UUID for each item
How can i achieve this
UUIDs are very unlikely to collide
tell it suppress uuids
Plugin Messaging
If you do it correctly it is actually impossible to collide
ye
At least impossible within a reasonable timeframe
thx
The UUID's colliding isn't the problem. The problem is if the item gets copied ingame, they aren't unique anymore
if its smth rly important just if(isUsed(uuid)) return UUID.randomUUID();
Why are they getting copied?
that is the dumb way to do this
For example a villager shop, you would input the wand, and if it gets sold to a player, it would be the same wand and possible to collide
Because then they have the same UUID bcs it copied
When buying the item, have it randomize a new UUID
Just set the most significant bits to the current system time and the least significant bits to the the most sig bits of the player UUIDs XORd with the least sig bits of the player (or whatever outside factor you need to use)
The shops are from an external plugin
do they have events
like playerPurchaseItem()
if so then you can regen a new UUID
Sounds like that plugin has an issue then
Yeah that's what i was trying to prevent. I don't want to treat the symptom but i want to treat the problem.
Because I have never seen a non-malicious plugin that has duping as a feature
Nana, you are treating the symptoms at that point
Not really, the shop does what it does. https://dev.bukkit.org/projects/shopkeepers
If you tell it to sell that specific item it does
Yes, but that is the case for admin shops?
yeah
Because like you can never sell the same item twice (thus duplicating it) ... or is the plugin THAT stupid?
its that stupid
No i'm talking about admin shops
But it's just an example, if i would have to find a workaround for every plugin that might get added that would get very annoying, so i'd prefer to treat the root problem
Yeah okay. In case of an admin shop your best bet is to actually treat the symptom - i.e. listening to click events and de-duplicating in that case
The only thign i can think of, would be regening the UUID when an item enters or leaves the inventory
or have a registry
with the existing UUIDS
which would become laggy
i wish we could set instead of only getMaxStackSize()
You could also treat the problems by the power of ||MASS ASM||, but beware there be dragons if you do that
is generating UUID expensive?
It takes resoureces
Depends on how you do it
just random
Depending on how much its getting called
what does config.getCurrentPath() return? is it like parent/path/config.yml or just parent/path?
the current path
where the files is located
so if the file is in sys/data/myfile.txt
it will reutrn
sys/data
I think i'll just leave it like this for now. If the user finds there is a problem, and they don't want to use tools (its configurable the material), i might try find a solution
If you do it correctly (system time + 8 random bytes) not that expensive.
16 random bytes would be even less expensive.
how do I get the full path with the file?
is there a reason why there is only getMaxStackSize and not setMaxStackSize
file.name()?
File#getAbsolutePath()

wat da hail
whats File tho, I only got my FileConfiguration
(More concretely I mean ||Transforming every mention of ItemStack.clone() to de-duplicate your UUID. That being said the issue therein lies that you will have small breakages that you need to deal with in a case-by-case basis. Furthermore you need to handle plugin loading order correctly - otherwise you cannot do the transformation of the classes||)
config.getFile() isn't a thing and FileConfiguration.getFile(config) isn't a thing either
Of course you could do a deep-dive into NMS internals to just allocate your own item that has a custom stack size
fileConfig.save("file")
But bukkit probably would not like it
At some point ur setting the file that all the configuration gets written to
I need the path to save it tho... bruh
Yeah im also trying to prevent NMS way more work to code
So you have a file configuration
Are you making a new file?
but no path
yes
no, I only have the FileConfiguration available tho
So, your making a new file after all?
no
You have to
bruh...
How tf are you expecting to save this data to disk then?
why does spawnParticle shoot the particle to idk where but far?
world.spawnParticle(Particle.FLAME, block.getLocation(), 1);
declaration: package: org.bukkit, interface: World
is that extra?
where is speed
an mp4 file
ain't clicking on that thing
Its a plugin
I did not find anyone who knows his name
changes the 2nd layer of ur skin
frick :D
I forgot my KASM login and the free demo doesn't let me access it :D
but its legit as it seems from your messages
Do you know how to do this?
?paste
Anybody know how tf my Enum is null
https://paste.md-5.net/ubipanejus.md
Doesnt makes sense
since im setting values
Your enum is depending on itself or sth
its because the type is still be initialized
Or another class thats not initialized yet
Thats a design error and typically means your enum shouldnt be an enum
what is in the constructor for that enum?
yeah, that writeToArrays function tries to use the the values() method which can't be called yet because they all don't exist yet
ye
what do you expect the values() method to return before all the instances have been created?
...m
is there any way to force gradle to overwrite currently loaded plugins inside plugins directory
not on windows
its so annoying to copy and paste everytime i want to test niche things
You can have it stop the sevre
server*
insert file
and resart
start the server*
for some reason
i can copy and paste it
without restarting it
at least on purpur 1.20.1
on windows?
yea
but gradle refuses to copy and paste
because its already used by javaw.exe
so basically i can do it manually
but its so annoying
I cant even do it manually
could you insert it with a script
or maybe set your gradle output dir there
i've tried it to set outputJar to that path
but it cant copy it
because when i use file() to specify path
it tries to open the file
when its already used by another process
hmmm maybe try making a python script to insert it and run it with Gradle if possible
I mean live updates would be cool if you can get it working, though idk how that's even possible
plugman
what the checksum of the file changes
yea
but its not really recommended
since it memory leaks
after a while
due to how class loading works for plugins
but it works for dev environments
can I somehow use markdown on my plugins spigot page?
its really annoying since I usually keep a readme in github but converting it to whatever spigot text is is a pain
Why I can't understand anything 🥹
some markdown to bbcode converter
yeah I feel like tahts also an answer to me
oh its bbcode
okay
then I know enough xD
spigot uses a modified version iirc
Ikr
Yes yes I tally understand that and what it means
yeah but I changed like all features
like why cant they just use markdown like a sane platform
M A R K D O W N
Can you guys tell me where I can learn spigot development correctly
Is this why people do images for their plugin description
probably
no they do it because it looks great
learn basic java, then just read the javadocs
and flashy
im one step away from just putting a link to my github readme
but that will probbaly plummet downloads
Alr 🥲
I wish mc bedrock scirpting api had something like java docs, because the main page of the docs they have loads seven years because it describes every method, enum and constant there 💀
also whats the fastest way to upload a version of your plugin for multiple version, like 1.18, 1.19, 1.20 etc
i wish microsoft would not have made bedrock in the first place, it's so stupid to have 2 versions of the same game
afaik microsoft page has a documentation for scripting api
why don't you just create a .jar that supports all those versions?
is there like a specific way to do that?
it sucks to create wrappers
dynamic class loading
maven modules
Ikr
and also then I guess I cant use new api on older version ofc
so I guess those will just get the yeet
detect what's the current version of the server
then load the class using classloader
that is named according to the format you've decided to have to mark down version per changes
okay yeah thats too complicated for me, ill just change the version in spigot.yml
It wasn't just microsoft, it was mojang that made pocket edition which became bedrock edition later. So, you should consider it notches fault he decided to remake the game for mobile devices instead of recompiling the game as an apk and optimizing it
at least that's how most plugins handle cross compatibility with NMS
I dont have nms
okay that's fine
hmm
I guess I will need an actual solution if I want to use new api stuff though
why isn't it adding comments to the YamlConfiguration?:
@Override
public void addField(String path, CachedConfigField<?> cachedConfigField) {
configuration.set(path, cachedConfigField.getValue());
if (cachedConfigField.hasComments()) {
Bukkit.getLogger().info("Adding comments to " + path);
configuration.setComments(path, cachedConfigField.getComments());
}
}```
basically you have one module per NMS version, and one core module. the core module does all the stuff possible with the API, and it has something like an interface that each of your NMS modules implements. then in onEnable you create the proper instance based on the craftbukkit package name. the final .jar shades all your modules into one .jar. for example take a look at jefflib, especially core/JeffLib -> getNmsHandler() and all the separate NMS modules https://github.com/JEFF-Media-GbR/JeffLib
the dist module is what's shading all the modules into one .jar, hence it doesn't have any code on its own
well like I said I dont use nms
basic is debatable
by module are you implying java modules
or just classes
but if your definition of basic is not using nms
I recommend using the resources for setting configs with comments
its much easier
maven modules
like "subprojects"
Grade also has sub projects
so its yeah subprojects
Wait, could you do something like that with forge/fabric mods?
well i dont do subprojects for the compat layers
but its seems like a good idea
since you can remove it anytime you want
without manually removing the classes
no can do
im making a lib for configs
and it decoupled from the main classes
aka:
@Config
public class ConfigExample implements ConfigClass {
@ConfigValue("test-testing")
@Comments({"line 1 of comment", "line 2 of comment"})
private String test = "test";
@ConfigValue("testing-value")
private String testing = "ew";
/*
* In file: test-testing:
* value: ew
*/
@ConfigValue("test-testing.value")
private String value = "ew";
}```
oooh
well maybe FileWriter?
i use minecrell's plugin.yml
i don't know, never used that
so that i can get plugin.yml synced with the provided version of my project configuration file
Just the problem is that mods usually do gradle instead of maven
in gradle it's basically the same https://github.com/mfnalex/lunatic
(that's not done, it only has 1.19.4 module but the idea is the same and the general structure is working)
jackson allows you to do this without any new annotation processors
@JsonProperty(value = "key")
im not sure for yaml tho
@tender shard how you so pro at coding
THATS SOOO COOOOL
but afaik jackson support serialization to yaml
When you do it a lot you become better
I am not, i didnt even study this shit
Then how tf ;-;
i studied law and only do coding in my free time
U made soo good plugins
Like every programmer lmao
programmer either means pro(fessional) grammer or poor grammer lmao
Olt every programer studies law ;-;
Where u learned basic java
in school like 15 years ago but that wasn't more than just "what's a method and how do you call one" lol
the rest I learnt through just trying and googling and doing stuff
oh and books ofc
;-;
a book is much better than any shitty online tutorial
😲
cuz it takes more effort to make that book
i've learned java in like 3 years, but i cant say im not pro at it, but it works for me
i've started from skript
until someone insulted me
from using it
Alex makes the best maven dependencies, definitely. Doesn't matter what project, my pom.xml always has atleast one mention of jeff_media
tbh my skripts used skript-mirror
so basically i've been calling api already
i've once a made a fricking factions plugin inside one skript
it took me like 3k lines of code
and bunch of procedural programming functions
It started with me making discord bots with bot maker lol. Then I wanted to port my bot to a 24/7 hosting instead of using the app and watching ads, I've tried and failed. I've been told I'm stupid when they tried to help me so I started coding in js. I then wanted to make minecraft mods, as it was and still is my favourite game and when I saw java I was like: holy shit this looks like javascript, but with a shitton of unnecessary shit
i remember i've once made skript clone perform faster than some shitty memory leaking minecraft plugin
💀
thanks lol
unfortunately I learnt recently that this groupid is invalid and I had to change it for maven central
yeah new stuff will be jeff-media
Naming conventions be like
Imagine having to change each _ to - by hand
at least the package names won't change
Imagine if you had to change each of them
im currently working on my own lightweight command api. It right now supports greedy and literal dynamically registered commands, and it hooks perfectly with bukkit api (you can retrieve plugin command via JavaPlugin.getCommand())
hello, im currently making my own fork of spigot, is there any way to set the default amount of ram my spigot will start with or can that only be done by the users arguments
im looking for a way to hook into brigadier in the future
so that i can color it with types (booleans, strings, floats etc.)
user arguments
Idk as I barely ever did java applications, but I think thats a thing the jvm defines (or the user when doing arguments), not the application
you could just include a start.sh and start.bat file ofc
As it could be used for malicious purposes
or your server.jar could start itself using a processbuilder ofc
but that's pretty pointless
just let the user decide??
-Xms <gb amount>G -Xmx <same gb amount>G ?
Sounds like a bottleneck lol
i have this one spigot fork that does it somehow but idk how
no idea where i would find it in the code
in your start script
just create a ProcessBuilder that starts java
oh you meant this
dunno :D
or Runtime.exec(...)
Why you want this in a first place
yeah it's a stupid idea
hardcoding ram amounts is a disaster waiting to be happen
so that buildtools has enough RAM?
BuildTools GUI runs with your native JDK. But then it starts a subprocess with the appropriate JDK needed for the selected version
e.g. if you use java 17 to run buildtools, but you wanna build 1.8.8, it looks for java 8 installed and uses a ProcessBuilder to start itself again using that JDK so that it can build 1.8
but what's the point of hardcoding ram values, Allocated heap amount should expand with the usage of it, no?
if you don't specify an amount it uses like only 256mb on some systems and buildtools requires at least 512mb
The default value is dependant upon how much system ram you have available, but even then it's not consistent. Having the ability to set the minimum value is only beneficial.
#1117702470139904020 message here I had roughly 16 GB of free ram and buildtools only got like 250mb
Mappings & Javadocs. Also useful for devs who need specific PRs built.
it can write comments just fine
yes it will
then im doing something wrong
declaration: package: org.bukkit.configuration.file, class: YamlConfigurationOptions
enable that before loading the file
default is enabled
ah then nvm
the main thing that annoys me in spigot's yaml stuff is that it uses path separator stuff
that's sometimes annoying if you wanna have dots in key names
yeahh
person1.name: "mfnalex"
person1:
name: "mfnalex"
for bukkit this is the same
you can set the path separator though
yeah but to what? what if I don#t know which chars the keys will contain
can one set it to null?
i havent checked
nah it can't be null, it always forces you to use a pathseparator
can;t set null
I mean for 99% of people it's useful to have this separator but sometimes it's annoying
but in those cases I just use SnakeYAML directly
would be nice if it'd take a Character instead of char so one can just null it to disable this
Configurate 
you're probably on an old version of the api
Human-Optimized Config Object Notation
Hocon is nice. It's like JSON but actually accepts comments.
And isn't as bad as YAML
I'm trying to use buildtools to get a remapped jar of 1.17 but I'm getting these errors:
org.apache.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact org.spigotmc:minecraft-server:csrg:maps-spigot-fields:1.17-R0.1-SNAPSHOT
This is how I'm running buildtools:
java -jar ./BuildTools.jar --rev 1.17 --remapped
Did BuildTools finish running
Yes
are you on latest buildtools?
oh wait that error is not from buildtools?
Well I scrolled up a bit to see it
Its an error when buildtools is running, trying to compile
but does it say Build Success at the very end?
No
Ah yeah I read that error wrong
Try building 1.17.1 instead
try to run buildtools in a path without a space
Oh I didn't think about that
it works fine for 1.16 though
hm
I'm trying it now
That didn't work
Thats giving the same error
I'm on linux
do you have anything weird in your /etc/hosts ?
Could you send the entire BuildTools log
Is there a way to render a beacon beam from a specific block
is maven set to offline mode using .m2/settings.xml or sth?
No, I haven't made maven changes
I haven't installed maven though
Well actually it does depend
I forgot about that. I can try to install it and rerun
You could probably use display entities on top of a beacon
But the beacon still needs to be there
does this say BUILD SUCCESS?
mvn dependency:get -DgroupId=org.spigotmc -Dversion=1.17-R0.1-SNAPSHOT -DartifactId=spigot-api -Drepo=https://hub.spigotmc.org/nexus/content/repositories/snapshots/
How does minecraft render a beam from end gateways without beacons
Yeah
The gate way blocks have their own renderer
Thats with the system install of maven though, I wonder if the error is something to do with the built in buildtools maven
I could try to run that command with the packaged maven
BuildTools should use system maven if found
then idk. try to send your whole buildtools log, should be in buildtools.log.txt
It should be fine
❯ apache-maven-3.6.0/bin/mvn dependency:get -DgroupId=org.spigotmc -Dversion=1.17-R0.1-SNAPSHOT -DartifactId=spigot-api -Drepo=https://hub.spigotmc.org/nexus/content/repositories/snapshots/
fish: Unknown command. 'apache-maven-3.6.0/bin/mvn' exists but is not an executable file.
chmod +x mvn
I cant send it in discord
I used pastebin
Yeah, I chmod +x and it gave build success
run buildtoosl again with --rev 1.17 --remapped
any1 got an answer?
I'm going to try to clear buildtools cache and then rerun
then when it failed, paste your buildtools.log.txt somewhere
Okay
I got one
is it mojang magic
It’s client side stuff
you could also try out the buildtools GUI from #1117702470139904020 (latest file there), it uses a separate java process, maybe that magically fixes your issue lol
how should i go about making players have different names in tablist and above their heads?
Okay its working now! Thanks @tender shard @chrome beacon
where can i find the documentation for block dig protocollib packet? its not under that name in wiki.vg
I'm guessing it was something to do with those files that buildcache puts in CWD
and not having maven installed
protocolManager.addPacketListener(new PacketAdapter(plugin, PacketType.Play.Client.BLOCK_DIG) {
this packet
i need to cancel the animation associated with it as its causing my vanished players to reveal, cancel the animation while still allowing them to break blocks
the player gets revealed when they left click a block
the dont get reveled if i cancel that whole packet
but i want them to still be able to break blocks
but i dont want them revealed
same with eating food, placing blocks, right clicking air with blocks, placing blocks, etc.
I’m not that good with spigot but could you set them as vanished on the block break
Hmm
but this stuff is syntactically hard
yes
im cancelling the break block packet
that makes them not reveal
but
then they cant break blocks
No like the actual packet that shows them to the client
yea thats what im trying to do
no such packet exists
im doing
PacketType.Play.Client.XXXXX
XXXXX is the packetr
for client bound
Ah idk protocollib names
i have "teams" and every team has name, maxplayers and list of players in it what would be the best way to store these teams? i would need a hashmap with 2 values. what should i use
so how do hipixel modify their packets so they dont need to be limited to inventory guis like us ?
They still use inventory guis
is there any way to disable tab completion for the command label without specifying the permission for it inside command object?
i would like to have a predicate instead
or smth like that
There would be a way to make an actual working elevator right?
Eg.
Move the whole structure down on (on y axis) and AS SOON as that happens, teleport the player down for 1 axis.. without modifying their looking direction or anything
So basically if the player is within the bounds of an elevator structure then he can't leave until the elevator is at the certain y level (elevator levels)
This would be possible right
I'm kinda thinking of making this for my underground mine shafts for skyblock
would be a little less stuttery when using falling blocks and velocity but yes your approach would work, too
For the structure I'd use boundingbox
anyone?
falling blocks? can you explain?
like sand. You can create every block as a falling block
And then they don't have to be on a .0 coordinate but can move freely like an entity
I would use block displays
hmm
If you’re in the appropriate version
Invisible shulkers also provide a solid floor the player can stand on
That can be at fractions of a block
Btw also, by teleporting the player on y axis for 1 block up or down, I don't have to change their eye location or anything right? So that it wouldnt cause weird glitch issues
I could just grab the previous location and modify the y
Eg. if they're looking around and while they're teleporting to a new y position, that wont cause any weird glitches
yes. Might still be recognizable though
hm
Yes but would player still be able to move in the elevator and look around then?
Look around yes. Moving will make it harder to implement but could work by just changing the y of the current velocity and setting them into active fly (as they can't walk otherwise since theres no blocks beneath them). Falling blocks/display entities aren't solid
??
what kind of predicate? You can technically add back the permission dynamically in the command preprocess event. There is probably a better way but I don't know about it either
Maybe something like a tabcompletionevent you can change/cancel?
what's a good tutorial to start coding in spigot rather than looking at the api reference randomly ?
yes I looked at the pins
which IDE and do you know java?
Probably look at some open source plugins and know about basics like event listeners and command executors (maybe also configs)
intellij idea (no choice) / alledgedly was forced to work with java before while being paid to code but not enough to write java on my resume
Like to avoid getting fired Ill code in java but if there is some security implications Id rather a more experienced colleague review/fix it but it should sorta works in production (kinda)
like my state is running my code at the moment and I havent been arrested yet
that was in netbeans ide though and j2ee. sorry maybe too many details but Im not sure how to answer 'do you know java" accuratly
use the link above to learn how to create a basic plugin. The framework is all you need
So long as you understand that, pretty much everything is event driven
You just need basic experience in java. No need to be an expert for common plugins
If you wanna dive deeper into nms (net.minecraft.server) you will need reflection which is a little advanced but you can do a lot of things without that
yep, ignore anything mentioning nms until you are unable to do what you want via the api
Also start coding on 1.20.1 as there's a lot of helpful things compared to legacy versions like 1.8 (that are still used from time to time)
New api is SO much better than previous versions
what's new api wise since 1.16?
oh yeah displays seem amazing
awesome
after all this time it looks like I might actually be coming back to mc development
looking like it won't be in java though
which I am grateful for
I cant code on 1.20 Im using arclight for a 1.16.5 modpack
Barring that I must have ice & fire working, mods that add metal armors, diagonal blocks and a few other things or I quit arclight same with a couple of plugins
reflection is still pretty straightforward
a bunch
https://hub.spigotmc.org/changelog/ go brrrr
View the Bukkit, CraftBukkit and Spigot changelog.
new ban API
Maybe BungeeChat support for everything soon 
living.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 150, 2), true);
The potion effect is applying for just zero seconds, not 7.5 (150 ticks)
lol
can someone help me with a plugin error
?paste it or send a screenshot
is this a bug?
do you know how to fix that
You are not including the org/inventivetalent/reflection/minecraft/MinecraftVersion library
How you updating .yml files in your plugins? I just want add some thinks to it. I can just post update and say "you need add this or regenerate file". But Im looking for something what will automaticly add thinks and keep the settings in file.
u can use a version scheme maybe
Just add any keys that are missing
Fairly simple
Changing the types or names of existing keys is a bit more complicated
But, they will need regenerate file
I have file in .jar and If I change the file, the changes will be not aplied to file in plugins folder.
I just wanna update the file for plugin folder and add some things
have a config version system. track what changes based on versions. when the version is old, apply the changes to the file in the plugin folder
isnt it just open event?
😭
Nah vanilla has an advancement trigger that runs when the players inventory changed
But we don’t have an event for it
Make a feature request
So thats lot of .yml files for each version or just adding code to generate the file for each version. There is problably not other way right?
you don't need to generate the files for each config version. just write code to update the contents of the file, add things, remove things, etc
im patient i was just asking if you guys can help
ok, and what is your problem you need help with?
so i compiled this plugin from github
Ngl inventory change events would change the game for anti duping.
Always wondered why noone didn't set up a bunch of sanity checks to detect when the logic of an inv wasn't followed.
E.g: dupes that don't send inv close packets etc.
It'd be pretty easy for spigot to be like "ayo an inv oprn3d by this player... then it opened again... with no close event... nani the fuck?
Also be the change you wanna see ^_^
word
Well if I don’t feel like beating my head against vectors tomorrow
Maybe I’ll do this instead
It’ll depend what is available when vanilla fires the trigger
Maybe
I don’t have the code in front of me so I have no idea atm
dont ask for help, state your problem, and help will come to u
Ngl would be a huge win
The inv changes
Performance would need to be handled with care tho
how do you mean now?
The thing they proposing above
this tho
I mean its just an event
For it to work the event would have to record the inventory per change no?
That's a lot of snapshots lol
sorry boss
after 1 year i still cant figure out a way to stop items from being put in other containers besides the players inventory, all the "solutions" never work
I'm having issues with the new custom world generation API.
@Override
public boolean shouldGenerateCaves(WorldInfo worldInfo, Random random, int chunkX, int chunkZ) {
Bukkit.getLogger().info("Testing");
return true;
}
@Override
public void generateCaves(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, ChunkGenerator.ChunkData chunkData) {
Bukkit.getLogger().info("Generating caves for chunk at coordinates: (" + chunkX + ", " + chunkZ + ")");
}
I can see shouldGenerateCaves being called, but my generateCaves method is never being called. What am I doing wrong/misunderstanding?
I know it has to be something obvious which makes it even more frustrating.
When I look at the JavaDocs, it appears on the surface that this should be working (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/generator/ChunkGenerator.html#shouldGenerateCaves(org.bukkit.generator.WorldInfo,java.util.Random,int,int))
Gets if the server should generate Vanilla caves.
The Vanilla caves are generated before generateCaves(WorldInfo, Random, int, int, ChunkData) is called.
Only this method is called if both this and shouldGenerateCaves() are overridden.
that method declares whether vanilla caves are generated, which happens before generateCaves is called; it does not govern whether generateCaves is called
Yes, I included that tidbit to show that I have the world generator setup correctly and generateCaves should be getting called
Otherwise, shouldGenerateCaves wouldn't be getting called.
I'm not 100% sure but have you tried not overriding shouldGenerateCaves? I could be wrong but it seems to me that those methods are only to be overridden if you want to delegate to the vanilla generator and not handle that yourself - therefore by overriding shouldGenerateCaves, you are implicitly causing the server not to call your generateCaves implementation and instead letting the vanilla impl do it.
If you look at the javadocs, it reads as if you override it to use vanilla generation then have generateCaves called so you can modify it
I get that impression from here:
Some aspects of world generation can be delegated to the Vanilla generator. The following methods can be overridden to enable this:
shouldGenerateNoise() or shouldGenerateNoise(WorldInfo, Random, int, int)
shouldGenerateSurface() or shouldGenerateSurface(WorldInfo, Random, int, int)
shouldGenerateCaves() or shouldGenerateCaves(WorldInfo, Random, int, int)
shouldGenerateDecorations() or shouldGenerateDecorations(WorldInfo, Random, int, int)
shouldGenerateMobs() or shouldGenerateMobs(WorldInfo, Random, int, int)
shouldGenerateStructures() or shouldGenerateStructures(WorldInfo, Random, int, int)
at the top of the page
but I could be wrong 🤷
Look at here, "The Vanilla caves are generated before generateCaves(WorldInfo, Random, int, int, ChunkData) is called."
yeah after i sent that i was like wait
welp idk ima step out, but hopefully some chunkmaster pops in at some point
I really think this should be working as-is, I just don't think this feature is used much because I couldn't find any example code.