#help-development
1 messages · Page 664 of 1
bump
why?
but it didnt work
it thinks the plugin is in a repo
What
like it checks the .m2 folder to find the plugin instead of checking for external libs with com.amirparsa.hypixelcustomitems as their group id and artifact
wdym?
okay you arent understanding at all how maven works
it requries a repo or a system path to find it
it wont magically search your entire pc
no. the plugin is a .jar added as an external library
Intellij external library have nothing to do with maven
how can i add a system path. is it done by the file:/// thingy?
its not recommened anyway, you should mvn install it
how?
do you have it as another maven project
it is another maven project but its built
run the install goal
not source code
do you have source-code with pom.xml
yes
run the install goal then
how? again...
on the right of your screen
im an idiot in java
i did. it gives the error i said
which project are you running it on
you have Plugin A and Plugin B you want Plugin B in Plugin A you should run the install goal in Plugin B
what if i just create an interface with all the methods in the plugin B im adding and cast the getPlugin output to that? would that work?
sure but thats pointless
why?
mvn install the plugin, add its info to ur other plugin and you can now access the entire plugin
what if i create interfaces for everything i need?
these are 2281337, 22813372, 22813373, 22813374 and i can't see any animation
there must be a better way for animations in resource packs
what are you even doing
currently just learning how to connect plugins together for future use
what way? It must work without optifine or cit
mvn install it, add the depend: Name to plugin.yml add the dep and boom
you just need to add somewhat to get the plugin instance
which doesnt require any changes to the other plugion
should i run nvm install in plugin B and it would work when adding the depend?
alr lemme try that
its 1:30 AM here. i havent got sleep in 15 hours
go to sleep
i only have a 1AM to 11AM infinite data plan and then i have got no internet for the rest of the day so i should use it as much as i can
Time to flip your sleep schedule
then i would become a namuh (human in reverse)
so i will just use the internet till 5AM, sleep till 5PM. a 90degree change wouldnt damage me metally and physically... right?
yall sleep?
It's just the first frame and i have no idea why
add a frame before the first frame, then that frame would become the first frame and that would not work :genius:
nonono. It has the "idle" stage and it is 2281337 then it changes to other frames and then back to 2281337
i added idle frame as first and its working 💀
display entities are non-ticking right?
did NMS change between 1.20 and 1.20.1?
no
Basically, yes
👍

