#help-development
1 messages · Page 863 of 1
test[1][2]
no, not like that
I mean, how would I specifically search for the 3
when I don't know where it is
depends which 3 you are looking for and its position
Wait, can you not do an int[] or is there some disadvantage I don't know about
Okay, wait
can certainly do an int[][]
Loop through the array and then through the inner array ig?
okay ig
if they have no idea where this 3 is at and want to search the entirety, it would require two loops to go through both arrays
Yeah, that's what I'm saying
no, only one loop, second one I can index, eright?
Index?
how would you index it? you have no idea where the 3 is at
I think you don't understand how multi dimensional array works?
I feel like you are missing some basica of java or programming in general
No wait
Im bad at explaining
Like, I go through every array of the entire one, so I only have a normal array. Then in this normal array i would index the thing I'm looking for
Index?
get the index of the thing I'm searching, pretty sure I've used hat before
Let me see if this clarifies anything. If you have a 2D array, index 1, contains all the index of the second, and index 2 also has the same. So [1][1], [1][2]....[2][1]. [2][2] and so forth.
@wet breach Can you count to 10 in binary
yes, its not all that difficult
List.indexOf()
0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 right?
Hmm, an array isn't a list tho
Cannot it be converted?
It can, yeah
so I think I'll do that ig then, right?
¯_(ツ)_/¯
looks right
I learnt that when making a redstone binary encoder and decoder lmao
but you seem to have it down, that it just basically keeps shifting left with the 1
I learned that in 2nd grade lmfao
We called it '2 number system' back then
It was exam-relevant
Damn, in 2nd grade I learnt the 100
Well, that's what it is
ik
Sorry I don't get the confusion. Couldn't you just do linear search through both dimensions?
2 number system? Do you mean to say base 2 instead?
We also have octal and hexadecimal a lot in computers iirc
pretty weird to say 2 number system
Well, it isn't wrong tho
no it isn't wrong technically lol
Lol
What
I could, but I like complicated haha, then everyone thinks I am a master of code, but actually, I'm just pretending like I do
you forgot 0
avg spigot user
you're not alone
:)
Do you start counting from 0 or from 1
I, too, pretend I know my stuff
0 1 2 3 4 5 6 7 8 9 A B C D E F
well, 0 represents 0 so yea
¯_(ツ)_/¯
You go one, two, three, not zero, one, two, three ig
you start counting from 0, but 0 is just that 0. So it doesn't change the value
so, 00 in hex is 0 and then 01 etc
Why is hex always represented in two "bits" (whatever they're called)
Such as 4F 5E 01 2A etc.
each hexadecimal number represents 4 bits
Doesn't 4 bits go up to like 15 unique numbers
each pair of hex digits is 8bits
Why is there a pair tho
easier for representation ig
because a byte is 8bits
Ahh
therefore, you can fit 2 hex digits in a byte
FFFF,FFFF power of 16 is the largest hexadecimal number in 32bits
4 if you use a sign
unsigned numbers are funny
fun fact 4,294,967,295 is the largest known odd number of sides of a constructible polygon
pom.xml: https://hastebin.skyra.pw/vixaziqalu.htm
the maven reload on the IDE seems to find it tho and this is my usage:
for (List<String> between:aa){
String type = between.get(0);
between.remove(0);
Expression expression = new Expression(String.join(" ", between));
String resu = "";
try {
BigDecimal result = expression.evaluate().getNumberValue();
if (type == "int") {
resu = "" + result.intValue();
} else if (type == "float") {
resu = "" + result.floatValue();
}
} catch (EvaluationException | ParseException e) {
return "bad statement";
}
commande = commande.replace("£" + String.join(" ", between) + "£", resu);
}
it's making operations between £ ||/tp £4+3£ 4 5 actually tp in 7 3 5 ||
its factorization also happens to be exactly the 5 known Fermat primes 3 * 5 * 17 * 257 * 65537
may have found it myself
Damn
?paste ur pom
it's a bit above + i think i can make it work at this point
its this
dont change location in the shade plugin
If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...
it's a copy past of this on the site (did i miss something?)
u right
Is there a way to counter this? I want an enchantment to be applicable to all targets. There isn't a replacement for ALL. The wiki just says "this target no longer exists in Vanilla" (Source: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/EnchantmentTarget.html#ALL)
Does someone know why sometimes the background color is not transparent?
TextDisplay t = (TextDisplay) damager.getWorld().spawn(interaction.getLocation().add(0, 1, 0), TextDisplay.class);
t.setText(AdventureUtil.serialize(Component.text("-" + damage).color(TextColor.color(0xff0000))));
t.setBillboard(Display.Billboard.CENTER);
t.setAlignment(TextDisplay.TextAlignment.CENTER);
t.setBackgroundColor(Color.fromARGB(0,0,0,0));
Bukkit.getScheduler().runTaskLater(SillySMP.getInstance(), () -> {
Transformation transformation = t.getTransformation();
transformation.getTranslation().add(0, 1, 0);
t.setInterpolationDelay(0);
t.setInterpolationDuration(20);
t.setTransformation(transformation);
}, 4);```
have u tried using it anyway?
looks like in theory it should /just work/, idk
It will work, but it is deprecated. I want to avoid any deprecation obviously
What do you mean "sometimes" ?
default_background can override the background color if set to true, could that be your "sometimes" ?
it does not appear always, it's rare, like 1-5 out of 20
will relogging fix it perhaps ?
Try using the other spawn function with supplier (or consumer, I never remember)
it's only for a short time there (2 seconds)
what
Try the other method
But otherwise, you probably have something else interfering with the entity
like here, it indicate damage
which method do you mean?
declaration: package: org.bukkit, interface: RegionAccessor
Okay, it works now, thank you <3
honestly did not expect that to fix it
Glad it did tho
Also, I learnt something new :D
haha,
I also have to have at least a delay of 2 ticks, otherwise, it will teleport
Guys... have these always existed?
For 5 years or so I believe
Maybe a bit longer
Oh ye the other one calculates sin and cos in itself
Finally managed to get some sort of "fake" enchantment through NBT tags, but it still shows. I'll be looking for an approach, unless someone knows how I can add an enchant to an item without it showing on the item
but... why are you doing that?
I want a fake glow effect
I mean if you're already editing NBT tags, you should just be able to give it Enchantments: [{}] (or whatever the enchants tag is) and it should glow
Not that isn't a client quirk and you probably shouldn't 100% rely on it, but it should work
It appears that since recently "empty" compound tags get stripped away automatically
that's very possible lol
I hope you tested that and not only relied on my word
I did test it
I was thinking of adding the flag to items that hide enchantments from the lore as long as it doesn't have Minecraft enchantments on it. Then, remove the flag when it does. However, the enchant event does not get fired when a plugin adds an enchantment through code (ItemStack#addEnchantment), rather than in-game
Once I hacked the vanilla enchantment registry, created a fake enchant and added that to the item.
I do not remember if it showed anything in the lore tho :D
But those were the fun days when I just refused to use API for some things.
Also, please don't even try this, for your own sanity.
With that come two downsides:
- Issues will arise as soon as you try to remove the enchantment from the item, since the object is casted to
CraftEnchantment, causing aClassCastException. You could also extend your custom enchantment class fromCraftEnchantment, but then you are very far away from home, implementing all the overrides. - One of the overrides from the
Enchantmentclass is thegetItemTargetmethod that has to return aEnchantmentTargetenum constant. I want to make it so the "fake glow enchantment" can be applied to all items, so I would simply useEnchantmentTarget.ALL, but that value is deprecated, limiting you to a specific type of item. You could make a custom class extendingEnchantmentcovering allEnchantmentTargetvalues, but that will only cause more brain damage.
Honestly, there must be an easy way for this, no?
one question, what are you trying to do?
I'm making custom enchantments, so I want the item to have a glow effect when one of my custom enchantments is applied to the item
As simple as that
okay, why dont you just apply some enchant and then apply itemflag.hidenechants?
you can use NBT to add an empty list of enchantments to your itemstack
but it might get removed whenever an anvil etc is used, or whatever
Because it has to still work with vanilla enchantments
so you'll have to add this again everytie it gets removed
okay
It gets removed as soon as I add an empty list to it
See this message: #help-development message
oh that didn't happen in earlier versions
sad
well you could change the packet sent to the client whenever the item is updated or whatever... but that's also messy
why not just extend CraftEnchantment
Who changed that in the server .jar and is getting punched today?! 😠 💢
"Just" 😭
do you guys know how can i type something and move them little to the left, i think something like (offset:-10)
I'll see where extending from CraftEnchantment will lead me
and then reimplement it every single spigot version haha
Oh fuck, you are right.
.
tbh isn't it only this?
static class NmsGlowEnchantment extends Enchantment {
static NmsGlowEnchantment INSTANCE = new NmsGlowEnchantment();
protected NmsGlowEnchantment() {
super(Rarity.COMMON, EnchantmentCategory.BREAKABLE, EquipmentSlot.values());
}
}
static class CraftGlowEnchantment extends CraftEnchantment {
private static final NamespacedKey KEY = NamespacedKey.fromString("whatever:glow")
public CraftGlowEnchantment() {
super(KEY, NmsGlowEnchantment.INSTANCE);
}
}
which idiot decided relocating all this shit was a good idea
me
do they have a book on how to be annoying as fuck or something
What about the overrides?
which ones?
what I sent should compile fine I guess
craftenchantment already delegates everything to the NMS enchantment, and NMS enchantment has default values for everything
only problem is that you'll need one CraftGlowEnchantment and NmsGlowEnchantment per NMS version
These are required from the Enchantment class
well you're supposed to extend CraftEnchantment, not Enchantment
but you should override isCursed() because custom enchantments are cursed since 1.20.3
Oh, gotcha
Yo wait I had a question would it be possible to make some kinda system like this? For those lazy staff members to punish players through discord?
Now creating an implementation for each version is quite a struggle
i guess it would be, there a many some servers that connect their discord chat and minecraft chat, i guess typing commands there wouldnt be an issue
It would be role specific though
are there any projects on this?
hallo deutscher freund
of course
you wanna go in a vc?
okay... im not but I know german
oh
no, its just that i cant help you if i have no experience
i think it has something to do why the continue statement, if is set it to break the message is sent
but i want it to search through every request
it shouldn't have to do anything with it
does the problem only appear when you do return instead of break?
yeah theres not much code above this, its just checking if player is null or if sender instanceof player
I meant the library classes
returning is correct as the command ends after accpeting
Did this ever work, is it just the problem with return?
you should make even more things static to avoid ever being able to reuse your classes kek
static good :)
why should i reuse manager objects
for example in case you want to have one manager per world later on, or similar
i mean you don't know what you wanna do in 3 months
or to be able to unit test your manager
yo one question does this static manager stay in memory for ever?
as long as the classloader exists
when the classloader gets GC, your manager can eventually be collected too
ok good, i thought this i gonna steal all my ram
Well I don't really like doing things that aren't planned.
Anyways problem isn't solved yet :p
yes but I bet that your manager only has like a static Map and that's basically all it stores i guess
but by making everything static, you take away your opportunity to instantiate it as often as you want, without getting any other advantages
so it basically has 1 downside and 0 advantage
what is the original problem? i didnt see it
all the tpa accepting stuff works. all the system have worked, just this loop to distinguish doesnt work
and what does it actually do?
Wait whats here
case TPA_HERE:
continue;
switch is unnecessary
so what's the issue exactly?
its that the error message is never sent
also you continue if TPA_HERE, and you return if TPA
its just skipped
yes because you continue if it's TPA_HERE, and you return if there's any TPA in the list
the only possibility that ht emessage is sent if there's any TPA in the list that is neither a TPA_HERE nor a TPA, and if that happens to occur before TPA
btw very bad idea to name the enum class the same as one of its constants
i don't even understand this thing, can you send more tpas to one player or what
it should be sth like TpaType { TPA, TPA_HERE }
no, you can send 2 diffent type tho
and player's can send each other both types
why are these in the same list then
why?
show your TPA class
thats just an enum
?paste
it's not
oh i see
show your TPAType class
theres not much
yeah in that case, what I said earlier is true
you continue if it's TPA and you return if it's TPA_HERE
so it can never leave the switch
oh thats true there is not break statement
unless the last element in the list is TPA
why on earth use a switch for this
no
no?
also who cares whether it's technically faster
you don't even need if
if you want your stuff to be faster yo ushould use one letter method names and classes lol
totally not worth it
Sounds like something pointless that doesn't even work anyways
well yes
so im guessing splitting the tpatypes in 2 different hashmaps would be better?
yes
haha if only you could be able to simply instantiate a second manager class now
or i can create a tpaheremanager
🇩🇪🤯
(static)
TpaManager tpaHereManager = TpaManager();
TpaManager tpaManager = TpaManager();
would be so easy if not everything would be static 😛
but static is better :(

this makes as much sense as making util classes non static
why?
util classes are fine to be not-static, which is if they require an instance or access to any instance members
This is Schnitzel:
. Schnitzel uses static only for utility classes, the singleton pattern and nowhere else. Be more like Schnitzel.
but why use instances if static is simply better?
Static is always bad besides singleton pattern ig
if static stuff would "simply be better", then sure, you should do it like that. but that statement is based on a false assumption
i made a spigot/bukkit plugin but my server cant run it can someone help me
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Is there ?nolog
?nocommand for that
where can i send the code to
?paste
I don't understand why to use non-static manager class.
Manager classes are usually never static
me too
but why?
yeah
Usually for managers you'd use a singleton pattern
singleton = static
because that would allow you to just create two managers, one for tpa's and one for tpahere's. If you create one static god-manager class, you'll ahve to duplicate your logic and check the tpatype in each method
Static bad, atleast that
i pasted it
you gotta click on save in the top right corner, then send us the link
It's different
no
Yes
i used the shortcut crtl + s
Oh
The singleton pattern is probably the only thing you can use static for
you still have to send us the link, otherwise we can't see it lol
singleton is basically static
Static but good
Lol what is this monstrosity org.bukkit.event.Listener
static but exactly the same
It still allows you to extend or instantiate the class without running into stupid static problems
While with static that is just not really possible
i guess thats true
You can also always switch from it to just having an instance of that class stored elsewhere without being concerned about replacing static stuff
I'll give you an easy example. Imagine that you made a CooldownManager used to keep track of people's cooldowns for a /tpa. It has a method "hasCooldown(Player)". Works fine.
Later on, you add another command to your plugin: /spawn. Spawn also should have a cooldown, but a separate one. Now you add a hasSpawnCooldown(Player) to your cooldown class.
If your CooldownManager would not be static, you could just do it like this:
// In your TpaCommand class:
private final Cooldown tpaCooldowns = new Cooldown();
// ANd i nyour SpawnCommadn class:
private final Cooldown spawnCooldowns = new Cooldown();
You can now create as many instances as you want, they are all indepent and you don't have to expand your class ever. If however the "hasCooldown" method in your cooldown manager is static, you are never able to reuse it, and you'd have to write nasty spaghetti code that gets unmaintable as soon as you added the third command
ye this is what I didn't think of
what's the issue? does it enable at all?
Alex, were you drunk writing the second comment
it's the fentanyl laced keyboard bro
give me one sec if u can send me an other paste ill send u what happens when i startup the server
Why is his class not implementing Listener
Am I high
oh
why is this openTrixEnchantingGUI
not static?
Its never registered as listener anyway
Damn
Because it accesses instance members and hence cannot be static
oh I see
i have copied the startup in the terminal can i paste it to u
paste it here :p
?paste
com.example.TrixEnchantingPlugin...
yeah but it is compiled with it so i dont get it
i only have this
Well it seems like you put everything in the resources folder?
🇩🇪
if u want to i can zip the plugin folder so u can checl
send me the project file
i mean before it is compiled
yeah
in plugin.yml you said "my class is in the package com.example" but you didnt put it there
yes he put it in resources or smth.
maven
you do know what packages in java are?
https://blog.jeff-media.com/how-to-create-your-first-minecraft-plugin-using-the-spigot-api-and-maven/ scroll down to the part right after it mentions creating your plugin.yml file
not exactly no this is my firt time working with java to this extent i made a sort of memory with it in school but i went more to web dev
this do i get when i pres the button reload all maven projects
@quaint mantle i send u the full project prived
Anyone know a good way to stop a projectile from breaking on hit? Like a snowball, ender pearl, egg, etc? I'd prefer not to create another projectile as well.
@tender shard can i send the project to u mabye you can see what i did wrong mabye i place some shit wrong
no sorry, your whole project is messed up
- You have declared a different package than your class is actually in. And you even used "com.example" wwithout changing it
- You have declared listeners / eventhandlers in your main class which does not implement Listener and also isnt registered as listener
It looks like you blindly copy pasted code from random places, through it into a java file and changed things until it compiled
you should create a new project from scratch, and start with this tutorial on how to setup the actual project layout: ^
And you should also learn java if you don't know it yet
can i ask for assistanse for example by chat gpt or someting if i dont know or is it beter to ask here
Use both Java docs and Spigot API docs.
You have to learn Java before you can code a plugin
But there are plenty of good tutorials online
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
because i wanted to recreate the mod enchantment plus but than in the form of a plugin and than on the normal enchantment table itself
Oo, then you will probably need some experience in java and plugining
i have learned java in school but that wasnt mutch i now the basics but thats all
That's something relatively complex. If you don't want to code though, there are plugins that do that.
sure you can ask here. But as said, you seem to ignore obvious things, like you tell plugin.yml "my class is named com.example.MyClass" when in reality it's just "MyClass"
that's why I'd suggest you to create a new project from scrathc, then FULLY read the blog post I sent, and follow it, and then feel free to come back here again if you got any specific questions (or questions about the blog post)
i just dont know where to start anymore that the point java isnt my strongest side but i need to program it because the server we creating is going live i prob think its beter to pay someone to do it for me than do it myself because i have a 40 hour job beside it but i dont know anyone who will
I'd do it for free if I had experience in enchants
Yea. If you don't know Java give the project to someone else till you've learned enough to understand it. Java is far from traditional code languages so learning it is a little of a hassle if you are used to other languages.
Java is just oop++ lol
you won't be able to do anythig like you're trying to do properly without having written a ton of smaller, basic plugins for spigot/java
Yea lol
I use like 12 code languages and Java is by far the most finicky
primitives are not objects so I'd rather say java is OOP--
"You can't case this to this"
THEY ARE BOTH NUMBERZ!
I use 2 actively and know basics of other 2 or 3
Lol
blocks of arbitrary code are also not objects
then you probably never tried to write a small application in shell 🥲
Yea... Screw that lol
Python is better xD
iffi
yeah I guess everything has its own advantages and disadvantages... even lua lol
talking about shell hate: try working with arrays or maps in bash
I use Lua too. Its... basic?
They exist in bash?
I don't have a better description
it's also confusing imho. for example . and :
What about php
myobject:somemethod vs myobject.somemethod
i find it to be better than rust but it aint that good
Well yea, but in Java you have "&&" instead of just "and" so they all got their quirks
Is the first one a reference to a static method or whatever that called
php's standard library is a huge mess
&&, ||, etc is just a normal thing
it's similar. one of those, i dont remember whether it's . or :, implicitly passes the "this" object as first parameter or sth
Yea but being somone who started with more user friendly code types, I hate it.
isn't php's boolean operators basically the same as in java?
Well, and, or, not are very hard to see and comprehend with bigger if statements I would say, while !, ||, && are hard to miss
That's one I haven't used so idk
Unless you have them assigned to colors like I do. 👍
there's also a difference between & and &&, and | and ||
And that
1 can be a mathematical function and the other cannot
Bitwise ones and not bitwise ones
Yes we know that, but In a lot of languages both are one thing
It just acounts it based on context
I just thought, couldn't you maybe somehow force gradle into auto-replacing "and", "or", etc. by "&&", "||", etc.
I mean. Sure but like, might as well use it as it is
Ig
one is just lazy
if(a == null | a.getType() == Material.AIR) // Null pointer if a is null because | checks both arguments, eve nif first one is already true
and || just skips executing the right part if the left is already true
May I ask, why that would ever be needed?
Why would you use an or there anyways
I confused true and false in my answer
Bitwise operators can do bit stuff
have edited it
if the thing on the right side has side effects
e.g. if the method is pure = false
Ohhh, I guess that is true
Anywho! I was here to ask a question and got distracted.
I'm pretty sure you could use bitwise operators to like add or subtract bits
oh where's your question?
How does one stop a projectile from breaking when it collides with an object?
Like a snowball
i think you can cancel the ProjectileHitEvent
I did... But it. Doesn't work?
I don't know what it cancels tbh
If not the breaking of the entity itself
show your code pls and also which projectile have you tried it with?
iirc fireworks also use FireworkExplodeEvent
Primary snowball as I can control item texture easy
@EventHandler
onHit(ProjectileHitEvent event) { event.setCancelled(true); getLogger().info("Don't break!"); }
Just do sth extremely simple like this, does the snowballs still break?
hm in that case you'll probably need to create a custom NMS projectile entity and override whichever method is reponsible for the projectile to "hit"/"break"
EntityRemoveFromWorldEvent when?
Problem is I have no clue what's responsible for its breaking
I want.
yeah some1 PR it
downstream has this
unfortuantely they're afraid of creating pull requests
public void projectileCollision(final ProjectileHitEvent event){
Projectile ogProjectile = event.getEntity();
if (ogProjectile.getType() == EntityType.SNOWBALL) {
Snowball projectile = (Snowball) ogProjectile;
ItemStack item = projectile.getItem();
String oHandItem = OraxenItems.getIdByItem(item);
if (oHandItem != null) { //Find Oraxen ID in Config
String configSearch = "item_rclick_events.throwable." + oHandItem;
if(config.get(configSearch) != null) {
if (config.get(configSearch + ".ricochet") != null) {
Double force = (Double) config.get(configSearch + ".ricochet");
event.setCancelled(true);
if (force != null) {
if (event.getHitBlockFace() == BlockFace.UP || event.getHitBlockFace() == BlockFace.DOWN) {
projectile.teleport(new Location(projectile.getWorld(), projectile.getLocation().getX(), projectile.getLocation().getY() + 5, projectile.getLocation().getZ()));
//projectile.setVelocity(new Vector(projectile.getVelocity().getX(), projectile.getVelocity().getY() * -force, projectile.getVelocity().getZ()));
}
}
}
}
}
}
}```
I know there are a LOT of nested 'if' statements. I plan to organize them better later.
You mean through a plugin or by creating a new PR for spigot?
Like, does spigot use NMS? How does a server implementation even work?
you simply take the vanilla code and search for the code that you want to change. for example imagine there's something like this in entity's tick method:
// runs every tick
if(thisEntity.getHealth() < 0) {
thisEntity.removeFromWorld();
}
Now you could add an EntityDeathEvent like this
if(thisEntity.getHealth() < 0) {
EntityDeathEvent event = new EntityDeathEvent(thisEntity);
getPluginManager().callEvent(event);
if(!event.isCancelled()) {
thisEntity.removeFromWorld();
}
}
just an example ofc
Huh, that doesn't actually look that complicated, looks pretty similar to plugins actually
yep. CraftBukkit is just a bunch of patches / changes to the vanilla code. For example here you can see al changes made to the LivingEntity class: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/net/minecraft/world/entity/EntityLiving.patch
obviously that patch is huge but that's just because so many things were changed there
Is there any way through NMS to make an Armor stand have pathfinder goals?
I remember when I did that to the item (in mcp), but I had to make it a LivingEntity first iirc, or maybe that was for a different purpose
Ah ok.
NMS = net.minecraft.server
It refers to the server implementation of mojang.
Spigot is pretty much just a bunch of interfaces, which lets people write code and keep it the same
for multiple versions, because the interfaces dont change. (NMS changes often)
But those interfaces (obviously) dont do anything on their own. They need to be implemented.
This implementation is CraftBukkit. It is a link between Spigot and NMS.
Additionally, spigot creates changes in Mojangs code to interweave functionality.
An example could look like this:
Originally
public void damage(double amount) {
this.health -= amount;
}
Patched:
public void damage(double amount) {
EntityDamageEvent event = new EntityDamageEvent(this, amount);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()) {
return;
}
double dmg = event.getFinalDamage();
this.health -= dmg;
}
well Armorstands are not PathfinderMobs. so no, at least not an easy method
-= dmg and not amount, you mean 😛
Might become a contributor 😁 doesn't sound too complicated, before I was pretty frightened by it
Its really not that bad. The most difficult part is understanding mojangs shenanigans.
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
second one explains how to setup your IDE and create actual changes
first one is a tiny form you have to fill out to contribute to spigot, it's basically just a promise that you say "Whatever code I contribute to spigot, I wrote myself and haven't stolen somewhere else"
the more fun promise being that you grant spigot permission to use your code indefinitely
👍
how else would it work? Inviting people to contribute, then allowing them to just back off after 2 years and force all that code to be taken out again or what lol
that is indeed how open source works most of the time yes
tho I guess undertsandable after the bukkit DMCA drama
idk in that case I'd probably rather not accept any pull requests for anything. imagine the hassle. how would you even know that the person requesting to remove "their" code is the person who originally contributed it?

