#help-archived
1 messages · Page 26 of 1
It puts more overhead on the server for sure, but having the ability to scale to show your information on a website or share it between servers at any given time should outweigh the overhead. Especially because the overhead should be handled on a separate thread, which should cause minimal issues to the server itself
Even then, if you have a network large enough you can just dedicate an entire server by itself to run the MySQL Database
and just remove the overhead
You can cache the information needed as well, to reduce any overhead
But, like @keen moth said as well, you should do whatever it takes to remove any overhead as possible
It just takes smart choices, that's all.
Plan out your development, and implement.
For most people, you dont even need MySQL
@wanton delta the globaltablist isnt depreciated
i meant in bungee config
I'm personally only using MySQL because I plan to link a lot of server-data together
oh yeah i am using a plugin that says it does the same thing
Well that was what I was getting at, even though you don't need a SQL server now doesn't mean you don't need it in the future. Using a SQL server for storage can be a good idea, even though it's not needed at the given time
Yeah, if you have plans or you think you may eventually need to access data from multiple servers then definitely invest the time into implementing it.
Or develop solutions to use MySQL and/or files
To Be Honest your database will reply fast enough to not need a local cache
Yes and no
If you're running a connection on the main thread of a Minecraft server, then it's definitely not fast enough
only exception would be if you need to sync stuff like cancel an event
In terms of efficiency, you should cache whatever is going to be fixed and not change over the duration of the runtime.
but in that case you need to really load a load of data from the database when the player first joins
so it's available on demand
Well the idea is to cache info that should be changed as well. Then update the database as necessary.
Most player data that gets loaded when they join is very insignificant.
You could load their data in as they join, and then update it as the plugin runs using Async methods.
There's an async login even you can use
Well, it should pretty much be Async the entire time
The only time you should vouch (in my opinion at least) for synchronized MySQL loading is when the server starts and caches the data
Yes, but for loading data on join, you'll be able to use the login event as it's being run on a different thread
Allowing you to ensure your user has their data loaded before joining the server
Well you shouldn't cache ALL data, only necessary data 😛
Yup
Yeah, by no means should you cache player data, if they're offline.
It really depends on the situation
that's where ur weak references come in
I mean, sure
I just mean player data by itself, load it as they join.
But it can of course get more in depth, if you need some data as you go
I can't think of a reason that I would personally need to cache offline player data.
maybe a top players scoreboard? but that would be very little data
Yeah but even then, you would have cached the top players, not the actual player's data.
yeah
and you wouldn't have even cached their data, you would have just ran a query to the server to get the Top 10 players with the score value + their names
and then cached top players for score board with their score+names, or whatever you see fit
Ping or dm if you can help
I’m trying to load schematic on my server but the schematic is so large that it crashes the server. Any solution? I’m not installing fawe because that plugin doesn’t even work.
Hey, I've worked on a little one day project. It's just a tool for one of my plugins to help people create in-game text based animations. I'd appreciate if someone of y'all would give me some feedback on the UI/UX, it all looks nice and makes sense to me, but I'd like to know what outsiders think, here's the link: https://tarkan.dev/tmgenerator
@meager lantern I think it looks good, it appears to function well and do what it says it does. I dont know if you plan to make this a public resource, or for what purpose. However, if you do, you could possibly include some JavaScript hover-over tip messages describing what the fields do.
But, mainly for people who may not necessarily know what they mean.
Ah yeah I could do that, thanks
The design is good, it looks very clean.
Navigation is very easy, it's very appealing to the eyes.
You could also instead turn the color code field as a Drop-Down List
Since they're going to all be fixed values anyways.
I mean TitleManager is already a public resource, but people seem to have issues creating more advanced animations for it as well as utilizing the inbuilt animations, so this is just a helping hand for those that are struggling
Ah yeah, I thought about that
But then some people might want a combination of colors and formatting
I was only saying that because I wasnt sure if you planned on adding combinations of colors.
Or heck, even text that scrolls by in the shine animation
I'm just giving feedback by what I see is all.
Yeah and that's exactly what I asked for
And thanks for that!
What about the color cycle page? Is it clear enough?
Seeing as it only says in small that you can re-order the colors by drag and dropping them
I saw that as well. I didnt really have any feedback for it because it seems to have a pretty intuitive layout already.
Perfect!
If there's anything you could change to it, it would be to add more color options.
But the drag+drop is pretty straight forward.
All of the colors are available in the "Choose colors" button
I just meant more like, available.
Like, if I wanted to remove colors from the cycle
or add more
Sorry that I wasnt really specifying that.
Actually, hold up
Oh so like multiples of the same color?
Nevermind you're good
Hahah
It does actually do that.
But, that is a good point.
Maybe adding functionality of multiples of the same color would be a good implementation.
Yeah, I could see that being useful
@meager lantern When you try to add your own color codes to the Animation input it breaks.
however, if i connect thru direct connect it lets me thrun the hub
anyone knows why?
o_o
:0
its making me mad tbh
Yeah, that's exactly why I asked for help in here, because I've been developing this in a vacuum
@frigid ember Are you getting any message?
oh hey 20 hours of waiting later. Why isn't my forced host working? It's configured properly in the config (I hope), but when I connect to my.server.com, it leads to the default server and not the one I forced hosted.
Just not in Word type
io.netty.channel.connecttimeoutexception
I typed &c into the Animation input, and
The text will appear and dissapear
and it will show the color I provided
@ the c character
Make sure you've configured the IP and port correctly
Oh wait, it actually seems to break for everything except the shine and color cycle page
It's weird, ServerListPlus picks up on the custom host and shows me my unique MOTD, but when I join just goes straight to default
Hm
Yeah, but I think I'll keep that as is, as I don't see too much of a need to allow for color codes there
Well
Using custom color codes does still break the Shine page.
wait
not anymore
actually yes it does
Kind of
How?
Hahah, damn
Temporarily
It appears to show it at the first cycle if I'm correct.
then it removes it.
Yeah, it's because it doesn't take color codes into consideration
The shine color code will at one point be inbetween the & and the c
Which is why it'll show &c at one point
Also, if you do something like, &ctest&9test&rtest
Again, there won't any need for color codes here, I should probably strip the text for color codes before generating it
Yeah, I see
Except, the first one gets changed.
so &c is red, then it goes back to blue (which I set as default)
so it seems to replace the red with what I placed in the field, then the rest of the color codes that I added stay in place
Actually, I'm seeing a lot of weird things here now
I'll just strip the colors, that should fix all of the issues on the Shine page
My shine color is &9(blue) but the shine matches the color codes that I provided
yeah, that'll fix it
So it appears, you set the color in the field, then if I redefine it in the animation input, it will use that first color I set as the Shine
the shines primary color*
Huh?
You sure?
Ohhh, right well I know why that's happening
I just prepend the primary color to the front of the string
So if there's a color code in the way, then it'll be dominant as it's the last color code shown
yep, at least that's what I observed.
So if I changed it, it will reflect in the rest of the animation.
But either way, it wouldnt be an issue if you stripped the color tags.
and as the cycle continues, if I add another color tag, it will just change the "dominant" color as you put it
Exactly, I've just stripped the text on my local version of the code, I'm gonna fix the issues Zaxarner found as well and then it should be golden
Is 60$ a fair price for paying a developer to set up a core API for a new movecraft-like plugion?
I'm talking bare bascs
basics*
and i pay for other stuff alter
It really depends, I'd probably never buy something so crucial for that low and I'd certainly never take up a job for that amount of money
I'd personally never sell services, regardless of my skill because if I try to evaluate my skill level and try to place a dollar value onto it I will always overvalue myself.
That's a good thing
Needless to say, if a person is spending hours upon hours developing said API for you, is it worth it? It's probably not. Not if you compare it to how a lot of people tend to equate to a livable wage.
Exactly, it's just not worth it for someone if they spend much for than 3-4 hours to get that amount of money
And chances are if it's a 'Core' plugin whatever that's supposed to mean, then they'll probably have to spend quite a lot more
But, also since plugin development is volatile, and said person might not be very experienced (since most people who work with plugins generally are not very experienced), they could be using it as a learning experience to improve their skills.
So really, whatever they agree to, should be pretty viable. You would not get a professional at that price. So you likely do not have a professional developer. But, that does not mean they can't produce a quality product for you to use.
If the person developing the plugin is okay with receiving experience while lacking in payment, then it's fine. Though I do not think it's okay to exploit someone who's just starting out
I don't think it's okay to exploit people just starting out, but I also dont think they should be trying to asking for payment with inexperience either, so you have kind of a gray area.
So with that said, if they agree with it, then go with it.
If you think it's worth the dollar amount they place, and they are willing then so be it.
Yup, true
I just wouldn't pay until I got the service that I asked for.
Unless they asked for some kind of deposit price before they initially start, then you might pay before you start (a portion of the cost), but it would be up to you to require them to provide some kind of portfolio or list of projects they produced to verify their experience.
Is there a way to disable the 1.15 "click on bed to set spawn point"
Get a plugin to do it or use command blocks.
I am writing a plugin
Beat me to it :((
Event Listener | PlayerBedLeaveEvent | setSpawnLocation(false);
thanks
ok, apparently bufferedstream gives me errors.
There we go, it looks like I've fixed the issue caused by color codes now and I've stripped the colors from the Shine animation
seems to work better and not break now
why isnt InputStream and FileOutputStream not supported in java 8?
if (args[1].isEmpty()) {
is returning an ArrayIndexOutOfBoundsException when args[1] doesn't exist?
@frigid ember You need to do a length check on the array
Make sure that it even contains that index
Well, I want to check whether args[1] is given...
So I guess args.length < 2 would work?
do something because there is no args[1]```
You need to do (args.length > 1
Because index 1 would be the second position in the array
i would prefer < 2 so you dont have nested if statements
It functions the same. I just want to check whether argument 2 is set or not.
return;```
Yeah
ya :P
@frigid ember If that [1] position doesn't exist, it will throw an exception.
Which is why we're telling you to check the length
1 will always exist if you use <2
Exactly
But if you want 2 arguments then youd have to use <=2
And wym check the length? He already is
@kindred vector name changes are $10 on spigotmc
No he isn't
He's doing "if (args[1].isEmpty()) {"
Without checking the length
You're reading the guy that is explaining it to him
Yep
^
you'd be suprised
meh i dont think ppl care here
I hate when people make their usernames their real name.
Even if we wanted to we wouldnt find you with only a first name.
but by all means donate $10 if you are so inclined lol
Oh rude this discord changed my nickname
I had a creepy guy msg me from the forum on a social media :p
Block em
oh yea thats 😳
Half the people here are creepy. Nothing new
report too
😟
when ur demographic is teens and young adults making minecraft servers lmao
You sure they didnt find you in another way?
Yes
The only other way I could think of is if you use social media with the same username.
they said they got my name from spigot when i asked who they were
bit creepy that's all
Eh, I'd just block.
It is what it is.
If you're really concerned, then you could change your name; maybe request a name change to the staff without charge for identity purposes.
doubtful
I know most people have to pay, but if its regarding your personal status IRL I think it would possibly be respected.
If you provide proof of harassment
mmm maybe it wouldnt hurt to try but 🤷
Not doubtful at all. Circumstances like that dont apply to most people.
I would personally respect it.
I just see more of a need to have people pay to name change because they are indecisive and it's a waste of time and effort. Personal/safety reasons are different.
Guys does anyone know the Sound enum of the hit? (the one which sounds when a player hits another with e.g. the hand)
Thanks mate!!
Ghmm, just realized those enums don't exist on 1.8 :/ shm
edit: nvm the sound is HURT_FLESH
wait how am i supposed to use bufferedstream with bukkit?
legit google isnt any help
That's because your question doesn't make any sense
What are you trying to use a BufferedStream for?
I'm pretty sure InputStreams existed before Java 7 as well
wait no dont take my advice
Is there a reason why you're trying to manually write to the config.yml instead of just letting it happen by itself?
wdym writing it itself?
Well currently you're trying to write a custom method to write contents to the config.yml file
There's already a save method
about that, im also adding a mysql.yml file so yeahhh. i really dunno
and saveResource doesnt function for me soo
This resource should give you all the information you need on the topic then: https://www.spigotmc.org/wiki/config-files/
It goes in-depth on both the default config.yml file and how to create your own config files
it only loads the config file not the mysql file.
There could be multiple reasons as to why that's happening, have you had a look at the link I sent?
can someone please help me setup votingplugin
How can I loop through the values from a primary key in a table on SQL
ResultSet
sellect * order by ''yourprimarykey'
yeah
i forgot a lot of stuff
public List<Object> getSections(String primary) {
List<Object> sections = new ArrayList<>();
PreparedStatement pst;
ResultSet rs;
try {
pst = this.getConnection().prepareStatement("SELECT * FROM PrisonsData WHERE " + primary + " = ?");
rs = pst.executeQuery();
while (rs.next()) {
sections.add(rs.getString(1));
}
} catch (SQLException ex) {
ex.getStackTrace();
}
return sections;
}```
im trying to make it like config sections so my friend knows what hes doing
this should work correct?
i guess
maybe i could change to list<string>
i don't know what you want back
Its storing like faction names
and i want those so i can add them to my list of factions in the setup method
so at primary i hope it's the sql column right?
So this doesnt work?
i thought you missed result set
Oh
Ok thanks for the help, otherwise i was just gonna start my server up and pray lol
@tiny dagger if ur still around, is it worth saving serialized inventories in SQL database or should i just stick to files?
it's gonna get ugly however sql would mean you can switch between sqlite/mysqlite easily
so yeah i recommend sql
I mean with my serialization an inventory can be up to like 26k characters
Idk if sql can handle that
plus each player that ever logs on the server will have something stored like that
may not ever reach 26k but it will be something
sql can handle everything
the point is to do it async
however you're gonna need a sync return point
so depends on how hard you want it to get
@tiny dagger im doing everything in async, every 10 minutes
I need to remove a set of permission from player.
Set<PermissionAttachmentInfo> efPerms = player.getEffectivePermissions();
inner: for (String perm : perms) {
for (PermissionAttachmentInfo efPerm : efPerms) {
if (efPerm.getPermission().equalsIgnoreCase(perm)) {
player.removeAttachment(efPerm.getAttachment());
continue inner;
}
}
}
is this correct way? feels overcomplicated
You could add a negative attachment?
is it required on send metadata after spawning a client side entity on 1.14?
🤔
As it seems this is only required on 1.15
How would I target a player inorder to give them an itemStack?
Player target = Bukkit.getPlayerExact(args[1]) wouldn't work in that situation, right?
Any help is appreciated
uuid?
target.getInventory().addItem(ItemStack);
But, to get the player, you would use: Bukkit.getPlayer(UUID);
Well then, you should send the full code you're sending.
and we can specify how you can reference to get the player you're asking for.
Okay sec
?
@dusky herald here's the code
Player target = Bukkit.getPlayer(args[1]);
if(target != null && args[0].equalsIgnoreCase("smelter")){
target.getInventory().addItem(smelter_pickaxe); ```
That's part of the code. Doesn't really show a whole lot :P
is smelter_pickaxe an ItemStack?
yep
does the code work?
everything works except the targeting player part
it does nothing
I even made a player.sendMessage("test");
to see if it even works when I try to give the target player the itemStack
Do you yet any errors in the add item call?
Send the entire class if you have to.
@zenith palm, @heady rampart is a troll.
You don't have to make those itemstack statics
Store them in a list or map if you need to access them again.
Local as in a text file?
Local, as in; not any variable outside of the method.
I would create a method that creates them that you can just call from the command. Create it locally in a method and call that, is what the means.
Yeah true
It seems like that command needs to be run twice
Once to create the tool and once to give it
I am pretty confused looking at the command though, still looking at it though lol
Looks like he wants to give a player certain tools
Also just had a quick glance ok my phone :P No syntax highlighting haha
Player target = Bukkit.getPlayer(args[1]);
if (target != null && args[0].equalsIgnoreCase("smelter")) {
target.getInventory().addItem(smelter_pickaxe);
} else if (args[0].equalsIgnoreCase("explosive")) {```
Why not make the first instance an else if?
Player target = Bukkit.getPlayer(args[1]);
if (target != null && args[0].equalsIgnoreCase("smelter")) {
target.getInventory().addItem(smelter_pickaxe);```
this part?
Yes, the part that says ``` else {
Player target = Bukkit.getPlayer(args[1]);
if (target != null && args[0].equalsIgnoreCase("smelter")) {
target.getInventory().addItem(smelter_pickaxe);
} else if (args[0].equalsIgnoreCase("explosive")) {```
if(statement) {
} else if(anotherStatement) {
} else if(oneMoreStatement) {
}
If you use the if(statement), you should use it like this:
} else {
}
if(condition) {
} else {
}
...etc```
not like this
} else {
}
else if(condition) {
}
...etc```
Chances are, if you're using a command, you can just use return; when a command is supposed to be completed.
or return true; *
Rather than to keep cycling through ifs that dont need to be fulfilled.
Ah okay, makes sense, I'll fix my code and see if it works
?kick @heady rampart Trolling
👢 Kicked 554677860523311105
and I dont see any viable reason that you would need to use else ifs
Not in the command you're using at least.
Just use if statements, and make sure they return true; whenever they reach the end of their checks.
Just dont use them, unless you have a good reason to.
You can always just place a return true; statement inside of them, and that will end the entire method right there.
and it will stop running the rest of the code that follows.
It still gives me the item instead of the player
Which part
I read the command but I'm still not 100% sure what you're trying to do.
Like okay player, sends...
./command smelter
The plugin is simply an autosmelting pickaxe, a pickaxe that mines 3x3x1 , and one that does both.
What's the Player target = Bukkit.getPlayer(args[1]) supposed to do?
Hey sorry to interrupt y'alls conversation, but here https://www.spigotmc.org/threads/approved-obfuscators.420746/ it says Permission is not required to use the following obfuscators on any plugin with any settings. and ProGuard is in that list. so you can use any settings you want and any dictionary you want?
the command for example is /pickaxe smelter
give me the pickaxe
/pickaxe smelter <player> is supposed to give it to the specified player
@rich saffron you can't use the long names
kk
can you elaborate a little more on that? like in the dictionary?
what about random strings? 10 chars long?
the point is to not be too long
but between a's and IIIiiiiIIIi
there is no difference
someone can just put proguard again and make them 1 char long
Try something along the lines of that @median wing ?
yeah it will as long as it's not too long @rich saffron
ok, sorry for all the questions lol, how long is to long :panic:
Alright one sec
@median wing and sorry, I wrote P2 in the arguments for Bukkit.getPlayer(P2), change that to args[1]
oh okay
How can I check which operations can be run asynchronously?
It appears your command probably isnt working as intended because you are using an else { }
Instead of using { else { Player target ... etc }
just add another if statement in there after you created the ItemStack
like....
Thats what I mentioned before. Because of that statement, it would have to be fun twice. Once to set it in the global static var and once to give it to the player.
So remove the if statement, move the creation of the tool to a method and call that when giving it to the player.
player.getInventory().addItem(smelter_pickaxe);
player.sendMessage("message")
if(args.length >=1) {
Player target = Bukkit.getPlayer(args[1]);
target.getInventory().addItem(smelter_pickaxe);
}
[CIRCULAR REFERENCE:java.net.SocketException: Connection reset]
I was installing BuildTools.jar but this happens...
You can nest IF statements into other IFs, and then they will not affect other IF statements.
and you can also generate items in their own methods and create them that way vice-versa
Okay, I'm trying it and I'll see, thank you very much for your help I greatly appreciate it
I'll tell you what happens
But, the way the command works as you put it, if you type /pickaxe smelter
or you do /pickaxe smelter <player name>
It will never give the pickaxe to the player name.
Because, you have the argument set as an else condition to the "smelter" string.
So it will basically only trigger if you do /pickaxe <w/e> <playername>
But even then, it still wont work unless a player did /pickaxe smelter
Because it's using a static reference, and if it was never set in the first place then it would never be defined.
So it could work if you did commands ingame like...
./pickaxe smelter
and then followed with something like
./pickaxe whateveriwanttosay <Player Name>
in that order
Oh, so how would I alter my code to fix this?
You should nest the IF statements
So not using else ifs?
// add actions here
if(!args[1].isEmpty()) {
if(Bukkit.getPlayer(args[1]) != null) {
Player player = Bukkit.getPlayer(args[1]);
player.getInventory().addItem(ItemStack);
}
}
}```
Yeah, if you have arguments that follow only the smelter argument
then you need to nest more if statements
and check those as well.
okay
Using just else will lead to issues.
so should I nest this with the target if statement?
You could use what I send
sent*
and add in the actions that you had within the smelter
to create your itemstack with the lore @ the // add actions here
oh so basically just copying the smelter again in there?
Yes.
Ah alright
It doesn't even have to be a public static ItemStack
you could actually remove that
yah I was using that for something else but never got rid of it
I'll recreate it for you, if you would like.
Alright
@median wing - Have a look at this: https://pastecode.xyz/view/533b84fb
Cleaned it up a bit, to show what I mean. I haven't tested it, but that's the basic idea anyway. You can still improve on that a lot, but the concept should work.
Thanks for all the help today in here. Really appreciate the community. Managed to get a good amount done today, but I am still unsure about a lot of things too. If someone could take some time and give me some feedback on this: https://pastecode.xyz/view/a130b6e4
The PersistentData method is a part I need to refactor. It's a bit messy. The basic idea of the plugin is that when you pick up a red mushrooms, it saves a record in the database, with the amount that was picked up, who picked it up, and when it was picked up. When it's dropped, the record is updated, dropped_by, dropped_at is added, and lore is created like "NAME dropped item on DATE". That's what I got so far. I've attempted to use
runTaskAsynchronously, but I am not 100% sure that the implementation is correct. Any tips on this would be great.I have a decent server running, but if I have a 64 stack I press Q to drop them individually, creating 64 records in the database, I feel it's really hard on the server and I get a warning like
[Server] Server thread/WARN Can't keep up! Is the server overloaded? Running 10700ms or 214 ticks behind- So something is up 😛 The Database does seem super slow though.SHOW FULL PROCESSLISTtook 11+ secs to run, so that might also be a bottleneck.
@naive stratus Just gonna bump this one from me, from last night, that got burried in a discussion 😄 Hope it's okay.
Just confirmed with my server host, that they do have DB issues. I will move to a temporary AWS instance and see if that makes any difference.
Sorry @dusky herald - I did not see that you were already editing the file for him. Just sat down at the desktop without reading the rest of the conversation, after he said "thank you so much" 😛
Haha it's alright, I'm reading it now to learn about what I can improve. I just wanna thank everyone that helped me, and that I appreciate you guys taking the time to help me.
@naive stratus Not a problem, just trying to help, everyone has their own input. 🙂
@median wing Maybe look into moving all the lore to a config or something. That would make the class a lot cleaner.
Then you could cut it down to 40-50 lines of code
Someone know how to allow 1.8.9v to join 1.9 spigot server? Because im getting this screen
I would move all lore to config if I were for example willing to release to public and allow the downloaders to edit the values.
Other than that, there's no reason to.
Move it into some constants class then
@frigid ember https://www.spigotmc.org/resources/viaversion.19254/
List<String> lores = Arrays.asList(
“Lore1”,
“Lore2”
);
Well then, I dont think you can let older versions connect to newer?
I would highly doubt the capability of old clients to connect to newer version servers. Too many risks.
It just makes more sense to be able to go back than forward.
Is there a way I can teleport players mounted to an entity?
without dismounting the riding entity
Hi
With a bungeecord server
Do I have to put ALL servers with connection-throttle -1 if they are hosted locally? even the lobby?
What could make this send?
[Server thread/ERROR]: POI data mismatch: never registered at BlockPosition{x=-76, y=91, z=-319}
@brittle stone maybe teleport them both to the location, then just remount the player
@fleet burrow - This might be relevant https://bugs.mojang.com/browse/MC-146279
Not sure if it helps, but could give you an idea of what's going on.
Go to the position and see if something looks odd
List<String> lore = new ArrayList<String>(4);
lore.set(0, "THIS IS A VERY SPECIAL EGG! PROTECT IT AS IF IT WAS YOUR OWN!");
Shouldn't that work? I get an Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 error
Oh nvm, needed to to lore.add
😉
haha
does anyone know a plot plugin where non-opped players can put up a plot for sale using a sign for example where other plays have the abilty to buy them.
please dm me
Hi does anyone here know a good method to capture player input?
Try-with-resources are not supported at language level '5'
what does that mean?
@timid basin What kind of input? Any presses or chat input?
im using language level 8
Who know any on screen Faction claim board
@naive stratus oh sorry somehow i didn't mention it WASD / SHIFT / SPACE input
PLz
@naive stratus I tried calculating vectors from playermoveevent it works quite well, but if i cancel the event for some reason the player gets teleported to 0x 0z 0y idk why
It says under setCancelled in the documentation: If a move or teleport event is cancelled, the player will be moved or teleported back to the Location as defined by getFrom(). This will not fire an event
That might be why
Idk why it from would be 0,0,0 though
is there a way to get all the users id from spigot from a plugin buyer list? 🤔
Anyone got any ideas why the following code does not work?
https://prnt.sc/s28csp
Trying to check if a player has one perm then but not the other
Test account 100% does not have the perm and is not op, Any ideas?
nvm im dumb
why not just lore.add("test");
@inland meteor hahaha why not use reflection and directly modify the lore!
List<String> lore = new ArrayList<String>(4); lore.set(0, "THIS IS A VERY SPECIAL EGG! PROTECT IT AS IF IT WAS YOUR OWN!");Shouldn't that work? I get an
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0error
@naive stratus When I make lores I often make something like this
public class LoreList extends ArrayList<String> {
public LoreList(String... lore) {
Arrays.stream(lore).map(Utils::color).forEach(line -> this.add(line));
}
}
/* then */
ItemStack item = new ItemStack(Material.DIRT);
ItemMeta meta = item.getItemMeta();
meta.setLore(new LoreList(“&aLine 1”, “&4Line 2”));
item.setItemMeta(lore);
You can also make a method in LoreList which returns LoreList but are liable of adding more lines
Dude. Just use Arrays.asList()
huh
The reason you’re getting an error is because that index doesn’t exist yet. It was never set
But yea... Arrays#asList() takes varargs and returns an immutable list
Arrays.stream(list).map(Utils::color).collect(Collectors.toList());
iirc that would give the list as colored
Or just use ChatColor constants in your list
Don’t translate hard coded strings. That method should be used for configurable values
Well if you want to make something configurable. Using the translate color is the way to go lol
It’s even better to use a StringBuilder rather than to concatenate strings with the ChatColor constants I’d say
Pls bin
bin?
use the latest version of essentialsx
really?
Thanks @naive goblet
I'll see if it works
(:
I don’t think a StringBuilder is necessary. You can concat just fine
Rip readability
Anyone know why I cannot get meta from an object spawned with block.breakNaturally(itemStack); ? I set meta on the stack, but when I check in ItemSpawnEvent it does not have the meta that I just set.
Send code ig
itemStack is the item used to break the block, not the item to be dropped by the block
Hi. I followed this guide (https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/), but I'm getting error during server starting org.bukkit.plugin.InvalidPluginException: Cannot find main class io.github.matbcvo.pricamc.pricamc though I have main class named pricamc and I have plugin.yml name: pricamc and main: io.github.matbcvo.pricamc.pricamc What's wrong?
What’s the name of your Main class
package io.github.pricamc;
public class pricamc extends JavaPlugin implements Listener {
@subtle blade So there is no direct way of controlling the meta of what gets spawned?
Look at your package and look at what you’ve set in your plugin.yml
Ok thanks, troxx
It’s pretty clear
@idle tulip I’d recommend you to google Java name conventions
Actually.. I'll just spawn it myself.
io.github.matbcvo.pricamc.pricamc
vs.
io.github.pricamc.pricamc
main: package.name.MainClassName
Look at your package... then look at what you’ve specified in your plugin.yml
It’s very clearly wrong
Sorry, I just saw that package name wasn't correct, I renamed both package and class names, now it's all working, thanks.
Question... https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/scheduler/BukkitRunnable.html#runTaskTimerAsynchronously-org.bukkit.plugin.Plugin-long-long- mentions that Asynchronous tasks should never access any API in Bukkit. Great care should be taken to assure the thread-safety of asynchronous tasks., yet I see it happen all over the place, in examples I can find, such as: https://github.com/The-SourceCode/Advanced_Bukkit/blob/master/Episode_12/ParticleTrails/src/me/tsccoding/tutorial/TutorialMain.java
Can someone clarify a bit?
because that packet doesn't read world state
I don't understand why you'd use an async task for sending particles though
is it good practice to make stuff async where possible, or is this overdoing it?
in this case it's dumb
generally I'd only use it for disk IO, databases, etc
or any non minecraft related CPU intensive task
You have to remember that async tasks will need to have a thread to run in, if there ain't enough threads, it will have to create one; That task would potentially create a metric ton of threads in the worse case scenario
right, this runs every tick :/
in any case, I'm pretty sure there's a proper particle API in spigot in 1.12, not sure why this uses packets and NMS
I see. Thanks for that. Now, another question 😛 I have a lot sorry. If I want to make the world indestructible in a radius around a specific location, for certain players, how would I go about doing that?
I place a block and only the person that placed the block, will be able to destroy the world in a radius around that block.
i mean, you basically wanna do what worldguard does
divide this problem into components, and start by writing methods for each component. For example, start by figuring out how to calculate if a block is in a radius of some other block
also be careful not to reinvent the wheel
who can tell me some good custom scoreboards
BroNon work tho
@naive stratus you can use the blockbreakevent and check if the distance squared from the center is less than your radius squared (from the circle equation)
True. I was just wondering if there already were some methods for doing this, but the block event will work for sure.
Thanks
there is a distance method in Location
yeah
make sure to use the squared method so it doesn't need to calculate square roots
I have a schematic made that I want in my world but its so large that world edit crashes the server a FAWE doesn't even do anything. I just tried mcedit I followed all the steps and even that didn't show anything. I know the schematic works because I tested it with cubical.xyz (online schematic previewer). I literally can't access my schematic at all in game.
you can configure the watchdog in bukkit.yml iirc
set it stupidly high and paste it
either that or you'll have to use an offline map editor, or paste it in smaller chunks
Who know a java code for custom score board
Spigot has a guide for it
see my message above
I found a dupe bug with a plugin of md_5's
What do you mean watchdog
@naive goblet Idk what to put tho
you say none of the scoreboard plugins work, you must be doing something very creative
Send your code ?
@coarse shoal yes
ugggghhhhh
paper != spigot
then why did you ask lol
if you're going to file a spigot bug report you'll have to reproduce it on spigot
No SWEARING
@sour dock What ??? i just need 1 to show the server name your ingame bal thats all
Nono, it's a plugin
its a bug in a specific plugin?
@pale plaza I bet you can find a plugin for it with little effort
nope
if you're not the author submit the issue to the author
Yeah, one of md_5's
i try for 2 hours now
NO SWEARING CAMM
Yeh Looking
his plugins are targeted at spigot servers iirc so you should still test it in spigot
and clicking every link
@light fjord sh
NO I AM A GOOD PERSON
can you stop using caps lol
Your name has sinner-esque numbers in it https://i.imgur.com/uxb71PD.png
you should repent
public void setScoreBoard(Player player) {
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective obj = board.registerNewObjective("ServerName", "dummy", "Test Server");
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
} is that all i type in my codeing app
codeing app
@light fjord Avoid off topic conversation. This channel is mainly for support and help.
lmao
are you a server owner or plugin developer @pale plaza
I doubt you are a plugin developer
so use an existing plugin
@pale plaza You should go and learn about PlaceholderAPI
Yeah
Yep
What it do
Read about it
read the resource page
Jeez
But can it make the score board
no
these plugins can: https://www.google.com/search?hl=en&q=scoreboard plugin site%3Aspigotmc.org
Okay I’m out now
xd
I DONT UNDERSTAND IT
if you are not willing to spend time to learn stuff and want others to walk you through everything you shouldn't be running a server
Well I Just need A Fucking Place holder
okay then
@light fjord we need you to yell no swearing again
NO SWEARING
ill tell ur mum
Do That
ok big man
/**
* Creates an empty {@link ConfigurationSection} at the specified path.
* <p>
* Any value that was previously set at this path will be overwritten. If
* the previous value was itself a {@link ConfigurationSection}, it will
* be orphaned.
*
* @param path Path to create the section at.
* @return Newly created section
*/
public ConfigurationSection createSection(String path);
what does it mean to be orphaned?
the previous ConfigurationSection object may still exist but if you try to get/set stuff in it, changes will not make it to the config?
sorry, i don't understand
so if you do
section = config.getConfigurationSection("example");
section2 = config.createSection("example");
now section is an orphan
oh, so it isn't linked?
if you do section.set("something", "something") nothing will happen to the config
it can't
i understand
thanks 😄
you can't control that via a plugin
afaik
because the plugin is a child process of the server
you need to make a program that controls the server
How do i make a score board with PlaceHolderApi
WELL#
@pale plaza I think you've already burned your bridges in here with your behaviour 😛 Best chance is to follow the links they send and figure out how to make it yourself. Or pay someone to do it.
Hey a question is anyone here?
no
So i own an Minecraft server im using WinSCP (Putty) as console. I typed restart and i get this problem: (i should of typed stop and not restart)
https://prnt.sc/s29y8w
This is what a guy said but i dont know how to do it so is anyone able to help me out?
type htop in a normal putty console and then press F4 and then type java and then find the instance of your server running and hit F9 9 ENTER
PLEASE @ ME IF YOU RESPOND
@frigid ember restarting the whole server will work
@silk bane Its weird because i typed restart and i ment to type stop
It broke something i cant start the network up because of that (you see in the prnt.sc)
How?
reboot
sudo reboot
or shutdown /r /t 0
if your windows
OOOOFFFF
or he has no access to root
why wouldnt he
unless hes trying to run a server on a seedbox or something
TADA
I own the VPS
do you not know your root password
Then you should have root access
you typed it wrong then
i typed it twice over
Then your box is broken because it means wrong code
wait lemme do it again
more like he just forgot it
How can i forget it?
humans tend to forget stuff
Alr lets reset it then to show its not me forgetting a password, anyone knows how to reset the root password?
you dont
you need to be root to do it
if you're lucky, since it's a VPS, your host might provide a way for you to do it
why are you running it on gcp
Thats expensive af
free credits style
I ran out of the credits alrdy
...
😕
Because its really smooth tho
idk tbh
at that point just move to a shared host
you dont have access to root out of the box, your account is a sudoer
but it seems like you broke something
that wouldnt break it
Thats the only thing i did
Well i ran w/ 150 people on 20 tps
on gcp?
youre paying too much even then
what are you looking for
Just good for a mc server
not gonna lie
15/24 gb
just get a dedicated server at that point
**
oh
budget?
there's no way GCP is cheaper for similar hardware
Its not cheap GCP
what plan was that on ovh?
has to be like
FS-72T
about the same price
RISE-1 would probably be fine
oh unless he was looking at public cloud
Oh fr?
I have this piece of code
public void removeMachineCoreLocation(Location location) {
Bukkit.getScheduler().runTaskAsynchronously(machinery, () -> {
Path file = location.getWorld().getWorldFolder().toPath().resolve("machines.dat");
long longToFind = Utils.locationToLong(location);
try (ByteChannel in = Files.newByteChannel(file, StandardOpenOption.WRITE, StandardOpenOption.READ)) {
ByteBuffer buffer = ByteBuffer.allocate(128);
in.read(buffer);
buffer.flip();
LongBuffer longBuffer = buffer.asLongBuffer();
for (int i = 0; i < longBuffer.capacity(); i++) {
long position = buffer.getLong(i * 8);
if (position != longToFind) continue;
buffer.putLong(i * 8, 0);
in.write(buffer);
break;
}
} catch (IOException e) {
e.printStackTrace();
}
});
}```
It is supposed to get a location, find it in a file of longs and remove it/set it to 0, however, when I call ByteChanncel#write it appends the long of 0 as shown in the picture. It should overwrite the first 8 bytes
How do I cancel the drop of certain items when I kill the zombie?
I'm using the EntityDeathEvent event, I've tried some methods, but always drop the items I don't want
you can use event.getDrops() to get the drops as a list of itemstacks and then remove all from that list
Gcp is definitely not cheaper but has better network usage tolerance
Hello, can I find a tutorial on installing a server on Linux?
preferably an updated on
Install Java,
Run the server
wow great advice lol....
Its that easy tbf
Put jar in seperate folder
install java
run java -jar Spigot.jar
It doesn't take a genius to run software
@silver pollen I did it, it actually stopped dropping, but there are times when I "bug" and drop the item that I didn't cancel
Maybe install screen too if this is on a vps
How do I cancel the drop of certain items when I kill the zombie?
I'm using the EntityDeathEvent event, I've tried some methods, but always drop the items I don't want
Has anyone ever had problem with a plugin using another plugin rewards?
i have 2 separate plugins,both using same logic to handle rewards,each with theyr rewards.yml inside them
but somehow 1 is stealing from the other one
How do i reset my custom data.yml file to its orginial state how i made it in eclipse
delete it?
or if you want through code,you could delete everything on enable then recopy it
How do i download spigot jar ????
Well i gotta admit i am lazy but im tryna code idk were to look
download 2nd one then..
@vernal spruce remove the getbukkit link
Thanks
then why is google marking it 1st search?
I'm sure if wolverness reported it to google they'd remove it
like 1st page of that search is only getbukkit..
@narrow crypt set("Drops",null)
Drops:
'1':
==: org.bukkit.Location
world: world
x: 130.0
y: 4.0
z: -196.0
pitch: 0.0
yaw: 0.0
'2':
==: org.bukkit.Location
world: world
x: 130.0
y: 4.0
z: -196.0
pitch: 0.0
yaw: 0.0
would delete the section itself
well havent seen anyone but you complain about it @silk gate
how do i download the spigot cus i have a server just needthe java file
im gonna ask a staff member later
or will it create it by itself if i do `data.set("drops." + blablab,blabal);
@narrow crypt yeah that will create a entry in it
Isn’t getConfigurationSection().clear a thing
I’m not entirely sure but give it a try
does same thing.. both works
set to null to clear
you don't
run build tools
you download buildtools
?buildtools
with the flag --rev 1.8.8
@wanton delta im not talking about the defaultconfig
compile paperspigot
You still have to use YamlConfiguration right?
it will take me here but how download 1.8(top)
Code (version18 (Unknown Language)):
java -jar BuildTools.jar --rev 1.8
Will build a CraftBukkit and Spigot jar for 1.8
Change Log: Mojang | Stash | Jenkins
Issues and Common Concerns(top)
it take me here but i need the 1.8 download https://www.spigotmc.org/wiki/buildtools/#1-8
you can't just download it
yes i do martoph
@silk gate How Then
Download buildtools and run it with fit bash
you are literally on the page that explains it
Git bash*
Fit bash
:(
💪
yeah sucks a bit needing getbash to downloadi t..
martoph it doenst suggest me data.clear
can editing config files and what not be done in an async thread?
sure but don’t access any bukkit api
it's for saving ::D
hmm would the default config.yml go into bukkitapi?
I don’t see why not
alright
FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
this is how i created the file
Fit bash haha
Sure you can use the bukkit api to access the file but it’s returning a YamlConfiguration
I have a class for Configurations, creating is simple than new Configuration(plugin, "config.yml");
I checked bungee docs but couldn't found answer.
is ProxyServer#getPlayer(UUID) non null?
if its non null, can I sendMessage() or should check isConnected() before?
doesnt it say what it can return?
would p.getUniqueId() break in async threaD?
yes
but how do i clear the Drops section in my FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
@narrow crypt that is a YamlConfiguration that youre getting
set null @narrow crypt
hmm alright
data.set("some.section", null)
I mean @wicked sage since the uuid never changes it won't cause any issues, but it's bad practice
Try not to use singletons
it might throw asyncacces not sure though
im saving things based on the uuid. just means i need to get it as a final variable before going into my async therad vs claling the method asynchronously
It's a antipattern
about config
Im using this https://paste.helpch.at/tatesologa.java
doenst work @hot girder
ah
@hot girder data.save() didnt work since its configurationfile but using:
try {
data.save(new File(plugin.getDataFolder(), "data.yml"));
} catch (IOException e) {
e.printStackTrace();
}
worked
use my class @narrow crypt
when you want to save it
bad english aaahhh
Create a class extending to YamlConfiguration
Uh
about config
Im using this https://paste.helpch.at/tatesologa.java
@fair abyss
actually same, but yours hard to use
Dont Repeat Yourself
That code will be repeated
When you save it
bad english :(
You can put it on a method
Dont Repeat Yourself
Wdym?
boys how would you go about creating a persistent,custom entity with my own stuff
rn im deleting them at ondisable,and at onenable replacing them while checking the location
its gonna have its own listener..
note: killing entity in on disable will result dropping entity's items.
and you cant block it
dont care as location will be saved
in configs
and will later spawn again oneanble
Wdym?
@narrow crypt what
"what do you mean"
.
