#help-archived
1 messages ยท Page 33 of 1
doubt it, I think maybe a route went down and the BG's re-routed to a non optimal route
called iTickable
well yes, and the Networkhandler tries to execute a Handshake with the client, in this time he unfortunatly holds the server
Is there no sort of timeout ?
There is, 30 seconds
there is, you see it in your console
standard TCP timeout
^
I dont get any timeout or other errors
because it didn't hit 30 seconds of no activity
ok
how can I protect server against that ?
(and why it does lag only every 2 minutes ?)
well you can't protect your server against that
you could lower the TCP timeout on the dedi but I don't recommend it. As I said I do believe a route went down to get to your servers and everyone is being re-routed sub optimally to a different route
oh good god, now I need to explain how internet protocols work
but you can only find that out with some network tools
if its a route issue there isn't much you can do except just wait
or you contact the support of your host
that too
okay, thanks a lot
sorry, but we can't help further
wont bother you anymore
is there a way I can register a vanilla CavePopulator to my custom generator
thanks again, will come here when it's resolved
well support was my job and is hobby
ping plotter is a good tool to use sometimes to see if there is an issue with the route
I do believe its free to use for a period of time and then you have to buy it, but its handy sometimes
especially if it does show a problem on the route it gives you more information to give OVH support ๐
Is it at all possible to "pose" an NPC or entity through the use of a plugin?
is there a way I can register a vanilla CavePopulator to my custom generator
well some more information what you're doing would be helpful
Is it at all possible to "pose" an NPC or entity through the use of a plugin?
depends on the entity
Specifically a player entity.
you mean disguise yourself as another entity?
Like, if I wanted to create a faux statue
Not pose as another entity, pose an entity
oh, well probably better off using armor stands to put entities in a pose
Ah okay that makes sense
It's not possible to recreate an entire skin on an armor stand though, right?
no, it is not mappable, at least as far as I know
anyone got the nms for spawner?
like the mappings?
the methods a,b,c,d yeah
Well if you are using NMS, you should be that advanced to recreate them from the methods
I think the mappings aren't online for 1.15
im getting an NPE for some reason when i try to call YamlConfiguration.loadConfiguration(file) when the file is not null, can anyone help me out here? im pretty new to spigot development so apologies if im being small brain
please show us the stacktrace and the sourcecode
one sec, lemme put it in a pastebin, is that alright?
sure
pastebin does what it's supposed to do
Except for giving me epilepsy?
and I'm to old to use something newer ๐
erm, so which one? (heres the pastebin https://pastebin.com/Y56QDATr)
Jesus dude
._.
put it in https://hasteb.in
for the right format there was no money left xD
oh boy
ill warn you now, my main class is not pretty as Im still learning how TO make it neat
where should I start my tour of code destruction
Lol
Let me go on my pc
shoot i didnt realize i would have to leave this soon, please tag me or dm me (if that's allowed) if you happen to find any clues please, sorry about leaving you guys like this ;-;
I will see what I can do
thx veri muches
np
first, the parent will always exist that is the plugin datafolder, if it doesn't then you have more problems then just the plugin fyi, second the way you create the directory is incorrect as you are using the method to create a file, not a directory
public final class
I'm getting worried, since this thing spreads like a virus
Correct
yes
final Main is good?
I have what I'm pretty sure is a dumb mistake, which is good since it means it'll be easily fixable. My plugin isn't even loaded, can anyone help me figure out why?
I am just concerned that everybody is making everything final today
Well final should be used ?
I would be more worried about static then final ๐
Except if you want to reassign a variable later
You have no reason to finalize your main class because even if it does get extended, it canโt be initialized. The class path will throw an exception
Frost is right I think
Itโs a class path enforced singleton
statics isnโt as bad as everyone says. Overall itโs kind of wrong blaming everything on staticโs if you know when to use static
the problem is most people don't know
I hate brigadier
it takes 2 seconds to get some knowledge how static works ;/
one space = bad -> https://i.imgur.com/VEr2A93.png
two spaces = good -> https://i.imgur.com/Mx6jZbD.png
it takes years to know where to use it and how to use it properly
I have what I'm pretty sure is a dumb mistake, which is good since it means it'll be easily fixable. My plugin isn't even loaded, can anyone help me figure out why?
@wicked atlas is an exception thrown
why this error appears in the console?
https://pastebin.com/BbitUvUQ
at some point
Takes years?
@narrow basin some skript doesnt work with 1.15
why this error appears in the console?
https://pastebin.com/BbitUvUQ
Because of a incompatibility issue
no it just doesn't even try to load it https://hasteb.in/hakigosi
or more like com.gmail.thelimeglass.Books.EffOpenBook doesnt work with 1.15
the compiled jar is in the plugins directory
or more like com.gmail.thelimeglass.Books.EffOpenBook doesnt work with 1.15
am I stupid or is this a strange package
not really
[16:12:41] [Server thread/ERROR]: Could not load 'plugins/totems.jar' in folder 'plugins': uses the space-character (0x20) in its name
@wicked atlas
never saw gmail
ppl use their email as package name if they dont own a domain
oh I apparently missed that
ok but it doesn't
name: TotemNotification
version: 0.0.0
main: com.github.redstoneguy12.totemnotification.TotemNotification
api-version: 1.15
description: Sends a chat message when someone pops their totem
ppl use their email as package name if they dont own a domain
honestly I never saw that, till today
com.github is another one many use
that one I saw a lot
and I understand
but gmail
is there a accidental space in there redstone?
at the begin or end
but that should be cut out
the Strings are trimmed
that's the exact file from the jar, and no there's not
why not buy a domain name for no reason other than to feel safe using it for your group id?
because no credit card
I think the github option is more reasonable than gmail
well then, have fun
redstoneguy, wish my problems would have been solved like yours :o
NMS problems magically solve themselfs if you delete the world folders
and guess who didn't know that
Ight
If you stress about readability, static will be one of your nightmares as well ๐ฆ
I'm the good old singleton fanatic
Depends but certainly
I generally just use framework and hierarchies xD
Everyone should (:
Static has its purpose, but not everything needs to be static
Good purposes
yes
it has its very own purpose, but some people don't understand
Well I'm the person who multithreads his plugins
his?
wdym
he's referring to himself
this sentence is totally fine I think
yeah that's a normal thing to say
Grammatically wrong
yeah the tense is wrong
sorry
spigot-api
Copyright(c) 2012-2020 SpigotMC Pty. Ltd.
https://www.spigotmc.org/
Public License
https://www.spigotmc.org/wiki/public-license/
Does this count as attribution or needs it more things?
Think it counts ?
@zenith palm can you update my nicname please my name was changed on forum
Yes update mine as well
@zenith palm can you update my nicname please my name was changed on forum
@lean knot Please PM me on the forums with your current discord name (not the nickname on this server) eg:VitaniNecro #0624
Can I as well?
Yip
how do i pm you on forums?
Itโs through starting a conversation right?
how do i pm you on forums?
@lean knot https://www.spigotmc.org/conversations/add?to=ssamjh
Updated your name @naive goblet
โค๏ธ
so lets conclude
done @lean knot
incredibly bad joke
Yes my dude
Gotta have some relaxing time in the quest of setting that shit into a itemstack for 2hr
Enjoy (:
I have a not relaxing time convincing the pose vector of an armorstand to do what I want
How to get mods
How would this look as nbttag? {ArmorItems:[{Count:1,id:diamond_boots}, {Count:1,id:diamond_leggings}, {Count:1,id:diamond_chestplate}, {Count:1,id:diamond_helmet}]}
cant figure it out
hey.. it was fun
the Tnt spawner still is the best
Now imagine armor stand spawner
Fish spawner
armor stand spawner that spawns with initial velocity
Or, falling sand spawner
why not go crazy and just put them stands on bats
boom, halloween themed spawner
xD
What would be the most efficient way to check if the first n items in lists are equal
for loop get the 0 element and check all against that, I suppose
that's not what i meant
sort of like doing list1.equals(list2)
but only checking the first n items as opposed to all items
well
Yeah, for loop
there is a compare function
No lmao its a O(n) problem
but I never used that
You cannot make it more efficient xd
int ct;
for (int i = 0; i < a.length; i++)
if a.get(i) == b.get(i) ct++;
else break;
"pretty much"
i need to look into time complexity a bit more
@bronze marten hue hue hue,you just solved my problems
if this is the thing you worry about in your efficiency, then you are a real pro
i get the basic idea but need to study it more :p
Beatiful @vernal spruce
i just worry since it will be checking on a lot of events
well, enchant apply events
dont worry
maybe not that bad
keep the list as short as possible and you should be good I guess
yeah lists are only the lore
As long as your n does not exceed a few million ur fine
just trying to ignore success and destroy rates when comparing
people often are worried that their code will be unoptimized and super slow
its a lot faster than what you think
^
if you worry make a system millis before the operation and one after it and print the difference
I used to worry a lot lol
@vale slate bruh literally the worst xd
you should only be worrying if its a big operation
Never do that xd
just for debug
Especially with java in a JVM environment xd
I know it's inaccurate
But sure it can be nice too see it run fast xd but dont expect it to run always like that
Would there be any benefit to putting the said code in an async thread?
no
Thanks, wanted to make sure
definitely no
int count = 0;
for (; count < lore.size() - 2; count++) {
if (lore.get(count).equals(compLore.get(count))) {
count++;
}
else {
break;
}
}
return count == lore.size() - 2;
That look right?
what the heck is going on with that formatting
well no
I always use {}
Too much identation
you're doing count++ twice
youre using count++ twice
just do if (!lore...) break;
ye
can't do a foreach in that case?
i don't think i can ^^
since it's comparing one list to another
Hey does anyone know if the resource version API is caching the versions or it's bugged? I updated my resource about an hour ago and it's still showing the wrong latest version. https://api.spigotmc.org/legacy/update.php?resource=1049
You can use foreach and an iterator tho
okay, i've got a working algorithm
If you want to compare two whole lists if all elements match there is a more efficient way to do that
@meager lantern try clearing cache?
I mean it's showing up both in-game and in my browser
So it's not a browser cache issue
What version is it showing for you?
2.1.7
It should say 2.2.0
2.2.0
Or actually I just updated it to 2.2.1
Takes a bit to update
Ah okay
Mine is updated, it's a cloudflare cache thing
Had some issues with that page as well tbh, ended up using github tags now
Right, so the edge server I'm connecting to has it cached
I could just switch over to GitHub as well, I've uploaded all of my releases there as well
Can spigot maybe disable the caching for that page? xd
Cloudflare has page rules right?
I don't think they can, maybe if they have the huge enterprise plan
Any body got any ideea how i can translate this into nbttag in code? ArmorItems:[{},{},{},{Count:1,id:diamond_helmet}]
You get a few page rules for free tho
use the new api @meager lantern https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=1049
Oh sick!
Any body got any ideea how i can translate this into nbttag in code? ArmorItems:[{},{},{},{Count:1,id:diamond_helmet}]
I don't know how it is called anymore
docs are here https://github.com/SpigotMC/XenforoResourceManagerAPI
I was wondering why there was a legacy path, but not a new path
When did this come out? Probably ages ago
last month
Oh nevermind then
if something is missing, yell at @pale crow ๐
if its working, send tacos to @pale crow
Hahah, I just need the version so all should be good ๐
The hell you talking about
the new api you build
Caching is like 5 hours
Oof
I have no idea how the legacy API works tho, I'm assuming it does the same thing I do which is just db.
arent there events called when a resource updates or sth? Then just updste the resource cache version?
No i mean for fetching version for my plugins
How you fetching version of plugins with github
@frigid ember legacy means old and replaced by something newer
there is a github api for that
Git tags
Lmao ok
And then just use github api indeed
So I want to create my first modular project, any advice on where I should start?
Well, if that works for you great. Most people posting resources don't even use git let alone tag their versions
But releasing more than once in a 5 hour period smells like bad developer to me and is not an argument for reducing the cache time in the api
It's no so much that, we'd like to notify users the second a new version comes out
Or within let's say 10 minutes
well releasing is not working like that
So what? Are you repeatedly hitting the API every 10 minutes?
How does your checker work
Yup, it hits the API every 10 minutes
It is a notifier build in Github, if you update a source the software will be notified
What the fuck
at least the one I use does that
Yup, it hits the API every 10 minutes
@meager lantern that's what i call bad practice
we dont have webhooks
which is what you're talking about mfm
anyway, yeah hitting it every 10 mins is a shit idea. every hit you renew that 5 hour cache period
yeah, there is a github api for java using webhooks
ye i thought you were suggesting to add webhooks to the spigot api
Yeah, there's no way for me to get a callback from the API, which I've got to periodically call the API
alright im back, i read through the comments and suggestions you guys had on my Main class and I made some adjustments (most notably changing parent.createFile() to parent.mkdirs(), at least i think this is what you guys suggested), but im still getting the same NPE, ill post the hastebin below so that you guys dont have to scroll all the way up https://hasteb.in/vilasuhu.gradle
It's not so much bad practice as there's no other option, the API has no rate limit and no guidance as to how often we're allowed to use it
ye i thought you were suggesting to add webhooks to the spigot api
It would be a nice feature
But is a rolling cache? I've been using the Legacy API up until now and it seems to me up until not too long ago it was either not cached or at least not a rolling cache
even if it would not be cached, if your update checker frequency is 5hrs there is no problem to it
Granted even if I were to poll it every 5+ hours, then there would be too many users polling it to cause it to ever release the cache
thats correct and as for adding webhooks to this, we more than likely cannot as we'd have to add user reg, auth, whatever and we're simply not doing that
it caches per user.
its not per resource.
yes to be more specific, per region (also)
if you hit it, you get a 5 hour cache.
if another person hits it, they get a 5 hour cache.
that line of code applies the cache to the requestor's browser
and then yes, behind that is the CF cache
I mean y'all were talking about Cloudflare's cache earlier
there is the browser cache, then CF cache
Browser cache can be cleared, CF not
Yeah, well my resource doesn't respect the cache header sent to it
ok, then you dont have to worry about it
i believe CF is set to the same amount of time though
which is my point, there is no point in polling every 10 minutes
you're just wasting your and spigot's bandwidth
reduce your polling period
CF is complicated as it splits it also to the regional servers
if you want to yell at someone and tell them to change it, that'll be md_5
i only made that api to use in my resource, and md made it public
Well I'm wasting my users and spigot's bandwidth
But yeah, I don't think there has always been a cache, as it always seemed to update quite quickly
I only give auto updates out if a user specifically registers for those
Either that or it was a short one
regardless, polling every 10 minutes is stupid. if i found that any of my plugins were sending net requests every 10 minutes forever i would remove them from my server hands down
i'd only update check onEnable or on a way less frequent scale
that's ridiculous
I'll stay with my webhooks
webhooks wouldn't even work in this case for a public plugin
true
we'd have the same problem every time he updates
we'd have to send X requests
X being how many are running his shit
why tf did it took 2hrs to do this idk
ยฏ_(ใ)_/ยฏ
Idc thats githubโs problem if a lot of ppl start downloading releases at the same xd
Again, if there's no API key or guidance as to how frequently users should be allowed to poll an API, then I'm going to poll it as often as I see fit
But now that there's a long cache on it, I'll be toning that down to 5 hours
im not saying that is a guideline or rule
im saying that it's a shit idea for you to put into a plugin
Hey! I tried entering an end portal and it didn't work, there are plugins, does anyone know the cause?
Hey! I tried entering an end portal and it didn't work, there are plugins, does anyone know the cause?
@wheat summit a little more specific on there
I'm aware that it's not a guideline, I'll be changing it solely because of the CF cache
I used end eyes to get to a portal and tried entering it on activating and I fell through
im not even talking about cache at this point, im talking about being a sane person and caring about the people that use your plugin. if you don't, then...whatever you can stop reading. if you do? what the fuck are you doing???? just do it onEnable and when someone with perms logs in. what's the point in polling for updates? it's ridiculous mate.
Oh I'm talking with them, they don't know the problem either
Should I put a list of plugins here?
@wheat summit Tell them to check the bukkit.yml
Should I put a list of plugins here?
please send them here directly
allow end
@wheat summit Tell them to check the bukkit.yml
and that
yes
Caring about my the people that use my plugin? It's a document the size of just a few bytes every 10 minutes?
That's less than some of the packets being sent hundreds of times a second on the server
I think we should drop this discussion
just dont
okay, whatever. i don't have time for this literally retarded ass bullshit
I could understand this being an issue from Spigot's side
why is this so hard to understand?
okay, whatever. i don't have time for this literally retarded ass bullshit
please mind your language
That makes sense
So i downloadet a Spigot 1.15.2 jar. But its outdatet. SO i get build tools and type java -jar BuildTools.jar --rev 1.15.2 . But he said git dont work. So i want to make it manualy. But i dont find the github page from spigot
mild swearing is allowed kill crafter
Can somebody send me the link
did you install git on your computer Adrian?
I have a debian 10 server
i dont know. But its a essentail or not?
Supposed to be a nullpointervalue there
im p sure buildtools needs a git install to work
@lone rapids getDisplayName is nullable.
Why are you repeating stuff so many times
otherwise publishing straight downloads for spigot is illegal, that's the whole reason og bukkit got shut down a few years go
Just initialize a reference to the object u need
@lone rapids you should check the other way around
Help me please
?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.
I have a problem with GoldenCrates
very specific
@lone rapids When checking strings, Enums and primitives. Using switch is preferable
@lone rapids Taken from the docs for getDisplayName(): Plugins should check that hasDisplayName() returns true before calling this method.
Itโs probably Nullable then?
The docs say not null, but that line indicates otherwise I guess...?
I put the golencrates.user permission on the player but he doesn't have access to the crates
or simply turn around the equals statement
Air will return null Zax iirc
How can I check if the player has the empty inventory?
if(p.getinventory().getcontents().lenght == 0) is work?
What
whut
Im not english bro '-' sry
^
Does anyone help me?
I think he essentially means what I was doing
oh now I understand
@frigid ember I've never used that plugin before. Is there a wiki for it?
Hard you have to compare the getInventory to an inventory object you created I think
switch (item.getDisplayName()) {
case โstring1โ: {
//code
break;
}
//case ...
default:
//if no cases are found
``` @lone rapids
I think so
Read the wiki. There's probably other permissions you need to add.
I got the plugin from the site and got permission from there but it doesn't work
Please contact the developer first @frigid ember
When making items with meta etc you should make some type of ItemBuilder Nemesis.
Conclure, that is confusing sir. My java level is not there yet. What does the switch do? ๐ฎ
oh
There is no discord and they do not even enter the site
I have an ItemStack method
Okay so switch is instead of checking strings with if, else if, else if etc
More control rather than an if else statement @lone rapids
How can I check if the player has the empty inventory?
if(p.getinventory().getcontents().lenght == 0) is work?
@old barn I think inventory#getContents#length will always return the size of the inventory, and if it was empty it would just be full of air/null
Hello, is there any algorithm to paste schematics like villages in minecraft in a world ? Knowing the fact that the world is already created ?
public class ItemBuilder<T> implements Supplier<T> {
private final ItemStack itemStack;
private final List<Consumer<T>> metaList = new LinkedList<>();
public ItemBuilder(@Nonnull final ItemStack itemStack) {
this.itemStack = itemStack;
}
public ItemBuilder<T> withName(@Nonnull final String string) {
return withMeta(meta -> meta.setDisplayName(string));
}
private ItemBuilder<T> withMeta(@Nonnull final Consumer<T> consumer) {
metaList.add(consumer);
return this;
}
@Override
public ItemStack get() {
final ItemMeta itemMeta = itemStack.getItemMeta();
metaList.forEach(e -> e.accept(itemMeta));
itemStack.setItemMeta(itemMeta);
return this.itemStack;
}
}
``` I mean some ItemBuilder like this or just methods to add stuff returning the ItemBuilder then a build method that turns into an ItemStack
(Mortal)
(Okay) I will look at that, thank you Conclure
@old barn search the forum always https://www.spigotmc.org/search/187492401/?q=Check+if+inventory+is+empty&o=relevance&c[node]=52
Maybe generics is too advanced for that wait let me write some simplified stuff
I just wanted to say
Hey guys, I have a GTA server, including a ton of pvp. Now i'm having trouble choosing a version for it, 1.8.8 is the home of pvp, and where everything was originally setup on my server, 1.12.2 is more updated, allows for longer nametags, but not so good for pvp, and imo isn't a good look for a GTA server, Can I get some opinions please? ๐
player.setLevel(int number); I think aimorris
class Builder {
private final Material material;
private int count = 1;
private String name = null;
public Builder(Material material) {
this.material = material;
}
public Builder setName(String name) {
this.name = name;
return this;
}
public ItemStack toItemStack() {
ItemStack item = new ItemStack(material, count);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
item.setItemMeta(meta);
return item;
}```
nope
Mortal something like this perhaps
TheSisquatch, do you have google? O.o
@frigid ember setExp()
I searched for nothing
@rapid yacht 1.8 pvp is trash, imo. How is 1.12 not a good look for a server?
Wrong
People don't like change.
Non of them are very good Iโd say
@radiant pollen
@rapid yacht 1.12 w/ a 1.8 combat plugin
@radiant pollen I mean it isn't rlly a good look for a GTA server imo
@austere flame it doesn't rlly feel the same, does it?
idk it's just a feeling
it doesn't go together
Thank you conclure
ig but tbh i really like the 1.9+ combat so ๐คทโโ๏ธ
So you can add a method to change the size
@frigid ember setExp is a method on Player. what does getPlayer() return?
And maybe lore ?
A player?..
What version are you on
Oh wait it returns a HumanEntity
My server is 1.15 pvp and I think it's more fun than 1.8.
Yeah I thought so.
I mean, I've changed literally everything about the PVP so it wouldn't matter if it was 1.8 or 1.15 but you get it
Hello, is there any algorithm to paste schematics like villages in minecraft in a world ? Knowing the fact that the world is already created ?
hello everyone, i have an issue with group manager says format is correct but when i load up server i get a big error saying the file is wrong but i double checked it using online yaml checker
this file is driving me crazy
๐ฆ
private List<String> lore;
public Builder setLore(String... lore) {
lore = Arrays.stream(lore).map(Utils::color).collect(Collectors.toList());
return this;
}
@lone rapids
This was my build, Conclure, lol
Can anyone help me solve the problem with GoldenCrates please?
Uhm itโs decent
Didn't accept an array tho, for lore
I can be on pc tommorow so can probably help you more then
@frigid ember We didn't make the plugin. If there's no wiki or doc then we can't really help
Sorry for the late reply though here's the list of plugins we have:
Plugins (77): KitsPreview, MazeGenerator, PlaceholderAPI, PlugMan, CustomDrops, ViaVersion, NBTAPI, ViaBackwards, LuckPerms, ClearLag, WorldBorder, BuycraftX, BannerBoard, Votifier, Multiverse-Core, ProtocolLib, MovingDevApi, VotingPlugin, BlowableObsidians, BanGUI, MVdWPlaceholderAPI, FastAsyncWorldEdit, IPWhitelist, mcMMO, ItemStacker, Vault, EnhancedPlayTime, ViaRewind, BlockParticles, FastAsyncVoxelSniper, Trading, HolographicDisplays, Marriage, RewardPRO, ActionAPI, VoxelSniper, PlayerVaults, HubBasics, Bank, ShopGUIPlus, WorldEdit, CustomEnderChest, Essentials, HeroBounty, Citizens, DiscordSRV, CrazyAuctions, EssentialsChat, Parkour, Lottery, CrazyCrates, LeaderHeadsRevamped, WorldGuard, Factions, Quests, EssentialsProtect, EssentialsAntiBuild, CommandNPC, CombatLogX, EssentialsSpawn, BungeeTabListPlus, CompatNoCheatPlus, KoTH, SilkSpawners, ShopGUIPlusSilkSpawnersBridge, NoCheatPlus, ECore, WGCustomFlags, ProCosmetics, StackMob, NeoMoreTPPlus, CrazyEnvoy, WGPlayerDamageFlags, CrazyEnchantments, MyPet, Jobs, TreeAssist
Ahh cool man
You can change the last parameter mortal till String... lore
We're not sure if any off them are stopping the end
this is my error for group manager:
Then lore is
List<String> lore = Arrays.asList(lore);
It's a wiki but I don't know where to go
@wheat summit Check the essentials config, the multiverse config, the worldborder config, hubbasics. I image all of those could be messing with it.
And you can then write item(Material material, String name, String loreline1, String loreline2);
Since you used varargs in the last parameter
Ok thanks
@frigid ember You either created the crate wrong or they don't actually have the permission.
https://pastebin.com/ZxhhCaf1
@junior acorn Your file is malformed. Run it through an online YAML parser
I have now install git and have now so much new things on my Server. I only want a Spigot.jar is it so Hard? ๐ญ ๐ญ ๐ญ
Please help i dont understand englisch very well. So i read, Readme.md but it dont get me forward. Please help
@digital sphinx what was the error when you ran buildtools
I have copied the permission from the plugin site, or I think I need to install the latest version, as the version I have I think has been fixed
No error but i get 6 new folders and in Spigot is no spigot.jar
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Go to /Spigot/Spigot-Server/target
It's really not hard to look through some folders dude
Go to /Spigot/Spigot-Server/target
@radiant pollen There is in the Spgot folder only CraftBukkit Patches and Bukkit Patches and .git
Then you didn't run buildtools correctly or it hasn't finished.
it was finished i type "java -jar BuildTools.jar --rev 1.15.2"
did you follow the buildtools guide ?
Try saving your config file in UTF-8 and try again @junior acorn
it was finished i type "java -jar BuildTools.jar --rev 1.15.2"
@digital sphinx please send your latest build log
I make https://www.spigotmc.org/wiki/buildtools/#1-15-2 this
Try it again @digital sphinx
Make sure the entity is an armorstand, cast to armorstand. profit.
setArms(true)
@digital sphinx please send your latest build log
@vale slate If i copy and paste in Discord, discord crash
You should verify
well paste it to a pasteserver
with your spigot account
does it matter what format file is under is YAML picky when it comes to txt unicode format
?
If I delete the GoldenCrates plugin and add a newer one, is it possible to work?
If I delete the GoldenCrates plugin and add a newer one, is it possible to work?
@frigid ember ask the developer, we are not omniscient
it's the encoding
GameMode oldGameMode;
@EventHandler
public void onInventoryOpen(InventoryOpenEvent e) {
if (e.getInventory() instanceof EnchantingInventory) {
GameMode oldGameMode = e.getPlayer().getGameMode();
e.getPlayer().setGameMode(GameMode.CREATIVE);
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent e) {
if (e.getInventory() instanceof EnchantingInventory) {
e.getPlayer().setGameMode(oldGameMode);
}
}
The enchanting inventory opening works fine, my gamemode is set to creative. But then when I close the enchanting inventory, my gamemode doesn't get set back?
@frigid ember What are you talking about? The plugin was updated yesterday...
thanks @keen moth
np ๐
Nevermind, I'm blind and didn't read console.
with your spigot account
@radiant pollen I am 15. So under 16 . It would be illigal. Because the EU say no data collection for people under 16.
yes
^
also they're in radians, not degrees ๐
@radiant pollen I am 15. So under 16 . It would be illigal. Because the EU say no data collection for people under 16.
@digital sphinx not quite correct
it's stupid bc nms uses degrees but bukkit uses radians ๐ค
you need your parents to approve
ayy spending 4hrs on it,but was worth it ๐
it's stupid bc nms uses degrees but bukkit uses radians ๐ค
@keen moth and forge uses degrees from 0 to 100
wat
Anyone here knows what makes the Eye of Ender fly when its thrown? And can I use it to make an item do something similar?
What if you need 101 degrees?
setVelocity
you need your parents to approve
@vale slate So i can make it tommorow. Because i live in UTC +1 Its now 1 am
@naive stratus hmm
he means its capped at 100, i.e it gets clamped. 101 = 1
What if you need 101 degrees?
@frigid ember I wasn't precise 90 degrees are 100 ndegrees
Or i can also make a illigaly thing. But i dont want go in Prison.
not for that
setVelocity could work I guess, but I would not get the same effect. It can be done ofc, but I would really like to avoid that
What are you in for? I made a Discord account when I was only 15 ๐ฆ
setVelocity could work I guess, but I would not get the same effect. It can be done ofc, but I would really like to avoid that
@naive stratus it will
else you can use shoot
or whatever it is called
I will give it a shot... Heh.. ๐
Or i can also make a illigaly thing. But i dont want go in Prison.
@digital sphinx The only one who would get problems is md_5 if he would know that you are doing it
it's in radians not degrees @frigid ember
@digital sphinx The only one who would get problems is md_5 if he would know that you are doing it
@vale slate okay
I'm off now it's 1AM for me, bye
Anyone has an idea of what event the eye of ender fires when it starts flying?
I want to cancel it and set my own direction/velocity
Thought of using PlayerInteractEvent and cancel that, but it can only give me an ItemStack. Need an Item for setVelocity.
It's PlayerInteractEvent.
ProjectileLaunchEvent?
you need a entity
You spawn an Item and then setVelocity()
EnderSignal is no Projectile
@radiant pollen True, that could work. Will do that.
Why is Spigot API so shit?
wtf do you mean
Ah
EntitySpawnEvent jens?
For ender eye, @naive stratus you want to EntitySpawnEvent
cast to EnderSignal
set target
Beautiful! Thank you. Even better.
Oh I got the impression he was trying to launch some other item like an ender eye...
but yeah if you're just trying to shoot an ender eye then do that
Yeah I probably explain it a little bad. Sorry ๐
/giphy You're all awesome
Oh... But you get what I mean.
I thank you for the attempt โค๏ธ
Hmm boys,should i register a listener for each individual object or everything in one?
GameMode oldGameMode;
int oldExp;
@EventHandler
public void onInventoryOpen(InventoryOpenEvent e) {
if (e.getInventory() instanceof EnchantingInventory) {
Player p = (Player) e.getPlayer();
oldExp = p.getTotalExperience();
oldGameMode = p.getGameMode();
e.getPlayer().setGameMode(GameMode.CREATIVE);
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent e) {
if (e.getInventory() instanceof EnchantingInventory) {
Player p = (Player) e.getPlayer();
p.setGameMode(oldGameMode);
p.setTotalExperience(oldExp);
}
}
Any ideas why my experience isn't getting set back to how it was before the enchanting table was opened? The gamemode works perfectly.
I'm trying to shoot an armorstand in a curve with the item in the hand aligning tangential to the flight curve, that is a pain
oh
getTotalExp aswell
you want to setExp and setLevel
not setTotalExp
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html reference javadocs more ๐
I mean
@vernal spruce Specify
getTotalExperience() - Gets the players total experience points.
easy mistake to make
Yeah it could be more clear
nah its clear
no it isnt
I had troubles with this too :/
you just need to understand that minecraft stores xp and levels
not just xp
so perhaps clarification would be desirable but it's correct
'Gets the players total experience earned' or something yeah
Wait so I have to getExp and getLevel and then setExp and setLevel?
ye
ok
I always had the impression that the total exp methods were the exp required for how many levels you have + your current exp progress
@naive goblet custom object,let's say a block made to do something,wich should stop certain events from happening,best example,a custom entity who opens a certain inventory when right clicked
so if you used them, it would take care of level and exp progress for next level at once
yo, sorry to interrupt but I have a question about packets
This used to work before 1.15 and now doesnt :/
ask away
I mean having every event in one listener class isnโt smart
heh
I think the handlers are classwise
has to do with entity metadata
I had this lovely way of making holographic text with EntityArmorStands
@naive goblet thing im asking,is it bad to have a listener for each object rather than piling em all in one?
gonna post some code ofo
ah, entity metadata isn't required no more and gets sent as a separate packet
ah!
Send code
avoid registering/unregistering listeners frequently
Player player = Bukkit.getPlayer(sender.getName());
Location loc = player.getLocation();
WorldServer s = ((CraftWorld) loc.getWorld()).getHandle();
EntityArmorStand stand = new EntityArmorStand(s, loc.getX(), loc.getY(), loc.getZ());
stand.setLocation(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
stand.setCustomName(new ChatComponentText("Test text"));
stand.setCustomNameVisible(true);
stand.setInvisible(true);
stand.setNoGravity(true);
stand.setMarker(false);
stand.setSmall(true);
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand);
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
this is just with a command at this point
also tried this
@vernal spruce send the listener
PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(stand.getId(), new DataWatcher(stand), true);
((CraftPlayer)player).getHandle().playerConnection.sendPacket(meta);
still seems to be appearing as a regular old ArmorStand though :U
so, when using packets, entity metadata may or may not be there and just no longer required to be in that packet. So sometimes the metadata gets sent as another packet especially if metadata gets added to the entity afterwards
It really depends on what type of event listeners as well
Like the PlayerMoveEvent gets fired pretty frequently and itโs wise having its own class for it in most cases
Why does that matter?
it doesn't matter.
one of the events '//Events
@EventHandler
public void onRClick(PlayerInteractEntityEvent e) {
if(e.getRightClicked().equals(cat)) {
e.setCancelled(true);
if(e.getPlayer().equals(p)) {
pl.playerM.managePlayer(p);
pl.playerM.getHandle(p).setHandler(new GuiHandle(p,cc));;
}
}
}'
hm, alright - since I'm still a bit new to packets though, should i be sending the EntityMetadata packet before it spawns or after?
listened on each instance of the object
entity metadata packet comes after the entity spawn packet
events like those wich dont get fired often
ah, alright - ye, I have it open in a separate window, but the code above seems to not be doing the thing
Stellrow I think you can keep it in one eventhandler if youโre down casting
there's a boolean at the end though, which I couldn't find on the wiki - maybe that is it
yeah it isn't on there, that's weird ..
Why does that matter?
It matters. All event methods gets fired somewhere right? Firing an event frequently with a big code can take on the performance.
Well it depends on the code obviously
If the event code is the same for each instance of the entity, you shouldn't put it in the class. You're duplicating code.
You're also not using any object fields. Everything in there is from the event or static.
im using instance variables
So there's no point in having it as part of the object.
egetrightclicked equals cat points to object entity
getplayer equals p points to object's player
oh okay i missed that
np
Is that an event to open guis?
I mean have you tried InventoryHolder ? With abstract methods that fires on event?
It works better than comparing titles
its not rly comparing titles..
public GuiHandle(Player pp,CustomConfig config) {
this.cfg=config;
this.p= pp;
openMenu(p);
Yeah but I mean I suppose you have different GUIs depending on entity interacted with right?
this is the constructor for it
yes
it will create a gui based of the config given
Hmm you have same config for all or different ones ?
Each Player has one for each Entity?
Player pp xd
Reconsider that part
Stellrow have you worked with abstraction?
not yet,don't think it will be that hard
Well I strongly suggest involving yourself into it. Itโs really insane stuff once you learn it (:
Very useful
abstraction is a good time
it can't be that hard to quickly learn it
Can't you just compare the entity's UUID's?
they are deleted/spawned on player join/leave
:0
i mean theyr invincible,they have skills,they always teleport to the player..
dont think i should let them free without the owner
Seems fair enough
They mostly get annoying as you can't just hit them/easly move them
Isn't there a type of metadata you can attach to entities?
You should probably query for that first, before checking if it's that particular entity.
it's better to have them removed so there wont be 400 custom entities roaming the server for no reason..
i have a list holding each object
Imagine whenever someone attaches a leash to some random animal or tries to feed one or attacks a monster
Metadatable
Every single time, it's going to search for that lol
rightclick is disabled on the pets,it only opens the gui if owner did it
also im just checking if the clicked entity is equal to mine
so its not rly doing much just checking if its the same
rather than looping thourgh anything
Do it your way. If you feel for a round of nitpicks just go here (:
i will have to switch to abstract inventory holder
as it seems the best way to handle this
Yahhh
Thatโs what I use even if md_5 triggers himself on the misleading interface InventorHolder
feels bad that i have to kill compatibility to use nbt
not rly, just modularize your project
Migrate to IJ
tried.. couldnt get it to work,it got stuck at the way i get plugin instance
so threw it in the bin
I use JavaPlugin.getPlugin to grab my plugin
DI exists
As do I, but I usually use hierarchies where I can for that.
the only reason its because its shorter
Wew static
private PetsMain pl = JavaPlugin.getPlugin(PetsMain.class);
Send ur code :0
never used it so far
Just be careful as a developer
Well thing is obviously you already know but static is never getting gcโd so theyโre kept in memory
Yeah
dem block of config messages
Imagine constants
hi everyone what is the event for picking up an arrow
And sometimes itโs better to create new instances instead of bombing your gc
PickupItemEvent
Or smtng
Whether an arrow entity can be picked up depends on its status
theres also PlayerPickupArrowEvent
couldve looked on the docs ๐
but it also triggers pickup item event... which is strange
hi everyone what is the event for picking up an arrow
theres also PlayerPickupArrowEvent
is that a thing?
deprecated
Just listen for when a player picks up an item and check if itโs an arrow?
@wanton delta if an arrow is on the ground as a dropped item, it would only trigger PlayerPickUpItemEvent (or whatever it is called), otherwise it would trigger both x)
yea
which i find funny
because im actually detecting a trident being picked up
but saying event.getItem() instanceof Trident amuses me
If the server is stopped, will that trigger PlayerQuitEvent?
yep, any time the player leaves the server, PlayerQuitEvent is fired
though i am not exactly sure - when the plugin is disabled, it might not
or it might error out
on server stop there is a chance
for the listener to be unregistered
so it might miss on that..
I'm not sure if PlayerQuitEvent fires if the player is kicked
Doesn't PlayerKickEvent fire?
If that's even a thing..
most used holograms plugin i should use for api?
or should i just screw it and spawn it myself?
most used holograms plugin i should use for api?
If youโre looking for an API, I recommend HolographicDisplays
I'm not sure if PlayerQuitEvent fires if the player is kicked
It should
so holographicdisplays its the go to plugin?
looking for compatibility with as many server as i can
Probably
k,thank you
ive been getting (almost, in different locations but on the same method call) the same exact NPE over and over again when calling YamlConfiguration.loadConfiguration(file) as well as when i tried to do YamlConfiguration.loadConfiguration(reader), hastebin for my (perhaps disgusting looking as im new to spigot development) main class here https://hasteb.in/kulayujo.gradle
as well as the stacktrace here
https://hasteb.in/gowexiju.sql
as stated earlier, im new to plugin development, so any help is appreciated
i've looked at tutorials given to me but none of them seem to be for what I want: a custom config file that saves my data of type HashMap<Player, TreeSet<TenzepitTag>> as well as HashMap<Player, String>
(and TenzepitTag is indeed serializable, as I found out it needed to be not too long ago lol)
How should I handle the storage of custom inventories? Is it smarter for each one to have its own file within a dedicated folder, or all in 1 file? The amount of inventories depend on the server. Also, should they save their contents to said file on every inventory change or save periodically, onDisable, exc? Seems like the former could invoke possibly hundreds of saves a minute depending on the use.
dedicated folders sounds a lot easier to manage from the owner pov and it allows you to organize further or leave room for future functionality by letting you have more than one file in each folder
DankRaft, by any chance you got an answer for Pitt's problem? xd
I really don't know how to approach that, the best idea I can think of is going with a custom JSON
@austere flame Thought so, just wanted some confirmation.
@gloomy flower I'm looking into it now.
eyyy ty ty
how to do, when after clicked (grass block) in a gui, open another gui ?
yo i need help with EssentialsX sign shop
my problem:
can't sell music discs via sign shop
my players want it bad
@frigid ember Just open the other GUI?
Dexty, you can call the method player.openInventory(Inventory), at least i think that's what it is
yo i need help with EssentialsX sign shop
my problem:
can't sell music discs via sign shopmy players want it bad
update:
only record_13 sells
Is there an error for the other records?
yes
What is it
well im trying to sell the entire collection
im putting in the names off of an ID list for 1.8.8
nor the IDs work
it says "Invalid ID" or "Invalid name."
any good, complete, guides on custom enchantments? I have made my enchantment. I can enchant items with it. however 2 things: Name of my custom enchantment does not display on the enchanted item, and when applying to item from a book it disappears entirely.
I think I may have found solution for book, but not sure because i haven't been able to try it just yet. But as far as name not showing up idk what to do
@rotund fulcrum What does your sign look like?
And you're on 1.8?
yes
@safe robin Do you know how to read stacktraces? It seems on the line 94 the only thing that could cause an NPE is the reader. But I don't see any issues with the reader or the file, however in the stacktrace the error is issued at method convertMapsToSections. I looked at that area in the file, specifically line 73 (of org.bukkit.file.YamlConfiguration). It's only ran if it isn't null, so something must be wrong with PaperMC which is what you are using or the serialization.
By the way, you should look into programming in OOP. Your Main file should really just exist to initiate everything else, house its instance, exc. To work with configuration, especially multiple different configs, you should have a separate class for each config, and it extends YamlConfiguration. Here is an example.
https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/main/java/com/ugleh/redstoneproximitysensor/config/LanguageConfig.java
And here is where I reference it: https://github.com/Ugleh/RedstoneProximitySensor/blob/master/src/main/java/com/ugleh/redstoneproximitysensor/RedstoneProximitySensor.java#L56
still nogo on the book issue... yea i need a better guide or something.
tbh its probably wrong with my serialization call, ill check it out. i have taken some courses in java but have really never applied it to a real application like spigot plugins so i definitely understand that my encapsulation and stuff needs to be better. im hoping that with practice my ability to code in java and other OOP will get better, but thanks so much for the response
trident.remove();
Vector vec = trident.getVelocity();
EntityThrownTrident thrownTrident = new EntityThrownTrident(((CraftTrident) trident).getHandle().getWorld(),
((CraftPlayer) shooter).getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.TRIDENT)));
thrownTrident.fromPlayer = EntityArrow.PickupStatus.DISALLOWED;
thrownTrident.shooter = shooter.getUniqueId();
thrownTrident.getBukkitEntity().setVelocity(vec);
((Trident) thrownTrident.getBukkitEntity()).setShooter(shooter);
((CraftTrident) trident).getHandle().getWorld().addEntity(thrownTrident, CreatureSpawnEvent.SpawnReason.CUSTOM);
it semes to
run into a stackoverflow error
((CraftTrident) trident).getHandle().getWorld().addEntity(thrownTrident, CreatureSpawnEvent.SpawnReason.CUSTOM); at there
?paste
anyone have a clue lol
i think its claiming the world is null? but im not entirely sure
Then check if the world is null ๐
I haven't really touched any NMS but keep going back until something is null to make sure.
yea whats strange is that its fine for an egg entity lol
Location loc = egg.getLocation();
Vector vec = egg.getVelocity();
EntityArrow eArrow = new EntityTippedArrow(((CraftEgg) egg).getHandle().getWorld(), loc.getX(), loc.getY(), loc.getZ());
eArrow.fromPlayer = EntityArrow.PickupStatus.DISALLOWED;
eArrow.shooter = shooter.getUniqueId();
eArrow.getBukkitEntity().setVelocity(vec);
Arrow arrow = (Arrow) eArrow.getBukkitEntity();
arrow.setShooter(shooter);
((CraftEgg) egg).getHandle().getWorld().addEntity(eArrow, SpawnReason.CUSTOM);```
@mossy zenith Have you created a class that extends CustomEnchant and registered it? I don't know how you created your enchantment.
extends Enchantment actually
and registered for sure
like i said it all works except you don't see the name of the enchantment on the item
and the book won't transfer enchantment to other items when you put them in anvil together
Sorry, your right. Should extends Enchantment.
yea then i did all the overrides
and made an event listener for my enchantments actual ability
The reason the name isn't showing up is because Minecraft runs on localization and custom enchants don't. What does getName() in your custom enchant return?
yo i need help with EssentialsX sign shop
my problem:
can't sell music discs via sign shopmy players want it bad
@haughty stag it returns Bane of Ender as proposed in the code
Is that your enchantment name?
custom enchantments, this one in particular deals more damage to endermen, endermites, and ender dragon
and whats the problem youre running into
the enchantment does not show up on the item, even though it's been applied and works
the effects are definitely applying and working
it takes an enderman out with 2 hits, no other enchantments on diamond sword
at max enchantment level
so it just doesnt show up
right
ok
let me look at what i got
because i managed to get it working
does it add the glint?
or nothing
okay thanks, glint?
lore?
I need to set item lore?
it just doesnt have the enchantment name in the item
right
Yep, the only way i know around that is adding the lore yourself
hold up
sec
i can do that in like a minute
public void onEnchant(EnchantItemEvent event)
{
Map<Enchantment, Integer> theEnchantments = event.getEnchantsToAdd();
if(theEnchantments.get(this).equals(null))
{
return;
}
ItemStack theItem = event.getItem();
ItemMeta theMeta = theItem.getItemMeta();
List<String> theLore = theMeta.getLore();
theLore.add(ChatColor.DARK_PURPLE+"Bane of Ender"+ChatColor.RESET+" ?");
theMeta.setLore(theLore);
theItem.setItemMeta(theMeta);
}```
should it look something like that?
or am I going about this the wrong way?
looks fine to me
ya np
I recently switched to 1.12.2 from 1.8.8 and i'm opped, when I type commands for the plugin SexyMOTD, it says you do not have permission!
What's the issue here?
ask SexyMOTD?
That's me.
how to create gap on the gui, im using barrier for that, any solutions ?
What do you want? If you want a gap just don't set an item in that location.
how ?
How are you creating the GUI now?
I still don't even understand what you want. Define "gap".
Do you want the barriers there and thats just an example photo?
like this, but im using skript.. and skript in 1.14.4+ spamming my console, and thats why im create plug
You trying to make a custom enchantment?
You don't want the barriers?
yea
Yes to who?
yo you
If you don't want the barriers then just remove the part of the code that adds them
You trying to make a custom enchantment?
@unreal hedge no im not, i wana make the gui
ohhh
@frigid ember Just don't put anything in those slots...?
@unreal hedge The person wanting custom enchants, @mossy zenith has said he already registered it.
but the item move in frist slot
My bad
What method are you calling to add items?
If you want the item in the first slot, you need to add it to slot '0'
Not slot '1'
@frigid ember You create an itemstack, and then you set the item into the inventory slot. This is how that works. The first slot is 0, everything in code starts at 0.