idk it's a valid question
I mean, that is what you got licences like MIT for
if people don't want to give away the rights to their contributions, they just shouldnt contribute imho
I mean, you yield people the right to use it via an open source licence ?
I don't think you can revoke your contribution, but you can certainly DMCA others (including the original project) when the license your code was contributed under was violated
which is what supposedly happened in the wolverness case
yeah, bukkit's license was violated by craftbukkit from the get-go, people warned the original authors about that, original authors called that senseless scaremongering and the rest is history as they say
Which is why only craftbukkit got nuked, but not bukkit
wdym? those licenses grant rights to the users of the software that is using that license, but it doesn't have anything to do with the agreements made between the maintainer / "owner" of that project and its contributors
I could also just release something under a "anyone may use this, no questions asked" license, then accept a contribution from someone else and someone else ofc still has the urheberrecht about their contribution
the github TOS specifically state your contributions to projects are licenced under the same licence as the project
idk what github says but nobody had mentioned github until now
I mean, that is where it is at
idk spigot is definitely not on github
not anymore because it can't xD
but I mean, even if not
You'd fork the repo, the code in there is MIT licenced, you add your own code and don't adjust the project wide applying licence.
You then publish your changes to PR stuff, gg you just published an MIT licenced repo
sure its a fork of the one you contribute to
but the upstream you PR into can just pull your work, they are MIT licenced after all
yes, you cannot relicense the code without their permission. But beyond that the license would still apply
However if the license is something like CC0, re-licensing is basically allowed by the license
like, idk, given giant companies with lawyer groups larger than half of spigots discord have open source projects that don't require a CLA, I'd guess its legal for them to pull stuff and they don't have to worry about you yanking it after as long as they don't break your licence
HOWEVER, CC0 is not a thing in all countries
the CLA is there so that cute md can sleep tight at night, as he does not have giant lawyer groups
yes
I am not saying I don't get why its there xD
it is certainly the more legally robust way
I mean, you grant spigot the right to change the licence on your work
for all intends and purposes spigot could just go paid and closed server software tomorrow and you can't do shit
bit of that pufferfish++ vibe 
Which basically happen every mc update with unstable mappings.
pufferfish++? the who?
pufferfish++ ?
what that thing
damn
or purpur
a good solution to avoid problems with smallprints in contracts, like AGB, is to simply not read them
I'm pretty sure purpur forks pufferfish
spoken like a true laywer
yea I think they include some patches
but yea, pufferfish++ is pretty ehhh
interesting on a copyright level
all this "using mojang code" stuff is a huge mess anyway. all the patch files contain original mojang code
if that is true, then purpur forks pufferfish, pufferfish forks paper, paper forks spigot, spigot forks craftbukkit, craftbukkit implements bukkit. Is this right?
idk if anyone ruled on whether patches are derivative work tbf
like, it would need someone with the balls to challange microsoft 
@Microsoft I challegene you
yes, challegene
but yea, pufferfish+ iirc has downloads availalbe and you can run it locally ?
At which point like, GPL says you better be supplying the source code on request
which, its a closed fork so they don't
i don't think so. However they must be a derivative, they don't have any purpose without the original stuff, and their only purpose is to be used on the original stuff. however what they actually contain are such small parts usually that they're worthless. There should be a proper law written about that, preferably as AS Verordnung instead of Richtlinie, but they got more important things to do like raising their own salaries D:
why does spigot not have some jar that auto downloads the vanilla mc and then patches it and then also runs the patched one
like paper
das called paperclip
I mean
the project is open source 
its just a bit of a gray area
wait, I can make papaclip run spigot?
sure
CAN I MAKE IT RUN CRAFTBUKKIT?