what about the math behind spinning? Ik its basic math but im slow
1+2=×
yaw += angle
I mean x its smth to do with Pi right
how to edit/adjust plugin page after i released it?
oh
not really
the base of all particle effects is ✨ trigonometry ✨
I'm shit at explaining it but see it as
Assume you have a circle of length 1, given a point at an angle, what would be the X and Y position of that point?
And do a basic x = sin(angle), y = cos(angle) and that's your answer
so basically I just need to increase the angle each time
this makes sense
I've honestly been thinking about this. Why does ItemStack not just wrap the NMS ItemStack with NBT? I'm not quite sure how ItemStack is completely implemented, but I've been curious. (I get currently it wouldn't be easily possible anymore as we have the class ItemStack.class and we can create new instances of it
Mostly because you need to be able to create itemstacks on the fly
It works in a weird Adapter model
i mean there is CraftItemStack, but the problem is that ItemMeta exists and stuff needs to be read from and written to the NBT all the damn time when using it
I haven't looked at the exact impl (though I probably should) doesn't ItemMeta do some weird cloning and copying shit all the time when you would call ItemStack#setMeta and ItemStack#getMeta
what would a benefit of the clone be vs direct access to the NBT (granted with a semi nice wrapper you'd need as you wouldn't want the api to be abused) without all of that
the memory footprint isn't exactly minimal
mostly a smaller memory footprint and less cpu time spent on unnecessary deserialization of some things like lore/name components, skull profiles, banner patterns etc
I've heard a few times that ItemMeta is "bad" though whats the flaw in how its currently designed
fairly new to actually working on server stuff starting to actually get really interested in this stuff
Imagine if you will an inventory or custom items.
You call inventory click. Would you rather want it to regrab the nbt directly and figure out what it is via deserialising , or have a copy to hand to reference?
Now imagine a server with 100 players all clicking as part of their day to day
hmmm that's a good example thanks
I'm just trying to get into more how the server works, been trying to make prs and such to help my understanding by just going in and fixing stuff
Thing you need to understand mate, as noone says nearly often enough.
This entire API framework we use.
From NMS all the way to Purpur and Foila, is built on rubber bands, PVA glue and dreams.
It's confusing because fundamentally it's flawed
I mean there is a reason the Material enum is a meme
honestly NMS Confusing me too
more so than the API sometimes
Moment you take a step back and realise that, it becomes easier to manage
the container stuff in NMS seems so convoluted to me I don't get it
Approach it from the angle of "some muppet probably tried the most round about way of solving a problem" and it becomes much easier to understand
I'm relatively new to java so a lot of my code is just me doing that xD
My advice is learn how to make good code before going as deep as NMS.
Because you won't find good code in NMS
Or spigot for that matter (Enums ... *shudders)
I wish there was good code in NMS its hell in there I find myself constantly going why.. why is it like this
for example they tick signs
why why do you need to tick signs you don't need to tick signs
And as someone newer to java you will keep getting confused.
Best to make good , simple shit and then move on to other stuff when u have confidence
by "relatively new" i mean I'm 2 years into my java experience which I think is pretty new compared to quite a few people in here
Ah fair
Ah if u ever want someone to do some code reviews holler me up
you should check out #1100941063058894868 lol lots of code reviews in there to do sometimes
🤔 I do want advice on something though give me a minute I gotta push it to github
I meant proper pr reviews lol
I've got 2 up rn if you wanna take a look :P
though they are both 1 liners xD
Link em and I'll look in the morning
?stash
4am vibes
I meant more github stuff but aight lol
ahhh
I do have some github stuff I'd love you to look at though trying to go about constructing an inventory api for myself, but Idk I feel like I'm doing something wrong with this structure it seems ridgid, but idk how to explain it
Send me in dms and I'll look tommoriw
My team recently finished the inventory menu package in our library so good fortune all round
you'll have to accept my friend request as I don't take DMS from non friends (too many shitty dms from this place)
Done
thanks
can anyone reccomend an open source plugins I can look through the github repo to learn more about plugin development? prefferably one thats easily digestible.
I tried essentials and although I can sortof follow everything, its easy to get lost in it
I find the best way of learning an api is just making your own plugins. Most big plugins are too convoluted to understand fully and most small ones are horribly coded
The main things you want to learn are proper plugin structure then the specifics are usecase dependant
ok
BukkitRunnable vs Bukkit.getScheduler().runTaskLater()?
no difference
thanks'
how does Interpolation work?
i've never messed with it before
can't find any forums or anything
interpolation is just calculating the change between two states
ie given two locations and a time factor with speed you can calculate the intermediate location between those two locations.
Player player = event.getPlayer();
if (game.getPlayers().containsKey(player.getUniqueId())) {
List<Pos> buildAbleLocations =
new ArrayList<>(LocationUtil.posFromTwoPoints(
game.getGameData().getBuildAbleCornerOne(),
game.getGameData().getBuildAbleCornerTwo()));
Location blockLocation = event.getBlock().getLocation();
Pos pos = LocationUtil.locationToPos(blockLocation);
for (Pos buildAblePos : buildAbleLocations) {
if (!LocationUtil.coordinatesMatch(pos, buildAblePos)) {
event.setCancelled(true);
}
}
}
I have this code for checking if the blocks are in the buildable corners. Im just asking if there was a more performant alternative to the code above?
There is pretty much no code in there to comment on
you are cancelling if ANY of your Pos are not a match
may as well break; when you cancel
finding more is not going to do anything different
block and item displays are awesome
I can't wait to start playing with them
yeah im struggling with that rn, can you help me?
basically
make a state
a boolean or anything with "isPossible = false"
and once one is possible, set it to true
and voilá
if its still false afterwards, then you can cancel
double yaw = Math.toRadians(player.getLocation().getYaw());
Vector direction = new Vector(-Math.sin(yaw), 0, Math.cos(yaw));
Vector offset = direction.clone().multiply(1).add(new Vector(1, 0, -1));
Location petLocation = player.getLocation().add(offset);
pet.setPosition(petLocation);``` i have this, i'm making a pet system. It should always stay at `1, 0, -1` of the player's location (with yaw) but it rotates weird
and idk how to fix it
nvm
thats not how vectors work
i figured it out
ok
why are you not using the players direction?
idfk
?paste
mines simpler 😉
Nice
Can I use the sellgui with every economy plugin ?
is that a development question?
i can't
Okay
am i check player craftbukkit permission with bungeecord ?
no
?whereami
best ask the developer themselfes or goto #help-server
well can u give me idea for that ?
i wanna make global ranks i mean bungeecord ranks
for players
Why not use a global database then and make requests to it for quering the rank of a certain player
i will do this
but i don't know how works
i mean
luckperms works like this ?_
and how to query works for luckperms
so i will do this ?
i check when player rank update with api
i insert rank to database
why don't you just get the groups directly from luckperms?
ah
wait
luckperms
storing anything in db ?
i mean group name(rank)
and permissions
they storing this in database ?
or file
hey does anyone know how i would store a copy of a player inventory to set again later? right now im trying to create a new inventory and set the contents but the inventory size has to be a multiple of 9, while the player inventory returns 41 which, last time i checked is not a multiple of 9
you could just use Inventory.getContents() which should return an array
getStorageContents
if youre trying to store in a chest or something
but otherwise like alex says, just array
@Permission(value = RolePermission.VIEW_MEMBERS)```
someone remind me how i make it so i don't have to do value = in my custom annotation
its been a min lol
I think if it has only one value, you can just ommit the "value ="
also, default for values exists
if it only has one value name value it’s a single-element enumeration and you should be able to get rid of the explicit “value =“
oh nvm it was my IDE shitting itself
yeah thats what i thought, it just wasnt updating the class definition for some reason
as usual
e.g. responding to my question or asking me a follow-up question or a question on a topic in which i am clearly versed, but definitely not randomly asking if i can do something or not
the "randomly asking if i can do something" is also the case for ?ask
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
- i was half meming by pinging ngl g
I'm trying to make a random kits server where everytime u die u get a random kit! Any plugins for it?
xD though it was valid because you were asking me a question
Why do we create an object in a different class when making a query in the database?
In what regard?
database is a very broad term
i.e. what class
someone check database objects
with java objects
like this
and getting objetcs with getter setter
That.... ive... erm... never seen someone do it quite like that 0-0
average mongo document
Cant spell mongo without mong...
Which event is used to listen if an entity turned into a block?
When would that be the case? Which entity does that
how can i generate sha1 for resourcepack?
sand
gravel
anvil
aaah, the faling block entities
oh I thought you were talking about silverfish, that one does callEntityChangeBlockEvent
https://www.spigotmc.org/threads/falling-block-landing-event.187155/ ?
https://www.spigotmc.org/threads/event-that-fires-when-fallingblock-turns-solid.517947/
thank you
the second thread has this
how'd one improve this?:
public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
if (ascending)
return map.entrySet().stream()
.sorted(Map.Entry.comparingByValue())
.limit(maxSize)
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(e1, e2) -> e1,
LinkedHashMap::new
));
return map.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.limit(maxSize)
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(e1, e2) -> e1,
LinkedHashMap::new
));
}``` i dislike how it looks
and very bulky
which is nooby
public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
Comparator<Map.Entry<Object, T>> valueComparator = ascending
? Map.Entry.comparingByValue()
: Collections.reverseOrder(Map.Entry.comparingByValue());
return map.entrySet().stream()
.sorted(valueComparator)
.limit(maxSize)
.collect(Collectors.toMap(
Map.Entry::getKey,
Map.Entry::getValue,
(e1, e2) -> e1,
LinkedHashMap::new
));
}``` this looks a bit better
still bulky doe
separate it into 2 more functions
public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
if(ascending) return ascendingMap(map, maxsize);
else return descendingMap(map, maxsize);
}
...
?
or just have an enum with your Collectors in them
that seems worse, essentially duplicate most of the code when you only need to change the comparator
That's why I added this suggestion, cause I noticed too late that everything is identicle, except for the Collector
longest.. what, method signature? (idk what it's called but the public static <T> @ returntype thing) I've seen so far lol
eh
I was not asking to see a longer one
please don't
JESUS
Why do you have Instanced extends InstancedGameMap in there, does that even do anything differently than just using Instanced?
Yes
oh?
It's the difference between paste(BedwarsMapTemplate.class, "map-one") returning BedwarsMap and returning InstancedGameMap
Ahh, ok
gotta do more stuff with generics and method signatures, got way too little experience with them
this is just me goofing around with my minigame lib stuff :)
generics are weird here
in recent times this was the most I've done with generics
should i use what im using now or make a bubble sort algorithm. I feel like that would be overkill your only sorting like 15 values anyways
I suggest keeping what you have
And whatever you do, do not create bubble sort
It's like one of the worst ones
just use what you got
i meant merge sort lol
both meh
i'll keep it
ty
How to make tab completion that does not offer any specific option? like <message>
smth like this?
Check out https://github.com/Mojang/brigadier
The image came from this repo though: https://github.com/JorelAli/CommandAPI
Brigadier is a command parser & dispatcher, designed and developed for Minecraft: Java Edition. - GitHub - Mojang/brigadier: Brigadier is a command parser & dispatcher, designed and...
Though I think it only works with mc versions 1.13+
Cries in developing 1.12.2
If you want to use Brigadier then I highly recommend Commodore
If I put something along the lines of the folloing in my config.yml do I just get it with get() or is that getStringList()?
textFormat1: ["DARK_REED", "BOLD"]
textFormat2: ["RED", ""]
textFormat3: ["GREEN", "ITALIC"]

