#help-development
1 messages · Page 1562 of 1
if you have it all setup correctly it shoudl be using Mojang auth so you will have online UUIDs
right
You can enable and disable bungeecord
that does not sync uuids
So, I seem to have a memory leak on my server that causes the memory to rise--and therefore cause a major drop in TPS, even with no players online--but after checking the heap dump, these are the suspects
well, what does it do then?
So long as you followed the Post-Installation section, you will be using online UUIDs https://www.spigotmc.org/wiki/bungeecord-installation/
It's all net.minecraft.server stuff, so no plugins
none of my plugins even use this (to my knowledge)
Allow spigot instances to connect into proxy...
is there any fix?
even vanilla can connect to them
Like to open communication system
i have another question
player join the server and his stats got saved on database with his uuid
and the player offline
how i can get his stats
if in arg i use his name?
don't use name, use uuid
i save it with uuid...
ah, you mean permament plugin message channel? I do not think that that setting does that
His UUID will never change as your Bungee is online.
but on the command i use
/stats player
not
/stats uuid
who cares
yes
But to connect to the bungee server you need the ip of the bungee server, so I don't get your logic
ask help-server
have you thought about using a different version of mc?
As I said save player names too.
or is that not applicable
Bukkit.getOfflinePlayer is a thing btw
it can return null. I don't trust this XD
just note that it might not be good for performance, but it is there
what I typically do is each time that user logs in, assign a string (their username) to their UUID upon login
it can never return null
and what happend if player change his name?
You can lookup the UUID by name using Bukkit.getOfflinePlayers().stream
For it, everything is a valid player
not an option unfortunately
);
THANKS YOU GOD!
uhm, is that efficent though?
Bukkit.getOfflinePlayer(String) is deprecated but it is very useful when trying to identify if a username belongs to a specific uuid
oh no can;t use stream as its an array
you have saved uuid: name and then when they join with new name just change his name.
sec
q: does anyone know how to make this work? Right now the plugin loads but the command errors if you run it
ok thanks
this is such a geolykt way of solving this - I do not recommend that
doesnt give a offline player with the name null?
I mean why do you need the player's name if you already know the player's name e.g, arg[0]
What would you use instead?
no i mean when you get a offlineplayer with uuid
Deprecated methods? XD
Bukkit.getOfflinePlayer()
which can return null XD
the string is depreated but UUID is not and they're both annotated notnull
It can NEVER return null
^
?jd
For that method, an offline player with every possible name exists
Here, look it up yourself
dont know why you think it can return null /shruh
/shruh
Bukkit.getOfflinePlayer("Player that has never joined your Minecraft server")
it returns a player
@notnull doesnt do shit tho if it returns null its still going to return null?
Might throw before
even if it is invalid
Arrays.asList(Bukkit.getOfflinePlayers()).stream().filter(p -> p.getName().equalsIgnoreCase(args[0]));```
yeah that also works really well
might work better but the player has to have joined before
Why not just stream it?
would still return an offline player
but you won't be able to get their name which is the whole point here.
that's not the point ziga
thanks
the point is to check to see if a username has a valid UUID inside of their config
You can still do validation if that is an issue
it's not like that bukkit has methods for that
if a player is offline your gonna need to deal with a offline player and not a player?
correct.
iirc it always returns offlineplayer
what? yes?
yep that what i wanted
show player online stats
show player offline & saved on database stats
and if he dont on database show 0 on everything
thanks you
Just call Arrays.stream(arr) to be pedantic
you can only get an offline player from getOfflinePlayer but if they are online you can cast it to a player
yeah was about to mention that lol
why should that exist if you have a OfflinePlayer doesnt it mean it is offline
Player extends OfflinePlayer
why
woah
Player extends HumanEntity
[{"name":"Black1_TV","uuid":"5ddda7b6-5e79-4dbc-8c74-bcf2364d06c7","expiresOn":"2021-08-08 18:18:49 +0000"},{"name":"Katja02","uuid":"cfaee8ea-209b-4244-8b43-bbb363e69767","expiresOn":"2021-08-08 08:13:16 +0000"}]
why would offlineplayer extend player?
usercache.json
that... doesnt make sense?
its a player still?
HumanEntity extends (by extension) Entity
Player represents a player playing on the Sever
^
yep is cleaner java OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p -> p.getName().equalsIgnoreCase(args[0])).findFirst().get();
god i love lambda
eh yeah but OfflinePlayer mostly have the same stuff as Player why should Player extend it
because that's not how mojang works
good idea, parse a potentially enormous file that is already loaded in memory somewhere else
Because they represent totally different things despite both containing the term Player
offline player has like nothing that player has tho?
it has a few things in common tho
Heck, the paper API even has it's own dedicated method for it that does not block!
That’s why Player extends OfflinePlayer
Yeah that's why it's better to store your own uuid: name
but then you cant do if (player instanceof OfflinePlayer) {} it would say it for a offlineplayer and a player?
And that is the geolykt way of doing it - as it assumes that the plugin has been there from day 0
so if you don't need to store any data for a player just remove it
yeah i guess you could use .isOnline() but it would be nice not to
oh
thats will be work?
public static void getPlayer(String PlayerName) {
OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p -> p.getName().equalsIgnoreCase(PlayerName)).findFirst().get();
}
if it is an entity, it has to be online
It will throw if none is find derpy
Java Coding Conventions: https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html
use orElse(null)
isn't OfflinePlayer's getName nullable
It is
yeah
i think so
cuz getOfflinePlayer(uuid) i think creates a OfflinePlayer with a null name
time for yoda statements!
🥲
Yes, however getOfflinePlayers only returns known players to the server, so no names will be null
dont trust this
OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(p-> p.getName() != null).filter(p -> p.getName().equalsIgnoreCase(PlayerName)).findFirst().get(); jic
😉
what does that do
check to make sure the name isn't null
doesn't follow naming conventions 0/10
i dont know much about streams in java
they are dangerous tools, even if they are usefull.
So you don't need to absolutely understand them
Arrays.stream(server.getOfflinePlayers()).map(OfflinePlayer::getName).filter(Objects::nonNull).filter(playerName::equalsIgnoreCase).map(server::getOfflinePlayer).findAny().orElse(null) maybe?
just define them as black magic and do whatever you are acustomed to
OfflinePlayer target = Arrays.stream(Bukkit.getOfflinePlayers()).filter(offlinePlayer -> offlinePlayer.getName() != null).filter(offlinePlayer -> offlinePlayer.getName().equalsIgnoreCase(PlayerName)).findFirst().get();```
(bump)
for(OfflinePlayer op : Bukkit.getOfflinePlayers()){
if(op.getName() == null) continue;
if(op.getName().equalsIgnoreCase(PlayerName)) return op.getUniqueId();
}
Yeah that’s way more performant
aren't streams multithreadable?
Yup
Looks like you forgot to register the command
int-array, for-loop : 0.36 ms
int-array, seq. stream: 5.35 ms
if you look benchmarks streams are slower
Myeah, streams have quite a bloated implementation
for what data set?
very much so. So many extra object created for streams
yet I love streams
I'm coming around to them
oop shoulda specified its just the Random thing I can't get to work, if i put the random thingamajig in onCommand everything works as expected
Higher order functions are sexy generally lol
It can be nice with parallel ones
again, the dataset matters
Altho you could of course implement your own parallelable loop
I have seen a game doubling it's fps in part by using streams instead of iterators
dont ask how, but the evidence is undeniable
Games don't use Java...
I kinda wish we could provide a custom fork join pool for parallel streams
most games dont use Java
yes
I know quite a few
minecraft does