i think it's much safer than buildtools
huh ?
who tf needs this goofy ahh spigot stuff when we have craftbukkit
how so
I mean, paperclip contains a binary patch, which is like another piece of maybe derivative work
Runs server with craftbukkit
Every plugin using components explodes
haha, fuck components

why can't components be a bukkit feature
I have not looked at how paperclip works. BUT I assume paperclip works like this:
"take the mojang jar and replace bytes 92715-192274 with this: (..) and bytes 12756182 up to 2957 bytes later with this: (...)"
contains 0 mojang code.
buildtools uses patch files which at least party contain moj code
Soon™️
I mean, build tools does not contain patch files either
yeah I meant the stash repo
why must it be player.spigot().sendMessage() and not player.components().sendMessage() or even just player.sendComponentMessage()
Doesn't the paper repo also have patch- yeah
i thought it just downloads binary patches
player.components().sendMessage()
Again, Soon™️
the CraftBukkit repo has patches
yeah that ofc is equally legal or illegal as the spigot variant
what's that?
Uh it's called PaperSpigot
when that soon arrives we'll be using a fork of a fork of purpur already man
who even thought that was a good name
Idk
if mojang would hire me I'd say what spigot and paper do is illegal, if paper or spigot would hire me I of course would think it's legal. so yeah
Who founded paper
Ok so alex is not allowed to apply to Mojang
given how close peeps are with mojang over this xD
I doubt they want to consider this illegal
you technically work for spigot rn
considering how many libraries you made and stuff lol
I don't think that counts
no, a rechtsanwalt is an organ der rechtspflege
Technically no one works for spigot except MD
Someone ping CMarco to pretend they are hired at Spigot Ltc
he's done more for spigot than for minecraft I'd say
§ 1 brao
dude do you remember leguernic?
Still not employeed by SpigotMC Pty. Ltd.
I am like 99% sure that leguernic and cmarco are the same person
idk, i barely remember CMarco, I have most idiots shoved into the same corner of my brain
Wtf is a leguernic
was lugearnerneic religious too
probably an idiot
i dont remember, i dont think so. but from what I know, cmarco also started with this jesus shit only a few months ago
Bro got enlightened
he... took the time to become religious?
hey sometimes people find faith
I've never seen CMarco before he started causing drama
damn
Sometimes people find faith in shit that was made up
FendiTony777?? what does that mean
Tfw name history is public
righttt TheViperShow
jesus is not shit 😭
why are you so rude to Jesus
all I know is that leguernic had the same overly unjustified superiority complexas cmarco does. both are praising old versions (1.4.6 for leguernic who claimed to be the "most popular spigot 1.4.6 coder as of today", and beta 1.7.3 for cmarco). both have / had a spigot resource list full of totally useless plugins that nobody wants to use and are coded like shit but both claim that their work is "obviously superior, totally optimized, bla bla". Both consider themselves to be way better than everyone else, cmarco e.g. calling himself poet, designer, etc bla bla all the time. the similarities to identity-stealing leguernic are definitely there. I don't wanna claim that it's him but it's definitely not far-fetched to at least think about it
dat name rings a bell
to me that means nothing
Same
is our memory short or what
iirc leguernic got banned from spigotmc after he stole some french college professor's identity. that dude, whose actual name was Madeg Leguernic, joined my discord and I talked to him a bit and a few days later leguernic got actually banned from spigotmc and I haven't heard of him ever since
and that's fun
it was about 2 years ago
whaa
You're right
you're just an anonymous class extending human like everyone else here does
say that like a normal person and not like you just read 600 pages of shakespear
you're an interface with no implementation
and your photography skills are subpar at best
Guys we might go to #general just saying
is that an insult? IT SOUNDS CRAZY LMAO
Could be the past after a PR gets merged.
what the heck is a photography exam
The funny thing is this channel has more unrelated drama than actual help 🤣
avg spigotmc
sorry lol
I wish there was a way to download all the messages as a txt from some specific dc channel
either cmarco is a huge fucking troll or he's actually clinically insane
It would be ridiculously massive
Soon™️™️
I don't believe he is a troll, this is WAAAY too much work for trolling
@young knoll did you see that we are now a joint duo for implementing BlockType 
player.components().sendMessage() will be the one in the future, hopefully short future.
what's BlockType? half a material?
I have never seen a troll investing more than 1000 hours just for one troll
indeed
why did I imagine some asian hitting cmarcos pfp with a shoe in the head turning him off like a tv with that typical sound
Wtf 💀🤨
how does the Material class get created anyway? does md have a secret php4 script that he runs when a new version comes out to generate it?
clinically insane it is
unpaid intern
don't ask questions to the person who has never known the answer
Did you want write access to the PR branch or did you want me to handle it?
php4? damn
That's some deep shit man..
I recommend a high dose of antipsychotics like quetiapin, and 20mg diazepam twice daily
I am like, swamped with uni till next wednesday
after that I'll probably just PR my changes to your branch
if you can rebase them onto current master, that would be great (like your branch xD)
I'm just another anonymous class extending human, with no implementation for answerQuestion(Question question);
dont ask questions if you dont know the answers
What does Question.class consist of?
easy logic
it's an interface or abstract class (not sure) with some stuff
auto-generating that fucker isn't that hardest thank god
That's some crazy stuff man.. so you're just some deprecated class no one will ever use ? 🤔
okay then you should be able to answer this within 1-2 small sentences: what's the correlacne between dof, aperture, focal length and focal distance?
I'm not deprecated
I'm just not fully implemented my friend
Hopefully as soon as possible. Only the Bytecode manipulation is missing for now. I vote for 1.20.5.
They know how to use ChatGPT
👍
I can help with that 😌: Delete class.
no, please
they are all things that do things
if you knew you would have needed 1.5 sentences at most
I am the best photographer
PUT ALL THE CODE IN COMMENTS.
NOOOOOOOOO DON'T
bigger aperture = less dof
more focal length = less dof
bigger distance = more dof
I just know what dof is
Remove element by element from the Queue. Every. Second.
Big dof vs small dof
Isn't that just focus?
no. focus is the distance at which the focus point lies. which is at my hand in both pictures
Hmmm
the difference is how far the distance spans that one can consider to still be sharp
they are identical length
which in the first pic is up to my monitor, in the second only a few centimeters
Well my smartphone has exactly one issue. The camera has insane DoF
I only know the german word "doof"
yes sure, only the aperture is difference
Tell me how to fix plz
you don't even know the basics about photography nor anything else. everything you ever did or showcased here is either shit or stolen from chatgpt marco
of course you can't, maybe that's because that's not true
no thanks, i dont want to see it
Damn
you can send it in #bot-commands and have cafe babe take a look at it
lmfao
can't you adjust the aperture
small number = "big hole" ( lol ) = large DOF
@tender shard may I send you some picture in private to show you? dm
big number = small hole/aperture = narrow dof
Hello, I want to integrate into my plugin a site consisting of two parts frontend and backend. I connected the backend without difficulty. But I have some problems with the frontend since it was written in React + NPM was used. And I can't find a way to run the frontend part from Java code. For npm I use the "Frontend-Maven-Plugin" library. The build system is Maven. Do you have any idea how to run the front-end part from the plugin code?
why would you want your plugin to run both the back and frontend? o0
to me this just sounds like combining two things you shouldn't combine
As you can see, the camera focuses on the maths
Everything else blurred out
Perfect example
If I built paper locally, how can I use access mojang mappings?
Sir
I tried compileOnly("io.papermc.paper:paper-server:1.20.4-R0.1-SNAPSHOT") but it did nothing
This is spigot
for paper you want to use the paperweight plugin for gradle
yeah obv not, that's just a dependency and doesn't remap anything
check the docs of paperweight o ngithub
I have a menu and inventory. how to make it so that when the menu is open, it is forbidden to drag items into the menu using the keys 1-9
help pl
jsut cancel the inventoryclickevent
or do you need the player to click the inventory and take something out?
I have a slightly different system. When a player clicks on their item in the inventory, that item is removed from the player's inventory and added to the menu. If I point the mouse at a menu cell and press the 1-9 key, then in this case the item is also dragged and I need to ban this
good afternoon guys
does anyone know how to make a scoreboard without numbers on the right side of screen?
wich version you have
1.20.4
i refer to a several servers where on 1.20.4 theres no numbers on scoreboard
and i have searched for like several hours and have found nothing similar
Are you trying to make a plugin or are you looking for one?
Trying to make a plugin
I've seen one that removes these numbers on right side of screen but i have no idea how to do this
What is the difference between "Bukkit.getServer().getName()" and "Bukkit.getServer().getServerName()"???
For versions 1.17+ you can use a resourcepack
for 1.20.3+ you can use nms
getServerName doesn't exist is the difference
yes, exist
alr tysm for help i'll search some info about nms
Not in Spigot
i am using it
You're using something else
You're probably using Paper
nope
.
I wonder... how can you achieve that?
Which one?
1.20.3+
Mojang added support for scoreboard lines with components and without a score
So you'll have to use the nms scoreboard system
can you tell me where do you find info about these news?
Just read the release notes when a new game version releases 
okay ty
i dont remember what the event need for check player in water
associated with an air bubble
declaration: package: org.bukkit.event.entity, class: EntityAirChangeEvent
thf
Why doesn't an enchanted sword with a sharpness of 10 kill mobs in 1 hit? Minecraft logic?
Enchants broke after 5 lvl
i was use 13
You should use attributes
lvl
ItemEditors should have
if the ratio of level to damage is not known
Attributes does fixed amount
Isnt the sharpness math pretty simple
In Java Edition, Sharpness adds 0.5 * level + 0.5 extra damage.
In Bedrock Edition, each level of Sharpness adds 1.25 extra damage.
thf
if a player leaves the server (player object gets deleted) does all its hashmap entries get deleted as well or do i need to handle that?
You need to handle that unless you use weak references or whatever
trying to change the glow color of a shulker by adding their uuid to a team, doesnt seem to work
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
Do make sure the player can see the team
You need to add all the teams to each players scoreboard if you want them to see the team
wth? why weakness effect != WEAKNESS
can I somehow just send raw text to the player using netty?
Arnor
oh
uh
@eternal night Explain this
it works fine on bukkit
or rather spigot
but breaks on paper
Paper issue 😎
then the issue is paper
That's why I'm pinging the paper man
since I'm banned on their discord
Make a github issue