what are you searching for...
lmao that's some good regex xd
bro wrote a whole method into the regex line
so yeah I just ran this for the entire project, ran my code formatter and fixed imports :)
no one got a shot at that?
that's a stringlist
Okay so just a stringlist perfect thanks
Is this only for command completion, not execution using the arguments ?
how i can change my nickname in spigotmc?
?changename
Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.
ty
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
final Player p = (Player) commandSender;
PerlinNoiseGenerator perlinCosine=PerlinNoiseGenerator.
newBuilder()
.setSeed(3301)
.setInterpolation(Interpolation.COSINE)
.build();
Location loc = p.getLocation();
for (int x = -5; x<5; x++){
for (int z = -5; z<5; z++){
Location spawnLoc = loc.clone().add(x,perlinCosine.evaluateNoise(x, z) ,z);
BlockDisplay display = loc.getWorld().spawn(spawnLoc, BlockDisplay.class);
display.setBlock(Material.DIAMOND_BLOCK.createBlockData());
}
}
return true;
}
all the diamond blocks have the same y level
PerlinNoise probably returns a value between 0 and 1
sysout the result of PerlinNoise
not a lot of noise there 🙂
anyone have a better method for this?:
public String getFancyTimer() {
long seconds = convertToSeconds();
long minutes = convertToMinutes();
long hours = convertToHours();
long days = convertToDays();
long remainingHours = hours % 24;
long remainingMinutes = minutes % 60;
long remainingSeconds = seconds % 60;
StringBuilder formattedTime = new StringBuilder();
if (days > 0) {
formattedTime.append(String.format("%02dd %02dh %02dm %02ds", days, remainingHours, remainingMinutes, remainingSeconds));
} else if (hours > 0) {
formattedTime.append(String.format("%02dh %02dm %02ds", remainingHours, remainingMinutes, remainingSeconds));
} else if (minutes > 0) {
formattedTime.append(String.format("%02dm %02ds", remainingMinutes, remainingSeconds));
} else {
formattedTime.append(String.format("%02ds", remainingSeconds));
}
return formattedTime.toString();
}```
oh ty
I'm trying to remove the "§c+ Damage " from the "§c+ Damage 0.1", but the character "§" isn't being removed.
ChatColor.stripColor
Hello is there an Event that is called after the player joined the Server and can interact with the world. It should be called after PlayerJoinEvent, because you can't send WorldChanging NMS Packets if you call it in PlayerJoinEvent.
Yeah its called DecimalFormat and DateTimeFormatter
nothing has changed
ItemStack newItem = a;
ItemMeta meta = newItem.getItemMeta();
List<String> lore = new ArrayList<>();
double i = 0;
if(meta.hasLore()) {
String inputString = meta.getLore().get(2); // ChatColor.RED+"+ Damage 0.1"
String prefixToRemove = "§c+ Damage ";
String valueString = inputString.replace(prefixToRemove, "");
i = Double.parseDouble(valueString);
}
u can also use substring
You shouldn’t be storing data in lore anyway
if it is the start of the string
?pdc
How do I give a player a door which can only be opened by a nametag that has a specific alphanumeric string as key in the lore?
Hey do you know why i am getting an error here at "Slag"?
.retain(ComponentBuilder.FormatRetention.NONE).append(Slag)
BaseComponent[] Slag = new ComponentBuilder("S")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Tryk her for at jail for Slag").create()))
.create();
And i am getting an error at ComponentBuilder builder = new ComponentBuilder(); it says that it cannot resolve componentBuilder()
Also: is this the same as if i were to add the string list using failSafeFormat.add()?
private static final List<String> failSafeFormat = new ArrayList<>(Arrays.asList("WHITE", ""));
immutable?
Oh right
I mean either way it looks like a constant so it doesn’t matter if it’s immutable
yeah i just need it as a fail safe. No need to remove.
this
Arrays.toString(handleNameFormat(ownerNameFormat));
Does this make a String out of the elements of a String[]?
Or does it litterally do "["", "", ""]"?
Sorry, I couldn't understand how to use it, do you know any guide to do this tab completion thing?
Use this one that olivo. recommended; It has a wiki and even a discord server for more help and advice
https://github.com/lucko/commodore
Hmmm but is it possible to do this without any addition?
idk, never used it before
Or in any case i should use brigadier?
nvm, used a diff way
all of them base of brigadier
oh ok
it doesnt feel right
should i make the insert into database sync with the main thread?
for (double x = -count; x<count; x++){
for (double z = -count; z<count; z++){
Location spawnLoc = loc.clone().add(x,noisePipeline.evaluateNoise(x/scaler, z/scaler) ,z);
BlockDisplay display = loc.getWorld().spawn(spawnLoc, BlockDisplay.class);
display.setBlock(Material.DIAMOND_BLOCK.createBlockData());
displays.put(new Vector2d(x, z), display);
display.setInterpolationDuration(20);
}
}
final int[] skipped = {1};
final double y = loc.getY();
$.setInterval(40, interval -> {
skipped[0]++;
for (double x2 = -count; x2 <count; x2++){
for (double z2 = -count; z2<count; z2++){
Display disp = displays.get(new Vector2d(x2, z2));
Location newLoc = disp.getLocation().clone();
disp.setInterpolationDelay(0);
newLoc.setY(y+(noisePipeline.evaluateNoise((x2/scaler)+skipped[0], (z2/scaler)+skipped[0])*multiply));
disp.teleport(newLoc);
}
}
}, PerlinNoise.getPlugin(PerlinNoise.class));
why does interpolation doesnt work?
$.setIntervak is repeated task with delay 40
Where is additional information about players usually stored for the plugin? In JSON files?
?pdc
Does depend on what you want to store though
Hi, how can i calculate fortune? (i need this for a prison server)
wdym "calculate fortune"
if i break a block like a diamond ore needs to be calculation behind it or not?
I'm new to developer, my theoretical knowledge is not bad. Can you suggest open source projects that I can take a look to get ideas while improving myself?
Can I somehow add Coloring to the plugin name so that i can get the pluginName using getDescription().getName() and have it colored in the console?
no but you can just add color codes to the message 🤔
you can get it, cut it, put a color code between and glue it together 🤔
I mean ofc I can just write the name out in the onEnable-Message but that's boring and if I felt the need to change the name of the plugin yet again i'd have to change more than 1 line lmao
cut? isn't it split?
not really since you would substring
or just substring
substring? (i feel like i should know what that is)
ohhh interesting
i just read up on it
then again would it be easier to just write it out lmao
hey, not a spigot question, does anybody know a rust ide? i've started with rust and i'm using vscode with some extensions rn, i was wondering if there's an ide for it with stuff like intellisense, cargo support, etc
I\m creating a configurationsection using #createSection but it just doesn't create any section
nvm
I think I know what is wrong
Yep fixed it, forgot to save the configuration.
next time plz send your code so we can actually help
My bad. I would've sent, but it was just 1 line of code actually.
I was about to mention that I was creating it under PlayerJoinEvent but I already found the issue by then.
vscode has been fine for my rust projects
but if you want to eclipse and intellij can both be used w rust
tyty, i'll see if i can get comfortable with vscode
Hello. For a multiple server communication what is the best solution (without pluginmessages). Socket or redis ? Or other ?
there is a netbeans plugin for rust as well
best in what way?
if ur based u use vim
I suppose one could use vim for communications
not sure if I would classify it the best though
thats not what I was replying to
anyone knows the event when experience is get when an players catchs an fish with an rod? 😄
https://hub.spigotmc.org/javadocs/spigot/allclasses-index.html
searching there, but didnt found ._.
English pls
declaration: package: org.bukkit.event.player, class: PlayerFishEvent
that is english :P
perfectly, thank you!
searching for exp, fishing, etc. xD
declaration: package: org.bukkit.event.player, class: PlayerExpChangeEvent
you can use the search bar in the docs
just type in keywords
i fucking hate that it's called Exp and not Experience
call it XP or Experience but not Exp lol
EntityDmgEvent
reminds me of minestom
PlrJoinEvent
BlckBrkEvent
@echo basalt I was looking at NMS and I'm kind of stumped what is the difference between an NMS Inventory (spigot) / Container (mapped) and Containers (spigot) / Menu (mapped)
the fact that containers are totally different things between mapped and unmapped make it so much more confusing lol
ah let's look at this
then you also have like TileInventorys (spigot) / SimpleMenuProvider (mapped)
A menu is a container
but whats an Inventory then
Inventory is an item container for entities
A menu is for tile entities
And I'll assume that a container is an abstraction of both
so does an Anvil not have a TileEntity then? even though it would seem logical that it would
because it has a Menu
ahh okay
The only icky one is MerchantMenu
But it's a unique menu so
These menus are basically just all the custom UI
So yeah I get it now
Menu = Custom UI, instanced by a MenuProvider
Inventory = General item container, rendered by a menu
Basically a menu is an inventory renderer
If I grab the PDC from an ItemStack, do I have to set the ItemMeta after I make changes?
Yes
Okay, thanks!
I seee interesting okay thanks
Hey, I was trying to make an event listener, but event appears in red
I'm using intellij ide
yea well learn some java cos if you do not see the mistake there you're not familiar enough
EnchantsManager: https://paste.md-5.net/hasotofoki.cs
EnchantGui: https://paste.md-5.net/muferavaca.cs
Hi strangest bug and im 5 hours trying to fix it, when i enchant a pickaxe with a vanilla enchant and try naming it like a normal enchant es DIG_SPEED to Efficiency (Im using an older version so i can't use getByNameKey and i have custom enchants too) just get the pickaxe
Efficiency and Dig_SPEED like separated enchants but linked by the Level
AlixEnchantment is a private version of XSeries, they are the same but i added something else, but the feature im using in this code are the same as the one
🤦♂️
?
HINT: look in what brackets your code is
omg i know u
am i famous now? 😮
xdd
idk but i feel like i know u
works on my machine
yes
lmao
it supports way more than you think
that's gonna get confusing
functions inside functions
the top secret +5,000,000 social credits JDK
in java they're called functional programing
CocosJDK improves java speed by 73% because I have benchmarked it
i assume it only runs on temple os no?
what the fuck are you saying
you know when you do something like Runnable runnable = () -> //something
create class in your method, you can do it in default jdk
and run it
that is not what his code was about?
but still I recommend using CocosJDK with CocosGui
and it's called a functional interface, not functional programming
i wasn't talking about that specific interface lol
no, I dont think python is faster than javascript
i was talking about functional programming as a capability
anyone knows a good API for images on map?
ImageAPI
how would you check if tipped arrows have potion effects? I'm trying to use PotionMeta getCustomEffects() function but it's always empty
Link?
google it
already did.
didnt really came up with anything
on git
I dont think it supports images
you have to convert a java.awt Image to a graphics?
you can just call setPixel a bunch of times
At work we just use awt and move on with our lives
I already found a API that supports images on maps but sadly that only supports 128x128 images only
Raycasting is probably the hardest part of rendering a map
Anyways if you want to use bigger images than 128x128 you can just segment that image and use something like this to get relative positions for proper rendering
looks very similar to rotations at 90 degrees
That's because it is
The most simplified way:
- Create server that will create ready images asynchronously and send packets to client (plugin)
- Make client (plugin) that will send requests to server with callback using CompletableFuture.
- I recommend java sockets
🙂
chatgpt moment
what chatgpt
nvm the other API does support multiple images https://github.com/SBDPlugins/MapReflectionAPI
But thanks for the information, I will play around with both
whats ew about it?
Having to make an image array
from where is this code
wrote it years ago
is this for animation?
there's more to it than just that
EnchantsManager: https://paste.md-5.net/hasotofoki.cs
EnchantGui: https://paste.md-5.net/vovufupoyu.cs
Hi strangest bug and im 5 hours trying to fix it, when i enchant a pickaxe with a vanilla enchant and try naming it like a normal enchant es DIG_SPEED to Efficiency (Im using an older version so i can't use getByNameKey and i have custom enchants too) just get the pickaxe
Efficiency and Dig_SPEED like separated enchants but linked by the Level
AlixEnchantment is a private version of XSeries, they are the same but i added something else, but the feature im using in this code are the same as the one
thanks for copypasting the same message
no i changed only the links
gah static abuse
why, servers are easy
how does that work?
i love that, you know that (i know its bad)
I love slapping the block button
Doesn't mean I should do it
Average "ask for the entire plugin concept and hope someone spoon feeds you" moment
Lol thats so troll
What?
you dont spoonfeed people?
?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.
Are you trolling?
yeah it's bogdan he trolls
🙂
still being a slave for that server that's never coming out?
@echo basalt yo sry for bothering can you help me quick really quick full hypixel skyblock clone
it will be quick
Guys take this outside the server please
star my git project and when EP comes out I'll release it
ep comes out soon
would you put JDA inside plugin jar to make connection between jda and plugin?
it was meant to be out last december
I dont fuck with jda
high turnover I see
better than any other libs
we recoded literally everything
How so?
lol what
mostly because of code structure, docs and api
What mojang remapped packet controls potion effects?
its also thread safe
nvm
How can I create a world with a custom chunk generator that doesn't freeze the server?
nvm
Potion effects on the player I mean
I've tried for 6 hours to do this.
jfc it's one worse than the other
Write performant code p much
Lmao noway??? Its not like every other discord wrapper lib addresses concurrency designs bud
World generation has always been icky
jda has the best support and the best api in most people opinion
o also illusion i have a question for u
At this point I wouldn't mind writing data to the chunks directly and loading them
can u check dm
I mean sure but there are tons of other libs that have just as good reasonable apis and docs
javacord has lost support I think
I'm logging whenever the server generates a block
I might've removed you
Where are those people?
Me
I dont use javacord
I am the people
I am one of them
Bukkit.createWorld(new WorldCreator("arena-"+worldCount).generator(new CustomChunkGenerator()));```
🍿
it stinks paper

