#help-development
1 messages · Page 1557 of 1
they are basically something like an implementation specification, while not being the implementation itself - those are hidden
cuz its to know what each thinig does
for example
the code in w3schools
they have the interface animal with 2 public void , no body, they then use public void animal sound and make it sout "the pig...", the one in the interface is not doing anything
and if you call it is empty
i think i got it
Interfaces are basically glorified abstract classes with even less logic than abstract classes
thats why its called abstract
Myeah, polymorphism basically
yes this
Yup, abstract methods helps with the what, not the how
basically a template. all the classes that extend animal are animals ex. pig
fill in the methods according to what it is more specifically than an animal
The good thing with interfaces is that other than abstract classes, you can inherit multiple interfaces in a single class - which is good for polymorphism
And interface segregation but yeah it’s very powerful
This means for example Player is a ProjectileSource and a LivingEntity, while LivingEntity is not a ProjectileSource and vice versa
so the "best way" of doing a plugin is having packages, each package has a main class doing a function and an interface explaining what each method does, so its more orginized in case you need to read the code
Don’t use interfaces just because the sake of it
I see tons of open sourced projects which just layers interface after interface. It makes your application hard to navigate and if we talk about unit testing, not everything need to be strictly unit testable. Use it when you want to achieve powerful abstractions only.
you might need none 🤷♂️
well i got into interfaces cuz im making a plugin and i get lost, between the classes and what they do, its hard to debug it sometimes
i want a more orginized way
Doesn’t really sound like interfaces would solve that
"smaller" way
spaghetti code I see
yea..
🥲
interfaces wont help here I digress
im trying to find new ways to think a code, im now trying making the entire logic and then making the code
like skirpt
I mean if you wanna write clean code, learn to avoid anti patterns and when to use the right design pattern.
Could not find artifact net.lucaudev:api:jar:1.0.0 in (custom maven repo)
<dependency>
<groupId>net.lucaudev</groupId>
<artifactId>api</artifactId>
<version>1.0.0</version>
</dependency>
I mean like it clearly exists
but it seems to be adding jar to the artifact id or something?
did you actually declare the repo in your pom?
I did
Definitely not true at all
and it lists the repository as the one
is it http or https?
then idk what the issue is
Oh maven, rip
could you back that up?
Sorry how are they slow?
I mean more classes to load so probably some negligible impact
Either way, INVOKESTATIC is the fastest of all
Hmm I should start writing composeable static methods henceforth
how can i specify in which file i want to save something?
Why does #isInLava not exist in base spigot?
it's in paper
Sorry if you don't know
Lol yeah I don’t know sorry
How are you doing it right now
:D
invokestatic is the fastest of all, but interface invokevirtual is no slower than invoking a method on any class. (ie the only faster alternative is 100% static methods)... which is actually totally viable especially in Kotlin. (tho personally I do statics and interfaces together)
https://stackoverflow.com/a/28511095/16138583 shows that interfaces would be worse
in this case runnable is invokevirtual
Sure but that's not a facet of interfaces
Runnable is an interface, Runnable.run is an implementation of an interface
It's really the difference between monomorphic vs megamorphic call sites as well as the 2 step virtual lookup.
In fact interfaces can be faster than abstract classes since lambdas use invokedynamic/invokestatic and forgo the invokespecial.
Oo
lambdas require functional interfaces
But either way doesn't matter at all... since in this case good design will lead to better performance (as it does up the point where you have to decide which you want)
no one
someone
they got banned already, calm down lad
"lambdas require functional interfaces" sure so worst case... ur dealing with normal invokevirtual speed.
yes, which isn't much of an issue
Yeah, so no issue using interfaces
mass ping?
2021s JVMs should be able to handle it - but I stand with my point of them being ever so slighly worse in terms of performance than public static final everywhere
ye
@ivory sleet Any chance you have perms to move this to spigot not buildtools? Idk why it's in buildtools
https://hub.spigotmc.org/jira/browse/BUILDTOOLS-603
Could you send it up the chain
It's impossible to get a mod's attention
You just got mine
Helper's are easier 😉
any recommended resources for making a custom item with an action when clicked?
Conclure is just better
Plus, you're very responsive 🙂
Anyways liquake uh md5 will probably see it soon, no need to hesitate
who cares about that
Thanks
and obv constants are gas where applicable
In meantime does anyone know where the collision api went in 1.17?
procedural came before OOP, as such procedural must be superior
anyone who writes good code and or is a developer by trade.
predicted.getMinX(),predicted.getMinY(),predicted.getMinZ(),
predicted.getMaxX(),predicted.getMaxY(),predicted.getMaxZ()```
Looking for this method
Did it go? Normally nothing gets removed
I just meant package wise
I'm assuming it's probably in an instance now
but it's possible to be "object oriented" without doing virtual polymorphism too.
Inside worldsserver
Quick search should reveal it
or serverworld
Idk what I'd search for
Already scanned the class for similar signatures
Nothing.
I'm on mojang mappings
I've got the yarn remapped ones here too
Run buildtools with —remapped and then decompile it
I got that too
No, I've got all the tools
I've got obfuscated
yarn
and the mojang mappings here right now
That I'm devving against
What would be the appropriate way of making tablist names appear for everyone?
Currently I have this set up because I figured that it's how it works but the name in tab is only displayed to oneself. I am running Spigot 1.17
public void updateTabNames() {
for(Player p : Bukkit.getOnlinePlayers()) {
UserObject user = userManager.getUser(p.getUniqueId());
p.setPlayerListName(p.getName() + " " + ChatColor.GRAY + user.getUsername() + "#" + user.getDiscriminator());
}
}
please add the 1.17.1
spigot is already updated for 1.17.1
latest still builds 1.17 though
how can i know which command im on in TabCompleterEvent?
who tagged me
Hi, why are arrows bouncing off players instead of damaging them
ok
they were already banned
🤣
who the heck is jacob
the legendary jacob spigot
✨ scroll up ✨
Good job
😄
You did it
I was also trolled tbf
bruh
does the InventoryClickEvent work even if clicked without opening player inv?
uuuh, the player's inventory is going to open either way if you open something that count as inventory, from a chest to a brewing stand to an anvil
but yea, generally, it counts for all types of inventories
Anyone know of any good tutorials for maven? I have no idea what it does, and it seems way more complicated to write it out in the pom.xml than in the plugin.yml
But I saw that you write out the dependencies and plugin name and all
the plugin.yml dependency list controls the order of loading plugins
yes, those are the dependencies you use in your project
in that all dependencies load before the plugin
Trust me, it's a great system. Much quicker than manually doing it all when you get used to it.
it is
And for teams - forget about it - it's like the difference between git and sending files back and forth.
If you're good with java? about an hour to get a decent understanding of basics
Quick if you know xml
(And xml is really simple anyway)
do you know how html looks
And to convert my plugin to maven, do I have to make a new project and copy rhe files over?
What IDE?
Yes im very siilled with html
No
Eclipse
no, maven is not a software like spigot
I recommend IDEA
it is just a software for making java projects in general
and other types of projects, but we like java here
With IDEA you just right click -> add dependency management -> maven
Or something like that
i also recommend idea because m2eclipse is sort of broken
Any good tuts for maven?
I never looked back
Basically just look up examples
Anything you need google it
Ok *
I mean he clicked it when he wasn't opening any inv
yeah, tell that to the developer of the space plugin, for whom i am staff
i have been trying to get him to switch to both maven and intellij
if you click outside the inventory, the inventory returned by the event will be null
Last thing, when I tried instlaling maven I had trouble
I couldnt find out how
And the tutorials that I followed didnt do anything
the maven docs tell you how to do everything
Yeah thats what confused me
I only found out how to unzip it then I couldnt find ant more steps
i don't use windows for development, though it shouldn't be too difficult to install
Im on mac
then i would look for installation instructions for mac
They have those two lines of code where do I do that? Its everywhere and I dont know wgat to do
Do I write it in the terminal?
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
This
well you have it now, just add it to your path
👋
yes, because it's not in your path or in your immediate director
y
if you navigate to the bin folder of the extracted files you can do mvn and it will work
well intellij bundles its own version of maven anyway
eclipse probably does the same
but idk
i dont use that
Ok
i actually changed my maven version to 3.8.1 today because i hate being outdated in anything
though there is another option for something called a "maven wrapper" so i will research that
the maven wrapper just forces a project to use a specific maven version
i dislike
when doing some cleanup with code in onDisable I get a noClassDefFoundError
descriptive
Looks like you're using a class that doesn't exist on the server
I use the class when the server is running but it just throws an error on reload
then maybe don't reload
it's a minigame and sometimes I have to to refresh some stuff
at the line that I call a static method to remove people from bossbars and kill some entities that shouldn't be there anymore it says this
Caused by: java.lang.ClassNotFoundException: me.mintnetwork.Objects.CapturePoint
capturepoint being the class
rebuild the jar, stop the server, install it properly and try again
Hey,
I am trying to recreate a system like hypixel skyblock where when you break a block it turns into bedrock and then turns back into the original block after a few seconds does anyone know how I would go about doing this I just can't find out how to turn it back into stone I know how to turn it into bedrock but not back into stone after a couple of seconds for example 5 would anyone know how to go about this?
use the scheduler
^
idk how to go about that though
Bukkit.getServer().getScheduler().runTaskLater()
1 tick = 1/20seconds so 5 seconds = 100 ticks fyi
didn't you guys know that? lol
That could happen in vanilla in older versions if you managed to make a tripplechest
it's semi-useless though
it is not semi-useless, it is literally useless
it looks bad
inventories have feelings yk
I was trying to look nice 🤣
and who needs more than 54 slots lol
u sure it's IJ doing that
maven way too easy, not maven you will need some tweaking
remove your shade plugin from your pom?
Are you using Maven
set teh dependency to provided in your pom
can someone hop in a VC rq, and answer a question? For 40 minutes i have been trying to figure out smthng. (its a general java question not a spigot question)
then you've manually added it as a shaded in your build settings
Then it doesn't shade spigot unless you've manually told it to
change the scope or whatever its called to compile only in the dependency settings
damn i can't build spigot 1.8.8 via buildtools
same place you added it
Can someone explain to me the use of interfaces. Are they just for organization??
Ive been looking stuff up for 40 minutes now
for abstraction
interfaces are nice because you could edit or add new stuff without editing other classes
Ok, then whats the use of absraction?
You should be able to
can't tho it gives me an error
take the entity class for example, there are half a million different entites within minecraft, but they all inherit Entity
ur not using java 16 to build 1.8 right?
let me paste the error
nope, never installed java 16
This
I thought of that, where could i view the Entity interface?
you can check if it is a specific type by doing instanceof Creeper for example, but you will always be able to abstract it with Entity if you are keeping collections of different entites for examples
it's an example of abstraction
that's the error: https://paste.md-5.net/osicikanar.nginx
I couldn't fix that one for like years
not even joking
are you up to date with the buildtools?
so if i do it i should also get the error
I doubt it is because my internet provider
try it
and here is a question
what if you compile and send it to me?
i... will not do that
Ok, so what im getting is that it is used so that if you have too many of one specific type of Object it would group them all together?
why tho
that is abstraction yes
but what you can do... is get the paper one wich doesnt require buildtools
all java objects extend Object
But even then im confused because everything i have seen all the methods dont have and code inside them
people be like "no can't otherwise i will get arrested" when I ask that
so you can do Object obj = <any type of object here>
I am curious why
Ok that makes a lot of sense
im just not in the mood to get booted..
interfaces do not have implementations for the methods, they simply define what is to be implemented by subclassses
as nobody can know if the jar i sent is modified to backdoor or shit
technically they could, but most of them in bukkit don't
so its better to keep it safe
I need a this emoji for reactions
let me code an example so you might understand better
Perfect thanks
usually unless you actually code something from scratch the need for abstraction doesnt usually happen
is it possible to color the inventory title?
do color tags work?
I am trying to get some player input when creating the inventory and idk how I would do this
All of the chat colour enums work iirc
however dont think its a good ideea to give them a chance to mess them up
What makes arrows bounce off players?
wdym mess them up
bouncy arrows
you can get some really stupid strings with some combinations
usually invulnerability(cancelling projectilehit)
I messed up a little but hope you understand https://paste.md-5.net/ixuyuxoceq.java
Yeah sorry I didn’t see the use ads
Usecase*
alright
Probs just let them use the colour codes - don’t they work by default
dont think unless you specify it to
Huh
did you understand tho? lol
unless you call it somewhere in your code its gonna get passed as a literal string
so you will have all the color tags
yaay
I thought that all the chatcolour enums did was be a placeholder for them
np
But I guess
it took me months to understand that, so, glad I could be helpful
my player isnt invulnerable tho
spawn protection?
I'm trying to get all other players to see a player pulling a bow, but why isn't it working?
What is a popular permission plugin that work with Vault api?
GroupManager or LuckPerms
For itemmeta, I’m trying to set the display name. It’s saying that setDisplayName(String) is deprecated and I have to use displayName(Component). I don’t really get components but is there a way to make a string into one?
Ok
Component.text("");
they're not deprecated in spigot...
I see
Oh shoot is that a paper thing?
Thanks
has playerconnection changed in 1.17?
👻 :ping:
sike
WHY DO YOU NEED PACKETS FOR SCOREBOARDS
I found it
😕
Why is the spigot API so far behind on so much 😦
Because I can't order players correctly
What?
In what way can you not order them correctly?
I can think of one scenario - but packets won't help you if that's it.
so its for tab, we can use spigot to set the display of the player but also to keep tab in order by the ranks.
i know you can set the display with the API but you cant order it
Isn’t order determined by their score..l
I thought it was alphabetical in tab
I haven't used tab in a while, as we're all custom
Or are we talking tab a plugin
But also idk what tab has to do with scoreboard packets
Honestly, making / using a tab api is just easier for us
Can I ask if spigot development is going to use mojang mappings in future, or obfuscated like old times?
?1.17
Install 1.17 with BuildTools: https://www.spigotmc.org/wiki/buildtools/
You can already use Mojmap in 1.17
Tried to make that clear
I've read that post, but I was curious about actual spigot dev
I'd find it nicer to contribute API with mojang mappings
Though I'm sure there's a way to back & forth purely in your dev environment
I read this a few times, but yeah not the answer to my question
I got another question how do you spawn a entity for only 1 player with out using NMS. To my knowledge it’s not possible with out it.
Pretty sure it does answer your question
Apologies if I don't see it
But no I don't think so
I'm asking about development of spigot
md_5 you know why the iteams dont appear in the anvil?
.
What API is this? I don't recognise it
I'm not sure pinging him for coding questions is really a great idea
There's plenty of talented people round here that can help
@sullen marlin this isn’t possible with out NMS
There's only one head of spigot around to answer those questions
ye i asked this question 3 times and noone know the reason
so maybe god know the answer
: P
I don't even know what your code is
For starters it's not using correct java formatting
Every time you go near NMS you need to ask yourself: 1) Do I need NMS for this? 2) Is there an API for this? 3) Can I contribute / create an API for this? Perpetual (ab)use of NMS by developers hurts everyone. It hurts server owners who must constantly wait for updates and it hurts other developers by stunting API growth and providing a bad example.```
md_5, if you want reasons people don't contribute API, it's because:
- It's a lot faster to make an NMS solution yourself usually
- You're being asked to get a feature in quickly, and developing and testing especially when honestly deving for spigot is difficult to setup, it takes forever.
- Once you do get it working, you're then locked out of updates until your pull request is accepted, if it's even accepted.
So the dominant strategy is just use NMS if API doesn't cover it. The other route takes forever, most devs on the job just don't have that kind of time.
It's a tricky problem to solve, but I there are a few things that could be improved.
Obviously I’m aware of those reasons
You come across quite hostile.
It’s clearly locally more efficient to use NMS, but when 1000 devs all use NMS for the same thing, globally its not more efficient
^
Look at python, its strength comes from all the modules and libraries
Also if you use NMS you need to update each version, whereas if you make an API we handle that
If it was easier to contribute API than do it yourself, I'd be doing it all the time
I certainly don't want that NMS everywhere
As for on the job, maybe people should contribute something to the free software they rely on
Often it isn't my decision.
I’d have to learn how server patching and stuff works though… that’s what holds back
In fact most of the time it isn't
It's a question of if you want to do it right, or if you want to do it lazy
It's a lot of red tape, which is something I don't have time for when there's 9 other things on the todo list.
It depends whether I want it done and in testing today - or next week.
The point is you and your boss are completely free riding
You’re not contributing time and you’re not contributing money
True, I do what I can to help out people around here when I can
And that's the best I can offer
Maybe you should reconsider one of those
I'm a hobbyist, not a full timer in this community.
I think if you're trying to appeal to a sense of morality, especially in this community
You're going to fail
True
And you're either blind or stubborn if you can't see that.
Okay, appeal to your sense of actually being a good programmer then
NMS is an antipattern
I do fine, thanks.
I don't know what you're trying to do here
Insult me into contributing API?
Good programmers don't use anti-patterns
This is a bigger issue than just me
I don’t know if I like where this is going…
Have you contributed to the api?
Yee
Nice one
I don't really understand the point of his argument honestly, I'm just trying to hope it'll be better in future.
It's not hard
And doing my best to give thoughts on why it's not a better environment
We can't appeal to your morality and we can't appeal to your programming skill. What should we appeal to?
You shouldn't be appealing to just me
He is a lost cause
In this one conversation
make NMS a payed expansion
Hahaha
I refer you to this
I will, and I want to contribute API
I like this one
I wouldn't be talking about this if I didn't care
I would
You said morals will fail
I think it's naive to think they won't
As humans people prove time and time again it's better to make it the objective course
Game theory - and all that.
Yes, so what will work
If the dominant strategy was to contribute, I think that would be beneficial for everyone
That's what I'm asking you
Explain PyPI then
I think the path for developing spigot should be simpler. More little tools to streamline the process
Hey md did you say in your announcement that at some point in the future you were gonna add armour events? Did that mean like change armour sorta thing? Just wondered
We've been through it before, and it wasn't pleasant
that was a while ago though.
I'm sure it's improved a little since then
Like?
You're just saying shit should be better without actually saying how
Do you think mojang will ever switch from zlib to lz4?
There's always more resources to put out. If it was very simple, say one command to get the source in front of me, do my edits, then another simple command to get proper patches and one other to commit + push them properly in a neat little bow. That'd be lovely.
I think its time to start deprecating bukkit and homogenise it all under spigot.
You mean git?
I'm gonna look it up some more
It's been a while since I've tried the spigot dev stuff
I'll educate myself on the current toolset
You mean like BuildTools.jar --dev and ./makePatches
Both of which have existed for 6+ years
and I'm not educated enough on this
That’d be nice
obviously
Well @wild inlet the docs explain all the hook points? The rest is just understanding Java.
I think what we mean is change from org.Bukkit to org.spigot or something like that, well that’s what I mean. Remove all Bukkit references
Relatively pointless change
yep, drop bukkit all together in the end
pointless for anything other than uniformity
I mean
What's the benefit
of relocating code
Is it hurting your workflow?
Doubt it
Btw, md_5, any clue on this?
When did this become a benefit lol?
Yeah, but then you could get rid of .spigot()
Well it's about time tbh
I'm pretty sure that's just experimental isn't it?
Which I always found weird
You sit in here for a year or two providing support for 10 year old version.
I can't remember the last time I used spigot()
Components
Oh yeah
i think they just need new names
Hasn't paper given them new names?
That's a decent way of doing it
Hell
Isn't method overloading valid?
Probably In the middle of bitching about them
A good first step to elimate Bukkit is stop giving options for making the jars with bt lol
People still run Bukkit for whatever damn reason
Yep, so it only produces spigot
I say we eradicate the Spigot API altogether. Problem Solved.
Right?
I believe they only support java 16 now
I saw they changed their packages but anything else change?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Someone say if I'm wrong
But where's the part of this to actually compile your changes?
Interesting
?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
public ConcurrentHashMap<UUID, Integer> getPlayerVoted = new ConcurrentHashMap<>();
public ConcurrentHashMap<String, Integer> getVotes = new ConcurrentHashMap<>();
``` I have that for the map voting system I'm trying to make. The getPlayerVoted just gets what the player has voted on and getVotes just gets the map + the amount of votes it has. I'm having an issue with it because I 'm trying to check if they have voted on something else prev and then removing their last vote and then apply the new one, but I'm not sure why I can't / how I can do that with what I'm currently using.
Paper currently breaks with some NMS due to missing mappings
This is all I see
Which doesn't seem to be very helpful.
Install git and run buildtools? What?
What’s a cla
Yes, after you have followed the instructions on how to add your changes, you run bt
Agreement to work on this
Does cloning the repo come with BuildTools?
But what does it stand for
Check if the key already exist??? And why are you making map-voting async?
?bt you download bt
Yeah, but you just run it in that directory? How would it know?
U do
You use buildtools run it and edit off of it afaik
i am struggling to comprehend what i just read but that data model looks wack
Then generate a patch I believe, I'm no expert in spigot contributing
a CLA is a Copyright Licence Agreement (probably)
probably, didn't know what else I should've used at that time
Point is, these are questions I shouldn't have
The guides are great
But they're unclear
Yeah, I assume the votes will be interacted by players in-game, and I don’t see why you would need the map sync
contributors'
And there's questions
thanks
how about map<level name, players who have voted for it>
Well, when you have been through and seen what is inaccurate you could always submit some updates.
Yeah, I'll try API again soon
It definitely needs work
Because this just takes forever
All the commands
Testing patches
Even the CLA
Can’t you just fork it from github?
What do you mean "all the commands"
Most devs will say "Fuck waiting 24h I'll just get this in production now and be done and go to sleep"
There's a few that could be trimmed
I shoudl do the CLA myself sometime as there are some features I know are missing that could easily be added
What?
Where is all the time you're talking about coming from?
Fork Craft Bukkit
Clone your new repo
Download BuildTools.jar and move to a separate folder (it will generate a lot of files next step)
Run BuildTools.jar (follow the guide at the bottom of this post)
Now we need to generate some code from the current existing patches in order to have all the classes and files necessary to compile and build the project.
make sure you are in the directory of your cloned CraftBukkit repo.
run:
./applyPatches /path/to/buildtools/work/decompile-xxxx
That will generate the appropriate nms-files and classes. Make sure that you don't add these to version control. The only code that gets added to version control is the nms-patches/ directory.
You can now edit the CraftBukkit code and make your changes/implementations.
When you are finished, run the following commands to create a patch for the work that you've completed.
make sure you are in the directory of your cloned CraftBukkit repo.
run:
./makePatches /path/to/buildtools/work/decompile-xxxx
git add nms-patches
git commit -m "Adds implementation of x"
git push origin your_branch_name
Now that your branch is all updated, you can follow the creating a PR guide above under Bukkit.```
And that's not all of it
...
Plus
May I draw to your attention
You still need to test
Then get into your project
and actually code for your new API!
you haven't even got in your original feature!
Tbh, I need to come up with solutions
What's the problem with those commands?
But I don't think ignoring the fact there's an issue to be solved here helps anyone
are you just going to keep moaning about it?
True
Tbh
I do keep getting pinged with qs
A bit of humility wouldn't hurt around here.
What are you on about
Impossible, you are amongst the egos of programmers here.
That's about as streamlined of a workflow that you could ask for. Build, test, push
Technically there isn't even that much testing in there
Being in any discord any length of time hurts
Software is the worst
Most jaded people I've interacted with? Open source software leads
You get beat down over the years
Can't really blame them
I've seen worse. I joined the Paper one once 🙂
The worst part of discords as a whole is people seem to think having their viewpoint be wrong is the worst thing possible.
Being wrong isn't bad.
Anyway
This isn't relevant to spigot dev
No idea what you mean there, I'm always right.
Is this the same person that was talking earlier?
I'mma had out
Lol
I was out of touch / rusty on the current process for contributing
I needed to educate myself
and I still am.
Anyway
G'night all.
I'm sure you are.
You make no sense though
I'm not wasting any more time on you
This discussion ultimately serves no purpose
You realize that you are one of those problem people that you just described, and that the open source team leads that you "understand" are the same that you just said were doing things wrong
I said there was a problem and proposed a solution. I was happy to be proven wrong. I think I was, to an extent, but I think the problem remains.
With the contribution workflow?
Just because it's a difficult job doesn't mean someone should never critisice
And you're trying to suck me into more
I need sleep
Goodbye
The contribution workflow is pretty darn streamlined as far as workflows go, and well documented too
The reason that most people don't contribute is that they're too lazy, not that the workflow is convoluted
I'll leave it to you to solve an entire population of developers being lazy!
You don't need to solve that
You just need to solve the good developers being lazy, and convince people that are lazy that it's not always our place to fix things for you
Everybody on this server contributing changes would be just as bad as nobody
Is it possible to change the world compression to lz4 within a spigot fork?
Probably. What are you looking to gain?
Less disk usage and better performance. Could possibly add in a in-memory world feature for smaller worlds as well ofc.
Well performance on the game itself might not be a possible outcome of this.
https://github.com/PaperMC/Paper/pull/5029
Looks like paper is working on it
Zstd using zstd-jni: https://github.com/luben/zstd-jni
LZ4 using lz4-java: https://github.com/lz4/lz4-java
Added new command-line option, --forceWrite, which will forcibly write the chunk/flush to ...
hi, bit of a noob question: I'm trying to make a plugin but I keep getting cannot load plugin, uses the space character in its name but i can't find where this space is, i despaced the name in plugin.yml and and pom.xml then rebuilt but that didn't fix it
My question is if it uses lower disk space, does it also increase the time needed to compress and uncompress things written to the disk?
I know swm made the use of Zstd, just wanted my implement it directly in the fork so we don’t need to add an agent.
No, it’s actually faster.
Nice
package TreeSpawning;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.scheduler.BukkitRunnable;
import me.facemonster11.TreeSpawnerCrypticCraft.Main;
public class OakLog implements Listener {
int Task;
@EventHandler
public void onBreak(BlockBreakEvent e) {
Block block = e.getBlock();
Player player = e.getPlayer();
Task = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(new Main(), new Runnable() {
int x = 0;
int limit = 5 * 20;
public void run() {
if(block.getType() == Material.STONE) {
block.setType(Material.BEDROCK);
x++;
if (x == limit) {
block.setType(Material.STONE);
}
}
}
}, 0, 200);
}
}
Does anyone know why this doesnt work?
?paste
what are you trying to do?
When u break a stone block it turns into bedrock and after 10 secconds it turns back into stone
You can;t use new Main()
you have ONE instance of your Main and thats created by Spigot
what should I put there instead
inject your main instance into the class through a constructor
public OakLog (JavaPlugin plugin) {
this.plugin = plugin;
}```
Is there any reason why SpecialSource2 code isn't public?
Fear?
Fear of?
SpecialSource is an "Automatic generator and renamer of jar obfuscation mappings"
https://github.com/md-5/SpecialSource/
SpecialSource2 from what I understand is not public for some reason.
The Licence says all rights reserved
That is irrelevant to what I am asking though. A lot of licenses say "All rights reserved". The SpecialSource license allows anyone one to use it as long as the original copyright notice is included.
I just want to know why SpecialSource2 is not Open Source.
Because the owner chose all rights reserved.
There is no obligation to open source your code
Considering md_5 is the creator of SpecialSource2 and uses it in BuildTools, it would be against the interest of the community to keep it closed source.
His code, he can do as he likes with it.
. Can some help me with it,
For Maven, which dependency scope would be best suited for annotations?
Still cant get this to work anyone know why im pretty new to this
Event class: https://paste.md-5.net/eguxusalom.java
Main class: https://paste.md-5.net/epokuyorar.java
If anyone knows what to change it would be appreciated
triple help request combo
Your OakLog class will not even compile
add a field for plugin
up where your Task field is
then replace new Main() with this.plugin
Then in your Main change new OakLog() to new OakLog(this)
what do I put in as a field
Im not getting any more errors but its not doing what its supposed to do though
check your latest.log for any startup errors
no idea, what are you expecting it to do?
When u break a stone block it turns into bedrock and after 10 secconds it turns back into stone
ok, does it turn into bedrock to start?
no
it shouldn't need it but you should have @override on your run method
and delete the line e.getPlayer(); its pointless and doing nothing
now the reason its not workgin is because you are using Block
by the time your code runs the block has been broken so when you test its already AIR
you need to use a BlockState
BlockState block = e.getBlock().getState();
then after you call setType you need to block.update() after
okay im trying this
What's the best method to get a player's UUID from name?
getOfflinePlayer(name) is your only real option
But it's deprecated .-.
Nope
is it always going to be a player that has been on your server?
Should be
then you could use getOfflinePlayers() and search them
that will return a Collection of all known players for yoru server
thats what getOfflinePlayer(name) would do
ight cheers
may i go next
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
ah okay
well i said it earlier
For Maven, which dependency scope would be best suited for annotations?
compile
from my understanding, provided can be used for things like the spigot api and spigot plugin dependencies, and compile can be used for non-spigot assets like swing layout and such
okay thanks
no idea of what situation would call for runtime though
as far as I know provided means you dont need to have them in the jar, while compile means you need them
Theres prob a lot more info on that just thats my common sense reason lol
i understand what it means, but i can not think of any examples
in other words, i do not know how to apply it to anything
does your block get changed to bedrock?
external libraries that spigot doesnt include would require to be compiled, apis, etc, provided would be using a library that spigot provides but you cant access through the api would be my best example in spigot terms
no it doesnt
so would integrating plugins require compile or provided
if you are using an api of a plugin, if that plugin is run on the server already you dont need to create a new instance of it in your jar, so it would be provided
you can delete line 37, you are no longer in your evetn once the runnable starts
i was using provided because i was thinking that compile could make parts of the plugins function inside of the compiled jar
You really shouldent have to use compile much in spigot unless you are using external libs
Ight
oh okay i was thinking that i was using compile too little
thank you for your maven knowledge
make line 27 final
okay
your code should then at least turn it to bedrock, but it will not set it back to stone
Alright trying now
So heres a better definition that I found online,
Provided are dependencies that should be provided at runtime by an outside executor or a JDK, such as Spigot.
Runtime are for dependencies required at runtime but not for compilation of the project.
System basically means you host the jar yourself and you point to it.
Compile basically means that the dependency is not provided and you will be providing it.
all paraphrased, excluding Test and Import scopes
i can comprehend all of them, excluding runtime
and import since i rarely hear of it
yeah runtimes a weird one lol
@eternal oxide Nothing.... idk what im doing wrong
is block update in the right location
i can not understand how a project could be compiled without a dependency but then require it whilst running
does your plugin load?
¯_(ツ)_/¯
maven moment
does your plugin load?
does the weird shit just include a lot of miscellaneous utilities (e.g. swing, gson, annotations)
ill send one of my pom's 1s lol
it does yeah and no errors a few mins ago it placed the bedrock if I spammed placing it and breaking it but that was before putting in the BlockState block = e.getBlock().getState(); thing so it does work its the block.update in the right area?
oh boy
the formatting is weird in this, dont question it https://paste.md-5.net/conibiveca.xml
but yes
you are breaking a stone block and no other type?
i am having a stroke by looking at this
yes stone block I did this before and It worked but without the scheduler
yeah like I said the formatting is weird dont question it lmao
one sec
Pulled it from my git rather then opening my IDE
i spot a SYSTEM DEPENDENCY
I spot 2
i do not think that a scope exists for that kind of dependency
despite being needed only for compilation, the compile scope would keep them afterward
maybe gradle has one, but i do not know gradle at all
Considering its a spigot resource by md they might be shaded into Spigot, gonna check quickly- its not.
try ```java
public void onBreak(BlockBreakEvent e) {
Block block = e.getBlock();
if(block.getType() == Material.STONE) {
block.setType(Material.BEDROCK);
e.setCancelled(true);
}
Task = Bukkit.getServer().getScheduler().runTaskLater(this.plugin, new Runnable() {
@Override
public void run() {
block.setType(Material.STONE);
}
}, 200);
}```
Did that work for you?
I didn't try it
Didnt work and no errors
I guess I need to run up a server then
sorry for this
How would I got about combining two text components?
like this
oh
uh
TextComponent join_message = new TextComponent(ChatColor.translateAlternateColorCodes('&', "&c[DeathSwap] " + p_send.getDisplayName() + " is starting a DeathSwap game! Click to Join >"));
TextComponent join_button = new TextComponent(ChatColor.translateAlternateColorCodes('&', "&a[JOIN]"));
join_button.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, ""));
Bukkit.getServer().spigot().broadcast(join_message + join_button);
the bottom line is the non working one
Lol there's a 69 in it kinda
the funny
.append
This works ```java
@EventHandler
public void onBreak(BlockBreakEvent e) {
Block block = e.getBlock();
if(block.getType() == Material.STONE) {
block.setType(Material.BEDROCK);
e.setCancelled(true);
Bukkit.getServer().getScheduler().runTaskLater(this.plugin, new Runnable() {
@Override
public void run() {
block.setType(Material.STONE);
}
}, 200);
}
}```
How would i start out making a plugin
its super confsuing and I don'
t have much experience with java dev environments
Tutorials
?learnjava first
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.
A bunch of them
.append doesnt work
i know basic java, from the codecademy thing but im just confused on how to set up the plugin dev environment
not just an online compiler
eww
Yes I think so
It is, but its much more difficult
You will need a extension tho
please pick InteliJ or Eclipse. You will get more support using those
ok
would never recommend vscode to anyone for spigot development
Literally only chads do that
Dude tysm for your help and thank you for being so patient with me I would have lost my cool tysm
np
ok ill go install it, im just looking to make a plugin that gives a random potion effect on kill
that stacks
ive seen it in a youtube video but can't pay for patreon
Okay so I have an issue
My plugin makes it so that you can fly when you have a chestplate with my enchant, and it breaks essentials fly
I changed it a little bit. the code was bugged and would have changed every broken block to stone (eventually)
wait where did u put the changed code?
above
cause I was having that problem and tried to fix it
I just updated the code I posted above
okay ty
Hello, I have an Endercrystal and I'm trying to cancel all damage events to it (without making it invulerable because I need to detect left clicks). Now it doesnt get destroyed when I hit it, but when an explosion I spawn through code happens near it, the ender crystal disappears. Why is that?
And how do I cancel it
Hey, so I'm having some issues with the new 1.17 Mojang mappings. I got everything working I'm pretty sure. Depend on remapped-mojang, and use SpecialSource to remap back to obfuscated when building the JAR.
If I decompile my plugin, it looks like everything was re-obfuscated correctly, and almost everything NMS wise works as intended, except for 1 thing.
CraftInventoryView#getHandle throws a NoSuchExceptionError. For seemingly no reason. I even used Reflection to manually call the method and it worked perfectly fine, it only doesn't work if I invoke it directly on a CraftInventoryView object.
I know this isn't a Spigot issue directly, but was hoping someone might have so insight as to how to resolve the issue.
Also seems like EnchantmentMenu is called that in the Mojang mappings, called "bnc" in the obfuscated maps, but the Server implementation refers to it as "ContainerEnchantTable" 🤔 I think I've done something wrong but I don't know what
hey i've been struggling with this for an hour now, for some reason a slime im trying to spawn is spawning at 0 0 0
it works on my local server, but when i upload it to an online server it doesn't work on there
other entities i spawn with the exact same method do work but only not the slime, on the public server and i have no clue why
does anyone haven an idea why on the public server it gets teleported to 0 0 0 while on my local server it just works? i have no idea what it could be
How are you spawning it
Ender Crystals are entities, explosions deal damage to them, so they explode when you do that. Cancel all damage events, not just when a player hits them.
public static LivingEntity spawnEntity(JXEntity entity) {
LivingEntity livingEntity = ((CraftWorld) entity.spawnLocation.getWorld()).addEntity(entity.entity, CreatureSpawnEvent.SpawnReason.CUSTOM);
livingEntity.teleport(entity.spawnLocation);
LivingEntity finalEntity = entity.livingEntity(livingEntity);
plugin.entityManager.livingEntities.put(finalEntity.getUniqueId(), entity);
if(entity.getPassenger() != null) {
LivingEntity passenger = ((CraftWorld) entity.spawnLocation.getWorld()).addEntity(entity.getPassenger().entity, CreatureSpawnEvent.SpawnReason.CUSTOM);
passenger.teleport(entity.spawnLocation);
LivingEntity finalPassenger = entity.getPassenger().livingEntity(passenger);
finalEntity.addPassenger(finalPassenger);
plugin.entityManager.livingEntities.put(finalPassenger.getUniqueId(), entity.getPassenger());
}
return finalEntity;
}
I tried doing that
so i'd do EntityManager.spawnEntity(new Slimethingmob(new Location(location data))); which works fine on my local server, or for any other custom mob im trying to spawn
Can you send the EntityManager.spawnEntity line for the Slime
Location towerSlimeLocation = towerLocation.clone();
towerSlimeLocation.setY(towerSlimeLocation.getY()+5);
LivingEntity towerSlime = EntityManager.spawnEntity(new TowerSlime(new Location(plugin.world, 1882, 79, 755)));
LivingEntity boss = EntityManager.spawnEntity(new BossNecromancer(new Location(plugin.world, 1882, 79, 755)));
and this always work, even on the public server so its just the slime, when i try to get the location of the slime it returns 0 0 0
(they're at the same location now because i was trying to see if the location was the issue but it wasn't)
public class TowerSlime extends JXEntity {
public String name = "";
public TowerSlime(Location location) {
this.spawnLocation = new Location(location.getWorld(), location.getX()+0.5, location.getY()+0.5, location.getZ()+0.5);
entity = nmsEntity(this.spawnLocation);
}
public EntitySlime nmsEntity(Location location) {
EntitySlime entity = new EntitySlime(EntityTypes.SLIME, ((CraftWorld) location.getWorld()).getHandle());
return entity;
}
@Override
public LivingEntity livingEntity(LivingEntity livingEntity) {
livingEntity.setPersistent(true);
livingEntity.setRemoveWhenFarAway(false);
livingEntity.setSilent(true);
livingEntity.setAI(false);
//livingEntity.setInvisible(true);
((Slime) livingEntity).setSize(5);
return livingEntity;
}
@Override
public void onDeath(EntityDeathEvent event) {
event.getDrops().clear();
bossBar.removeAll();
}
}
and this is the towerslime custom mob class
Hm, try printing location right before & after you set this.spawnLocation in the constructor.
i already did that, and the location given to the entity is the correct one but after it's spawned (directly after spawning the entity in the spawnEntity method) it returns 0 0 0
so im really, really clueless, the console gives no errors or info about an error or anything
I don't see any place you modify the location except for this.spawnLocation = new Location(location.getWorld(), location.getX()+0.5, location.getY()+0.5, location.getZ()+0.5);, and if you already verified that the location is correct before and after this line I'm not sure what's happening
im thinking it's something external but again i wouldn't know what
yeah i'm pretty stumped on this, i haven't tried one thing which is trying to spawn a different mob where i now spawn the slime, but i dont see why it wouldnt work on the public sever while it works on my local one
Yeah that is odd. Is there any configuration for spawn locations for the entities or do you hard code them all into the plugin?
no configuration for that, it's "hardcoded" in the class where i spawn it in (hardcode because its an event class but like a boss event)
Whoever can help, i need support in #help-server
so i just tried to spawn another custom mob which did work this time so it's the slime mob that won't work on the public server
very very wild assumption, but could it be java versions or whatever? the slime mob is an inner class so it can interact with the boss event easily while the others aren't
no wait nvm the boss mob is also an inner class one so that's out of the question
What happens if you change the EntityType of TowerSlime to something else that you know works?
was about to try that, uploading to the server now
maybe the server just hates slimes with a passion
nope, changing the entity type won't work either so it's definately something in the mob class
Well, whats different from TowerSlime vs BossNecromancer?
You're missing entity.setPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()); in nmsEntity() for TowerSlime
didnt see that, i think i copy and pasted the base things from 2 different places then, trying it out now!
because the location is already set in the EntityManager.spawnEntity method, it did work without that line on my local server
is there a way to get the item entities when a player dies?
AH
IT WORKED
but why did it work?
i've been stuck on this for like 1:30 hours now
thanks so much holy
Only thing I can think of is that the Local & Public servers are on different versions and they treat that differently? Not sure honestly.
yeah that's what i was thinking
it's probably the reason why it worked on my local, but oh well it's fixed now
Like the items that a player drops?
would love to know why that happened but im not gonna dive into it further for hours
yeah, but the entities, not the itemstacks
oh wait
i know
u just clear the death event drops
then spawn the items in new
for the case of using a GUI to select a kit, I have a switch case for which one you clicked that is clicked, is it is bad practice to do a player.performCommand(); ?
What is the best way to implement a api key to use the plugin but without people being able to decompile it to find the api key?
there is no way
at the end of the day the api key needs to be read by the jvm to send the http request or whatever u want
hm ok
What API is the key for?
So only certain people can use the plugin
wot
Just supply it separately from the plugin then, all will work nicely
Plugin starts, checks for API key file, validates API key file, continues if appropriate
People could still decompile, crack, and then recompile the plugin, but there's not really much you could do about that
Could do same basic obfuscation if you feel like it
Is there a way to change a players time, but not affect other players? For example, it could be night, but I could run /ptime day and it would be day for me?
Player#setPlayerTime
Could you explain a bit more?
Ty
There's not really that much more to explain. You distribute your jar, and then give the API key separately. When the plugin loads you check for the API key file exists, read the key out of it, and then check if it's a valid key. If it's a valid key, you continue loading. Else, terminate
How do I completely stop creepers from exploding?
Like not stop the explosion damage, but just make them never ignite?
Is there some CreeperIgniteEvent I can cancel?
You could maybe use EntityExplodeEvent
I want to stop the creeper from ever igniting
EntityCombustEvent maybe? Kinda hazy on what "Combust" means.
In the file you give the user, that's the only place it ever needs to be
Also my reasoning is I wanna experiment with my own creeper mechanics
Like instead of it exploding, it shooting snowballs or smth
Lemme check
Yeah that isn't working
