#help-development
1 messages Ā· Page 856 of 1
Since choco pr not merged yet smh
no, but why would you ever want to do legacy string š¤
i dont, wrong channel here for it too
oh lol I forget of my obscene NMS use often
š©
its litery the help channel moron
this is for development
#help-server stop being an ass
idc its a help channel make me bud
this isn't even the place to ask whoever directed you here was wrong no one here will know how to configure your anti-cheat besides its creators and community
@young knoll this is why you gotta use Pineapple I can maintain all this NMS for you
:P
If you arenāt developing a plugin please take your question to #help-server
Although for specific plugin help itās often better to ask the developers directly
I donāt need NMS with my legacy jank :p
huh whats this
did u see he said i sent a reply on gmail where he told me it stupid LOL
honestly sharing half an iq
then go through the refund process if you don't like the product, he is literally the best person to help you
as he knows that product better than anyone else
well he said hes busy and doesnt know how to
legacy jank is so jank
Yes but thatās craftbukkits problem not mine :p
Iāll happily move away from legacy when Iām able to
Is this OK or do you think I could separate some of the logic differently
public final class DamageListener implements Listener {
private final PitMap pitMap;
public DamageListener(PitMap pitMap) {
this.pitMap = pitMap;
}
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
if (!(event.getEntity() instanceof Player)) {
return;
}
Player victim = (Player) event.getEntity();
this.cancelEventAndTakeActionIfIllegal(event, victim);
if (event.isCancelled()) {
return;
}
}
private void cancelEventAndTakeActionIfIllegal(EntityDamageEvent event, Player victim) {
if (event.getCause() == EntityDamageEvent.DamageCause.FALL) {
event.setCancelled(true);
return;
}
if (event.getCause() == EntityDamageEvent.DamageCause.FIRE_TICK) {
event.setCancelled(true);
victim.setFireTicks(0);
return;
}
if (event.getCause() == EntityDamageEvent.DamageCause.VOID) {
event.setDamage(999999);
return;
}
if ( this.pitMap.getSpawnBounds().collides(victim.getLocation().toVector()) ) {
event.setCancelled(true);
return;
}
}
}
Is that your whole code? Or are you omitting something? Because at that point you might as well just inline everything. No real sense in pulling it out into a method
(also, your last if (event.isCancelled()) { return; } doesn't do anything, it can be removed - again, assuming nothing is omitted)
how do I link the gui i added as an Itemsadder to InventoryClickEvent?
e.getView().getTitle() returns "IA_CUST_GUI"
Oh I just left it there because I'll prob add more things later
idk I'm really thinking now tho
about making my custom events
and having the rest of the plugin deal with the custom events instead of just putting them in my damage listener
i looked up itemsadder api docs but couldnt find them
package lol.nightmarexd.practicecore.menu;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
public class StatsMenu implements Listener {
public StatsMenu(Player player, Player self) {
Player target = (Player)self;
String name = target.getName();
String name1 = target.getName();
Inventory stats = Bukkit.createInventory(null, 54, ChatColor.translateAlternateColorCodes('&', "&8" + name + "'s sį“į“į“ÉŖsį“ÉŖį“s"));
ItemStack head = new ItemStack(Material.PLAYER_HEAD, 1);
SkullMeta headmeta = (SkullMeta)head.getItemMeta();
headmeta.setOwner(name1);
headmeta.setDisplayName((ChatColor.translateAlternateColorCodes('&', "§x§f§b§0§0§0§0" + name + "'s sį“į“į“s")));
head.setItemMeta(headmeta);
stats.setItem(22, head);
package lol.nightmarexd.practicecore.listener;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
public class StatsMenuListener implements Listener {
public StatsMenuListener(Player player, Player self) {
String name = self.getName();
}
@EventHandler
public void onInvClick(InventoryClickEvent e){
if (!e.getView().getTitle().equals(ChatColor.translateAlternateColorCodes('&', "&7" + name + "'s sį“į“į“ÉŖsį“ÉŖį“s"))){
}
}
}
how to fix
Fix what
you define it in a constructor not in the class
how do you expect to be able to access it
Also one has &8 and one has &7
Also you shouldnāt use title to identify inventories
Use the actual inventory object or the InventoryView object
if you do I will patch your code with e.getView().setTitle("trolled") to mess with you
Inventory is probably better. AFAIK InventoryView doesn't override equals or hashCode
I wonder how many plugins I could break just by doing this
public void onInventoryOpen(@NotNull final InventoryOpenEvent event) {
event.getView().setTitle("Hi :3);
}
none
Hello i have a tabcompleter for a command and i want tab completer for a list of numbers, I have this code:
The code prints this:
But in minecraft the tab completer looks like this:
So i cant sort from 1 to 10?
God damnit now I have to fix my inventory framework
No
damn
any other option to do this?
i can do it with roman numbers but i would like a number tabcompleter
Donāt go above 9 ig
Or only suggest numbers based on the digits the player has already typed
i need the 10 to do 100% posibilities so, damn
uhm
i think ill use roman numbers
anyway is from 1 to 10 only
Ill just use my array sorted then convert it
Look at pineapple š
(its nerdy)
I
II
III
IV
IX
V
VI
VII
VIII
X
i have an util for it lol
oh josh
It almost works
Mmk
Man didn't even bother to steal mine wtf
Chonky but useful
I thought pineapple was just a component api
Fr
Join our corporate take over
Ur a pineapple
I dm you our documentation
Since it's not finished yet
But you can see the glory of pineapple
the chat gpt 3 license
no idea what ur talking about
wrote that myself
Yeah I gotta get around to depreciating that legacy config api
Thx for the reminder coll
i will fight you if you remove it and dont replace it with something that works as that does but better
See I avoid this problem by having me be the only person using my library
Depreciation? Nah just yeet it
@worldly ingot is lgtm lets get this merged or looks good to me
there both lgtm
Big brain
nah, I'm gonna start using lets get this merged.
Exactly
what does it stand for
It stands for letās get this M E A T
ą² _ą²
@young knoll how does it looks like
š„šÆš
which is it
I'd definitely opt for numbers > roman numerals for a command
i cant use 10
?
This is still out of order.
is lgtm lets get this merged or looks good to me
I see it as "looks good to me", but I've heard the former as well
@worldly ingotthis is how it looks like with numbers
nooooooooooooooooooooooooooooooooooooooooooooooooo
Yeah Iād say 1 10 2 3 4 etc is better than 1 2 3 4 9 5 etc
who else has a valid opinion here
If it bothers you just remove ten lol
simple does
@sterile axle what do you say
i need enchantment lvl 10 š
Do it in binary
Trueeee
wym
Binary is guaranteed to be sorted
Can't you just have 10 show up only if they type 1?
No?
I don't think binary would get fucked
Just use the actual names of the numbers. smh
Wait
As long as you pad it with 0s
im great at naming tables
Ah yeah
wym by binary lol
00001
00000000
00000001
00000010
okay so if theres 4 bits in a byte, does that mean we can count to 32,767 on our hands
What kinda bytes are you using
Definitely not 4
Mans got them discount bytes from Walmart
oh its 8
Double that infact.
frfr half of byte
Sorry, Tesco
so we can count to 255 on our hands
No
mans has a nibble
We have 10 fingers if you count thumbs
yess
I like bits
if we only use 1 byte we can count to 255
if we use 1 byte and 2 bits we can get higher
Or from -128 to 127
Chop off childrenās thumbs and teach them to count in binary so they are ready for the ai overlords they will grow up to have
We only use signed integers here. :p
If you want to be really quirky, you can count from -255 to 0
Shh I got that backwards
kekw
I mean technically you can do any 256 number range
If you just remember the base offset
Let's start using base 4 instead.
why do embeds have so much stuff
use base 9
makes life a lot harder if you dont know ur 9s
what times tables did ur schools make you learn
1-10
^
As far as I remember
Obviously im a big boy now and can handle higher
Alright, now to learn 13-24
Yeah cuz you didnāt go to anything past primary
who pang me and why
Gottem
me and i need ur opinion
is lgtm lets get this merged or looks good to me
literally by definition
Md uses it as looks good to me
rekt
So get rekt again
looks good to me is #1 and endorsed by google so gtfo
whoever thinks lgtm is legitimate can get the fuck out
I like that last one
The key is to do the merge on a Friday so you donāt have to worry about it until Monday
what if you work weekends
Just don't work weekends.
^
If anybody ever uses "LGTM" in place of "legitimate", they can rightfully eat dirt
LGTMly
That just makes me think of LMGTFY
@sullen marlin please ban Choco for that
Donāt pretend
Imagine minecraft but it makes every chunk like this
this is literall yme
Tutorial code is for the weak. Return to binary.
What if that gives an error
Then you're brain segfaults. Don't mess up.
My brain did that long ago
Where are the spigot.yml settings found in the source code?
Fuck Ngl, no clue how patch files work. Nor how to edit them properly.
If I get like a runtime exception in the onEnable method
for cb its like you edit the java file and it makes the patches
and my plugin can't run anymore
i think spigot works the same
Do I try to give a friendly error msg
Nah for spigot editing the patches is wack
or just print stackttacd
Ask choco, he knows how
and disable
Friendly error message would be nice alongside disabling the plugin.
alr what if it's like an uncaught runtime that I'm just paranoid might happen
but I don't know what to catch (all theoretical)
should I catch Exception?
And give a friendly error msg
@worldly ingot How does editing the spigot patch files work?
I want to verify functionality of the spigot config options, but idk how to work with it.
What are you doing to warrant this?
They're a stack of git commits. You reset to the one you want to edit, amend it, then run the rebuildPatches script
But I'm not sure what you're trying to do, sounds like you can just edit the source normally
I was looking at https://hub.spigotmc.org/jira/browse/SPIGOT-7414 and wanted to verify.
I just don't know where that section lives in craftbukkit. If at all.
It's in spigot and the issue there is that datapacks load before the server now
That ticket is a duplicate you can probably find the core issue by searching spigot.yml and data pack
Workaround: reload
https://hub.spigotmc.org/jira/browse/SPIGOT-5824 is a basically identical issue with bukkit.yml if you wanna stick to CraftBukkit
I didn't even know that feature existed in bukkit. lol
I thought that was a thing that forks added. :p
Another question. When it comes to Player#getBedSpawnLocation(), would it be better to
- Update the docs stating that it can actually return the location of Respawn Anchors as well?
- Deprecate
#getBedSpawnLocation()and introduce#getRespawnLocation()since respawn anchors aren't beds?
both
i'd deprecate it with reason "misleading name, see <here> instead", then add getRespawnLocation and in these docs explain that it could be a bed or anchor location
Which config options?
There is two kinds fyi. Command line and config file
The ones for command line use joptsimple
The spigot.yml options.
can someone help me, i wanna do it so that miner group only can drop items from certain ores. how do i do it using luck perms
i dont really know that plugin well
I would have to look when i get home for that. Not something i can easily do on a phone lmao
anyone?
.
so i make a permission node then like assing check for it in block break event?
BlockDropItemEvent for drops
Is there something I can use to send commands to console instead of
Bukkit.dispatchCommand?
?
Is there a better way for sending commands to console?
why do you need to send commands to console from a plugin?
I want to execute commands to console for automatic keyall events
keyall?
its a command in another plugin
then just invoke that command directly
declaration: package: org.bukkit.command, class: Command
o
Hey i have a issue when i try to install BuildTools im trying to use it for my plugin for world border packets So when i run java -jar BuildTools.jar --rev 1.16.5 in the correct folder It dosent do anything no errors pretty much nothing as output
I made sure i have java 8
Post the output
not sure if you are talking to me but if you are there is no output
like nothing
how do I link the gui i added as an Itemsadder to InventoryClickEvent?
e.getView().getTitle() returns "IA_CUST_GUI"
i looked up itemsadder api docs but couldnt find another event
https://lonedev6.github.io/API-ItemsAdder/
Thats impossible
send a screenshot of the log
Unless he fucked up installing Java somehow..
you cant fuck up that lol
You would be shocked at what people can fuck up.
ive been using java for a few years now and i installed buildtools on this pc before
Did you possibly download an offbrand Builtools.jar? If so, maybe there is just some infinite loop?
When did you last use it?
uh like a month ago
for 1.20.1
and i also reinstalled the buildtools to make sure its all good
So literally nothing at all pops up when you run the command in console?
Screenshot your console then
it dosent let me send a screenshot in this channel
You need to verify.
If you DM me the screenshot, I can post it for you.
ok
lol that username though
Eh, I just do not care at all.
Try to use the normal Windows console.
Do java -version
Your issue is not with Buildtools, it is with however you setup Java on your computer.
uhm thats weird
because i used the buildtools in this pc before
do i reinstall the runtime enivorment?
If java -version did nothing, then Java itself is not setup properly on your compuiter. I would reinstall your JDK, JRE, and check your system enviorment variables.
ill do that and share the results
reinstalled it and still nothing
What happens when you run echo %JAVA_HOME% in console?
They banned
Oh, what for?
Look at the name
They they just change it ?
Eh, I was just ignoring the name. Honestly, almost everyone online is a little bit weird. The best stratagy is to care about literally nothing at all.
did he change his name while he was here or did you not notice it when you talked to him here?
He has had that name since at least the first message I replied to.
I'm not sure tbh
LOL his onlyfans link though
LMAO
it really wasn't all that bad, also people forget in other countries that is the name for the color and that is what they use
like its not a word to refer to people, rather the actual color
I just do not care. He could literally be responsible for mass genocides and I really really wouldn't lose any sleep over it.
I wouldn't ban someone over it, but it isn't my server and isn't my call. Honestly, I didn't see a massive issue with it. The only reason I have ever banned anyone from a discord server is when they posted stuff that was illegal and could get the server banned.
as this is a verified server, im almost certain they have to follow the general Discord rules
which includes not being racist
General discord rules doesn't prohibit words
it does. His account will 100% get banned
I do not think that discord's rules would disallow his username.
if reported
It wasn't neccicarly a racist username.
not once have I seen evidence of a discord account being banned from discord itself for use of a word
did you not see my comment?
we all know he didnt mean the color black in spanish.
As frostalf said, the word literally means "black" in spanish. He could himself just be a black man who is also a killer š¤·āāļø
We all know he was refering to black people
or you know, There is literal shows about Black Hunters
Probably.
I know how he most likely meant it, however, that does not gurentee that is how he meant it.
unless someone goes and asks them
no one knows what exactly is meant and can only assume
thats still on him then for not thinking his name through. If i run for president as a 70yr old man and say āi just love little childrenā its still my fault if id be called a pedo
Its dumb a country uses that word to refer to a color?
no? But his name is english not spanish
if you use a single spanish word in an english name, while being aware that the word has a different meaning in the english language
thats on you.
fully.
It was 1/3 Spanish 2/3 English.
and you can guarantee they are aware of this?
And who cares, even if his name meant exactly what you think it meant, he is just some random guy online.
anyways, people who want to think its offensive generally are the ones that keep perpetuating the problem XD
I like to put chicken nuggets in my macoroni and cheese.
its your food, eat it how you like it
1st This discord is verified as i said
2nd As a person with huge publicity Md could not only ruin the reputation of spigot but also himself by tolerating such behaviour
the rules don't ban words =/
if you think this is not a bannable offense you did not read them
Eh, Md_5 could probably do whatever he wants and be just fine. At the end of the day, Spigot is not something that is easily replaceable.
I am part of servers that are larger then this
I do not think Discord holds servers accountable for every username in the server. It would be impossible to moderate.
trust me, dude isn't going to lose their account and this server isn't going to get shutdown over it XD
now if they started spouting some nonsense in regards to it sure
bruh aren't there any good APIs for creating a dummy server on proxies?
They only hold the servers accountable for things that are in context
that is, people attacking others etc
I found 2 and both have absolutely no documentation
why would there be api's for something that isn't necessary?
there is literally no market for it
let's say on Velocity
would it be better for me to create a server engine and tell the user to start it with .bat
or create a virtual server with an api with no documentation
what you are wanting is a waste of resources to do
its a waste because its makes no sense to create an entire server to validate something
I've never used an mc proxy
or maybe I am confusing you with someone else?
and its coincendental you also want this dummy server thing
so I dunno how hard it is for the user to connect that server to the proxy
its super easy to dynamically connect servers to the bungee
because bungee doesn't need to know about the server ahead of time
and the server doesn't need to know about bungee
the only thing bungee cares about, is when it attempts to send someone to a server, the server picks up
and the server doesn't really care about the connection to begin with
guess I'll settle on this one
I'm trying to modify armor stand metadata using ProtocolLib, but I receive an error that kick me out of the server, here's the code and the error https://paste.md-5.net/uxamihohed.cpp.
The way of changing entity metadata has changed in newer versions.
One moment, ill show you an example
public void dressArmorStand(int entityId) {
// Create the packet first
ProtocolManager protocolManager = NextGens.getProtocolManager();
// Entity Metadata Packet
PacketType type = PacketType.Play.Server.ENTITY_METADATA;
PacketContainer packet = protocolManager.createPacket(type);
// Create serializers
WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
// Create list of data values to change
List<WrappedDataValue> dataValues = new ArrayList<>();
// Create a data value and add it to your values list
Byte armorStandTypeFlags = 0x01 | 0x08 | 0x10;
int asFlagIndex = 15;
dataValues.add(new WrappedDataValue(asFlagIndex, byteSerializer, armorStandTypeFlags));
// Write the data values
packet.getDataValueCollectionModifier().write(0, dataValues);
// Set the entity id
packet.getIntegers().write(0, entityId);
// Broadcast the packet
protocolManager.broadcastServerPacket(packet);
}
Yea
You understood what that means?
and it's thread safe
I assume he meant nested class to hold the singleton instance
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
What would be the reasoning behind that?
thread safety and lazy initialization
Elaborate
you can use a local class for its lazy initialization properties
My assumption, or the design?
The design of creating a nested class, just to hold an instance of a singleton. Never seen that.
public class Whatever {
public static Whatever getInstance() {
class Lazy { Whatever INSTANCE = new Whatever(); }
return Lazy.INSTANCE;
}
}
You know when your singleton is concurrently accessed and it may end up creating more than one instance of it, to fix that we usually double lock the retrieval method, a better way is to just have a nested class or local class, as classloading ensures its only loaded once pretty much
Yeah
if you lock and check null twice, intellij also gives you that suggestion to use a inner static class
And yes Max, thatās fine
I dont like this. What is the benefit over just
public class Whatever {
private static Whatever instance;
public static synchronized Whatever getInstance() {
return instance == null ? instance = new Whatever() : instance;
}
}
I think the synchronized way of doing it was considered as a way of not having to allocate a whole nother class, cheaper in other ways, but since we got just too much memory nowadays
Bill Pugh Singleton Implementation: Prior to Java5, memory model had a lot of issues and above methods caused failure in certain scenarios in multithreaded environment. So, Bill Pugh suggested a concept of inner static classes to use for singleton.
Nahh
yeah smile, i think the common approach was
if instance null
lock
if instance null
set instance
yield instance
yeah
you only lock when needed
Yeah
The nested variant is afaik the best approach
Yes
why
I see the problem with synchronized locking on every retrieval when only needed for instantiation.
But using the classloader to ensure single access is so unclean to me. There must be a better way.
because you donāt have to check if the instance is null every time u access it
using an additional class ofc implies more memory consumption in regards to allocating a whole nother class
Thats whatever
Im more concerned about the code readability.
This def requires a comment to explain its purpose.
No idea about the convo but If you design for Java 5 when your target environment is > Java 5 something went wrong
Iām curious as to what failures it caused concurrent-wise
It didnt
Yeah
i mean singleton in general is something I often comment on
It supports lazy initialize & thread safety
since there usually needs to be a reason why u choose such a design pattern ^^
Because its convenient af š
In my smaller projects, every manager is a singleton because its just convenient to use.
Dont need to have an intricate design otherwise.
Thatās fair
You mean dependency injection. Yes, valid, but enforces a lot of thinking about design.
It becomes a bit more tricky when you have layered abstraction, like certain layers are made to be consumed by the entire system and other layers are just internal abstraction
No
Fuck lombok
:)
i finally got my ssh honeypot working on ipv4 and ipv6
Im in the other camp. I dont like wasting time with getters and setters.
So u have public fields then?
šÆ
āinfluxā š
Is this an ok way to do stuff for my custom gamemode
class DamageListener:
void onDamageEvent:
check victim is not at spawn
other checks etc
call a new GamemodeDamageEvent
Then have all the "special" effects and abilities listen to this custom event
lol
I came to the conclusion that a plugin should not listen to its own events. Only fire them.
They should be seen as a way for other plugins to hook into your logic and modify it.
the thing is tho I don't wanna put everything in my DamageListener
Then pass the important parameters to another place
Ok
My listeners always delegate functionality. I really dislike having code in listeners as they are merely an API link
Should I separate this logic into something like combat manager
is call this. is your favorite
Yeah definetly. At some point your are going to have states as well.
So a manager is the way to go.
Wdym states
Stateful behavior
Read the method lol
the private one
There are a ton of ways to handle this.
Is there more code coming after those lines?
In the listener
Yeah
Here's how it will go
probably go
event:
cancel event and handle illegal scenarios
if event is cancelled: return
damageManager.handle(victim, attacker, etc..)
the names are obv not final but it's probably what I'll do
But I may just pass in the event into the damage manager idk
Oh and I'll have some custom enchants that also like modify the event
I mean separation-logic is totally fine to have in your listener.
You can increase the encapsulation of your spawnBounds by passing the event like this
@EventHandler
public void onEntityDamage(EntityDamageEvent event) {
if (!(event.getEntity() instanceof Player)) {
return;
}
Player victim = (Player) event.getEntity();
boolean validDamage = pitMap.validateVictimDamage(event, victim); // contains the logic of cancelEventAndTakeActionIfIllegal
if (!validDamage) {
return;
}
enchantManager.handle(someStuff...)
damageManager.handle(victim, attacker, etc..)
...
}
Yeah maybe I'm overthinking the names
why dont plugins store per-world info in the world folder
like worldguard and decentholograms
Clearing data from plugins should be easy. So storing everyting in your plugins folder is preferred. But
there is nothing stopping your from storing data in world folders. Storing data in PDCs indirectly does that as well.
true
i'd also think it'd be annoying if you wanna reset a world, you just delete the world folder. if the config is inside there, it'll be gone
depends. for example you might want to reset your farmworld once a month but keep the configs for that world for whatever plugin
sure one could do that. just wanted to mention a possible downside of storing it in the world folder, which is "you can't just delete the folder to reset the world anymore"
yeah true
I missed your message, thank you for the help, it works!
I have another issue, I'm trying to destroy an entity but it throws error saying that the field 0 is not exist.
public void destroyEntity(int entityId) {
ProtocolManager protocolManager = NextGens.getProtocolManager();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
// Set the id of the entity
packet.getIntegerArrays().write(0, new int[]{ entityId }); // <-- Error is in this line apparently
// Broadcast the packet
protocolManager.broadcastServerPacket(packet);
}
This packet now has an IntList instead of an array
Where is the IntList.class from? I see multiple imports.
Its from FastUtils. But ProtocolLib allows you to pass any List and convert it to an IntList internally:
public void destroyEntity(int entityId) {
ProtocolManager protocolManager = NextGens.getProtocolManager();
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.ENTITY_DESTROY);
// Set the id of the entity
packet.getIntLists().write(0, List.of(entityId));
// Broadcast the packet
protocolManager.broadcastServerPacket(packet);
}
Ah right, thank you.
I usually don't use ProtocolLib, just nms and other messy stuff. I figured using this will help me maintaining for future versions.
ArmorStand stand = block.getWorld().spawn(block.getLocation(), ArmorStand.class);
stand.setBasePlate(false);
stand.setCanMove(false);
stand.setCanPickupItems(false);
stand.setMarker(true);
stand.setInvisible(false);
stand.setCustomNameVisible(true);
stand.setCustomName(ChatColor.GREEN + "" + health + "/" + maxHealth);
stand.teleport(block.getLocation());
this.healthArmorStand = stand;
``` how to fix it so it teleports on top of the block
okay i'll try
is there any way to respawn the ender dragon as if it was its first time
Operator '+' cannot be applied to 'org.bukkit.@org.jetbrains.annotations.NotNull Location', 'org.bukkit.Location'
stfu did i ask you?
thanks it works
oh wanna be rude now
ur rude
language please
okie dokie
but anyway does anyone have an answer for this
Not sure if this is possible without nms. I remember doing this a long time ago, but via nms.
having to use nms is no issue, i just need to know how
Have you tried simply calling DragonBattle#initiateRespawn()
i mean that works but it spawns the dragon as if a player had respawned it
so it gives less exp and no egg
i wanna make it so that if a player who hasnt entered the end before yet it spawns a new dragon
as to prevent fear of missing out
i could just hardcode the dragon dropping that much exp and an egg though i guess
Im thinking which metadata value results in the dragon spawning an egg and additional experience.
Hmm
Yeah. This would need testing and then locating this in the NMS world.
After that you need to expose it in the API and make a PR.
Sounds like a good challenge for me :D
If I have some time that may become my first PR
CLA time 
I see no problem there
:)
Is there any guide on how the structure of spigot works and how to contribute to it?
?pr
https://www.spigotmc.org/wiki/cla/ apparently that link was the cla link
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Alright thanks, I'll look into it later
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
net.minecraft.world.level.dimension.end.EndDragonFight
So its simply a matter of exposing a setter in CraftDragonBattle
Players can re-summon the dragon by placing four end crystals on the edges of the exit portal, one on each side

Hi guys, I made this state variable to cancel the event when true. But it doesn't change (always false)
why is this not working
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
protocolManager.addPacketListener(new PacketAdapter(this, PacketType.Play.Server.ENTITY_EQUIPMENT) {
@Override
public void onPacketSending(PacketEvent event) {
try {
PacketContainer packet = event.getPacket();
StructureModifier<ItemStack> items = packet.getItemModifier();
ItemStack stack = items.read(0);
packet = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
items = packet.getItemModifier();
items.write(0, new ItemStack(Material.DIAMOND_SWORD));
event.setPacket(packet);
} catch (FieldAccessException e) {
e.printStackTrace();
}
}
});
plugin = this;
}``` I want it to change the player main hand item to a diamond sword every time the entity equipment packet gets sent, but instead, it gives me this error: ```java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.addPacketListener(com.comphenix.protocol.events.PacketListener)" because "protocolManager" is null``` it might just be me being dumb, but I can't really find good material on packets and protocol online
You probably have two different instances of your listener
I have one on one listener only
You are shading protocolLib.
Change the scope to provided in your pom.xml
alr, will try now
Add a debug statement when you set the variable to true and check if it is really being set.
how never did that š¦
Just a simply print statement here
okay
Also, probably not a good idea to create new object every time you want a random double
Since Java idk what, you can use Math.random
Show your onEnable
what's the issue?
He is using two different instances. He just doesnt know yet
ohh yeah when registering the event
How'd you even catch that so fast
damn impressive
So i make it static?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
I would not reference listeners to each other.
- Create a new class
- Store your relevant data in this class
- Create one instance of this class when the plugin enables
- Pass this one instance to all your listeners, commands, etc.
This way you have a centralized point for your data that can be passed around.
Just the first thought when someone here tells us that "a variable doesnt change when it should" š
Is it faster to have 1 database with all tables or many dbs with their own tables?
Why many, it is a hassle to handle
It's fast enough
Multiple might even be slower
lets say i have many different tables for the economy data, i create a economy db and put all the tables there, when i have one big all the tables would be there unsorted, or is it possible to create packages in sql?
im not so experienced but from what i have seen you cannot really create packages
I mean when you work with foreign keys and stuff
It will be needed
foreign key, you mean uuid?
Nah I mean like relational tables in general
Is there a way to make a gradle plugin apply to only some subprojects. I want to use the gradle checkstyle plugin, but I don't want to apply it to every module, only a specific few. Copying and pasting the configuration seems naive
Thats possible
you can in ur main one in the plugins block add the gradle plugin but also add apply false
then in respective project, add apply plugin: "name"
iirc
Dont remember groovy syntax
W kotlin dsl its
apply(plugin = "name") iirc
just about anywhere, I mean pretty much at the top i think
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
cuz u want it applied before using it ofc
hm I get an execution error when doing that
Basically connections within the tables. Those will be a pain in the ass
?paste
it executes fine when I put the configuration and plugin id in the specific project
You should add it in the top as well
like
id 'checkstyle' version 'ver' apply false
you can't do that with checkstyle
> Plugin 'checkstyle' is a core Gradle plugin, which is already on the classpath. Requesting it with the 'apply false' option is a no-op.
https://paste.md-5.net/upizamilox.cs with this configuration
unless you're suggesting I put its entire definition in the subprojects block
I get errors when doing that though š¤
one sec
Unable to create Root Module: config {/run/media/miles/minimize/Coding/PineappleDevelopmentGroup/Libraries/Pineapple/config/checkstyle/checkstyle.xml}, classpath {null}.
the checkstyle file doesn't actually have any errors either it works fine if I move it all into a single module
Hmm
okay I ran it and grabbed the stacktrace, but I'm confused
lemme double check the checkstyle docs
uuugh IJ always causes trouble for me when using checkstyle.xml, it never properly worked
okay yeah
like how is this possible
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Token "LITERAL_SWITCH" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck
it legit is
it also works when in a single module
how did moving it break my checkstyle.xml its nonsensicle
oh my days finally
yeah im kinda clueless
the stupid aabb ray intersection works
maybe subprojects override some sort of base file path that checkstyle is using
well what i'm confused about is how it's still reading my checkstlye file
and why all of a sudden now that specific file decides it's configuration is wrong
@tender shard any ideas you are the master of beating gradle jank
It's always been good. It's just too good is the problem lol
wdym by "too good"
Way too flexible. Easy to shoot yourself in the foot and not know how to fix it
that moment you realize you're build script is now more complicated then your project
no clue, I stopped using checkstyle alltogether as it was always causing problems, and tbh who the hell cares if you forgot a space once lol
I do >:(
well then chill out!
I have it for javadoc stuff so I don't forget :P
like javadoc rules
but javadoc itself complains if you're doing sth wrong?
not really javadoc doesn't care if you forget to doccument a class
or forget a parameter tag etc
not on IJ afaik
No no I just mean the general javadoc tool (Maven uses it as well with javadoc:javadoc)
You could specify an invalid tag in a Javadoc comment if you'd like
e.g. @thisdoesntexist
If you're compiling docs via IJ it might not fail though
yeah, but then I'd need to script writing that into all forgotten java docs and that's just a mess
oic you want to be sure everything has a comment
I mean I'm not disastified with checkstyle
it's pretty nice as it gives me errors for that stuff
I just am having issues applying the plugin to specific sub projects
Salut
I can just ask epic later I suppose
y'a-t-il des franƧais ?
he might beable to figure it out
english only no francais
ok i traduct my message :p
i cannot decide whether i should create my systems in one big plugin or split them apart. Any advice or experience on this topic?
what kind of "systems"
im creating a server, i make pretty much everything on my own except a few apis to help out, im not sure whether i should have this one big project or split it apart for readability
when having everything together i can create my own big api for servers and dont need to work with so many dependencies accross the plugins
One big project is fine
I can already tell its not gonna affect you a lot by splitting it up
so just stick to one big project
I would personally split, for example one plugin for essentials, one for pvp events etc
Generally how I'd do it is
Don't make 1 project for every plugin, but rather have a core module full of utilities you'll use between them you can have it as a "core" plugin that all of your plugins depend on. Dump every utility that could be shraed into that Core plugin including data storage etc
hmm, how would I store something like a little id number that I don't want to be accessible by the user and be independent of the world?
one plugin to manage chat for example, one for economy that's how i do it currently
I doubt youāre with many people, I doubt you need independent redeployment
that's a good way to be going about it
separate you're concerns imho. Having one big plugin can get nasty. Go with a core plugin that has many utils and stuff and stick with separate projects
its easier to maintain even if you're by yourself imho
You can seperate concerns without needing to split it into multiple jars
you can separate it in compile time just fine
if you canāt handle it urself, its also doable to modularize
that works well until you have plugins you want on one server not on another server too. If you're always going to stick with a 1 server setup this works, but if you ever want to use bungeecoord good way to fuck yourself down the line
thats a smart approach, i tried this once but it was kinda annoying to switch plugins if i wanted to change how data is stored for one of the small plugins. Or do i understand your approach wrong?
Well I forgot to mention VCS wise its easier to have separate repos, but thatās āhandleableā in a single project, tho I doubt u use vcs that much anyway
all that your core would contain is API
Data API's etc
not the actual implementation
implementation stays to each individual plugin
oh
If you have modules it takes like 5 minutes to refactor
And either way when you code multiple plugins you will still code them against each others apis
so youād get a binary incompatibility either or
if they depend on eachother that is which isn't always necessarily true
If you scope out to a new server youād have to completely recompile anyway at some point to tweak it
ig in my server work experience I've never worked alone only ever in teams
wait but how would that work, when i have the economydata object for example, and one plugins accesses it through the core how is the core supposed to return the object from the economy management plugin??
Can you actually give a concrete example of this
Apart from some generic library like bk commons
Yes I can agree w it if uāre on different platforms
But that presupposed you already develop platform agnostic a head of time
Just look at illusions code for instance
How much pre planning he does
Yes exactly when you work w multiple people it will be different
Because VCS is gonna be much more crucial
And independent redeployment as well
tf what block other than air has a null AABB
but at the scope of which yoursalvation is doing stuff, having multiple jars isnt helpful
I mean I can give an example from where I worked. We had a generic library core that provided everything you could ever want. e.g. every API you would ever need etc. You essentially can use that plugin accross any server as its just a library so you know it will be useful and used 100%. When it comes to plugins within that library we separated them out. We had a minigame plugin for the minigames servers which utilized the core library, but also had its own implementation. It'd be a disadvantage if we put all 3 or 4 minigames inside this library plugin we had it'd be a huge disadvantage especially when propogating across bungee and spinning up new servers.
But there you already recognized that ahead of time its likely you gonna have to distribute production onto multiple servers across the network
Hi, there,
how can I get my items to place 100 blocks of different heights?
huh right, gradle doesn't show any warnings about missing javadocs. I also haven't found any option to enable this. Weird
well there are a few approaches
for my skyblock core i'm making platform agnostic code so I don't depend on just bukkit or just spigot
hmm, i think i should give more context to what im doing, i working on a server with a permanent gameplay gamemode(not a minigame) and it would probably be better to have one big plugin as all my custom events that are present in the core experience would be available there to all the features. (so it could all connect and be one experience or am i wrong)?
what
That comes with a lot more development time though
normally I wouldn't care, but when I'm working with multiple people I tend to want to be organized and consistent
You can also make a bungee core and a spigot core
checkstyle can guarentee this to and extent
But that results in duplicate code
so in this case one big plugin would be better as the core experience relies on many different custom systems?
By doing a simple iteration or loop and placing blocks.
And your trigger can be the PlayerInteractEvent or BlockPlaceEvent depending on your item.
like illusiosn skyblock core?
why is raycasting so annoyign
I wouldn't got that far yourself xD
well yhe
as long as you stay on the bukkit platform
if you plan to use minestom you might want to look into platform agnostic API
:)
Yes
otherwise just do what Conclure said Ig
Iāve alreayd told u yoursalvatipn
like uh
Multiple jars is not gonna be helpful
itemstacks
You can listen to the others if you feel like going for the best practice in general
and because I'm using namespaced keys I can also support fabric in a very distant future 
But Iām just saying it to you, so u dont waste time
But does your project require that many ppl and platforms
woooo
yessir yessir
fabric by 2030
hopefully the project's out of alpha by then
working on minigame autoscaling
did some progress today
maybe next month I can actually try it with a real setup
planning on makin a lil minigame network and reselling assets or sumn
one thing I noticed is your minigame core was structured pretty similar to the one I made 2 years ago
I want to make a plugin I want it to listen to a plugin that I specify, so if that plugin stops, I want to tell it to restart the server
well then just enable all doclints
I'm a programmer 
i am a gay
tasks.withType<Javadoc> {
val options = options as StandardJavadocDocletOptions
options.addStringOption("Xdoclint:all")
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xdoclint:all")
}
@river oracle this should enable all doclints and then complain about missing comments
alex you have a new boyfriend opportunity
that's that folks
uwu
I don't think there is a PluginDisable event so run a scheduler like every second asynchronously
onDisable
and if said plugin disabled System.exit()
yeah i think one big plugin is the way as this gamemode is like one game and not just many different things glued together. But regarding this, i have a few data objects, do you think it is smarter and faster to keep them apart (coindata, leveldata) or should i create a customplayer object that can be wrapped around the spigot player and then return all the data once created, but therefore would be reasonably bigger and probably slower as i might sometimes only change the coindata and not the leveldata, but with the approach it would be forced together?
jokes on you
but that logic is flawed already since its hard to tell if the srever is already restarting or not
yeah seems to work
also you can't guarentee you load before or after the plugin you wanna watch
or conversely disable
Have a designated DTO
On my skyblock core I segmented my data storages so there are multiple data classes with multiple storages
At least facade it to a dto such that the lifetime of the data can be centralized
so no customplayerobject that has all the core data features?
There are multiple custom player objects with their own data features
On the surface I would do that
The "core"'s data object has a player id : island id association
There's an island id storage that maps island id : island data
Well, if I make it asynchronous, that is, if I request it to control every 1 second, will it consume too many resources? will it also have an impact on other servers, such as processor usage, ram usage, etc.?
Sub modules can handle their own stuff (economy module can map profile id : economy data)
That way I can selectively enable the modules I want without having to make new tables
Each storage can also handle its own logic (for more complex queries that require sorting and aggregation, for example)
It also allows me to store economy data in a separate database cluster if needed
But yoursalvation if you want some sort of dynamic data adaptation just define a visitor to populate and manage the data for each player data transfer
Or just inherit credentials
Only reason why I went with that system is because I'd like to make modules in the future, and I'd like something I can copypaste across projects as part of my utils
I'd suggest coming up with something yourself through trial and error
no, i was just wondering whether it would be smart to have a own player object so i dont need to get all the different data object all the time and just have this one player object that can return all my custom stuff that i would need
Well
In the past I've done a player data object that was just a Map<String, Object> wrapper
That became a mess to serialize and manage
It'd also toss everything in 1 collection
love my raycasting solution
that would make everything slower right?
It's just not a good approach
when i only want coindata i would also get all the other shit that i might not need
You'd load all the player data just to get 1 value
For example I wouldn't want to load a whole island every time I wanted to get the player's last known username
It's just too much to load in memory
It becomes a point of failure
if someone has corrupted data you compromise the entire system :)
Like do you think hypixel loads your bedwars win streak when you're logging into a skyblock server?
It's part of your player data
okay, the reason why i thought it would be cool to have this, is so that i would have my own api like spigot's player for example.
You can get the player's name, uuid, health, everything related to minecraft. I thought it would've been cool to have my own kind of player object that returns the defualt player and coins, levels or whatevery im storing in my core game experience.
yeah i know, i thought just thought i would looked cleaner than
EconomyData economyData = DataManager.getEconomyData(uuid);
LevelData levelData = DataManager.getLevelData(uuid);
instead of this, i thought it would have been cleaner to do this
CustomPlayer player = DataManager.getPlayer(uuid);
player.getCoins();
player.getLevel();
player.getWhatEveryThereElseMightBe();
Well
What if
EconomyData and LevelData were interfaces
And you just made your CustomPlayer object implement all of them
and proxy the data
(I'm personally not a fan of this and am not advocating for it)
what does proxying data mean?
basically just route the method to the getter of your other class
so this one player method just basically
EconomyData economyData = DataManager.getEconomyData(uuid);
LevelData levelData = DataManager.getLevelData(uuid);
does this in secret?
id personally put it all in one object for player data as you will probably save and load it all on join and quit anyways
u can just project the data u need if youre doing operations while theyre offline
It scales up to a certain point
But if you have A LOT of data and you only need some of it selectively
loading it all isn't a great option
Whatever you'll learn with time
different approaches fit for different problems
stats and economy data will probably be in use most of the time
like scoreboard
display
n shit
Then there's the different question
Are you going to reuse this system?
For instance I reuse my system across projects and hook with it on external modules
You lose flexibility otherwise
regarding data, when having a sql database, i would really like to only have one database, but putting all the tables into one seems kind of not readable, can you create packages in sql?
a database isn't meant to be readable
its meant to store data
that's why its stored in bytes and not ascii text
Why is the stacktrace so short? I can't figure out the issue
most databases have command line or gui interfaces to edit them which arguably makes them more readable but what y2k is saying is def true
stacktrace gets short if it's already been pasted a bunch
just open the log file and scroll down until you see it
only support mongodb currently but yes pls star it i need numbers to increase
damn you're learning them plug skills with me
pls star my skyblock core guys it doesn't even load islands yet guys but pls minestom
lmoa
34 stars rn
vouch
pascal case module names immediate unstar
fuck off
i knew a guy whose name is Pascal
wait holy shit im stupid im writing my own raycast using nms but the nms world has a ray cast method
lmao
what does an object need to have in order for it to work like a packet in Channel#writeAndFlush?
Someone has a ItemStack serializer for gson?
can't find one
and writing one for me is very difficult :(
thanks
wasn't there some directory you could put updated plugin jars so bukkit automatically updates them on next restart
I want to make a plugin I want it to listen to a plugin that I specify, so if that plugin stops, I want to tell it to restart the server Well, if I make it asynchronous, that is, if I request it to control every 1 second, will it consume too many resources? will it also have an impact on other servers, such as processor usage, ram usage, etc.?
Are there plans on adding actual api for custom anvil inventories?
mainly it is impossible to get text from a virtual anvil without the use of nms or packets
Hello?
I did that with packets
and can link you my github
please do
it will not
Can I disable those "original-*" jars from building or something
You can get the text of the anvil gui by getting the displayname of the item at slot 2
He literally said a Virtual Anvil
No idea what he means with "virtual" but it's the same thing?
It's really not
Probably means there is no inventory behind it or something
from the specialsource plugin?
The what
Ye literally the same thing
Doing it myself
where does your -original .jar come from?
How can you be so wrong about something if you're doing it yourself?
thank you
When I build with maven, there is the normal one, the original one and sometimes the shaded one
xD
I literally just looked up in my code that works across 1.8 and 1.20
?paste your pom
then it's not a virtual inventory
Literally the default pom the mc dev plugin generates
those do not change any actual item display names that you could read
(the shaded one only occurs with certain projects)
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.PluginDisableEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class AnaEklenti extends JavaPlugin implements Listener {
@Override
public void onEnable() {
// Olayları dinleyecek olan bu sınıfı kaydet
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPluginDisable(PluginDisableEvent event) {
// Devre dıÅı bırakılan eklentinin adını al
String disabledPluginName = event.getPlugin().getName();
// EÄer devre dıÅı bırakılan eklenti istediÄimiz eklenti ise sunucuyu yeniden baÅlat
if (disabledPluginName.equals("TakipEdilenEklenti")) {
restartServer();
}
}
private void restartServer() {
// Sunucuyu yeniden baÅlatma komutunu buraya ekleyin
// ĆrneÄin:
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "restart");
}
}
Do you think this will work?
My inventory isn't backed by a block, I just place the items in the inventory and read the display name when clicked on
try it and see
that's how guis work
no actual block or any existing entity
I don't wanna get too much into definitions and shit
but a virtual inventory is more when you have the items be virtual as well
But if there is something wrong, I want to correct it. š„¹
10 years into spigot development and it's the first time that I hear of virtual inventories and virtual items
very important in anvil guis
Do you mean items that have been sent via packets?