Starmade and Mindustry are 2 cool games
Wouuu I really didn't know that.
then why did you say games dont use java
He probably generalized
I know that there is a freeciv equilavent that was also coded in java
When I was programming plugins for 10 years it really seems strange for me why this C# syntax is so strange 😂
GetYes
Unciv?
don't think so - it had a 2000's website from what I recall, unciv looks more modern
And unciv is done in kotlin, so it only counts halfway
Does anyone know how I would go about replacing a specific string in a string with a textcomponent and then make that player send that message
I have this rn but it isn't really working https://gyazo.com/072dc3ba104a2ecf57c69448d7e3f536 (Adventure)
If you're using Adventure Paper discord might be better to ask in since they know it better
Personally I haven't used it yet
better ask the kyoripowered server, they are the ones that maintain adventure
Didn't even know they had one
Yeah I am there now
Is it possible to have custom ingredients (Custom Item meta and quantity) in ShapedRecipes?
Meta yes quantity no
You can however work around the quantity issue with the prepare event
https://developer.mozilla.org/en-US/docs/Web/API/Element/ariaLabel firefox is dumb cuz it dont support this
like yeah you can get around that but who wants longer lines in they javascript
ConfigurationSection cs = section.getConfigurationSection(key);
if (cs == null) continue;
String type = cs.getString("type");
if (type == null) continue;
Material material = Material.matchMaterial(type.replace(" ", "_"));
if (material == null) continue;
how do i make this less ugly
that looks fine
it doesnt sit right with me
select the whole thing and send it
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project version: Fatal error compiling
the whole thing
how it fails? i've no idea
maybe the compiler is too old for java 16?
maybe update you rmaven compiler plugin
https://gyazo.com/548139a81239eb78530b57456e1021b4
Why compiling im getting checkstyle issues? (Trying to Compile BungeeCord - Last version)
im getting this error in 1.17.1 and ive never seen it before
https://media.discordapp.net/attachments/810752039470235693/862819032515215400/1.PNG
check you rplugin.yml
what do i look for?
it says you have a null permission node, on the command probably
permissions:
betterkeepinventory:
its in there
i have the permission in the plugin.yml
so
permissions:
betterkeepinventory:
default: op
?
betterinventory: false
what does that do?
sets the default to false
permissions:
betterkeepinventory:
default: false
Anyone knows how line wraps are handled? The first one is with §f before the N.
How does the color actually affect linewrapping?
Not sure how you mean that. Shouldn't both cases be the same on my screenshot?
Or what causes the first version with the color to linewrap diffently?
oh nvm i am lost
probably some client sided mess
the client probably considers the first message as 2 different components concatenated thus it handles it differently, exactly how and why Idk but yeah
Can we be sure it is client side? Spigot does nothing on linewrapping?
afaik its client sided
Anyone else can confirm?
the client failed to recognise that Nutze is a whole word in the first one
because normally the client doesn't just cut words in half like that
and the small indent on the second line show it's word-wrapped
but that is only processed by the client
the server doesn't tell the client how to wrap the text
Ah alright didn't know if spigot would modify the message. Seems to be a client bug then.
Just weird, that the color is affecting it. Thx then!
can someone help me with a java problem? (not spigot related)
sure
my stackoverflow thread: https://stackoverflow.com/questions/68309275/using-interfaces-exclusive-method-to-compare-without-if-blocks
first of all, cache the Pattern
if endpoint is an instance of Endpoint, then it's not gonna be an instance of Nameable or Patternable
slightly confused with how you've decided to model this
class PlayerEndpoint implements Endpoint, Nameable
and I have:
class FileEndpoint implements Endpoint, Patternable
endpoints are actually http contexts
we to find files I use patterns
otherwise using context name
what does this mean?
So you're trying to linearly search for something which can implement any of those interfaces by matching pattern or name?
yep
if subclass of endpoint and instance of patternable, then i use that pattern method
otherwise simply compare names
I don't see the problem really
let me give an example then
"localhost/player" this goes to player context (simply loops the list and find the one that has the name of "player")
myeah
but if i want to get a file from the server like
"localhost/file/to/path/file.yml"
then I need to use a pattern
Seems to be a bit overcomplicated.
excuse me? but I have this code... ```java
private Main plugin;
private ItemStack compass = new ItemStack(Material.COMPASS);
public Hunter(Main plugin) {
this.plugin = plugin;
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(sender instanceof Player) {
this.plugin.hunted = args[0];
}
return false;
}
@EventHandler
public void onRespawn(PlayerRespawnEvent e) {
Player player = e.getPlayer();
player.getInventory().addItem(compass);
}
@EventHandler
public void onClick(PlayerInteractEvent e) {
Player player = e.getPlayer();
Material held = e.getItem().getType();
Action act = e.getAction();
if(!(player.getName().equals(this.plugin.hunted)) && held == Material.COMPASS && (act == Action.RIGHT_CLICK_AIR || act == Action.RIGHT_CLICK_BLOCK)) {
Player hunted = player.getServer().getPlayer(this.plugin.hunted);
player.setCompassTarget(hunted.getLocation());
player.sendMessage(ChatColor.GREEN + "Now tracking: " + this.plugin.hunted);
}
}``` It is supposed to give me a compass when I respawn but it didn't I have been trying to figure it out but I couldn't
btw cant Patternable#getPattern return a Pattern type instead?
TheCaptainSleepy, you could spare the ifs in the filter by polymorphism.
When you add a method to Entpoint that would return a boolean.
but this is the part that is supposed to give me the compass ```java
@EventHandler
public void onRespawn(PlayerRespawnEvent e) {
Player player = e.getPlayer();
player.getInventory().addItem(compass);
}```
sure can do that but still how can I get the endpoint?
from the list
i would just have a common interface for this with a method like matchString which returns a boolean, then have Patternable or Nameable actually implement the comparisons
maybe wait a tick, the player might be in an inconsistent state depending on when the event is called
makes sense tho
lol
how couldn't i think of that
Sometimes its the obvious things.
what?
give the compass a tick later
the player may not have respawned yet when that event is called
how should I do that?
so now, i have this:public interface Comparable<T> { <T> boolean compareTo(T type); }
Pattern getPattern();
}```
and same thing goes for Nameable but with String type
using this way, I must create compareTo method for every subclass of Endpoint
hello?
hello
use a bukkitrunnable
I thought of something like
interface Endpoint {
boolean matches(String stringOrPattern);
}
//then
.filter(endpoint -> endpoint.matches(stringOrPattern))
can you give example
that was what I had in mind
you can easily search up how to use it
This tutorial will guide you in using the scheduler provided by bukkit. It will allow you to defer the execution of code to a later time. This is not the same as registering a Listener, a block of code which is executed in response to an event in the game. Blocks of code may also be scheduled to be executed repeatedly at a fixed interval, with o...
Idk might wanna make the stringOrPattern to a separate object but yeah
that's allowed right?
lol
you're free to update it
lol
though most current information would be dumped on spigot's wiki now
yeah
so I must create matches method for every sub-Endpoint?
what about an abstract class
that implements to Endpoint
sure but you could have a base class that has a default match method
and I use that abstarct class
or just supply a Predicate
you can have classes like PattenedEndpoint and NamedEndpoint whiuch implement that if you want to take that approach
what does this mean
class EndPointImpl implements EndPoint {
final Predicate<? super String> predicate;
EndPointImpl(Predicate<? super String> predicate) {
this.predicate = predicate;
}
public boolean matches(String stringOrPattern) {
return predicate.test(stringOrPattern);
}
}```
tho thats not a good solution
how about that?
abstract classes create powerful abstractions
base class is just straight inheritance
myeah abstract class is better here
in maps, lists should I use Endpoint or AbstractEndpoint
i guess i will go for Endpoint interface
yes
why not a default implementation in the interface?
is that possible?
is it like this ```java
BukkitScheduler br = plugin.getServer().getScheduler();
Player player = e.getPlayer();
br.scheduleSyncRepeatingTask(this.plugin, new Runnable() {
@Override
public void run() {
player.getInventory().addItem(compass);
}}, 3L, 0L);```
there are multiple implementations he wasnts tho
to match via pattern and just stright up with a anme
like
if (this instanceof Blah) {
doSmnt();
}
you don't want it reperating
repeating
sure that would work but kinda defeats the point
how do I stop it from doing that?
then he can just go with the original one
that's what I don't want to do
well you're calling the scheduleSyncRepeatingTask method
yeah
that will make it repeat
LOL
ever 3 ticks
this guy
anyways TheCaptainSleepy feels like you don't need the abstract class
what
so what method should I use to stop that?
just have the interface?
yup
and nameable, patterable
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
class NameableEndpoint implements Nameable, Endpoint {
}
class PatternableEndpoint implements Patternable, Endpoint {
}```
just this?
or my bad, maybe the reply method is the same regardless
well in that case go with the abstract class
i will try that abstract class first
my brain has stopped
can't do shit
please tell me that cursing is allowed here
i don't want to get punished for "shit"
of fucking course it is
ah my innocent ears!!!
the dude is able to hear text
lmao
I smell colours too 🙂
void reply(HttpExchange exchange, Map<String, String> parameters, boolean prettyPrint);
}```
```public interface Patternable extends Comparable { // I seriously suck at naming
Pattern getPattern();
@Override
boolean compare(String str);
}```
```public abstract class PatternedEndpoint implements Endpoint, Patternable {
private final Pattern pattern;
public PatternedEndpoint(Pattern pattern) {
this.pattern = pattern;
}
@Override
public Pattern getPattern() {
return pattern;
}
public abstract void reply(HttpExchange exchange, Map<String, String> parameters, boolean prettyPrint);
}```
it doesn't require to add Comparable's compare method to any sub classes
even if I remove it from Patternable
sooooooooooo
I mean PatternedEndpoint doesn't inherit Comparable's compare method
Comparable is my custom class
oh wtf why lol
I guess
but just implement a Predicate<String> at this point
or extend
gonna use it like that
but the problem is it doesn't require that, it's like bukkit's onEnable methot
I want it to be required
no errors
because it is abstract
here removed
implementations of your abstract class will have to implement it
implements doesn't work tho
if yoy don';t implement it t
keep your override there
seems like you've made a mess of it though
but it is required when you come to create the base class in the example you provided
did you try it?
if yes what is your language level
i use 8
it is true for 8
that is what i said after all
it's 2:47am here and I didn't even see that message
welp
sorry
no worries
seems redundant
yep
alr, last question how may I pass that reply method to subclasses
I must use abstract right?
I mean make that whole class abstract
yes but your class must also be abstract
I remember something like passing method to subclass without using abstract
you should probably have reply defined in Endpoint instead
then you don't need to write anything for it then
i twill
anything not implemented in yhour abstract class will need to be implemented somewhere later on
how should I leave this class then?
just get rid of the line altogether
like that?
no because you've created an implementation there
get rid of the whole method
and make your class abstract
no problem
Does Anybdy here use aternos?
Dont ask in every channel
go to #help-server, as this is for development
aternos support may be better either way
?cc add scheduling https://www.spigotmc.org/wiki/scheduler-programming/
Custom command successfully added.
?scheduling
send it from your player
or preferably use the worldeditapi
but its kinda overkill
Player#performCommand("/set " + args)
hmm
Hello, I started to create a plugin for spigot 1.17 based on the version of my plugin in 1.16, but it seems that I cannot add items in the inventories (whether it is a player inventory or other (ex: dropper))
to add an item in the inventory I used:
dispenser.inventory.addItem(item) (kotlin)
It worked with version 1.16 but not anymore (and doesn't give me an error)
Has the method changed for 1.17 or is this a bug?
big brain only using / because // is the normal command but sense you are using player.performCommand() it auto uses a / so there is no need for a // in the player.performcommand 🤣

Is this the right way to load info from config.yml?
seems suspicious but I can't think of anything better
Pretty much
can cnyone help me i m compliling a maven project
but this error is comming
anyone 😭
Can you pastebin the pom.xml as well?
Ah, found it on GitHub. It requires the specified Spigot JARs (https://github.com/Indyuce/bounty-hunters/blob/master/pom.xml#L69-L172) when building, and since it's using scope provided for those, you need to place them on the classpath. You'll need to either run BuildTools for those, name them correctly, and place them in the correct place or modify the POM (and potentially code) to work around it (for example, if you only want to build it with 1.17 support, you can probably drop the other version and the related code.)
you can probably drop the other versions (from the POM) and the related code
By deleting the references to it. If you're not familiar with plugin development though, it's not going to be an easy task.
????????
ahhhhhhhhh
😭
like do i just have to delete the other versions from that pom.xml
?
You'd need to delete any code in the plugin that references them as well. Of course, you'd still need to place the 1.17 JAR on the classpath for it to build.
The easiest solution is probably just building all of those versions of Spigot and using your IDE to put them on the classpath.
Sorry, but not something I have the time to do, unfortunately.
😭
that just sounds so confusingggggggg
Who on earth manages dependencies that way
Yeah, it looks rather archaic. Guessing they're using NMS, otherwise why not use the public repo for the API JAR?
like if i download it from dark spigot just saying will it still be piracy ?
cuz its open source
Don't go on bs
Likely so, as I don't see a license permitting it. And of course, you'd be risking malware.
hmm
If you call yourself a developer you can always decompile the jar before using it
To test for malware
i dont
Why are you trying to compile maven then
cuz this plugin is paid
Might recommend using the free version. https://www.spigotmc.org/resources/bountyhunters-legacy.40610/
i need for 1.17 tho
It says 1.13+, so perhaps it will work if you haven't tried it yet?
nope
It will work with 1.17
but will it really work
then why r there 2 diff pluigns
1 premium n 2nd this
hmm
Just give it a go lmao
ok will try this
Worst case scenario doesn't work
like the features r the same lol
idk like the front page is completely same
Just try it
Hmm, I misread on the provided scope. So, it's trying to search public repos for those Spigot API JARs, but of course they're not there, at least the way it's configured in that POM... You could try updating the POM to use the Spigot Maven Repo and API JARs from there if you wanted. The example at the bottom of this page has all you need; you'd just need to update things accordingly. https://www.spigotmc.org/wiki/spigot-maven/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
[10:08:39 ERROR]: [BountyHunters] Your server version is not handled with NMS.
[10:08:39 WARN]: [BountyHunters] Loaded class me.clip.placeholderapi.expansion.PlaceholderExpansion from PlaceholderAPI v2.10.9 which is not a depend, softdepend or loadbefore of this plugin.
[10:08:39 INFO]: [PlaceholderAPI] Successfully registered expansion: bountyhunters
[10:08:39 INFO]: [BountyHunters] Hooked onto PlaceholderAPI
[10:08:39 ERROR]: [BountyHunters] Couldn't load Vault. Disabling...
And suddenly, I come to the realization that it's been about a year and a half since I've worked with Maven much...
Ah, so it is using NMS, so scratch the idea about updating the POM to use the Spigot Maven Repo.
so nothing cn be done?
You could still build the JAR(s) with BuildTools, then mvn install it to your local Maven repo to get it to build.
just a sec let me try
gtg
anyone who can compile a maven project for me SORRY FOR BEING SHAMELESS 😭
install maven, open a terminal in the project directory, type mvn clean package
i did it all
...
nope like i did it all in cmd
now the thing is that i m exhausted i have been doing it since yesterday
now the only hope i have is that someone does it for me
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html Instructions here on how to install Spigot JARs to your local Maven repo. The first command on that page is the one you want. <packaging> would be jar for this, the rest of the parameters should match up with what's in the pom.xml (and of course, <path-to-file> being the relative path to the JAR that BuildTools generated for whatever version you're installing to your local Maven repo). Try it for 1.17 first, then if it still complains, try removing the older versions from the POM. If that breaks the plugin, add them back and go through the process to mvn install all the other versions as well, I suppose. Aside from that, I think your best bet is to just buy the plugin--gotta put in the work to DIY otherwise in this case.
[10:08:39 ERROR]: [BountyHunters] Couldn't load Vault. Disabling...
why does this guy use spigot-src
What's that
looks like you can just delete all the other versions which is just deleting from pom & removing the respective wrapper class
then build 1.17 with buildtools, and add the proper 1.17 depend cause this src one looks pointless
How can i change that
@quaint mantle like what do u mean but dependencies i have hosted servers before but never had to do all that
also looks like the github repo is 1 update behind
other then that, the steps I said do work
Delete these
where will i find these
Delete all of these from the pom.xml. Make sure only to do the "spigot-src" ones, not the other dependencies
w8 a min
its under version/wrapper
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Paste this in the pom.xml dependencies section(Where the src ones previously were)
will have to run buildtools for 1.17.1 still tho
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
It builds the server & adds it to your local maven repositories
so this can be found
k where do i paste it?
w8 its git bash?
i do have it installed
its starting cloneing something
done
it said build successgul
now there r some files
what to do now?
then why did he ask to do that?
so like what should i do now?
nope
k
done
its deleting
done
now
?
-_-
was that useful?
i mean the files i deleted
were they of any help?
so do u think i wont be able to redownload it
no those only existed so it works on those versions
if you don't need to run it on those versions they are useless to you
w8 a min a dev
sent me a file
of complied bounty hunter
but i am confused it could be a malware
can anyone help?
If you're that worried either decompile it or compile it yourself
No one is telling your to run it
Maybe don't open files from people you don't know....
ufff it worked
At least do a virustotal check
Just because it worked doesn't mean there isn't malicious code
lol
It could have a backdoor to forceop people
Or it could just run code to slow down your server without you noticing
well i m just making one idc if it does that like i was just worried bout data issues
"data issues"?
lmfao
I love how mfs download things off of black spigot when it's open source on github
like what
this guy
or the "dev" did
what is it suppose to do
nope even dark spigot does not even have that version
question is infect it with what?
like there was a paid pluign it had a open source maven project i m dumb so i was not able to compile it
so a dev did it for me
so i used his file
thats it
Just replace "a dev" with "the guy who has full access to my PC now"
^
-_-
All because you're too broke to buy a plugin
yes i m
Get some money then lol
nothing wrong with that tho lmao
Just compile it yourself
can you get the .jar of the github
nope there is no .jar for it
What were you using to compile it?
Just google java decompiler
then mvn install
There's tools to do it for you
let me see
question: do you know this dev in real life or been friends with him for year or 2?
LeL
Have you seen him make anything in Java?
nope
scan your pc with windows defender and I suggest (malwarebytes)
I want to decompile it
i compiled it for him i would never backdoor it
done dm;ed it
@cold heron lies
what i did is i removed all his spigot dependencies added the normal spigot 1.17 nms dependency and deleted all the other wrapper classes from other versions
then it compiled perfectly
Perfectly?
tysmmmmmmmmmmmm
How does one define perfectly
without errors?
You didn't get one single error?
it wouldnt have compiled…
How did you compile it
maven
why
So I can learn
i did mvn package in my terminal
how can i setup, that in a bungeecord network a play joins everytime on the lobby server and not on the lastest server he was on?
force default server in bungeecord config
ok
but what is when i set it to true?
@summer scroll
how can i lock commands as /plugins or /spigot or /? ?
You could use permissions for that
and what is the permission for this?
for /plugins it is bukkit.command.plugins I think
anyone know the easiest way to add prefixes to Tab?
I think you could use teams
whats wrong with this if statement thats making it not work
https://hastebin.com/guzozixute.java
im trying to disable /home within 1000 blocks of spawn
and for some reason its just disabling it everywhere
Well that's not going to work
There are negative cordinates you know
And you put an or
Put an &&
.
hmmm
any idea how to do a permission on a item
PlayerInteractEvent / EntityDamageEvent
yeah just figured that out lmao
Like I know how to do the right click event and all that , I have an idea but hmmm
i download the DAILY, WEEKLY & MONTHLY REWARDS | PAPI SUPPORT [1.13 - 1.17] 1.0.7 plugin but i didnt know how to change the rewards
Most likely nobody here knows how to do it, or even what plugin you're talking about. Ask the dev for support
is there a config for it?
can I use
Bukkit.getConsoleSender().
to run a command or do I need to do something else.
If you want to run as console use that
I'm having a command runned when a player right clicks
so I believe i'm going to use console
If you want to execute a command you could use Bukkit.dispatchCommand(CommandSender, String). If you wan to execute the command as the console you can use Bukkit.getConsoleSender() but you can also execute the command as an player by passing the player as the CommandSener
Ok
Have you opened it in explorer?
I opened the config.yml from it
If you dont find the program that causes this just restart your computer. Windows is sometimes buggy :/
I closed the file and it's working I just forgot I had that open
Ah ok
and I have 20 tabs open so it was hard to realize that
Did you register the "wether" command in your plugin.yml file?
configManager.getConfig().getStringList("plugin-banner").forEach(line -> Bukkit.getServer().getConsoleSender().sendMessage(Utilities.color(line)));
Seems like the configManager.getConfig call returns null. Did you write the ConfigManager class yourself or is it from a libary? Why arent you just using JavaPlugin#getConfig()?
?kick @subtle kite advertisement
Done. That felt good.
is there a short way to check in the blockbreakevent if the broken block is a log?
i mean instaceof Tree is deprecated
Yes You can use Tag.LOGS.isTagged(Material)
Just pass the material of the broken block to this
EDIT: The method name is isTagged() and not contains()
Are you able to unload the default world?
public void onPlayerDeath(PlayerDeathEvent event){
for (Player player: plugin.getServer().getOnlinePlayers()) {
player.kickPlayer(event.getDeathMessage());
}
plugin.destroyWorlds(event.getEntity().getWorld());
plugin.createWorlds();
}
How can I see if the server is in offline mode or online mode?
You can view the source code of the unloadWorld method here: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/CraftServer.java#1066
As you can see you cant unload a world if it has more that 0 players OR it it is the overworld
sigh
I think you can use Bukkit.getOnlineMode()
oh, thanks
No Problem 🙂
why do you want to unload the default-world? that's in most cases not needed
oops, wrong message answered
meant to answer to this
Will the plugin I am developing right now work on older version? like 1.8
depends on what you're doing
Use something like via versions and it's save
but i'm pretty sure that api-version from the plugin.yml will make it not enabling
If I test it and it works then I am fine?
Ye
oh
Yes obviously
if you do stuff that isn't different in the versions, for sure it will
if you do, you need multiple code for every versions i guess
Rivex u code mods right btw?
is the api-version a problem if I am going to upload the plugin?
well, not directly
Or maybe I was mistaken
i'm coding a client. but i'm not using any modloaders
Ah fair
What is the nams of the client you code?
Uh okay and why do you code it when you make no money with it or don't publish it?
to use it? lmao
Okay xD
so i don't need to pay 13€ for badlion cosmetics lol
i don't have to make money out of everything i do lol
badlion cosmetics
yea
Yes lmao
they actually indeed to lol. to tell their favourite youtubers DUD, I have your cape/wings/Halo/shield/everything
I Am A FaN
to be fair, i have 1 cosmetic too lol
I have two cosmetics lol
but never play badlion, so pretty much dumb to buy it
i have never used it
nvm, i have to aswell i gues? lemme see
but not from YouTubers xD
those badlion update take even longer than normal minecraft updates lol
lmao
if that's really downloadign with that speed, how big is it then lmao
:0
Oo
Does anyone have an example of adding custom tags to an entity?
Entity.addScorebordTag("something")
can anyone tell me... is my presence showing the name of any file right now?
seems broken
seems like the plugin was broken.. interesting
Thanks, but I'd like to add, similar to NBTTags with both key and value.
For that you could use the persistent data storage api: Entity#getPersistentDataContainer(). You can find a great tutorial about that here https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
Thank you ❤️
No problem 🙂
Solve
great
😍
When i break a log that is above a grass block will this replace it with an oak sapling?
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
Block b = event.getBlock();
if (Tag.LOGS.isTagged(b.getType())) {
if (b.getLocation().subtract(0, -1, 0).getBlock().getType() == Material.GRASS_BLOCK) {
b.setType(Material.OAK_SAPLING);
}
}
}
That code seems right to me
I think you'd wanna cancel the event tho
no, but if it isn't cancelled block breaking logic would still be executed
e.g. block drops
Huh but cancelling would prevent the player from breaking the log no?
but you are setting it to a new block
can someone give me a example of bukkit.dispatchcommand ,
i cant figure it out
Ah
if anybody has experience with custom world generation, is possible to use the default generator and change the way lava lakes are spawned? Like the chances
As far as I can tell you just can enable or disable vanilla world generation features like ChunkGenerator#shouldGenerateCaves()
yeah but wont just disable all caves?
the spigot world generation API is not that advanced sadly
changing partial decoration parts using the API is, afaik, impossible
In Bukkit there are diffrent types of CommandSenders. For example a Player is a CommandSender. The Bukkit.dispatchCommand() method takes a CommandSender that is used to execute the command and a Command. Example: Bukkit.dispatchCommand(player, "/msg someone something")
can a ( event.getplayer be a sender
ofc
Yes it can because event.getPlayer() returns an Player Object. The player class extends the CommandSender class so the types are compatible.
i mean, in which case?
event.getplayer was what I needed , Thanks
How could I check if user input respects my naming conventions (only letters, numbers and underscore) no other characters, is there a library that does this?
Regex time 👀
Having some trouble with vector, currently 2 locations are in db I want to store 2 vectors into List<Vector> someone knows how to ?
There are so many characters would take ages to check all of them
Well you have to check them
it might be faster to check if the input doesn't contain a character that I am allowing
probably
You could call String#toCharArray(). Loop through the characters and check one by one if the characters are valid. For that you could for example use Character.isDigit() or Character.isLowerCase()
I'll try this, thanks
prob not really the right way
You can have different classes for each command
Also a switch statement would be much better here
yea i'm not really someone who makes lots of classes for every command
some of them are very little
If you don't want multiple classes use a switch statement instead of that mess with if else
is a switch more efficient than if else?
so you guys like messy commands huh
try to create some sort of abstraction
I always have per command classes
jfc
🙂
all of that maps to this https://github.com/LMBishop/Quests/wiki/Commands-and-permissions#commands
i have one class for tabcompleters 💀
and i have one class for everything
😳
I've been meaning to refactor it for a while now, but I always end up doing some other meaningless change whenever I open the project#
I have used your quests plugin before though - it’s very cool
tis
I generally have a CommandBase class, that has tab completers etc, then I extend it for all commands so I can override
I normally just have a class for the command and a class for the tab completer per command
My plugins have never had enough args to require separate classes tho
like one oncommand method...
is it also a good way to make a class for command that can be executed with the console and a class without?
both players and console are instances of CommandSender
unless the behaviour of the command is drastically different then I don't see the need for different classes for similar behaviour
so i'm guessing
Bukkit.dispatchCommand(event.getPlayer(),command example)
doesn't run unless the player has is op
it runs as if the player ran it
just note that that would not run the command as the player
So a command such as "/healme" would not produce the expected outputs
Thanks for the help.
I made my own paper rank system 🙂
^
how was the player supposed to get the item from NBT?
wut
how did the player get this item?
a plugin probably
or any other type of modification
e.g a plugin writing to its persistent data container
data container?
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
used to store data
like remove ?
getPersistantDataContainer
stack.getItemMeta().getPersistantDataContainer()
beware on itemMeta being nullable and stuff
?paste
Hello i am getting error someone can help me what wrong?
https://paste.md-5.net/bojakozina.css
PVP.java:45
public static FileConfiguration DB = getCustomConfig("database.yml");
PVP.java:35
public static FileConfiguration getCustomConfig(String fileName) {
customConfigFile = new File("plugins/" + PVP.plugin.getName(), fileName);
customConfig = new YamlConfiguration();
try {
customConfig.load(customConfigFile);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
return customConfig;
}
is only on client :/
