#help-development
1 messages ยท Page 119 of 1
so just add this to jitpack.yml?
- sdk install java 17.0.4.1-tem
- sdk use java 17.0.4.1-tem```
Yeah
That should work, assuming Jitpack's documentation is accurate
They claim you can use SDKMAN commands
it's possible to make the armor stand head bigger?
taking longer to log
so that may be a good sign
finally!
thanks so mcuh
that took 2 days
bruh
o/ Glad it worked
Not really. You're stuck between either a small or large armour stand, or a resource pack
i'm trying to make a custom block with a custom texture. i have been working with nms and i could create a spawner with a block in his head
okay so another problem
i have the dependency added but nothing appears?
i've reloaded intellij
and reloaded maven again
i'm trying to follow this methodology: https://www.youtube.com/watch?v=VEk_l_bosZo&t=218s&ab_channel=SimplySarc
Today I'll show you how to essentially add any new block you want to Minecraft without having to replace any pre-existing, vanilla blocks or textures!
โบSubscribe - http://bit.ly/Subscribe_Sarc
โบFollow Me On Twitter - http://bit.ly/SarcTweet
โโโโโโโ
Other info:
โโโโโโโ
Commands:
/blockdata ~ ~ ~ {RequiredPlayerRange:0s}
/blockdata ~ ~ ~ {Sp...
in this video he creates a new block from datapacks
but i can't find the tags to increase the scale of the head
@worldly ingot
sorry for ping
but im curious
anyone?
i tried ```java
public static boolean isLocationInArea(Location location, Location location1, Location location2) {
BoundingBox box = new BoundingBox(location1.getX(), location1.getY(), location1.getZ(), location2.getX(), location2.getY(), location2.getZ());
return box.contains(location.getX(),location.getY(),location.getZ());
}
isLocationInArea(location, location,location);``` still false :(
have you tried a location that isn't within the box
yup
nah this is broken java BoundingBox box = new BoundingBox(1,1,1,1,1,1); return box.contains(1,1,1); it returns false
Use xyz lol
that what i used
Using like entire class with constructor to check if x y z is between two points is too much effort
what.
I agree. Either use a BoundingBox to start with or forego the BoundingBox entirely
Is this a jitpack dependency? Cause if so, it might be the wrong one.
what.
Anyone know why this: [INFO] Excluding com.lunarclient:bukkitapi-nethandler:jar:1.0-SNAPSHOT from the shaded jar. says "Excluding" when I clearly have it https://pneumonoultramicroscopicsilicovolcanoconiosis.club/CQwZf0gL
its two lines of code. how is it too much effort
i tried js public static boolean isLocationInArea(Location location, Location location1, Location location2) { if((location.getBlockX() > location1.getBlockX()) && (location.getBlockX() < location2.getBlockX())){ if((location.getBlockY() > location1.getBlockY()) && (location.getBlockY() < location2.getBlockY())){ if((location.getBlockZ() > location1.getBlockZ()) && (location.getBlockZ() < location2.getBlockZ())){ return true; } } } return false; } and it didnt work either
yes, its a jitpack dependency
Umm
like idk whats wrong anymore
i tried that too dawg
Should be everywhere
Idk about it's .contains method, so can't really tell what's the problem
But if your xyz doesnt work then your locations are wrong
locations cannot be wrong if i did this
BoundingBox's contains method might not return true if location is on border
Then
its in a void world
no borders
Don't think it's gonna change anything for him but let's hope
someone give me a plugin to make
i need ideas
I j wanna make a plugin
i need shit for my github
BoundingBox box = BoundingBox.of(location1,location2);
return box.contains(location.getX(), location.getY(),location.getZ());```
dying inside
im gonna try java BoundingBox box = BoundingBox.of(location1,location2); return box.contains(location1.getX(), location1.getY(),location1.getZ());
if this doesnt work idk anymore
Probably won't work because it needs to be inside the box not on it.
Expand your location1 and 2 by 1 and it'll probably work
I said that already)
.
is that general
ight ill go to general
BoundingBox box = BoundingBox.of(location1.add(1,1,1),location2.add(1,1,1));
return box.contains(location.getX(), location.getY(),location.getZ());``` like this?
ProtocolLib rotate player to his back. So when he flies up, he looks like he is going to heaven
bro what
I'd suggest location.clone().add(1, 1, 1)
Player has lying animation
You can make him lie forever
Is there any way to check if the player is in Minecraft Pocket Edition?
And even when he walks forward his character is still lying 90 degrees back
thats not part of spigot api
still doesnt work
But his legs are moving
geyser would have a method for it
How's he gonna connect to spigot server from MCPE
why are you adding 1 to it
I would even suggest subtract from first location
And add to second
you are just shifting it 1 to the side
To make box bigger
I wrote this back in the day. You just have to figure out which one is bigger than the other https://haste.miketheshadow.ca/posuduhuca.java
Not my idea, just suggested clone
making a box bigger isnt as simple as just adding 1 or subtracting 1
you have to check whether the value is larger or smaller, then do it accordingly
Well basically if you know that x y z of first loc are lower than x y z of second
You can do that
He is just testing
So he will get 000 and 222
After this
Write unit tests don't do it ingame
Are you sure its not working
Or you just forgot to compile and put to folder and restart
He probably died from cringe
bro I thought it would be easy like you could just go into the toggle flight event and rotate the player or some shit
but no
You know about new chat event?
its gotta be harder then that
But you just need ProtocolLib to help you send a packet lol)))
So player looks lying to everybody, even for himself
package com.lusionmc.rotateplayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerToggleFlightEvent;
public class myListener implements Listener {
@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
Player player = event.getPlayer();
ProtocolLibRotate.rotatePlayer(player, 90);
}
}
Nice but sucks
๐
LOL
And just started slowly flying up
Like from grave
With lying anim
Alr my second old idea
Homing Arrows
This is easy
Don't ask for ideas if you can't do anything
Like 30 minutes
Of cose and testes
Literally 2 classes
One for event and one for handling arrow velocity over time
And one main of course
Now as you can add PDC to arrow
You can store like entity id there
brain is hurting
Don't need to add PDC do you? A HashMap with the move event would probably suffice
And each tick change arrow direction
^ what he said
To entities location
Ye maybe
.
listen boss u gotta hook me up w the free java lessons
With literally default Bukkit runnable
Well if your opponent doesn't move you don't need to run a check
Call me like 10 hrs later
Its 5 am for me
You can shoot at entities
They dont trigger any move event
As far as i know
Paper has an entity move event
Well i would like just spigot
The thing is
You not only change arrow direction every time
But also set it's velocity
To any number you want
So if you are nice at coding
You can make them go reeeeally slow
It's just with enough arrows it could create some lag
And have like 10 arrows
From different directions
Going to one white sheep
Slooooowly
So you can take a screenshot)
Default color
Most common
Actually its gonna look like Dio's Za Warudo from JoJo
.
im j watching you guys argue abt how to make a plugin
that you told me to make
and im sitting here
knowing that im damn well not going to make it
Just make it
Not gonna take long
Start by changing an arrows direction when fired
Start with bowshootevent
OK
?jd-s to find the events you'll need
Check if player triggered it
Get arrow
Get entity player is aiming at
If no entity then dont do anything
If there is add it to hashmap
Spigot API
Or bukkit at least
I just type SpigotAPI into "depend?
Bro
ive never done depend

LOL
Just a default plugin
ight I'm out
Same
Good luck
Cop p__n
noooo
Bro i wanna sleep
use maven
I have philosophy class at my university today
And programming class
I wanna slip
Out
use maven I'm not going to elaborate more it'll be built into your ide look up an IDE specific tutorial on maven and how to use it on youtube/google there will be some pretty in depth docs/videos
pom.xml
javac
AND
java
Bro who cares
guess what I did with that codecademy lesson with the whole console shit
SKIPPED THE FUCK OUTTA IT
same here lol
๐ญ
I never had any java course
Nuker is going through a
First time?
moment.
The amount of people here who don't know basic java is high
been a year still can't compile a pure java project without looking it up lol
Learnt everything myself through years
maven>>
Never used gradle btw
In development channel
))))))
yup all the time
legit most people tryna makea spigot plugin don't know what tf a java is half the time
sometimes people come in with ANT 
Reminds me of my childhood
my first java project was a spigot plugin I have a couple cringy posts on the forums but I think I tried my best to not be a complete idiot
bro what it just game me an error when installing spigotapi adding it as dependency
When i tried 1.5.2 plugin
I actually never made any question post
Except for NMS ones
I tried to change book text in 1.8 plugin
AHA I ADDED THE SPIGOT API
oooooo mah gaaaaaad
Free java lessons btw
Hey guys
Who is still alive
Why do guys use "w" instead of "with" on the internet
What's the connection between this two variants
Where it comes from
me w the boys? never seen that before?
No one I know does it might be local to them
I see it for 9999 time
Already
Well on the internet only
Cuz i'm russian
No English texts here
Well I don't see it so
might be more American cause I'm from Canada
Just change your timezone 
Ez
public class myListener implements Listener {
public void onShoot(EntityShootBowEvent event) {
if (event.getEntity() instanceof Player) {
if (event.getProjectile() instanceof Arrow) {
Arrow arrow = (Arrow) event.getProjectile();
}
}
}
}```
bro
i can do this
this is light
My university wouldnt change it to follow my regime
Now get entity player is scoping to
In line of sight
And the closest from all entities in it
and then it popped up
Is it possible to play the enderpearl cooldown animation on items?
With some insane NMS maybe
Or it's player setCooldown
Will that play the cooldown animation?
Oh
I mean like it will be filled with white
And slowly the white layer will go down
Until item is recharged and ready to be used again
getSpectatorTartget?
Oh? Iโll try that then
idk
You can google how to find entity player is looking at
Smart bot
good idea
@fluid river ur gunna have to deal w the fact
that it is all sheep
not j white
got it
ok mike
its j u and i now
public class myListener implements Listener {
public void onShoot(EntityShootBowEvent event) {
Player player = (Player) event.getEntity();
if (event.getEntity() instanceof Player) {
if (event.getProjectile() instanceof Arrow) {
Arrow arrow = (Arrow) event.getProjectile();
player.getNearbyEntities(10, 10, 10);
for(Entity e : player.getNearbyEntities(10, 10, 10)){
//Example
if(e.getType() == EntityType.SHEEP){
LivingEntity sheep = (LivingEntity) e;
arrow.setVelocity(sheep.getLocation().toVector().subtract(arrow.getLocation().toVector()).normalize());
}
}
}
}
}
} ```
i stole
the nearby
entities
but ont the arrow.setVelocit etc
Check if player triggered it
Get arrow
Get entity player is aiming at
If no entity then dont do anything
If there is add it to hashmap
hold on im fixing it mike
get nearby would not be what you want.
but its like aimbot
well if you want aimbot over homing then yes
@vocal cloud
public void onShoot(EntityShootBowEvent event) {
Player player = (Player) event.getEntity();
if (event.getEntity() instanceof Player) {
if (event.getProjectile() instanceof Arrow) {
Arrow arrow = (Arrow) event.getProjectile();
if (event.getProjectile() instanceof Arrow) {
BlockIterator i = new BlockIterator(player, 200);
Location l = player.getEyeLocation();
while(i.hasNext()) {
l = i.next().getLocation();
for (Entity w : l.getChunk().getEntities()) {
if (w.getLocation().equals(l)) {
}
}
}
}
}```
Wat
Does it work?
no fucking clue
an AI made it
not github copilot
i lit gave it
I gave it this:
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityShootBowEvent;
public class myListener implements Listener {
@EventHandler
public void onShoot(EntityShootBowEvent event) {
Player player = (Player) event.getEntity();
if (event.getEntity() instanceof Player) {
if (event.getProjectile() instanceof Arrow) {
Arrow arrow = (Arrow) event.getProjectile();
}
}
}
}
and I told it "get all entities in player's line of site"
and it gave me that
and it seems right
Don't use AI you're smart you can prototype something on paper then execute it I'm sure.
why is my jitpack not working?
it should
but cant actually use it
dependency loads correctly
what do you mean by cant actually use it?
and you imported it? From JitPack?
yep
This is why I host my own lmfao
show the pom and link the jitpack
Where is the jitpack link
oh-
Time
like i said it should work
Works for me
tf-
Check your libraries on the project tab
off topic but how did you get that yellow when I click your profile
Beta feature. Discord is my Sugar Daddy and gave it to me
oh
no im not
but i'll create a new one
one sec
oh it works now
tf
ยฏ_(ใ)_/ยฏ
well i must be dumb
thanks
There you go
how would i get the plugin if its a dependency?
since i need a plugin for a scheduler
Why would you need the other plugin? Why not use the current plugin?
Then create a constructor with a JavaPlugin parameter.
This way the api user has to provide his JavaPlugin instance in order to use the api.
You can take this instance to register Listeners and schedule tasks,
is there an event called when an item is removed from a players inventory
Nope
so there's no way to detect that
There are several events that can be used for such a detection. The only thing you wont be able to detect is other
plugins removing items programmatically.
so clearing an inventory using Player.getInventory().clear() can't be detected
No
Thatโs correct.
i'll make a custom event then
eh i'll call it whenever i clear
You could in theory constantly keep track of player inventory states and make comparisons, but it might not be a perfect solution.
If you only worry about your own clears then you dont need an event...
ok well lemme explain
i have a custom items/gui library i made
and i figured out that when the items are removed
they keep activating when a different one is added back
and whenever i clear i'll call the event which the library listens for
smh
Are you creatibg a new listener for each item
Alright, so I'm going to try and revive an old thread of mine. Initially I was going to abandon the idea, but the more I kept working on my project, the more I kept finding the need for a system like this. Also, the more I thought about it, the more beneficial it would be.
The original context is located here: https://discord.com/channels/690411863766466590/991327724918550579
The gist of it is that I'm trying to create a Language Pack System of sorts.
I was originally going to hack this together by hard coding every file name needed, but the more I thought about it, I didn't like the idea of that implementation since it'd be a major pain in the ass to maintain. I'd prefer for something a little more robust. However, with with my ambitions for this system, a half decent implementation is proving to be quite the challenge.
I've only had two major breakthroughs in terms of a better implementation, but they seem more like stepping stones at the moment as there are still several things I wish to improve.
I currently have the ideal directory structure that I want to preserve. I also have a few ideas on how to reduce the initial file size of the plugin jar and a method for using all of the files that will be generated, but my problem lies in how to make this more modular. I understand that it is my plugin and I probably have the right to reserve what filenames are expected from the plugin, but I'd like to be able to add and remove files from these packs easily. The easiest way to do that would to not rely on hard-coded names, but this is where I need help because I don't know how I would do that reliably.
just have the pack include a key file, or index them
Hmm, indexing them would probably be the best approach as I don't want end users to accidentally edit important values like this. Because of that, it would have to be an internal index. However, it comes down to how I would store/make it. I know that I could make a list of names that are expected, but that wouldn't account for any future files that would be added.
See, part of the problem is that these packs will also rely on values from the config. So certain files will need to have the ability to be excluded.
including values from teh config is easy, just regex replace
To be specific, it would more than likely just be boolean values that it checks against. In my example, I have a guis file. If the server owner wants to disable gui functionality in the plugin, there would be no need to load the gui message file, so it would be excluded from the pack results.
How do I add a project picture to my plugin?
Hi,
How to prevent players from moving items into custom inventories? I already canceled InventoryMoveItemEvent, InventoryDragEvent and InventoryClickEvent. In InventoryClickEvent I use
if(e.getClickedInventory().getHolder() instanceof BlockChangerInventory)
and players still can move item with pressing SHIFT and clicking on the item. Of course, instead of e.getClickedInventory I can use e.getInventory but it blocks players from changing items' position in own inventory.
can you show your code
You could just cancel if they shift click items in their inventory
hello . how can i set my custom zombie health ?
set the max health attribute
World myWorld = Bukkit.getWorld("world");
Zombie zombie = (Zombie) myWorld.spawn(spawnLocation, Zombie.class);
zombie.setMaxHealth(50);
zombie.setHealth(50);
zombie.setBaby();
zombie.setCustomName("&4&lGhost");
zombie.setCustomNameVisible(true);
i use this but it didnt work
I recommend using the spawn method with a consumer
then put the code modifying your entity there
how can i do that ?
declaration: package: org.bukkit, interface: RegionAccessor
if this is a fully custom mob use nms
Doesn't look like it
How can I exclude a library from being minimized by maven shade plugin?
How can I do that?
See if the clicked inventory is the player inventory and not your one
Then check if they're shift clicking
what's problem ?
if ZombieSetMaxhealth does not work
zombie.setMaxHealth(zombie.getHealth + double);
zombie.setHealth(zombie.getMaxHealth);```
try this
why isn't this including all of the lib? java <minimizeJar>true</minimizeJar> <!-- Ensure not set to true --> <filters> <filter> <artifact>net.wesjd.anvilgui</artifact> <includes> <include>**</include> </includes> </filter> </filters>
ik
What's your advice ?
.
hmm
๐
you literally set "minimizeJar" to true although the comment says not to set it to true
I need to though because if I don't minimize its too large to upload to spigot
your filter settings are wrong
try "*:*" as artifact, then provide the full package name in the includes part
followed by /**
like this? xml <minimizeJar>true</minimizeJar> <!-- Ensure not set to true --> <filters> <filter> <artifact>*:*</artifact> <excludeDefaults>false</excludeDefaults> <includes> <include>net.wesjd.anvilgui/**</include> </includes> </filter>
or try fixing the "artifact" part by including both, groupname and artifact id, e.g. "com.jeff_media:JeffLib"
no, the include part should use / and not .
it doesn't go by "class name" but by file path
ahh right
since it's also used for resources and stuff, not just java files
it worked, thanks a lot. I had to do this because my library uses adventure and for some reason that library is dummy thicc, 2.4mb, thats ridiculous
but I can't remove it because all my language files use the adventure syntax
I could remake it, but thats a lot of bother
you can also get adventure through the libraries feature in plugin.yml
you gonna hate me for this
1.8-1.19
java 8
not that using java 8 changes anything to do with the plugin.yml
someone knows good obfuscator?
Why obfuscate
you gotta protect your source code from evil thieves 
I mean, just name your classes, variables, methods etc things that doesn't make sense
actual 5head move ๐
allatori, it's 290 US$ per year IIRC
but it has good deobfuscator..
they all have deobfuscators
I want to sell a nice plugin, but skids are active ๐
Something like skidfuscator not, but my plugin is too big to obfuscate it with that one lol
i bet that java-deobfuscator with all transformers from the "general" and "normalizer" package enabled also make it readable
Oof
Most commercial obfuscators can only be deobfed when using old copies
At least decent obf
yes thats why i use newest version of some obfuscators like skid
Skidfuscator is freeware, and as such the deobfuscators are much better there
At least I think so
don;t bother
^
All good obfuscators are paid
But buying one is pointless given that spigot does Not allow heavily obfed plugins
am I allowed to download libraries (can't use plugin.yml libraries) in code. Does this violate any rules?
yeah spigot forbids like the most useful settings lol
The only time you should obfuscate is if you are producing a commercial product which you own the IP for and are required to attempt the minimal level of protection.
yes
for paid plugins its forbidden
If it is optional, it is allowed
why?
they must always work without internet except for libraries feature
if it works without downloads, ok
if it's free plugin, also ok
damn adventure is causing a lot of bother
but a paid plugin that NEEDS to download something to run at all, that's forbidden unless plugin.ymls libraries loader is used
i see
Afaik even free Plugins must work without inet I blieve
I don't remember that rule
whats the point of that tho?
Although I could be wrong there
why wouldn't there be internet?
So what I did to use adventure is to have one Spigot jar with adventure shaded and one paper jar without it
Bricking
the point for paid plugins is that once you bought it, it must work even when the dev's server or whatever is dead etc
for free plugins, I dont see any reason in this rule, if there is one
hows that work?
Longevity and to detect even more Professional Malware more easily
Just three modules in gradle
You can also use maven
common
spigot
paper
wait so did you minimize the spigot java with adventure in it?
understandable, but I dont think there is a rule against downloading stuff for free plugins, at least I couldnt find one. There's a rule in the premium resource guidelines:
No but you can
You can also use ProGuard to strip unused methods as well
Depends on how much space you want to save
i just need it to be under 4mb
I mean adventure is less than 900kb if you have minimizeJar enabled
so do this?
Yeah
also when I download my library from my nexus server it doesn't minimize the jar
which I guess makes sense
is there a way I can do that?
so what I mean is if I minimize my library it will go from 3mb to 1mb, approximately. But if I download this library from my nexus server it adds an extra 3mb to my plugin.
Publish the minimized jar
Actually no don't
Just publish the api
No need for implementation
I'm not sure what you mean by that. If I don't provide an implementation for my library in my library then how do I implement it outside?
Do you want your library shadeable?
yes
you could also create a plugin that does nothing than to provide Adventure, then tell people it's a dependency for your plugin lol
you could tell them "if you run spigot, you must download XY-Lib, if on paper, you dont have to"
lol no, I hate people telling me to download extra plugins
4
yeah 4
Make your lib depend on Adventure
When developers use it let them handle shading adventure
This way the end user don't need other jars
Yeah
Any forum staff online
not a bad solution, thanks
i can upload .jars higher than 4 MB
Probably
yeah cuz your trusted
this uploads fine for me
7200kb is too large to upload on spigotmc but 4416kb works for me
i think its user specific
it's definitely SOMEWHERE between 4 and 8
You could also just have an external download like EssentialsX
yeah I could, but I like uploading directly to spigot, its convenient and I feel like people would trust it more even tho im pretty sure they don't scan the files for viruses
I say that because a month ago I saw some idiot spamming a plugin that was clearly a virus, people had rated 1 star and warned of it being a RAT
I should have decompiled it
They point to their latest ci builds
It points to their websites main page
Whhy not to ci
it points here for me
^^
Got the idea from the mc source
mc source is obfuscated though
Yes, but anything can be reverse engineered
Yes we got mappings for methods and field names but things like params and local variables are still obfuscated
Doesn't matter how much you obfuscate
I know
This is why I don't bother with obfuscation
I solved my ping message problem by simply making an overcomplicated piece of code that just works
Making a premium plugin, might as well go open source
Pay for support is the best model for everyone
Let me obfuscate mine by reversing the class name
get_event_loop
Turns into
loop_event_get
Same
You can only obfuscate so skids can't reverse engineer it
If someone wants to crack it they would
Can I like make the class name makes sense to dev but not normal people
Why would anyone normal look at your code
^
hello everyone! I was asking around to know if anyone knew how to create animated text in gradient. Iโve seen a bit around and the only one that seems to do something similar is MiniMessage but I did not understand how to animate it, it would seem to be just static? (?)
You can use :<number> to offset the gradient
gradient:green:5:blueHello world!</gradient>
Take that for example
so that would make me the animated gradient?
Every time you want to update the animation you change the number and resend the message
I explained really badly then, there is an API for the inventories of Phoenix616 (https://wiki.phoenix616.dev/library/inventorygui/start) where you can put the object Dynamic... I donโt know how I could implement MiniMessage with gradient here
Maybe create a class with an int position = 1 and increase and scale for each call I wouldnโt know
oh are you animating an inventory title
ah I see
gui.addElement(new DynamicGuiElement('d', (viewer) -> {
return new StaticGuiElement('d', new ItemStack (Material.CLOCK),
click -> {
click.getGui().draw(); // Update the GUI
return true;
},
"Update time: " + new SimpleDateFormat("HH:mm:ss").format(new Date()));
}));```
Yeah just have an int position and update it every tick or so depending on speed
thank you olivo, just one more question please... Whats that number
The offset
hm, okay I understand... I'm going to try, thank you!!!
oh wait that's a decimal number not an int
wdym
It goes from -1 to 1
so I do the same thing but starting from -1.0?
okay, thank you ๐
dont worry, Iโm still trying to figure out how to make the parse ahahah...
thank you ahahah
whats this ahaha
See the input
Put your minimessage there
<yellow>Woo: <gradient:green:blue:-1>||||||||||||||||||||||||</gradient>! Take this for example
thats freaking cool ahaha
Can I ask you one last question? I just started with "bungee" plugins, but if I program like I always do on Spigot, the same things happen, right? Or there are problems of compatibility with APIs like that of inventories etc...
Bungeecord is another API since it's a proxy
It does not have inventories in the same way as the spigot server
You usually don't have a lot of proxy plugins
Why are you making a Bungeecord plugin?
Like why is it on the Bungee instead of the server
I wanted to do a staffchat but it seemed like something too basic then Im making a staffchat bungeecord full of animations and settings via completely useless but decorative menu
sounds good?
from how I described it you can understand that Im finishing the ideas lmao
then you just want to do everything on spigot and have a communication layer through bungee
wat
yeah just have a basic system to broadcast a message through the proxy
and do the rest in spigot
How do I do it? How do I send information to the bungee from the spigot?
?pluginmessaging
no signal
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
So youโre telling me I only need four lines of code to do the bungee part?
laughs in redis
joins the laugh
laughs in abstracted packet communication system
pretty sure original support dropped but there's an updated fork
there's not much to add ig
care to share ? ๐
yeah fair enough
would love to see how it is compared to my own
yea i do too
I'll just provide an API example instead of sharing tons of code
it's similar to ProtocolLib
i hope better though lol
But I also have some variants for it
a lil specific
I'll use my more general version
I got some modifications for my skyblock core with more abstraction for direction n all
did yall ever have issues with redis connections timing out?
grr this is annoying to exemplify the API as it's a bit abstracted
we got packet processors, which are responsible for sending and calling back packets
so this is where you impl your redis logic, sockets etc
yeah jedis
isnt that what the JedisPool does for you?
Redisson
public class WhateverPacket extends Packet {
private final UUID playerId;
public Packet(byte[] bytes) {
playerId = readUUID();
}
public Packet(UUID playerId) {
this.playerId = playerId;
writeUUID(playerId);
}
}
and just send it
if the packet is registered, I serialize the packet id
otherwise I serialize the class
?paste
yea yours is quite similar to mine
mine look like this
@RedisPacket(id = "UserQuitServer")
public class UserQuitServerPacket extends Packet
{
private UUID uuid;
@Override
public void send(BaosOutputStream out) throws IOException {
out.writeUUID(uuid);
}
@Override
public void receive(BaosInputStream in) throws IOException {
this.uuid = in.readUUID();
}
}
PacketManager manager = ...;
manager.send(new WhateverPacket(id));
WhateverPacket response = manager.await(WhateverPacket.class, (packet) -> packet.getPlayerId().equals(id)); // times out after 3 seconds, add int param for custom timeout
response.getSomethingElse();
I abstract away the streams because some objects can be better stored
I can also add listeners for onReceive and onSend
https://paste.md-5.net/qipoyisoxe.cpp It enters both "ifs" but not dispatching the command in case21 can u help?
public class GenericQueryPacket extends MECallbackPacket<GenericQueryResponsePacket>{
private final String exampleData;
}
public class GenericQueryResponsePacket extends MECallbackResponsePacket{
private final String responseData;
}
public class testPacket{
public void exampe(){
MEPacket query = new GenericQueryPacket("data");
GenericQueryResponsePacket responsePacket = query.await(packetManager, 3(timeout));
System.out.println(responsePacket.getResponseData());
}
}
this is an example for my callback packets
then theres generic broadcast packets which dont require a response
on my skyblock core I went a lil fancy
made packet directions, server identifiers
uhh
packet redirection between proxies
a dummy packet manager that has empty methods everywhere for those idiots who can't setup redis
just jams all communication
tons of stuff
also made dynamic tabling for sql
whoa
yall also have packetlisteners that listen at all time? like spigot listeners bassically?
pretty much yeah
yep
i just got this ```java
/**
* Handles incoming {@link SendMessagePacket}'s
* Allows for message sending cross server
*
* @param packet
* @param channel
*/
@PacketHandler
private void handleUserMessages(SendMessagePacket packet, String channel) {
List<Player> recipients = Common.convert(packet.getRecipient(), value ->
{
OfflinePlayer player = Remain.getOfflinePlayerByUUID(value);
if (player.isOnline() && player.getPlayer() != null) return player.getPlayer();
return null;
});
packet.getMessage().forEach((line) ->
{
Common.broadcastTo(recipients, Localization.Format.USER_MESSAGE.replace("{message}", line));
});
}
yeah i wanna do someting like that
eh
works rlly nicely
I'm not a fan of annotations and reflections in general
mind sharing the code where you call the event?
@Override
public void receive(String channel, Packet packet) {
PacketLogger.logReceivePacket(packet, channel);
if (this.channels.isEmpty() || this.channels.contains(channel)) {
List<Method> methods = this.methods.get(packet.getClass());
if (methods == null || methods.isEmpty()) {
return;
}
for (Method method : methods) {
try {
method.invoke(this, packet, channel);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
ah so just a registry
?paste
am I the only one who made an exception logger that logs stuff to files?
helps a ton with debugging
and this is how i register https://paste.md-5.net/wukimemugo.cs
yep got that too lol
log files are for the weak
simple 35 line class
stores each exception on its own file, on a dedicated folder
you just scroll down to the last
I also made my own command system
might be the only one here tho
probably lmao
Epic
ya
have you considered for your annotation having channel specific stuff
e.g
/**
* Handles incoming {@link SendMessagePacket}'s
* Allows for message sending cross server
*
* @param packet
* @param channel
*/
@PacketHandler(channel = "channel1")
private void handleUserMessages(SendMessagePacket packet, String channel) {
List<Player> recipients = Common.convert(packet.getRecipient(), value ->
{
OfflinePlayer player = Remain.getOfflinePlayerByUUID(value);
if (player.isOnline() && player.getPlayer() != null) return player.getPlayer();
return null;
});
packet.getMessage().forEach((line) ->
{
Common.broadcastTo(recipients, Localization.Format.USER_MESSAGE.replace("{message}", line));
});
}```
so only if the packet is sent on x channel, it will invoke
oh thats actually not a bad idea. then i can lose the channel in the method itself too
since thats all it would be used for
yeah thats what i was thinking
just one less if check on the method
less boilerplate
pretty good idea thanks. will have to look into that
fancy
the only thing i hate
am I the only mf out here that enjoys supporting all types of APIs for common stuff?
Like block pasting
I got worldedit, but I can also load chunk files directly
or use SWM
I got mf amazon S3 support because some guy asked for it
lmao
i just put that it does and append packet lol
i try to make it as scalable as possible
I'd probably make more packages
yeh sure why not
yea mine is just named Packet
conflict of interest with nms Packets though
fair
there are like 35 Main classes
nah I do the same
sometimes I end up having looong packages
one listener per function
be my guest haha
I mean
one package per function too
so
listener:
- player
- mob
- block
- world
- inventory
then within player I'd make subcategories
instead of just pulling an essentials move and stuffing 50 commands in the same package
Does anyone know how to remove balance from an player using vault's api? I checked the docs and couldn't find anything
Economy#withdrawPlayer(...)
Oh I must've missed that thank you
not really it depends
sometimes when i have a huge class with 1 goal
which can include up to 10 listeners
in it
ew
and 2000-3000lines for example
but many other small classes..
i really see no reason splitting everything everything up
Because it makes the code not horrible to read.
Having a single class with thousands of lines is very bad practice.
Same goes for methods. They should be only a couple of lines long.
Especially listeners.
its good practice
there no reason making servel classes
at all
if i would go
and make class for each listener
it would be really messy
would be more 20 classes
for really no reason
when all those 20 listeners even a single goal
There are a ton of reasons for that. One would be modularity. You cant to write
reusable code. The other is separation of concerns. You want to have specific classes
with specific purposes. The next one is cleanliness. Having a lot of small methods with
descriptive names makes your code way better to read. Its essentially self documenting.
are there tutorials on how to add moments and attacks? (like attacking a player)
its just opinion like what color should be better
wtf do you mean?
pathgoals, and yk attack players in range?
ye
you cant make it more then 3 blocks
like otherwsie the attack wont be really made by playe
r
No its not. There is an industry standard for over a decade now.
There is tons of literature just going over this one principle. Its not an opinion. Its a standard.
does anyone with experience with the sonatype nexus repository manager know if there's two different managers for snapshot and non-snapshot builds?
u can use vectors to see where players aim
and if theres a player just make him it the other
I seem to be committing just fine to snapshot builds but can't seem to get it right for non-snapshot builds
It has two repos for each releases and snapshots on default
iirc
yeah that's what I thought as well but are they both searchable from the nexus repo manager?
because I can only find my snapshots on there
as far as I can tell it should be able to... guess I'll have to actually access the repo and see what it does
My listeners for example contain very little logic. Almost none.
They only react and delegate. Thats how an application interface like spigot is meant to be used.
I myself develop the whole plugin in the main class
โจ static state entrypoints โจ
how much white makeup do you order every day
Everything should be static and only write in the main class
a true spigot design principle
What's the need for multiple methods when you can have one
Do I need to reloadConfig after adding something with set to config and saveConfig ?
Not gonna lie i was a bit lazy in this project so i tried some alternatives to di.
thats why you abuse records to auto generate your constructor
(pls don't)
I love records
who doesn't
And i ran into the usual problems with statics being initialized and depending on
other static initialisations which leads to a mess. Solved this my writing a Lazy<T> class 
Easiest way to make a data class
Lazy is the lifestyle ngl
Just the serialisation through marshalling is a bit hard
does gson/jackson not support those ?
Lomboโฆ (/s)
I wish something like this existed
public void myMethod(final String... s, final Integer... i) {}
I havent found a lib so far that does. I wrote a TypeAdapterFactory for records which scans for a constructor
that matches the object field types in order.
If you really want that theres an interesting debate that goes like
If you have so many parameters, they are already so (arguably) cohesive that you might just encapsulate them inside some object before sending them to that function myMethod
I read through some JEPs yesterday. Does v19 include the first incubation for Valhalla?
List<int> when
๐
I mean wouldn't you be able to have a record class that holds them and then utilize it as a list
๐
you should use List<Object> all the time for the most flexible list possible
tho I think 19 has some neat loom things
scalability
Think they were joking? (I hope)
Why stop there? Just use Object all the time. It can hold a List<Object> if you want to.
the final level of polymorphism xD
I've got a question, how do I know if a player made 5 kills without dying? Every help is wanted
yes
bah
something like this
public record MyClass(String... s) {}
public record MyClass2(Integer... i) {}
``` @ivory sleet
Oh yeah
dunno what i did but i found something the other day that wasnt instanceof object
Keep track of his kills and reset them if he dies...
Would work in theory
I only learned that an array is an object like 5 years into java
sounds bout right
Indeed
how do I keep track? ik this sounds stupid im stupid rn
was checking for equality with ==
HashMap<UUID, int> killcount
I found another way to abuse record classes @eternal night
Integer
anything can be an object if you really believe in yourself

