#help-archived
1 messages ยท Page 53 of 1
yeah it just disables the plugin
The only thing with singleton is that you need to make sure, to call your getInstance method on load already to avoid potential thread issues
I made a pseudo singleton out of my main class
Yes,
If you have multiple threads singletons can get very pissed off
exactly
it's java
As the instance might not yet exist
multithreading is undefined behavior
Hey, I'd like you to answer my question in spigot forum. I couldn't find any documents about it in spigot.
https://www.spigotmc.org/threads/multi-arena-or-bungee-arena.433578/
Therefore, you need to make sure to call the get method before any other method will call it
I'm confused as to how to create an instance of your plugin so you can use it for things like BukkitRunnable.
the instance is created on load
your instance of your plugin is basically the class extending JavaPlugin
do not confuse classes and instances^^
You can save your class as a static content and get like ClassName.plugin
NO ^^
It's basic and not confusing for you.
this behavior is discouraged
It's static abuse
You should use the ctor to send the instance of your main class to other classes
https://discuss.kotlinlang.org/t/how-to-return-child-object-if-generic-type-extends-parent-class/10897 Apparently you have to cast it to T@sturdy oar
you should not assign values to static variables in non static methods
May you want to explain me why it is bad?
Why is that bad?
It's not threadsafe
There is really nothing bad with creating a Singleton like that
I do not think so
Well, bukkit API will only calls the method on one thread anyways?
Yeah, what's wrong with a static reference to the plugin?
nothing
...
...
And well, you would do it in onload
it's just the way it is set
It's simply not , how it is done. I would use dependency injection. Several reasons for that, but from a solution design perspective, it's more clean
And regarding the thread safety, it is thread safe, but from a performance perspective, that could lead to issues
Got a meeting now
see you guys later ๐
There's no performance issue about it
you would hold all instances while assigning
(if they are assigned to different threads)
Yeah, I still don't get it.
"not how it's done" elitism right there
So now we talking about Singleton vs DI?
I thought we talking about that one sample impl of Singleton vs other impls, lol
We were talking about a static reference to JavaPlugin...? The blackone1991 does it.
Yes, anyhow, it's simple
I can't follow this conversation.
Neither can I tbh
If the singleton of the main class is thread safe and runs everything n order, calling it form a different thread, might result in a latency on your thread
Anyhow, I really got a meeting now
There are specific use cases for DI and Singleton
public class Main extends JavaPlugin implements YourPlugin{
private static YourPlugin instance;
@Override
public void onLoad(){
setInstance(this);
}
public static YourPlugin getInstance(){
synchronized(Main.class){
if(instance == null{
throw new IllegalStateException("Not initialized!");
}
return instance;
}
}
private static synchronized void setInstance(YourPlugin instance){
Main.instance = instance;
}
}
is what would cause performance issues
you didn't close the if
nothing wrong with getting the plugin instance using a static, and there is no difference in performance considering your plugins instance isn't going to go away so as long as the plugin is enabled lol
which ever way you decide to use is fine. However, if you are creating an api or designing your plugin so others can use it in their projects, might be better to go with DI
it says is outdated mi version
@hardy island That is literally your first message in the server...
wtf are we supposed to do with that?
what says what?
idk
I'm so confused.
Yeah, if it says outdated, chances are, it's outdated? ๐ค
It is about the synchronization problem it will hold all threads while running Frost
it's not outdated he just a time traveler
it's forward-dated? D:
what would actually happen if i were to manually modify with a version that doesn't exist?
like 1.17 , would it say outdated or throw errors?
what synchronization problem? Are you trying to run the plugin multiple threads or what?
Not too sure tbh
You can get the plugin instance from multiple threads just fine
and have it not hang up any of them
"If the singleton of the main class is thread safe and runs everything n order, calling it form a different thread, might result in a latency on your thread"
Nobody said anything about syncronising the getter
Which doesn't make much sense anyways since it's a read op
Just do Bukkit.getPlugin("plugin name") every single time and then cast it.
am i right?
don't
have no idea, apparently the people I know here we all have our own in house anti-cheats XD
AAC always was pretty good, not used it in a while though
What kind of anticheat would you advise with minimum load and false alarms? AAC?
An insanely expensive custom coded plugin
||Just kidding||
@radiant pollen Just use static method that I mention it. There's only difference that is static method is more simple.
I am not sure what you would touch them with? A stick?
o_O
kick ๐
So like reaching out of the monitor...?
tbh I'd touch @keen compass if he was cheating, not gonna lie ๐
You may make anti cheat. I believe you, you can do it Envel
or ban
by technicality I have been cheating
it is how minecraft 1.8 community works
I was banned from irc, what should I do?
just fyi, the protocol has flaws in 1.8
It's dying but there are a lot of player who wants to play 1.8.x pvp in servers
Can't you get plugins for that now?
1.8 PVP is trash
Read the rules to learn out how to Appeal bans
so I don't believe it will complately die
I would say there is more players on 1.15 then there are on 1.8
1.8 is trash, change my mind
A lot more
where rules??
?rules
Please read the rules: http://j.md-5.net/1ikUQuU
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is there anything that can't be unlocked?
Imagine complaining about being banned and not even knowing the rules ๐
Yeah there are a lot of player in 1.15 but PvP no... This is minecraft.
there is plenty of 1.15 pvp servers
^
Hey stop there! Clicking is my skill I cannot play 1.15
Then learn it
autoclicker is my skill
lol
b-b-b-but all my y-years... ji-ji-jitter clicking? D:
I'd like to make 1.16 hub server but I don't believe there will be PvP community -_-
I don't play pvp on mc anyways
md_5 << who??
do some of you know a Java logic simplifier AI or something
I have thise 12 lines of code that I'm not finding a way to make shorter
myD_5inches
um..
@chrome edge I am not entirely sure where you derive your information from that makes you conclude that no one will pvp on 1.16 or that 1.8 is more popular then 1.15
wut
send him an email
Most people play on 'latest' and there are no PVP changes between 1.16 and 1.15?
there is support email for spigot
@keen compass from the servers...
The only change is netherite which is easy to disable
although most players like "op" stuff
there's so many plugins that make stronger gear so why is 1.16 a big deal?
Let me explain you basically, are there any 1.15 PvP server that has more than 100 player?
yes
A lot of 1.15 server has a lot of player but it is splitted
There's a fair few
like 1000 server with 10 players
Just search any server list for pvp and most of the top ones will probably be 1.15
you can have more than 100 players in a 1.15.2 server
Everyone is kind, thank you.
It's depend, if the server host a Faction server with 1.15, they can still count as PVP server
162,375 recorded for that statistic
You have your logic backwards dude. All of the big servers are big because they've been around since 1.8 not because they use 1.8. They have their entire infrastructure built with 1.8 and why pay devs to update everything when they've been around so long and have the playerbase already?
1.8 also easier to host ๐
They're big because they're old and they're on 1.8 because it's expensive to update a massive server like that.
There's so many exploits and game-breaking bugs in 1.8.
1.8 has UUID spoofing
and don't say 'hypixel uses 1.8' because they enough money to rewrite minecraft and patch any exploit
1.15.2 is cool. I'm currently host one without any problem, but for me it needs a lot more tweak than 1.8 ~ 1.12.2
people just use that as argument usually
there is also one other flaw in the protocol as well that was pretty major but can't think of it right now
just as bad as UUID spoofing. Maybe it was session hijacking
this is #help-archived not #discussion-with-no-result
yeah about UUID spoofing. We should avoid 1.8
@vale slate no one is asking questions
I really like higher versions of course but when I look at the community they really love 1.8. You're right about 1.15 has more player but I'm trying to say 1.15 servers are separated.
Anyways, mind the topic please
I suppose we could just move to #general
Imagine like no one needing help
Anyways, so the new CoD seems to be pretty cool
๐
I like how they decided to handle cheaters for that game though
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
run buildtools
i go but idk how to update it
how did you get spigot before?
in getbukkit
๐คฌ
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
๐ฆ sorry i just follow a video dont hate me
follow the instructions for build tools
get buildtools, then run buildtools as the wiki describes, and then it will pop out a freshly updated spigot.jar for you at the end
๐ฆ sorry i just follow a video dont hate me
@hardy island would you mind telling me which video, I'd like to destroy it
I think we should have competitions again
that was kind of fun to participate in way back when
Did someone tag me?
I don't think we can help you with that
is it possible to disable fly for a whole server ?
explain
so im trying to make aplugin for my server where when i do a comd like /disablefly it would turn everyones fly that on my server off
Just loop over all online players and use this method to disable fly for them ๐
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setFlying-boolean-
And if you want to completely disable them flying, you can use this.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setAllowFlight-boolean-
Bukkit.getOnlinePlayers().forEach(p -> p.setFlying(false));
this maybe?
Not using method references, pff
how can you use method reference for a thing that needs an argument
maybe im dumb, i don't usually use method reference
It's possible, it just makes absolutely no sense to do so in this case however.
- walks off before ppl realize he is dum *
private void myEpicMethod() {
Bukkit.getOnlinePlayers().forEach(this::setFlyDisabled);
}
private void setFlyDisabled(Player player) {
player.setFlying(false);
}```
Please Help Me
https://hastebin.com/wisatedodo.xml
Skin restorer? You running an offline server?
Why would you use that plugin then?
Sorry sorry , yes cracked Server
๐
I am a turkish sorry bad english .. :)
cracked players? I'm out of here
:(
^
the rules -> the law
people are living form the earns of their games, so pay them if you want to use their software
cracked players? I'm out of here
@vale slate me as well
Well, it's also part of the cug that you don't give ppl access to the server which have not brought the game
how funny is accepting the EULA then running offline mode servers
There are situations that you do not know ..
law doesn't care about your situation
help guys...
https://i.imgur.com/QsdNTDk.png
ten on first collum
tan in the second
but at the bottom left
now at the top
yet in the far collum
axe in the third row
read in the second row
all 7 words
just usually :p
Also that but i was going for 7
Hey where could I receive some help regarding my problem?
I bought LeaderHeads plugin the money went through but I dont have it in my purchased resources, it usually is instant!
probabily the payment is on hold for 24 hrs
Why would they be though! its the first time i've encountered this!
you should wait for some time, if it is not there in 24h you should contact the seller
Alrighty all I got is time in this quarantine haha!
thanks for the help guys!
You're welcome
By the way i've been looking to start messing around with Java
if I may ask there is a lot of of Youtube channels that makes java tutorials
which one would you recommend? ๐ thanks in advance!
Well I'm mostly interested in making plugins for my server but I guess I cant start directly with that without knowing the basics right?
you can do that, but I won't recommend it, because most of the spigot tutorials give a shi* on coding conventions
https://www.youtube.com/watch?v=grEKMHGYyns
For beginning in Java I'd recommend this tutorial
and no, you don't have to watch it all together
in one session
haha yeah makes sense too much information all at once
I would forget everything the next day!
I really appreciate your time man thanks ๐
nP
Last question i swear :P
would decompiling free source simple plugins help at understanding the basics at all? or would it make me more confused?
it would most likely confuse you
I would indeed not use decompiling to learn the basics, there is also the chance that the plugin you decompile is written poorly.
and decompilers not always do their job that good
so me and my friends want to play on a minecraft server but we all lag is there a way to fix that
Ah I see haha well if you fail you will never learn right?
I appreciate the information guys! if you got any more tips I'd be really happy to hear em!
Are you speaking of your own server or another server?
@humble hollow own
send a timings report using /timings on and then get the link using /timings paste
where
in your server, run those 2 commands
are you using the vanilla jar?
no Im using forge. sorry if im being dumb this is like my first time in minecraft
then switch to the forge forum
you can get better support from the forge forums as most of us probably never ran a forge server before
Is the paper spigot team different than this?
You dare use this word in here
oh no
Yes, the paper team is different
Use papers discord for help
It's linked on their website
Did someone say paper ๐ฎ
What if we said Taco
it's a meme
It's not, people are just acting weird the moment you say it ๐คทโโ๏ธ
I saw that
xD
๐
PAPER SPIGOT IS BETTER
grabs pop corn
Laughs in TacoSpigot
You have not heard of Taco Spigot?
Not really xD
it was popular at some time
Taco Spigot is a fork based of PaperMC
rock
Taco is ded, as is 1.8
everything <1.15 is dead
Oof
Modern paper forks include origami, purpur and tuinity
Who wants to join my craft bukkit 1.7.2 faction server
As well as my very own ToiletPaper ๐
are u joking

haha
help
u gotta be kidding @hoary parcel
What's up @compact smelt
and now I finally know where all the toilet paper went
I have my own Paper fork but It basically only add 2 events and a graph for TPS
so its kinda useless
I would show the output of /version but am not at my PC
?ask @compact smelt
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.
Does anyone have any good guides on creating custom entities for 1.15 or versions close to it?
Most of the guides I found are out of date
ohm, I only found one for 1.13 and changed it around a bit now it works for 1.14
1.15 I haven't touched yet
should I send you the 1.13 version or the new one I made?
It will be helpful to send both
So I can see the original source and the edited version
so it will make it much easier to convert it to 1.15
Define custom entity tho
the 1.13 version won't help you much I think, they changed this stuff completely
one thing
these are just the methods you should use to do this things
you can paste them to your plugin anywhere
Could someone explain how to use the constructer to get a new instance of your plugin?
you need to save it in onLoad to a static variable in your main class
public classname() {
this is a constructor with no parameters
}
ehh
can be called as new classname();
MFM I would avoid using a static instance in main class
that can lead to static abuse
I'm pretty sure there's a JavaPlugin# function you can use
i mean your main class would be a valid use case for a singleton
but just use dependency injection
I discussed this topic to death earlier this day, I don't like to do it again
you don't want to do that every time
That's what I normally do
This is discouraged
oh and to the Entity topic
public static <T extends JavaPlugin> T getPlugin(Class<T> clazz) {
Validate.notNull(clazz, "Null class cannot have a plugin");
if (!JavaPlugin.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException(clazz + " does not extend " + JavaPlugin.class);
} else {
ClassLoader cl = clazz.getClassLoader();
if (!(cl instanceof PluginClassLoader)) {
throw new IllegalArgumentException(clazz + " is not initialized by " + PluginClassLoader.class);
} else {
JavaPlugin plugin = ((PluginClassLoader)cl).plugin;
if (plugin == null) {
throw new IllegalStateException("Cannot get plugin for " + clazz + " from a static initializer");
} else {
return (JavaPlugin)clazz.cast(plugin);
}
}
}
}
a lot slower than
return instance;
yeah it was wrong copy paste from a guide I made
I made something like this is discourgaed
and I copied that code without thinking
and I meant to copy paste the one that said "this is a better way"
The Loading methods: https://pastebin.com/LjRF8xAN
The Entity: https://pastebin.com/iapHQcYa
@jaunty night
all imports are NMS in Entity
Is NMSEntity a class within NMS or is it a class that is made by you
or is it just a placeholder
It is any non abstract entity in the nms package
Ah so it's a placeholder
so you just replace it with like a Zombie
that's in the NMS package
yes, my bad should have made that more clear
Excuse my ignorance but is this converstaion about my problem or someone else's?
This convo is about custom entities
about Atom's problem
For your problem I tend to use different things depending on what I'm trying to do.
It was the instance thing
Yeah ik
Pretty sure he's talking about constructors here cheif
I think he/she wants to get a instance of his plugin
Let's ask, @uneven cradle Do you want to get a general instance of your plugin, or how to use an instance within a constructor?
I want to be able to use it with a BukkitRunnable, so I think the first one?
Which is not in the Main class BTW
could you send us the class extending JavaPlugin you have
Yes, hang on
import org.bukkit.plugin.java.JavaPlugin;
public final class HealBackport extends JavaPlugin {
@Override
public void onEnable() {
// Plugin startup logic
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
}```
Currently I'm not actually doing anything there because I don't know what should be done.
How do I give the player a reward daily?
with a runnable
Ehh
||just kidding||
use a database, and write the dates to it
then use something to check on that database
^ they login, check the last date they received the reward, if it was the day before then give them it again ezpz
import org.bukkit.plugin.java.JavaPlugin;
public final class HealBackport extends JavaPlugin {
private static HealBackport instance;
@Overrride
public void onLoad(){
setInstance(this);
}
@Override
public void onEnable() {
// Plugin startup logic
}
@Override
public void onDisable() {
// Plugin shutdown logic
}
public static HealBackport getInstance(){
synchronized(HealBackport.class){
if(instance == null{
throw new IllegalStateException("Not initialized!");
}
return instance;
}
}
private static synchronized void setInstance(Healbackport instance){
HealBackport.instance = instance;
}
}
@uneven cradle
Quick quesiton, why is the setInstance synchronized?
Which main do I import?
oops typing error
You'd just use HealBackport.getInstance() @uneven cradle
unless I'm misunderstanding
Why would you synchronize it though.
@marble narwhal yeah, not necessary on second thought
@uneven cradle if you want an explanation what this thing does in detail, feel free to ask
I'll be back in ~5 mins
What does instance refer to here?
Instance is a static reference to your plugin
nope
depends on what I'm doing
If I'm doing something small scale I tend to just use static
If I'm developing some form of API I usually just create an interface, put my API methods their, create a class that implements that and use that.
If I'm developing something that's really large scale
Stupid question but anyone know how to differentiate a click in the top and bottom inventory. I'm not exactly sure what the index bounds are for each one lol
I'm pretty sure there's an enum in InventoryClickEvent
or in InventoryView
but I'm not sure
I need to check
AH
So there's a method
InventoryClickEvent#getClickedInventory()
and that returns an Inventory
You can get an InventoryView by https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryEvent.html#getView--
and then use the method from @sturdy oar
Thats more for contents though. Unless i want to iterate through each item
InventoryView also has a getType
hang on
You can use InventoryClickEvent#getClickedInventory() to get an instance of inventory
and then check if Inventory#getType is equal too InventoryType.PLAYER
if it is then it's the bottom one
if it is not then it's the top one
I'm unsure weather this will work
but I have pretty strong feeling that it will
just ended up doing e.getInventory().equals(e.getView().getBottomInventory(). Not sure if it works yet but i don't see a reason why not
Or you can just check clicked inventory name.
Don't check on the inventory name, what if you change the name, or what if a different plugin has the same inventory name?
That's very incosistent
Man he just coding his plugin...
doesn't change that it's bad design
There are really simple ways to check this without using the inventory name.
Which were also listed
I'm checking inventory name that is simple way to do. I also change inventory name with packets.
A lot of player using it without any issue and that is faster. Also you can change inventory name without closing.
you can also just directly check if one inventory equals another
Yeah you can check top and bottom with click event. I meant to say as I understood from your picture, you're making trade GUI. I though you'd like to change inventory name without closing and saving trading player's uuid as a gui name
Note to self- don't add every MAterial to your switch ;)))))
xD
Why are you adding a switch with all materials in the first place ๐
hang on
Hhaa
why would you do that
Eclipse gives the option to auto import all enum thingos
just use a default
and i pressed it
oh lmao
eclipse moment eclipse moment
managed to survive
why there is a method that call the all materials as switch cases -_-
You may want to switch another IDE which is intellij
im too used to eclipse
can't change
tried to move to IJ but i can't it's too new and pretty
I know people who said that, and eventually switched xD
Eclipse for the win
No, IntelliJ is the best ๐
I love Eclipse. It was my first IDE for Java but it is bad...
I use notepad++
oh that is good choice!
move this to #general bois
Was just about to say lol
mb lol
I love Eclipse. It was my first IDE for Java but it is bad...
@chrome edge eclipse is not bad lol
It's not bad, there's just better options.
that's a matter of opinion
if intellij had eclipses project viewer iโd be so happy
I use Eclipse with SonarLint and AllClassDecompiler
I used to use command block instead of eclipse. It was better
I use MS editor
Hi guys, can anyone help me in loading a plugin?
uhm, could you be a little more specific, please?
yeah sure
I downloaded a plugin and put it into the plugin folder. However when I start the server it says that it couldn't load the plugin
can you send the log file please?
?paste
I should have sent it
you need to save it and then post the link from your browser
you need to add a plugin called HolographicDisplays to your plugin folder
Thank you so much
Is there a way to undestand what the console says or should I have learnt java language?
just asking
that one was very clear xD
Yeah but I dont have practice with this kinds of things
Sry, I have a weakness for ascii art
If you want to better read errors in the console, https://www.spigotmc.org/wiki/fixing-plugin-problems-easily-reading-stacktraces/
It highlights exactly what you want to look for
That way you can direct it to the required author and tell them where the error occurs ๐
this time we only have a simple problem
Do i have to change server version?
what is the name of the jar in your server folder?
The name of the server?
spigot-1.14.4.jar
I feel like a complete idiot, sorry for wasting your time
ok, please send the latest.log in the logs folder
Where did you get the spigot jar? And does murder mystery say on its page that it supports 1.14?
it does, but I found the problem, he/she has the wrong murder mystery version
Ah
The plugin should support all the version from 1.12.2 to 1.15.2
I took the serverfile from spigot mc
I can give you the latest.log if you want
please
do i use the link you gave me before?
oh damn you can't send files in here, send it via DM to me or verify your account
?paste is fine for log files
Surely that's not the whole log file
^
Also, I find messages like that super annoying lol
This server is running CraftBukkit version git-Bukkit-3e3818b (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
You're on CB, not Spigot ๐
Ok i'll find the server file
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Use buildtools
It's fine ๐ We're here to answer questions
^
Hi guys who can you cancel a specific runTaskLater Task?
Has player.getMaxHealth() been deprecated?
Yes. Use attributes instead
Trixone, you should have a BukkitTask on which you can call cancel()
as the deprecation note says...
How can I compare player.getMaxHealth to GENERIC_HEALTH_ATTRIBUTE
OK
I want to cancel it once something happens
It's actually Attributable that has that method, lol. All living entities should have it
From another method you know?
you should have a BukkitTask on which you can call cancel()
runTaskLater() should return it
Hi guys, trying to get WorldGuard API to work still and its just throwing back null errors. I'm trying to work with regions so I just want it to send back a list of the regions in the world
RegionManager regions = container.get(world);
This time of code is getting an error as it throws back a null since it can't find the world
Would Material.LEGACY_XXX_YYY work if I compile it with 1.15 API and run it on 1.12 server?
edit: I know there are some bytecode editing stuff going on on the server but I don't really understand how it's work
Hi, ppls.
How can i do if an user login/sigin tp to world named "lobby" and after login/singin to hub
@tranquil rampart authme?
no
Would Material.LEGACY_XXX_YYY work if I compile it with 1.15 API and run it on 1.12 server?
No
@tranquil rampart what do you mean by login/sign-in then, do you have some sort of /login command?
@subtle blade thanks ๐
wdym
/login and /register
what plugin are you using for that?
LoginSecurity
@hoary parcel there's no other explaination for that though .-.
It's a good thing we don't support offline servers ๐
It is the only legal way
Lo
How can I compare getHealth() to GENERIC_MAX_HEALTH?
just get the value of that attribute with the attribute api
Is that Attribute.getValueOf("GENERIC_MAX_HEALTH")
So like > Attribute.GENERIC_MAX_HEALTH
@uneven cradle Entity#getAttribute
What I currently have is player.getHealth() < player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()
Is that right?
Yep. Looks good to me
Set it to null
Doesn't work I already tried that
main.yamlConfigurationinvite.set(p.getName(), null);
Did you save the config? because that's most definitely how you do it ;P
Like this right?
If you set a value in the config as null it will remove it
Did you do what Choco said?
Isn't that right?
did you save it?
Yea, gotta save your changes after you make 'em ;P
๐ค
I'm having some really bad tps issues and im not sure whats causing it. any advice?
Spigot_Latest_1.15.2.jar:git-Spigot-2040c4c-a1a705e
That looks to me like a not-BuildTools-generated Spigot build
Though we'll need a timings report. Can't do much based on just a log
Ok, how can I find a timings report?
sorry, first time messing with plugins and stuff
You can run /timings start, let your server run for a bit. 15 - 30 minutes or whatever. Longer if you'd like. Then /timings paste to generate a report
Run that when you're having some server issues
It will send you a link in chat that you can then send here, we'll be able to diagnose a bit further from there ๐
thank you so much, one day ill know this stuff on my own xD
Can only learn by first not knowing
https://www.spigotmc.org/go/timings?url=alidelimow @subtle blade
should i just leave timings on?
Yea the only standout issue in that timings report is world saving
hm I wonder whats causing the lag then, i have around 16 consistent tps with 6 players and 16 gb
With how little plugins you have and the relatively low player count, I would lower that RAM down to 4GB. Maybe 6 if you're still having issues. You shouldn't need much more than that.
It's not my personal ram, its the ram for the server itself
That may help a little to declutter any unnecessary garbage sitting around collecting dust, though to address world saving, best option is to reduce server view distance
Definitely recommend lowering your plan then ๐ Save yourself a bit of money because 16GB is overkill and will likely lower performance over time
Java's GC is super lazy and won't clean up any memory unless it has to
really? I never knew that having too much would slow it down as well
I'd say you would do just fine on 4 - 6 GB
ok. thank you a ton for the help. Hopefully these things fix the tps issues im having
View distance should help a bit. Lower it by a few notches and see if that helps ๐
What should I use as a restart script? Right now I just use the start script for it, idk if there's a better way of doing it
๐
thanks
I have a service script and the handy thing with it is that when I reboot my dedi
my servers startup automatically
I also don't need to switch users to restart/stop/start either
Ah okay, I don't think that's really necessary for my needs
I mainly do trouble shooting/bug testing and play with friends on my server
well, you said you didn't know a better way. Just merely informing you what that better way is XD
That's true
seems to be much better so far Choco, the view distance and I installed clearlag, the two seem to have fixed the problem together
We typically advise against clearlagg because it causes more issues than it solves, but if you're noticing an improvement it should be fine
You have few plugins and players, I can't imagine it will be that big of a deal
Ok, I will keep that in mind. If tps starts going down thats where I'll look first. Thanks a ton for all of your help!
Pleasure. Best of luck
so I have been trying to find a way to code a player tracker like the one Dream did for the man hunt, but I don't know how to edit the compass values, can anyone help?
So I have an old server I used to run in 1.12.2 and have not updated it since but wish to update it to the latest version of Spigot again. Is it best to update through major versions and update all plugins and get it working on 1.13, then 1.14, etc. Or should I just jump straight to latest and fix bugs? I'm a very experienced server owner and error chasing is not new to me, I'm more so concerned about corrupting 5+ years of player data.
Thanks in advance.
Hi there
it seems if holographic displays are getting deleted
but no one is deleting them ;P
@pulsar badger You might as well just update to latest. I would back-up your worlds and plugin folder though. The only issue with updating to new versions with old worlds is you have to explore new chunks to see any of the world changes.
So long story short, the gamemode I run is an economy survival that has a "Town" world where people live, have property and store their items, then there's a "Wild" world that get's wiped/reset upon game updates.
So the new chunk loading is not needed.
I'm more so just wondering if anyone knows of any obvious issues with skipping major version?
versions
But thanks @radiant pollen
How do i use the bukkit task scheduler?
Also is there a simple way to just download spigot ๐ Buildtools seems to just break.
@pulsar badger No, there isn't. That's why I said just update to latest. Just make sure you do a backup of everything first.
No, you have to use BuildTools.
BuildTools on Windows?
@burnt raptor Bukkit.getScheduler().runTask()
thx
@pulsar badger are you having issues with using BuildTools on Windows?
@pulsar badger I would just try updating to latest first and if it doesn't work out go through the major versions. I can't see why it would mess up, but it's so much faster than going through the major versions you might as well try it.
I just want to download the spigot jars ๐คฆโโ๏ธ why does it have to involve installing git bash
Because of Legalities?
What happened to that simple gui program? Is it still updated
Yes but I just want to run 1 installer
you have to download the buildtools and run it from the git bash....
I tried that and the installation failed and git died
I can run it from the cmd prompt
How can i run a piece of code after a certain amount of time?
Bukkit schedulers?
@burnt raptor I told you that already. Look up
But i can't set a delay
You should go through the documentation for the Bukkit scheduler
What happened to that simple gui program? Is it still updated
Donโt think itโs still up to date. Iโve considered making my own a few times
anyone know where i can snatch the namespacedkey list for minecraft?
mostly the enchantment keys
Hey what is the event for crop trampling?
What do you think of this tick converter enum?
public enum TicksConverter {
SECONDS(20),
MINUTES(20*60),
HOURS(20*60*60),
DAYS(20*60*60*24),
WEEKS(20*60*60*24*7),
YEARS(20*60*60*365);
private final int conversion;
TicksConverter(final int conversion) {
this.conversion = conversion;
}
public long convert(final long value, final TicksConverter unit) {
return value*unit.conversion;
}
}
Nice!
@cold wharf EntityInteractEvent
Check if block is soil, farmland, whatever it's called these days.
farmland
@sturdy oar instead of calculating it in the parameter, why not put the answer in it, its faster
Thank you zaxarner I will try it
so I have been trying to find a way to code a player tracker like the one Dream did for the man hunt, but I don't know how to edit the compass values, can anyone help?
@kind berry you can use the setCompassTarget method
define faster because i don't get it
I don't think that there's a huge difference between writing 20*60*60 or 72_000
the compiler has to calculate for example everytime what 20*60 is, but if you put the answer of that in it, its quicker, not that you will find a bigger difference
ok thx @sage flame
Can someone help me?
If i have:
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if(event.getMessage().equals("/plugins") && !event.getPlayer().isOp()) {
event.setCancelled(true);
}
}
}```
And someone does /PLUGINS (In capital letters) then it still works!
it should just be "plugins" without the /
why are you using PlayerCommandPreprocess tho
You might want to also add pl and ?
add ignorecase
^
Or just use startswith
.equalsIgnoreCase
you can also do /pl
yeah you either use equalsIgnoreCase() or getMessage().toLowerCase()
How can i run a piece of code after a certain amount of ticks inside of a public void
No
i siad inside public void
@burnt raptor Did you look at the documentation at all?
wdym?
use Executors
??? wtf
@burnt raptor do you mean tick cooldown?
Bukkit schedulers are a no go lol, use Executors
they are also easier to do
less messy
Is there a documentation for them
Google it
Don't executors create new threads? @regal siren Never messed with them before.
I don't think so
I used executors
only newCachedThreadPool a few times when working with CompletableFutures
If a task is submitted for execution and the thread is currently busy executing another task, then the new task will wait in a queue until the thread is free to execute it.
I think like Bukkit scheduler is much easier for beginners
I know of course that Executor has more potential but they'll end up just copying stuff
I mean the BukkitScheduler surely uses the ExecutorService.
It's just the BukkitScheduler is probably easier and it's also synced with the server tick, right?
it's also very useful when stuff can't be done async
allows you to schedule tasks to be done
I'd any day prefer Bukkit scheduler over executors
the interface is very convenient (aside from requiring a plugin instance), maintains a threadpool internally already and allows for running sync tasks
I mean the BukkitScheduler surely uses the ExecutorService.
It does
private final Executor executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %d").build());
oh so it's c a c h e d
Yes. As any sensible executor should be lol
I still need to properly understand those things
Oof
So updating all plugins and spigot to latest, then booting results in my worlds just regenerating ๐
Despite my server having 0 errors with plugins in 1.12.2
Guess I'll go for the slow option updating through the versions ๐
check that the world file has the same name as in the server.properties
Not all world files can work universally, that's probably why it regenerated the new world
the bukkit async executor feels so unresponsive, i just make my own async executor
something is wrong with it
Executots.newsinglethreaded() :p
for my mysql requests it's perfect
I use standard Java threads for that, these Bukkit runnables annoyed me too many times
ik, I just was too annoyed by the framework, so I used my own threads for async tasks
the sync ones are pretty useful
the only thing I use the scheduler for is putting a task on the main thread
i'm under the assumption the async scheduler aligns with ticks or something
not certain
but it's bad
if I'm in NMS classes of my plugins I just implement ITickable and register to the scheduler
well who cares if an async task is performed without the ticks
the only part that matters is the last bit where you merge into the main thread if you have to
I only use the tick stuff if I want to be sync
so just write the code normally lol
not if I want it to be executed every tick
oh yeah then the bukkit scheduler is fine
in NMS i prefer the tickable option
does it matter
ITickable is more clean
I don't use it in normal plugins because of the version dependence
It's a matter of taste
Hello,
I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 48.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java
I am using ProtocolLib to handle packets.
Thank you!
the first really nice asked question today! Congratulations
whats the ip and version of the server?
https://www.spigotmc.org/
4th post
play.spigotmc.org & latest snapshot
Hello,
I have an issue where when I purchased a script I was double charged to my paypal and it sent 2 payments of 2.99
talk to the author
^
Hello,
I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 48.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.javaI am using ProtocolLib to handle packets.
Thank you!
@frigid ember there is nothing in line 48
why not handle packets yourself,like the real man Kapp
My bad, line 40
oof, I had this problem too, but I don't know how I solved it
Hey, I have a player in my server who changed their username but it is still the same account. They are treated as they are a brand new player in the server, how do I make it so that players who change their username still get to keep their /homes and /balance and everything?
your server is offline mode?
some plugin developers still haven't learned
@sturdy oar Yes.
then ๐คทโโ๏ธ
then what
reeeeeeeeeeeeeeeeeeeee ghost ping
then what
@neat orbit We don't support cracked servers on here for legal and moral causes
@neat orbit with the exception of BungeeCord users of course
Hey can i ask sth bout my databank?
20:50:40 [SEVERE] Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=127.0.0.1)(port=3306)(type=master) : Socket fail to connect to host:127.0.0.1, port:3306. Connection refused (Connection refused)
Why could it be? I made the user ranks, the rigths were given and the panel is done
What could it be?
Sorry im new in that ๐
the host couldn't be found
Hmm, I know but how could i fix that?
is the host on the same server?
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
*** Server will start in 20 seconds ***
I dont get that
what is wrong there
its the latest build of the version
yes
@sage flint have you used localhost as adress in the mysql config then?
where is it?
depends on your plugin, normally in the plugin's config
Hello, still looking for a solution to this.
I'm looking for some help to allow my ravager entity to rotate while moving. Currently, the player riding the ravager can rotate the ravager's head and body (see line 40.) While the ravager is in motion (with the player using WASD,) the ravager's rotation resets to a default position . How might I fix this during the movement?
Full code: https://hastebin.com/idexeludow.java
I am using ProtocolLib to handle packets.
Thank you!
uhm, the plugin can't find the database
its LP
so there must be a error in the config
or you have a error in your firewall
look
what could we dou about it?
or you have a error in your firewall
@vale slate how could i check?
LP = LuckPerms?
yes
one moment please
Ok ^^
https://hastebin.com/ovuzobizij.md - My server crashes idk why. (The link is the log)
[22:03:55] [Spigot Watchdog Thread/INFO]: Startup script './start.sh' does not exist! Stopping server.
[22:03:55] [Thread-4/INFO]: Stopping server
I dont know how to make a forum on the Spigot website please help
@west lynx how can i setup it?
Is this Hosted on your computer?
Yes
Ok ^^
@sage flint may I see you LuckPerms config (please blur out the password)
@tranquil rampart Im not sure how but this may help you ( https://www.spigotmc.org/threads/start-sh.328278/ )
wait
I created this gui, and I want to make it so when people click "add a friend" it then allows AyncChatEvent to be active, to then check what friend the player said in chat. Though I don't want it always active wasting resrouces, how can I do this?
that's not s problem with the start sh it's a stackof problem @tranquil rampart
k, and how can i solve it
@vale slate having the event always be active isn't intensive
having it register / unregister is intensive
????
me?
np
How can I make sure it doesn't fire when a player types another player's name?
just have a collection of uuids listening for
not sure exactly what youre doing
but you could use a map i suppose
Map<UUID, UUID>
hmm
https://pastebin.com/YZ1XC5dr
@MFMkillCrafter, I hope u saw it lol
I was interested in the storage method
Maria DB
so you use MariaDB on your server too?
Yea
and change address to localhost:3306
Ok
makes no difference :p
MariaDB is a very high rated bit**
Hmm? I am actually confused rn lol sry
okay so I fixed one bug, but I am still left with the issue: how can I only add the player as a friend if they clicked the "add friend" button instead of just typing their name in chat?
GUI
then just make it run the same code
so I have my if (event.getRawSlot() == 35) { player.sendMessage("please type the player you want to add in chat"); //add friend }
run the same code you run in chat