what did you do to get banned on paper?
the paper man xD
yes
I mean, we rip out some console stuff so ehhh
one of the moderators was a bit sensitive
This just in lynx owns paper
how are you doing the warn ? just plain logger.warn
Hi question, is caching a SQL table (like playerstats) in a HashMap a good idea? I'd assume any file storage is too slow (JSON)
ye
this is the code
just like spigot's
try changing the library to paper
uh
on pom.xml, if you havent done that
I don't use such sophisticated things
you probably do
lemme see if I can replicate 👍
yeah I don't use that
do you use gradle?
no
intellij library man
my compiler does yes
Is it possible to modify the draw speed of a bow without mods
pls switch to a build system as soon as you can xD
INTELLIJ ARTIFACT BUILDER
imo intellij artifact builder is only good for quick stuff
eg an olympiad, where you dont use exterior libraries
I don't see an issue doing it my way
then do it your way
That's what I'm doing
we are just recommending you to hop on to an easier life
I will not make a pact with the devil
you are not using vim
many people have said many things to me, and it turned out that most of them were wrong
that is, on programming terms
i can see
thats my point, intellij was made to make your life easier
yeah
And I'm utilizing it
in the wrong way 
man get to the testing
why would paper just randomly change this
show your custom logger
Prob cm😂
No.
is it like the one I sent?
it's actually paper's fault