I'm using Spigot 1.16.5
imagine not using JDA for discord bot in java
imagine using java for a discord bot tho
is it? the naming looks like paper
Fr
I have another quick question. What would be the best way to store an image in cache/memory while waiting for a onclick event on a block where the image would be placed?
So currently I have an command that takes in a image url, does some basic validation and then places it in a hashmap, Then on every clickEvent after some validation I check if there is a Image in the hasmap linked to the executor and grab it. But im not sure if this is efficient
Rust :-)
How do I apply trims to an itemstack for 1.20.1 armor pieces?
what you use? python? 🤣
Paper is based on Spigot.
OCaml
js is the most used, second one is jda
everything else lol, nodejs, python, java, go, rust idk any other language lol
here
Does this look like Paper?
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
True, I heard any method naming following the fluent naming convention belongs to paper
you are out of luck bud
you can make it in most languages
this is a big troll fest
I love it
the brain cells you loose
I cant find a class called ArmorMeta so im having trouble, and it doesnt seem to work with LeatherArmorMeta
are the entry fee
How do i make this little line not freeze the server?
not much you can do there
it'll create and load a world
that is expensive at runtime
faster, if these worlds already exist on the disk
I should just make my own world manager at some point
maybe show chunkgenerator implementation?
public ChunkGenerator.ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
ChunkData chunkData = createChunkData(world);
world.setBiome(16,64,16, Biome.BIRCH_FOREST);
world.setSpawnLocation(new Location(world,32,64,32));
for (int x = 0; x < 16; x++) {
Bukkit.getLogger().info("x: "+x);
for (int z = 0; z < 16; z++) {
Bukkit.getLogger().info("z: "+z);
chunkData.setBlock(x,0,z,Material.BEDROCK);
for (int y = 0; y <= 64; y++) {
Bukkit.getLogger().info("y: "+y);
if (y > 0 && y < 7){
chunkData.setBlock(x,y,z,Material.LAVA);
}
if (y > 3 && y < 35) {
if (random.nextDouble() < 0.2) {
int i = random.nextInt(10);
if (i == 0){
chunkData.setBlock(x, y, z, Material.DIAMOND_ORE);
} else if (i < 6) {
chunkData.setBlock(x, y, z, Material.IRON_ORE);
} else if (i > 6 && i < 9) {
chunkData.setBlock(x, y, z, Material.GOLD_ORE);
}else {
chunkData.setBlock(x, y, z, Material.LAPIS_ORE);
}
}
}
if(y >35){
chunkData.setBlock(x, y, z, Material.DIRT);
}
if (y == 64){
if (random.nextInt(5) == 0) {
world.generateTree(new Location(world, x, y, z), TreeType.BIRCH);
}
}
}
}
}
return chunkData;
}```
should i push my project to github when i make small changes or should i do it at 3pm every day
uh oh
every 5 seconds ideally
got it
When you've ran your tests and it works fine.
ok
who cares about tests, if it works on your machine then push it
imagine testing your code lmfao
who cares if it even works
yolo
where do u see that
I hacked the matrix
takes too long
by the time i start up my server i forget what i was doing
Any real solutions for fixing my problem?
debugging
After my generation stops the server is still frozen
have you tried figuring out why?
What do you think I've been doing for the past 5 hours?
someone?
what did you try 🙂
I've found to slightly make it faster
in these past 5 hours
Running the world generation in separate threads
I've atleast found this optimizationjava // old: chunkData.setBlock(x, y, z, Material.STONE); chunkData.setRegion(0, y,0,15, y, 15, Material.STONE);
Or I hope it's an optimization
why are you trying to optimize code that does not work
what exactly are you optimizing if the code doesn't work
and you can't generate worlds in separate threads
u can load the chunks asynchronously, but you can't generate the world asynchronously
Can I generate chunks asynchronously?
how is that relevant if your code does not work?
Maybe that takes a long time.
have you tried seeing how long it takes ... ?
About a minute of less
A thread of the server freezes
The logging part doesn't freeze
The command part does
I can't join my server
Commands don't work
But logging works fine.
Even without them it's the same issue
send your full code
My code is too long.
I can remove spaces
?paste
k
Why does it say Cannot resolve constuctor ComponentBuilder() at ComponentBuilder builder = new ComponentBuilder(); and at .retain(ComponentBuilder.FormatRetention.NONE).append(Slag) at (Slag) it says append(java.lang.string() in net.md_5.bungee.api.chat.ComponentBuilder cannot be applied to net.md_5.bungee.api.chat.BaseComponent[]?
ComponentBuilder builder = new ComponentBuilder();
BaseComponent[] Slag = new ComponentBuilder("S")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Test - (1)").create()))
.create();
BaseComponent[] SlagVagt = new ComponentBuilder("SV")
.bold(false)
.color(ChatColor.GREEN)
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 2"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Test - (2)").create()))
.create();
builder
.retain(ComponentBuilder.FormatRetention.NONE).append(Slag)
.append("§7, ")
.retain(ComponentBuilder.FormatRetention.NONE).append(SlagVagt)
Including Main?
only the relevant code
public void createArenaWorld(){
updateCounter();
Bukkit.createWorld(new WorldCreator("arena-"+worldCount).generator(new CustomChunkGenerator()));
Bukkit.getLogger().info("Generating world");
}
Also called in onEnable()
worldCount is an int
does it print generating world
I mean, again, generating a world on the main thread is going to be a lot of work for the server.
If your server is not on the strongest hardware, it is going to take a while.
While generating the world, the main thread is blocked, preventing pretty much any meaningful interaction with the server.
A whole minute however is quite a while
It's on decent hardware.
are you generating multiple ones ?
Just one world
How many chunks does it generate?
or how many times does it call generateChunkData?
catch what exception?
Well, the default spawn area, iirc 10*10 chunks ?
I didn't download sources
tbf I don't download sources most of the time either lol I just use docs
key word use

I'm part of the problem 😎
dont the bungee chat docs straight up not match up with the source
feel like ive had many issues specifically with the TextComponent class LOL
lombok is awesome 😈
it really is tho
records is a thing.
SO true
If you're using Java17
records don't invalidate lombok what are you even on about
Lombok sucks then
Lombok has more uses than record type classes
I mean it already did but yeah
@Delegate
who needs lombok when u have a keyboard
why annotate a 15-field class with @builder when u can build the methods yourself
true
I will say lombok is nice unlesss your doing open source stufff I feel like you should be extra clear about method definitions and such for open source projects
just stop being lazy, write the boilerplate 
it works somewhat in internals I guess
jep the fucking bungeechat source jar is not delomboked
fml
Lombok devs became creative tho, now its like annotations on annotations on annotations from what I heard
lmao
No.
delombok bungeecord pr????
I'm way to lazy to do that xD
Before I commit a single thing to bungee 
plus like yk velocity exists
true
I don't work with proxies so I don't get the difference between bungee and velocity
This only prints "Start of generation"
updateCounter();
Bukkit.getLogger().info("Start of generation");
try {
Bukkit.createWorld(new WorldCreator("arena-" + worldCount).generator(new CustomChunkGenerator()));
}catch (Exception e){
Bukkit.getLogger().severe(e.getMessage());
}
Bukkit.getLogger().info("Generating world");
}
The data and region folder are empty
Session.lock is 3 bytes and uid.dat 16 bytes
@eternal night do u know why structured concurrency jep isnt shipped with virtual threads j21? Pretty sad its in preview still
have not been in that mailing list for a while 
I don't know which one to choose. Which one would you recommend?
Trying to remove duplicate lore but its not working (i cannot describe why but i know it doesn't work)
private List<String> removeDuplicate(List<String>lorelist) {
for (int i = 0; i < lorelist.size(); i++)
{
for (int j = i + 1; j < lorelist.size(); j++)
if (lorelist.get(i).equals(lorelist.get(j)))
{
lorelist.remove(j);
lorelist.remove(i);
j = j - 1;
}
}
return lorelist;
}
My lore is like
- ChatColor.GRAY + "a"
- ChatColor.Gray + "b"
- Chatcolor.Gray + "a"
(the code needs only to delete the last in theory)
I mean, from a quick search through the archives
they had some rather active changes in regards to naming and logic even. Even talks about exception handling in here, so yea. Understandable its in preview
Can someone please help?
Yea lol they revamped the entire #fork call
Ah okay, thanks for the insight (:
Why doesn't fork(...) return a Future?
When the StructuredTaskScope API was incubating, the fork(...) method returned a Future. This provided a sense of familiarity, by making fork(...) resemble the existing ExecutorService::submit method. However, given that StructuredTaskScope is intended to be used differently from ExecutorService — in a structured way, as described above — the use of Future brought more confusion than clarity.
Can only suggest subscribing to the mailing lists 😏
you can get like, a daily little mail
just make sure to recieve list mailing batched in a daily digest
or make a custom mail just for that 
How is it not working, as in is it deleting all, some, or none?
It’s usually best to reload
Can someone please help?
ye
but
when i hotswap it and reload
javalin throws alot of errors
why is that?
the code works and all
but when i hotswap, it just loses its mind
I wish I could help, but I don’t experience with anything but normal Java and Python
oh okay, ty regardless
Sorry not returning
how can I convert between these net.minecraft.advancements.Advancement from org.bukkit.advancement.Advancement
See if there's a get handle in CraftAdvancement
^
Wdym
just doesn't work, it doesn't return and so it can't set the lore
hi im very new to plugin development, i know a bit of java but not enough.
how do i import dependancies i want to use? like bukkit packages, packages that have githubs, etc?
i could use like, a quick rundown of pom.xml, all ive been able to do so far is import spigot stuff
There are plenty of maven tutorials online
If there's anything specific you don't understand then feel free to ask here
Can smbdy help i dont get the wand when i execute the command in game
import org.sveaty.techno.ITEMS.TutoralEvents;
import org.bukkit.inventory.ItemStack;
import org.bukkit.entity.Player;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.CommandExecutor;
public class WandCommand implements CommandExecutor
{
public boolean onCommand(final CommandSender sender, final Command command, final String s, final String[] strings) {
if (!(sender instanceof Player)) {
sender.sendMessage("Only players can run this command");
return true;
}
final Player player = (Player)sender;
if (command.getName().equalsIgnoreCase("givewand")) {
player.getInventory().addItem(new ItemStack[] { TutoralEvents.wand });
}
return true;
}
}```
There's no need to create an array like that
Also show your wand itemstack
also did you register the command correctly
I did in plugin.yml
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.enchantments.Enchantment;
import java.util.List;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
public class TutoralEvents
{
public static ItemStack wand;
public static void init() {
createWand();
}
private static void createWand() {
final ItemStack item = new ItemStack(Material.STICK, 1);
final ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GOLD + "Explosion Wand");
final List<String> lore = new ArrayList<String>();
lore.add(ChatColor.RED + "This Wand is to powerful...");
meta.setLore((List)lore);
meta.addEnchant(Enchantment.LUCK, 1, false);
meta.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ENCHANTS });
item.setItemMeta(meta);
TutoralEvents.wand = item;
}
}```
did you run TutoralEvents.init() in main class or smthing?
what does that field String refer to?
Here is my main class
import org.bukkit.plugin.Plugin;
import org.bukkit.event.Listener;
import org.sveaty.techno.listener.even;
import org.bukkit.command.CommandExecutor;
import org.sveaty.techno.commands.WandCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class Techno extends JavaPlugin
{
public void onEnable() {
this.getCommand("explosion").setExecutor((CommandExecutor)new WandCommand());
this.getServer().getPluginManager().registerEvents((Listener)new even(), (Plugin)this);
}
public void onDisable() {
}
}```
And no i didnt
u should add TutoralEvents.init()
Then that would be the problem
yes
If the init method isn't called wand will be null
wdym?
?
oh u meant wand ok
oh I didn't see the typo
Ah i understand i will test ir and will get back to you if it works or not
Also one more thing do i need to add ItemManager... or it got removed in older versions as im learning from old tutorials
fixed it, just needed to change the java version in the pom.xml file lol
Is this a place to get help with making plugins?
Yes
Oh
I have no idea how to make one
I have watched at least 10 tutorials and I am still confused
Also one more thing do i need to add ItemManager... or it got removed in older versions as im learning from old tutorials
my plan is to make a plugin where everybody spawns in with a random positive effect and every time you kill them your effect upgrades by one
I also want every time a player kills you your effect gets subtracted by one.
can somebody help me with that
sure why not have somebody write it for u even
Yea i think he wants it free...
You mean… “can someone make that for me without pay?”
Youll pay him not him pay you?
no pay really
yeah
and you don't need to pay me
…
we'll all pay u
...
no need
so humble 💯
💀
can you make it for real
Also one more thing do i need to add ItemManager... or it got removed in older versions as im learning from old tutorials
Can you atlest answer my question
?
i wasnt talking to u
whats is the problem ur facing*
We alredy sorted
no sry i only know skript
I just wanted to ask you taht question
Im a prof skript dev and im switching
So dont talk about it
💀
Lmao
theres no fucking way u call yourself "prof skript dev"
there is just no way
you're joking right
does anybody here know how to make a plugin?
Yes
Im an avrage skript dev taht is having over 30+ costumers rn
And im done with skript
@quaint mantle
who even buys skripts What
yes
Ik
Thats why im switiching
Im done with skript
No offense, but we aren’t going to make an entire plugin for a stranger for free. No one is. My recommendation is start off with knowing the basics of Java, then go to a tutorial. https://www.programiz.com has free Java tutorials, and https://youtube.com/playlist?list=PLDhiRTZ_vnoUvdrkTnaWP_hPmbj2JfPAF shows you the ropes of plugin development
why did u even bother writing this message 😭
I at least have a little empathy for him. There’s a crap ton of terrible tutorials out there
fair enough i guess
ok I will try it
maybe i should start being more friendly

Sorry
If I'm struggling can I get help?
That’s what this discord server is for
But know the basics first
download page for what
the plugin creation thing
oh the plugin creation thing
.......
ok thanks