I tested it accross 2 terminals
and it's not possible for the terminal to show something it wasn't told to
meaning paper for some reason made it harder
Yea probably
Anyone experience with Jackson? I get the following error after trying to load a specific file (not happening with all files)
'void org.yaml.snakeyaml.parser.ParserImpl.<init>(org.yaml.snakeyaml.reader.StreamReader)'
[12:55:12] [Server thread/ERROR]: Error occurred while enabling bloodmoon-advanced v2.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void org.yaml.snakeyaml.parser.ParserImpl.<init>(org.yaml.snakeyaml.reader.StreamReader)'
I thought of one way but the colors get mixed up
what?
how would that even makes sense?
and what even is that
JLine is a Java library for handling console input.
?whereami
True that tho ^
Idk I mean, feel free to open an issue, maybe someone feels like debugging it for ya
I guess jackson doesnt support snakeyaml 2? make sure you are using the latest jackson
paper fucks around there a lot, not too related to spigot
as per https://www.spigotmc.org/threads/quickdraw-bow.79364/, you cant, its hard coded into the client. just make it have more power if it releases early
well I can't really ask on their discord
I said earliers u shud make a girhub issue
Well try github I guess ?
your problem not ours
or appeal 
bruh
HEY MD5
😂
You got a fanbase
so I am using an outdated version?
Heya, hopefully, quick question:
How does one use the IntelliJ profiler with async function calls?
I have a function being called by an event and the profiler just doesn't show it, even when checking in other thread contexts in the profilers result
🤯
what server version are you running?
Sounds like a legal violation
like the chunk thingy
naaaaaah
1..20.4
some people on Netty's official discord server scolded me for "distributing code" when I showed them how minecraft handles channel intialization
this says "jackson 2.14.2 has a fix that let's you use snakeyaml 2.0 -"
so make sure you use at least jackson 2.14.2
what jackson version are you using?
yep
checking right now
updating to 2.16.1
java.lang.NoSuchMethodError: 'me.mrgeneralq.bloodmoon.jackson.core.StreamReadConstraints me.mrgeneralq.bloodmoon.jackson.dataformat.yaml.YAMLParser.streamReadConstraints()'
I think you'd have to share your build file
make sure you did a clean recompile and all jackson related dependencies are updated
you could also just try 2.14.2 for the minute as maybe the jump to 2.16 is introducing other issues
I think I might have missed a dependency
I guess I got a conflict now with the shade plugin, because it no onger compiles (Unsupported class file major 61)
does spigot have anything for anti-piracy tools? to stop leakers or na?
another day another md_5 W
Algum br?
Can some one help? :)
why would you
pls stop spamming
Because i have a scoreboard with stats displaying for every player online, and i dont what to querry the db everytime
Não e publicidade estou procurando pessoas para fazer parte
scoreboard updates every second
theeeen cache it in a hashmap? you dont need to save it in a file
a simple hashmap would do the job
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
thanks
no hablo englis?
No
It's not advertising, I'm looking for people to be part of
Se pretender solicitar ou oferecer serviços de desenvolvimento/artes/construção/administração, pode fazê-lo em https://www.spigotmc.org/forums/services-recruitment-v2.54/
deepl supremacy
Thank:)
Is that french?
portugese
Ahh it spicy Spanish no wonder it looked familiar