#help-development
1 messages Ā· Page 2262 of 1
Having a bit of a weird problem. I'm trying to unpower a lever by setting powered=false in the lever-block's blockdata. It's working (like visually flipping the lever) but nearby redstone are not getting updated until a block gets placed/broken nearby them and triggers a block update. Is there a way to flip the lever so that it actually updates the surrounding blocks?
Skull headBlock = (Skull) event.getClickedBlock().getState();
SkullMeta head = playerHead.checkCustomHead(headUrl, headName, headDisplayName);
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (headBlock.getOwningPlayer().getUniqueId().equals(head.getOwningPlayer())) {
//code
}
}
what the issue?
Ba patient
As i always say instant support == paying someone or a team
You are not paying anyone to get fast help
I'm just showing my code if there's something wrong with it chill
Lmao what a lovely sociente we have
I'm not expecting anyone to help me
You already share the code
So be patient
You do it some minutes ago
If want to persis your message open a thread
im using the lamp framwork
and im using this java public class TestCommand { @Command("echo") public String echo(@Default("") String message) { Bukkit.getLogger().info("it gets here"); return message; } } Right, it logs that when i do that command. but the message does not get returned? anybody know why?
hello, is there a way for me using this api
https://www.spigotmc.org/resources/villagertradeapi.34146/
to create a custom villager trade, and i could open the gui using a command, not spawning a villager
This looks outdated. I recommend looking for other sources!
hi guys. i am trying to create a plugin that switches the player's server in bungeecord by commands
I get this
Attempted to send a plugin message through the unregistered channel BungeeCord'.`
here is my code:
`ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("survival");
if (sender instanceof Player) {
Player player = ((Player) sender).getPlayer();
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
}`
I found that:
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
should i do that in my spigot plugin?
Indeed
awesome, im on it. thanks
From a "best practice" standpoint, which revisions of each game version ought a multi-version plugin support? All of them, or just the final minor version (eg R3)?
For instance should 1.13 be supported as well as 1.13.1 even though the former is considered obsolete? Or should both of them be tossed out for 1.13.2 only?
Major changes only occur between major versions.
And supporting older minor versions makes no sense. Who would want to use a version where the only feature are more bugs?
So, the standard is only the most recent minor version of each?
Maybe they have a fetish for punishment
Just support the most up date minor version of each major version
You van also skip versions
Like 1.14 and 1.13
It will depend on my eventual development cycle. AFAIK supporting everything 1.13+ is fairly similar to each other
The major blockers are 1.8 and 1.12 which I might not even support
feel like the best way to go is last version of every major update
Don't bother with 1.8 or 1.12
Not worth it
Yeah there are a few big dividing versions where communities stack.
- latest only
- 1.16.5 + gang (16, 17, 18)
- 1.12.2
- buggy, outdated, useless garbage only (1.8.8)
Dont bother with anything below 1.16
With 1.16.5+ you cover >75% of the community
It's been a few years since I've been into spigot stuff so I'm glad the paradigm has finally shifted. I was once hired for a 1.8.8 server and I literally cried
You are probably going to hate yourself
I quit coding in 1.8 after I finished my first plugin
https://github.com/FlorianMichael/ViaForge/blob/forge-1.12.2/src/main/java/de/enzaxd/viaforge/protocol/ProtocolCollection.java simply take a look at this and decide ur versions ezpz
1.8 is a bubble. People in there think they are the biggest community and everyone just plays 1.8
yeah no i have no intention of supporting 1.8
They are the biggest community though
kappa 
Simply put they are the biggest community who actively believes they are the biggest community
Wtf is yatopia
wtf is CatServer
yatopia was bad
i wish i never looked that up
oh no
sponge is noticeably missing from the chart
that was the bukkit / spigot chart
ah
sponge has its own category on bstats
jeez sponge
wtf spigot stats were 50/50 on the offline mode
what are sponge players doing
Shady shit
what about spongeforge requires offline though
ive never actually used sponge at all
my server's in 1.9 and so is my plugin (launcher purposes)
1.9 š
well nothing really, but modded servers in general tend to be offline mode at least in my personal observation
huh, weird
I'm writing a plugin in a modern version, fully aware that there's a decent chance none of the people I'm writing it for will use it, since they basically only play on 1.8 lol
why not build towards the target audience then?
I was half joking lol. People are interested in playing an old gamemode in new versions, so I'm making a proof of concept so that people can test it.
but there's a decent chance most people wont want to update even if there was a functional plugin for a current version
for the same reason people still use viaversion instead of protocolsupport i guess
is protosupport better than via? :poggers:
Both bad
well no, my point is that viaversion generally allows new clients on an old server, vs protocol support supports old clients on new servers
They keep the evil alive
Why what about 1.9 makes it better than 1.18.2
i was commenting on server owners hate updating sometimes
via also allows old clients on new servers though
ViaBackwards exists
last i heard it was unmaintained
Someone lied to you
it got an update 5 days ago on git
most people who will play on my server are going to use a launcher that almost every uses in my country, and that launcher's version is 1.9
Change it to 1.18.2 you can through the launcher
oh :( just a build system update
the main reasons the community I'm in doesn't want to update are 1.9+ combat, and 1.12(?) swimming. Both are decently hard to replicate faithfully in newer versions
what is the proper way to add aliases to a command?
oh laast common's update was 21 days ago
plugin yml if you are using Bukkit command api
in the plugin.yml
Bukkit command api š
so i dont need to make any changes in the main plugin class, right?
No
I use brigadier
How to build jar file with name like {name}-{version}.jar?
<finalName>${project.name}-${project.version}</finalName>
Depends
Is brigadier nice
out of curiosity is there a new third option out there or something?
cough cancel this cough
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityToggleSwimEvent.html
declaration: package: org.bukkit.event.entity, class: EntityToggleSwimEvent
Itās provided into the server and itās fine. It doesnāt use annotations (and personally I prefer not to use annotation)
Nah, I was just talking about how those plugins ācontinue the evilā cause they support old versions
I'm not a huge annotations guy personally either because I like to abstract into configs which doesn't play nice with annotations
as far as I can tell, cancelling that does absolutely nothing
tysm
is there any way to override bungee commands in a spigot plugin? if players dont have access to ./server command, then it doesnt go through my spigot plugin
One of the cool things you can do with brigadier is that you can add argument coloring (like LuckPerms)
You just use commodore
LuckPerms uses brigadier btw
Nice
well i havent tried but afaik you swim like pre ocean update until you hit ctrl, so i assumed cancelling this would do it
lmc
oh bukkit command registry already adds the aliases from plugin.yml and im just stupid, nice.
couldve sworn i remember having to manually call setAliases
Do you know why no other api supports this besides brigadier
Because brigadier is used by both the client and server
Ahhh
bc bukkit commands bad
Canāt you just remove the hit cooldown and itās like pre1.9 (besides block hitting)
You don't have to shade brigadier right
You shouldnāt have to in newer versions
use commodore ezpz
Well commodore itself isnāt a command API
ik
Or how about you design your own custom combat system that actually has some depth and doesnt rely on minecraft bringing out new features for it.
It's a lot closer yeah, but there's still a lot of little differences that people dislike. eg. knockback is very different, arrows fire out of the center of your body and are affected by your momentum
im confused what u are trying to say
how is that relying on minecraft to bring new features?
All minecraft pvp systems are bad
by removing a feature they added
That 1.8 and 1.9 combat in minecraft is boring. Write your own stuff.
minecraft sword mechanics have always been kinda shallow but like anything else people have put a massive amount of time into them and now like them
ok i mean but why would i write a whole combat system if everything is in the game already and all that needs done is 1 feature removed
shit im not even trying to do this lmao
tell Oc_
Because then you can differentiate yourself from other servers and provide the user with a unique experience other
than clicking your mouse really fast like a moron.
I think a whole new combat system sounds cool, you don't need to convince me
but that's a hard sell to a bunch of old timers that are very attached to 1.8 combat mechanics
hey, it is what the people want brother!
Screw them. Let them play on the hand full of 1.8 servers that are still out there.
Target the actually big community. Not just the few 1.8 bobs.
Mojang already designed a entirely new combat system in 1.9, and people didnt like it
they just added crits
a vocal minority doesnt like it
Meh. Going towards <5%
Thats not a lot of people in my books.
at the crux of the issue I guess is that the core of the pvp community stayed behind and the casual player base kept going. And so now you have to pick sides, and leaving behind either is not that great
5% of minecraft users is a lot of people I would have to disagree
In comparison to 75% 1.16+
we should run a poll
Leaving behind 1.8 is great. They did slow down development of newer versions for almost half a decade.
Glad they are shrinking with every new day.
Those 1.8 people are going to die out eventually
They are slow of dying out but eventually they will be too deprived
Stupid mobile autocorrect
yea i was one of them but im not a player anymore so i guess that is most folks but im sure a lot of people still dev on spigot and keep the same opinions
the only servers running 1.8 now are hardcore factions
I see why people stayed on 1.8 for a while when I just play normally, but I felt that I always liked newer versions not just development wise, but also itās just the best to play SMPs on
Itās not fun to play 1.8
With SMP
yeah
now the case for a pvp focused server
pre 1.9 combat is preferred because 1.9 shrinks 'skill'(CPS) gap
you mean 1.8 shrinks skill
1.8 takes less skills combat wise then the other versions after it
I just don't have the confidence that there's a community for this gamemode in new versions. The gamemode here is very archaic, for a lot of people the only reason they're still playing it has atleast something to do with nostalgia. People have gotten incredibly good at a certain set of skills and changes to the game (improvements I mean). It's been in this situation for years and years and has only survived on the fact that the people who do play it, play a shit ton. Updating the gamemode would mean dropping almost the entire existing playerbase (which albeit is small) and replacing it with an entirely new one
Calling cps a skill is the kind of problem i have with 1.8
I can simply bind attack to my mouse wheel and unlock it.
16-18 cps no problem
lmao i never even thought of that wtf
I would agree on that
all my days
I would have to hard disagree here, but it's probably not an argument worth having
I have one of those wheels that can be unlocked and spun for ever
same
either way we shouldnt argue over these opinions... the whole argument is whether or not people want to play on 1.8
and they do
because we have seen them
Could anyone explain it to me why is it not working?
CraftBlockState cannot be cast to class Skull
Block block = event.getClickedBlock();
Skull head = (Skull) block.getState();
I have a 7 button mouse
Well... a minority does
a minority of people play any kind of server
Nor is spigot the server software to use for 1.8
doesnt mean they shouldnt exist
Wrong import probably
org.bukkit.block.Skull
the main problem of those that run 1.8 is the majority of those minority still keep coming here for support because they don't have a clue in what they are doing, or simply don't or refuse to understand that any problems encountered in obsolete versions, is solely on them to fix or resolve themselves
Yea, if you wanna run older versions it is a necessity to find a fork of spigot that is maintained for that version
I tried to update a 1.8 forge mod to 1.19 and I gave up heeheehaw
I think the solution to that problem would be add 1.8/1.7 combat as some kind of option in spigot by default perhaps?
there is plugins that exist already for it
then everyone would run newer versions
Wouldnāt matter either way cause owners are lazy
Plugins already exist as said above
And another problem is that they always come here for the same reasons.
Hey i wanna write a [KitPvP, GenericMinigame, FFA] plugin. How i do that? The other 24 plugins on spigot are not enough.
Adding a feature would not help
it's a client thing as well
true
The same thing was already suggested for vanilla and that didn't happen. Spigot tries to remain as close to vanilla as possible, so it's unlikely that they would implement such a feature.
at least with 1.7
I mean, /pray that Mojang goes forward with the combat snapshots one day lol
idk why nobody ever comes in here asking about 1.7. its better than 1.8
Oh no
when 1.8 came out it was a big deal cause they took out block hits
I think they've been fairly abandoned
Donāt
š¤”š¤”š¤”š¤”
you absolute troll
1.7 is worse by all means
it is the version that was DMCA'ed
block hits are so satisfying
The only reason it would be better is modded play style lol
1.7 didn't even get the log4shell fix did it
But never ever in any other circumstance
Isnt asking for 1.7 a bannable offense?
we had a hard time updating from 1.7 to 1.8 because water pushing tnt entities was too big of a change for people lol
Lmfoa
guys guys, hear me out.... 1.0
Good
was 1.7 even using log4j?
Still sad spigot patched 1.8
I have only this import
import org.bukkit.block.Skull;
I still think that the log4shell could have been a great cleansing
Thats the right one
It could have been
The purge
Someone should have made a movie
Tom Cruise climbing up a building to prevent the USB stick that contains the fix to reach the update servers for 1.8
Lmao
Kekw
one day we might have one
with as much history there is involving MC that isn't in MC, there is enough material for like 2-3 movies XD
It's gonna be a fitmc video isn't it XD
Do you make shure that you only cast for skull blocks? Like at least a material type check.
I tried to do 1.8-1.19 and just gave up and have started a rewrite. The github repo has comits >10 years old and it's still actively being used lol
Lol
On the oldest..
anarchy
server
in
minecraft
I hate this
i love it
I like that
Anybody have any clue about this btw? I'm banging my head against a wall here
i like and subscribe that. Migh even hit the notification button
if I make a movie, it wouldn't really be much of a movie, but rather single player maps that you have to play through and you get to learn about historical stuff
You can try changing a block by simply placing the same BockData on it again.
I think that's kinda what I'm already doing?
Block block = location.getBlock();
BlockData data = block.getBlockData();
Switch sw = (Switch) data;
sw.setPowered(powered);
block.setBlockData(sw,true);
block.getState().update(true);
Block attached = block.getRelative(sw.getFacing().getOppositeFace());
attached.getState().update(true);
(I'm also trying to update the block that the lever is attached to in hopes that would help)
InventoryView
You need to use the InventoryView to get the title. InventoryView#getTitle()
You can get the view from the InventoryClickEvent using #getView()
However, it should be noted that if you are trying to use the inventory name for comparisons, you should instead opt for inventory instances themselves.
I'll google that, thank you
ItemStack head = new ItemStack(Material.PLAYER_HEAD,1);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
headMeta.setOwner(player.getDisplayName());
head.setItemMeta(headMeta);``` is it normal to use skullmeta for a player's head and not skull ?
You better not be comparing inventories with titles
Lol
i'm comparing strings to titles
Yes, this is normal. However, you should be using Player#getUniqueId() instead of Player#getDisplayName() when setting the owner of a skull.
It requires a string and not a UUID though
Oh right. SkullMeta#setOwningPlayer(UUID uuid) is what you'd want to use.
Just create it from the uuid
okay
Bukkit#getOfflinePlayer(UUID uuid)
getOfflinePlayer() gets both online and offline players right ?
No, it just gets an instance of OfflinePlayer .
OfflinePlayer headed = Bukkit.getOfflinePlayer(player.getUniqueId());
headMeta.setOwningPlayer(headed);``` I have that
i know I can optimize it but my point is does this work ?
Try it and see. It should as long as #setOwningPlayer accepts a OfflinePlayer instance.
You do if your method calls for an OfflinePlayer instance. Which SkullMeta does.
Is there a way to store Gameprofile? I dont want to generate it for Skull because i have already placed some, I want to generate it once then load it everytime i reload the server
Or is it better to store positions of placed Skulls
I use NMS for custom texture
ah
oh wait i was sending that for @trail oriole anyway
not U smh
but also i think theres something on spigot forums for nms heads
How can I optimize reading a text file/make it asynchronous? I have a really large text file thatās about 30mb and upon reading it, the entire server freezes because itās so large (it contains a 50x50 map). How can I optimize this or at least have it run in the background to prevent server lag?
Why do you have a map, that's most likely in string form, saved to a single file?
Also, depending on what you do with that data, you may need to split the process up synchronously as some functions such as block modifications are not thread safe.
If you need to make it asynchronous (for file operations), use CompletableFuture and then use callSync on the asynchronous thread
is it like a schematic file lol
There is also a good tutorial on splitting up tasks with large block operations on the forums.
https://www.spigotmc.org/threads/guide-on-workload-distribution-or-how-to-handle-heavy-splittable-tasks.409003/
Solved heh
woo
?workdistro
š
Ok
engineer
Never would have guessed that was a thing.
Would have saved me some time trying to find it. lol
what events would I need to cancel if I wanted a skulker box to be unable to be placed? Just player placing and dispenser dispensing? or are there other events?
Anyone knows if https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#kickPlayer(java.lang.String) supports chat color?
declaration: package: org.bukkit.entity, interface: Player
BlockPlaceEvent & BlockDispenseEvent. I'm not aware of any other ways to place a shulker box down in the world.
thank you that is what i though and found from my research.
You could
Try and see
Yup I could
I'm pretty sure it does as long as you use ChatColor#translateAlternateColorCodes()
I'm asking trying to avoid the hassle lol
ty (:
How to change Material of BlockData when chaning Skull? It works with any other normal block just not with Skull
Skull IS a Material
I'm getting this error when I don't have ProtocolLib even though it's only a soft dependency. If I comment out adding the packet listener it doesn't give me the error but that doesn't make sense to me because that should only trigger if I have the plugin https://paste.gg/p/anonymous/2111a333f9124c249cf1001f80ecb1b2
https://imgur.com/a/rpfGx6r
Your importing classes that can't be found and it's getting confused on runtime iirc you can't structure code like that
Also If your telling the owner they need it anyways just send logging with the error that's readable
The Listener is fine, but you import Protocol stuff so you have imports. Move everything into your Listener class
is there a way to call a datapack mcfunction from a plugin?
Hi I'm extremely new to coding and trying to find a working replacement for vault as it doesn't work with 1.18.2 currently, not unless it has a dependency that I'm not aware of? Please and thank you!
Vault works fine
vault works well for 1.18
If i put it in it doesn't show up using plugman
Dont use plugman. Dont reload your server.
Restarting is the only thing that is supported.
And if its not listed in the spigot plugin list (/pl)
then its not in the plugins folder. Its either red or green.
Red or green?
Text color of the plugin name
Thank you! I don't really know what I'm doing š
:dynoError: The Fun module is disabled in this server.
Listen please, I'm a beginner in plugin creation and I have an error. It's a very simple error to fix but I don't understand people who explain how to fix it. If someone wants to help me, please, can I send you the code and can you just tell me what to write and where to do it
Did you learn the very basics of java before jumping into spigot?
Alright then paste your code here
?paste your code
And tell us whats wrong
i have this Exeptions:
Caused by java.lang.NullPointerException: Cannot invoke "fr.sniper.developer.developer.db.Database.findPlayerStatsByUUID()" because "this.database" is null
The classic Nullpointer...
i know it's simple to fix
Then "this.database" is null
Well... make sure you initialize the "database" variable before you use it.
Otherwise the content will be "null" and doing anything with a null object results in a null pointer.
If you show us the full error we can tell you what code we need to see
Listeners.java class > https://paste.md-5.net/fuyolugowa.java
two constructors taking different args
You have two different constructors. Only one is used.
Put both your variables into one constructor.
public Listeners(main main) {
this.main = main;
this.database = main.getDatabase();
}```
Just for your information: This plugin is only useful as a lag machine. It will cause lag with only one 2 or 3 players online if they are actively mining.
i know
Synchronous database queries.
Just allow me to test something
IO should never be done on the main thread.
No writing/reading files, no database requests, no http requests.
No shame in making mistakes. The best way to learn is to make them and be told what's wrong.
Like this ? public Listeners(main main, Database database) { this.main = main; this.database = database; }
if database is available from main just get it in teh constructor as I showed
dont name your main class "main"
whats your plugin name
SkyCoins
Then rename Main to SkyCoins
looks like your class name starts with a lowercase? that's not good either
apps have a Main class. Plugins are extensions so should have no Main
It's correct to write this in my main class ?Objects.requireNonNull(getCommand("mmcc")).setExecutor(new Listeners(this));
kind of. You need to store the reference to teh new Listeners as you also need to register it.
Generally this is fine. But Listeners is not a command i assume
as your Listeners has a command and Listeners
the error still remaining when I use /mmcc add <Player_name>
Where do you create your database in main?
Here my main class code: https://paste.md-5.net/pohoxicavu.java
getServer().getPluginManager().registerEvents(new Listeners(database), this);
Objects.requireNonNull(getCommand("mmcc")).setExecutor(new Listeners(this));```
You are creating two instances of Listeners
Listeners listener = new Listeners(this, database);
getServer().getPluginManager().registerEvents(listener, this);
Objects.requireNonNull(getCommand("mmcc")).setExecutor(listener);```
or fi you changed yoru constructor...
edited
but wait
database is available from Database.java
I wish intellij would stop recommending Objects.requireNonNull people don't understand it's purpose 
No thats not what I showed you
ok ok
i made this
Listeners listener = new Listeners(this, database);
i write this in main.java but the error is still here
at fr.sniper.developer.listener.Listeners.getPlayerStatsFromDatabase(Listeners.java:48) ~[?:?]
at fr.sniper.developer.listener.Listeners.onCommand(Listeners.java:165) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
... 20 more```
oh that class name is hurting me
i dont know why
Any creative people here have an idea what I could call a troll command that spawns an entity twice after it has been killed?
martyrdom
does it have a meaning? :D
because this.database is null
whats wrong?
Ƭ have this error Caused by: java.lang.NullPointerException: Cannot invoke "fr.sniper.developer.db.Database.findPlayerStatsByUUID(String)" because "this.database" is null at fr.sniper.developer.listener.Listeners.getPlayerStatsFromDatabase(Listeners.java:48) ~[?:?] at fr.sniper.developer.listener.Listeners.onCommand(Listeners.java:165) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?] ... 20 more
ok now main class code
i have this error when i tried the command: /mmc add <player_name>
problem lies here
private Database database;
public Listeners(main main) {
this.main = main;
this.database = database;
}
because you didn;t do as I said
Why is main lowercase
don't beat me guys
You should stick to java naming conventions tho
in your main add java public Database getDataBase() { return this.database; }Then use the constructor I showed you right at the beginning.
Sorry to butt in again but does anyone know a good way for plugins to talk to each other
?
im sorry, what
Lemme explain
?jd-s
I have 4 custom made plugins but I need to share a boolean between them all
apis?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
š
im too high to drive
I'm guessing just adding a discord bot could also work?
And having a specific discord text channel?
Sounds overkill but I know how to make discord bots with JDA easy
?
Now that you mention it
Are there any good tutorials on how to implement a discord bot to your plugins? To log stuff to a text channel or smth like that
It's pretty easy. Just make a thread and run it on that
Yeah
oh okay
Thanks, (I forgot how threading works in Java lmfao)
is this ok ? ```public final class Main extends JavaPlugin implements Listener {
public static Main INSTANCE;
private HashMap<String, Integer> scplayers;
public String prefix = "[SkyCoins] ";
private Database database;
public Database getDataBase() { return this.database; }
@Override
public void onEnable() {
scplayers = new HashMap<>();
getConfig().options().copyDefaults();
saveDefaultConfig();
this.database = new Database(
getConfig().getString("database.host"),
getConfig().getString("database.port"),
getConfig().getString("database.user"),
getConfig().getString("database.password"),
getConfig().getString("database.database_name"));
try {
this.database.initializeDatabase();
} catch (SQLException e) {
e.printStackTrace();
System.out.println(prefix + "Could not initialize database. Check the config.yml file");
}
Listeners listener = new Listeners(this);
getServer().getPluginManager().registerEvents(listener, this);
Objects.requireNonNull(getCommand("mmcc")).setExecutor(listener);
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
yes, so long as you also fixed your Listeners constructor
public Listeners(main main) {
this.main = main;
this.database = main.getDataBase();
}```
OMG, it work
thank you so much bro
also if your database fails to init you really should shut your plugin down too otherwise you'll just be stacking errors
ok
I'm kinda confused atm, isn't there a way to get an entity's health?
what type of entity?
cast to LivingEntity getHealth
makes sense, ty
Is this how to set a living entity's health back to full health since #getMaxHealth() is deprecated?
livingEntity.setHealth(livingEntity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
yes
I'm having some problems in the EntityDamageByEntityEvent when the player hits critical. Every time the player hits critical the entity is killed instead of running this code
if (e.getFinalDamage() > livingEntity.getHealth()) {
livingEntity.setHealth(Objects.requireNonNull(livingEntity.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getValue());
p.getWorld().spawnEntity(e.getEntity().getLocation(), e.getEntityType());
}```
The ServerConnectedEvent in BungeeCord is executed when the connection to the server is established. This does not mean that the player has successfully logged in, it only means that the request has been accepted. I would need to know when the player has actually joined the server, is there an event or a method to find out?
= to cover edge cases? If they have 10 health and you deal 10 damage that won't fire
Thanks, added that. The entity is still dying if I have a critical hit
Did you cancel the event?
Cause setting it to max health doesn't stop the damage from killing it
Or set the damage to something less than lethal
Cancelling seems to do the job, thanks! :)
With a discord bot you need to use maven for it to work but will my minecraft plugin complain about it?
About maven or the discord bot?
Maven
If you use maven then you should never manually add any other jars
to your project. You should only use maven for all your dependencies.
So this is going to be painful?
You can use any package manager to do it. Maven is the most common
Adding jars and building artifacts is the beginner way of simplifying it.
If you are a bit more experienced then you never have to worry about downloading jars anymore.
You just write some lines in maven and are done.
Ohh
Pretty much everyone here uses Maven or Gradle for spigot development
I recommend the minecraft dev plugin for intellij.
It generates a clean maven, spigot project for you where you can add more dependencies if you want.
Oh I have that
I just don't know how to start
Do I start a new project like this or use maven?
This will create a maven project
What's group and artifact ID again?
Thanks
Hello, simple question ``` if (args[0].equalsIgnoreCase("check")) {
if (args.length >= 2) {
Player target = Bukkit.getPlayer(args[1]);
try {
PlayerStats tStats = getPlayerStatsFromDatabase(target);
sender.sendMessage("§6" + main.prefix + "§e" + args[1] + " §ehas§6 " + (tStats.getSkycoins()) + " §6Mistycoins§e.");
} catch (SQLException e) {
}
You catch the exception and send the sender a message...
like this ? } catch (SQLException e) { sender.sendMessage("§6" + main.prefix + "§cThe player (" + args[1] + ") not exist in the database."); }
You should not use exceptions for functionality. Thats extremely dirty.
Or you handle cases where no data is present by returning null in the getstats method
} catch (SQLException e) {
sender.sendMessage("§cAn exception occured. Please report this bug.");
e.printStackTrace();
}
ok ok
This very much the wrong place but would just add another dependency for JDA?
Yes
All bigger projects are on maven central:
https://mvnrepository.com/artifact/net.dv8tion/JDA
If not then they have a custom repository
Wow thanks
So why does it not change when i change it by player.sendBlockChange(loc, Material.AIR.createBlockData())
you are sending a fake block change
Yessir
Skulls have tile Entities but I don;t believe the fake block change accounts for
Then send a block change.
Do you send the change when a player clicks the block?
*Because then you might need to send it one tick later
Block block = event.getClickedBlock();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (!(Objects.requireNonNull(event.getClickedBlock()).getType().equals(Material.PLAYER_HEAD))) return;
Skull headBlock = (Skull) block.getState();
String headBlockUUID = Objects.requireNonNull(headBlock.getOwnerProfile()).getName();
player.sendBlockChange(block.getLocation(), air);
Just create timeout?
I mean Scheduler
If you want your server to freeze
Yeah
Works perfectly TYSM! š š š š
Why does sendingBlockChange need 1 tick delay
Just being curious
Because if you click a block the server sends the information of that block to the player.
And your package is sent first. This means the client gets 2 packets in a short time with the
original block always overwriting your change.
Yes. It should be in your "resources" folder.
Oh I'm special
hey guys, how do i let the plugin count up? like i want to count how many reports come in
Use a database or config to store that information
yeah yeah but how do i let it count up
By incrementing a value and storing it in a database?
You have an int somewhere and every time you want to count something you increment that int...
ty
what?
thank you*
I know the meaning of "ty"
That was more of a baffled "what"
I love this discord sometimes
oh you just made my brain something clear, so i got the idea
and for that i just wanted to say thanks ^^
do you know how to make a plugin that exchanges player positions with other players?
do anyone know how do i send a chunk packet to client ?
idk if you are german, but do you mean like the one endergames mode on gommehd
do you mean smth lik that?
death swap
uhm how do i get this ```yml
589998538key:
repmessage: fehler mit meinen geld ich bin zu arm
bugtype: Sonstiger Bug
name: YuuqiiiIsMyMommy
date: Fri Jul 08 11:24:57 CEST 2022
id: 589998538key
Just teleport the player to the other player's location
getString("589998538key.name")
i guess that's what you mean?
how do i regenerate certain chunks
config.getString("589998538key.repmessage"); will return "fehler mit meinen geld ich bin zu arm"
Save one's player's cloned location, teleport him to the current player, and then teleport the current player to the temp location
yeah
i've waited 4 months for an answer to this, someone at least acknowledge me
Bukkit.getWorld("").regenerateChunk(int, int)
just use WorldEdit
that is deprecated
it does that stuff
i also want to regenerate a chunk with a certain chunkgenerator
forgot to mention that
See WorldGeneratorAPI
But you can use it, it's because you'll probably cut some trees or stuff like that
my plan is that im saving reports with a random number in front so i can get it with getKeys
it doesn't generate with a certain biome .-.
so i can list it in a inventory
That's where WorldGeneratorAPI comes in
But Bukkit World's generation as always been an issue
but I don't know how
Don't know what?
Explain yourself and i will explain back, but i don't know what you don't know.
NBTTagCompound @sweet pike
make the player teleport to another player
player1.teleport(player2);
Like that
No
It's not as simple as it seems. Generating a world requires multiple computations. First generating a noise, generating terrain, caves, adding decorations
Store the 2 locations in variables, clone() them and then teleport the players
i might just hand-make the chunks then
so the locations won't refer to the live locations
You can't just say : i want a forst biome
i don't need caves or noise or whatever
i just need trees and ores
corresponding to the biome
That's sadly the easiest way. But have a look at WorldGeneratorAPI it might help you
why would you clone them
Because if you're gonna teleport player to another player, his location changes
so?
You can't teleport the second player to the old location unless you save it
You should already be getting a clone
arent locations immutable by now?
They should be iirc
doesnt look really immutable in 1.17.1
Hm okay
ah lol that was my problem
hashset you noob
i was afraid u would say that
šŖ
in a way its genuinely dumb sets dont have get by index
im wondering why they say that sets and stuff arent accessible by their index but they are all backed by an array ://
is that NMS or a library?
any quick wikis/threads on how to use them?
myes
triggering too many tnt at the same location be like
ah after 10 minutes it finally exploded
wait ur running that on a pi?
Anyone here happens to know how to add a line break to a discord embed?
tried \n and \u200B
doesn't work
Works for me in the description. Not sure if other areas can be line breaked
yes lol
with \u200B it just doesn't put it in the next line
it works
Yeah I believe you, somehow this is still not working
new DiscordMessageBuilder(plugin).withDescription("The **" + StringManager.capitalize(getTrollCommand().toString()) + "** troll has been stopped on **" + p.getName() + "**\n**Duration**: **" + getDuration() + " seconds**")
.withColor(new java.awt.Color(0, 170, 170))
.withAuthor("TrollBossPlus", null, StringManager.DISCORD_WEBHOOK_IMAGE_URL).build();
wdym multiple lines?
ahh yeah
Does your IDE show any errors?
Did you register the listener?
if(!damagedBlock.containsKey(event.getBlock()))
damagedBlock.put(event.getBlock(), List.of((double) Math.round(event.getBlock().getType().getHardness() / event.getBlock().getBreakSpeed(event.getPlayer())), new BukkitRunnable() {
@Override
public void run() {
damagedBlock.put(event.getBlock(), (List<Object>) damagedBlock.get(block)/*HERE NULL POINTER EXCEPTION*/.set(0, (double) damagedBlock.get(block).get(0) - event.getBlock().getType().getHardness()));
if((double) damagedBlock.get(event.getBlock()).get(0) <= 0)
cancel();
Bukkit.getServer().getOnlinePlayers().stream().filter(player -> player.getLocation().distanceSquared(event.getBlock().getLocation()) < 121)
.map(player -> ((CraftPlayer) player).getHandle().connection)
.forEach(connection -> connection.send(new ClientboundBlockDestructionPacket(connection.player.getId(), ((CraftBlock) event.getBlock()).getPosition(), (int) (((double) damagedBlock.get(event.getBlock()).get(0) / (event.getBlock().getBreakSpeed(event.getPlayer()) / event.getBlock().getType().getHardness())) * 10))));
}
}));
((BukkitRunnable) damagedBlock.get(block).get(1)).runTaskTimer(SunderiaSkyblock.getInstance(), 0, 1);
Hey, I'm trying to do a custom breaking block system with a Map<Block, List<Object>> where the first element of that list of object is the number of ticks spend on the block (used for damage block) and the second element is the BukkitRunnable related to the block.
Here above the code i'm trying to use but I catch a NullPointerException where is the comment in the code.
I don't know if this approach is the right one. Can someone explain me why I catch a NPE here?
You made a new frozen variable
Don't store the block as a key. Use the location
wtf
Okay but this will not answer my problem
Yeah you have two frozen variables
Try it
LivingEntity#friction doesnt exist?
you made it static
do you get an error in the runnable now that the boolean has to be effectively final or smth like that?
Did you change it to frozen = false in the runnable?
guys, i am struggeling with saving stuff in yml.
so i made these 2 classes. my goal is to save a bunch of ncArea's inside a yml.
but all i cant seem to get a Area inside a yml, only parts
i just cant seem to figure out why i cant save an area, but i can save a part
It won't be working like that, you're creating a new boolean
Tried and NullPointerException on the same spot
my man
this is awful
[15:13:49 ERROR]: Error occurred while enabling DeepSmpPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Symbol does not appear in the shape: [s]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:180) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:130) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:115) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmpplugin.deepsmpplugin.Main.getWartPick(Main.java:89) ~[DeepSmpPlugin-1.0-SNAPSHOT.jar:?]
at deepsmpplugin.deepsmpplugin.Main.onEnable(Main.java:25) ~[DeepSmpPlugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[paper-1.19.jar:git-Paper-41] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:633) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:419) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1121) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-41]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
there's somehting wrong
you're trying to register an ingredient whose letter doesn't appear in the shape
what do you mean?
example:
SHAPE:
XXX
X.X
XXX
and you call
setIngredient('A', ...)
A is not in the shape
That doesn't help me
Clean up your code a bit
by reusing variables
Also you're a lot better if you use packets instead of this damagedBlock system
as the client sends block dig packets for:
start-dig
abort-dig
finished-dig
and some other statuses
you call every single possible getter like 15 times and don't reuse the values, but you're also doing a Map<Block> which is plain wrong
lol bro i found the wrong thing thx all that happened cuz i didnt make the s Capital
i fixed it
Use a vector or a location, Block is just a temporary instance that is made whenever you call getBlock
Okay
Hi, first of all, if an admin sees this can we talk about my other account and how it got banned, secondly, I need help compiling a plugin using the 1.19 spigot API using java 8. I can this error when I try to compile using gradle dsl
^
bad class file: /home/kyan/.m2/repository/org/spigotmc/spigot/1.19-R0.1-SNAPSHOT/spigot-1.19-R0.1-SNAPSHOT.jar(net/minecraft/server/MinecraftServer.class)
class file has wrong version 61.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.```
I understand the error, I just need help fixing it
Minecraft 1.19 requires java 17. Throw your java 8 to trash
I understand that, I also know that there is way and many people do it to allow lower versions to run plugins
I have found some resources online as well, however, they are all for maven, which is no use to me atm
hey, does anyone know how to open a villager trade with custom trades using a command?
not if you put your cardano and bitcoin address on your bio lol
Why do you even need java 8. I know that gradle wouldn't allow you to do that. It's because you're using classes that uses last versions features. It's compatible with lower versions, not higher
did i ask?
If you're looking for a plugin, #help-server
nope, i'm coding a plugin
so how do I allow my plugin to work on lower versions that use different jar versions?
its an amazing resource
already used it, cant find an answer
Don't, use java 17
he is literally spoonfeeding you
so I simply don't make it available to other versions because?
other plugins do it, what is their methodology?
also
thank you.
np
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/neomechanical/neoperformance/NeoPerformance has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[patched_1.12.2```
this is when I tried to use my plugin on 1.12.2
so I clearly need to use an older java version
Which is also what I have read numerous times
It's like keeping alive an old person that just want to die. We are struggling so much to maintain old version, we're always complaining so it's time to force people change please
It will still be compatible with other mc versions, they just have to update java
Which is great.
Struggling? I literally changed one line of code to make it compatiable with java 8, one line. Now I just need to figure out how to compile the spigotapi part in java 17 and the rest in java 8 to allow for these so called 'old people' to use the plugin.
And using older versions do have their benefits
Such as performance boosts, which is ironic when my plugin is meant to combat lag
but anyways
older mc versions have better performance
not java 8 specially, the versions of minecraft
prob the only reason why ppl use it
if 2b2t was on 1.19
2b2t trying to update so that's stupid lol, anyways you don't know how to compile your plugin on a lower version?
forget about eating
or what exactly?
I don't understand why it is a problem. Security is way more important and your plugin will still run the same. I need some proof that java 17 is slower
well why don't you use a newer java ?
it's better
what
i was lol, but I wanted to make it run on most mc versions
yes, what yada said
it was on java 17 before, now I'm trying to COMPILE it on java 8
using newer java wont make your plugin not run on older version? .. okay, well what ide do you use?
and are you using gradle or maven?
gradle on intellij
and using older java versions does make your plugin run on older versions
this error message is me trying to use my java 17 plugin on 1.12.2 for context
sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
Settings -> Project -> SDK: 1.8
Settings -> Modules -> Language Level: 8
because you're running a old java
that's stupid
no reason to use a old java version
.
no it only makes your plugin run on older JAVA versions
people dont have to use java 8 on a old version
I think they do if its an extremely old version
no they dont
lmao
Java is extremely backward compatible
you can literally run java 7 compiled plugins on java 17
you can run into some issues but they are easy to solve
so i see no reason to use old java versions
Stop allowing people to use outdated versions please
I don't think we are talking about the same thing here...
you can run your 1.8 server on Java 17
you can run your 1.5 server on Java 17
what else is the issue
Not without issues
Well I will be damned, I do remember having trouble running some version of minecraft on java 17
you will get some issues and warnings which can all be solved
All can be solved if you modify the code yes
I just ran a test server and it does work alright
But otherwise no
I believe the mc version was 1.16
the fuck
1.16 supports java 17 without any issues
i though you're going back to like 1.8
lmao
you did something wrong then
idk man, just telling you what happened with me
human error
Anyway you better use the java toolchain rather than setting source and target version with those variables
Unsupported Java detected (61.0). Only up to Java 16 is supported.```
is it a paper thing?
You might wanna change java version
But weird image
Feels like that should be shipped along with the container
this is 1.16 on java 17
I'm not bothered tbh
just something
and Conclure, a quick question, who do I talk to about unbans?
?support ideally
k thanks
But if you know who banned whom then you can go directly to said person
hello
i just want to register a expensions with PlaceholderHolderAPI but it won't work
?paste
how do i send a simple msg to all players?
i don't see a error https://paste.md-5.net/ubukejiyat.java
get all online players
loop through that
and send each player a message
any help ?
Hi I get java.lang.NoClassDefFoundError: net/minecraft/server/MinecraftServer when I run my plugin on 1.12.2
I think I understand the error, just wondering what I do to fix it?
would I need to somehow shadow net.minecraft.server into my plugin?
?paste the code causing the issue
default double getTPS() {
MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
double tps = mcServer.recentTps[0];
if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
tps = 20;
}
return tps;
}
its small
wait really, cus i already thought about this
but then i thought, no this cant be it
and its just the import ```java
import net.minecraft.server.MinecraftServer;
this is in efficient
someone can help me ?
hi, i use worldedit and worldguard api for my plugin but give me this error while running server
[05:59:02 ERROR]: Could not load 'plugins\AFKPool.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [worldedit, worldguard]. Please download and install these plugins to run 'AFKPool'.
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:290) ~[patched_1.17.1.jar:git-Paper-411]
at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[patched_1.17.1.jar:git-Paper-411]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[patched_1.17.1.jar:git-Paper-411]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Paper-411]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-411]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
plugin.yml
depend:
- worldguard
- worldedit
how to fix it?
By downloading worldedit and worldguard
i have it in my plugin folder
worldedit-bukkit-7.2.11-beta-01.jar
worldguard-bukkit-7.0.7-dist.jar
It might be case sensitive, use [WorldEdit, WorldGuard]
depend: [WorldEdit, WorldGuard]?
do /plugins and check their names there
yes
check with?
its plugins name
i rename it to WorldEdit.jar?
its WorldEdit and WorldGuard
no
its not the file name
its the plugin name as in plugin.yml for that plugin
Thanks, it's fixed
Does Bungeecord have a Singleton like Bukkit has?
something like the Bukkit Class only for Bungeecord
hello so i am creating a join/leave msges plugin and i made it so itll print the msg from the config as the join msg and the placeholder %player% or %player_name% isnt working..
bruh
oof
i gave you the link yesterday
Proxy.getInstance() i think
that's because you're not replacing any placeholders at all?
oh? idk abt that im a new dev. how do i do that?
String#replace
Bungeecord doesnāt have a mono state design like Bukkit with the Bukkit class in particular
well he wants to use papi placeholders
Altho it does as demeng pointed out have singletons iirc
yea
well they should mention that then lol
sorry,
then read the PlaceholderAPI's github readme file, it's explained there
i gave you the the way yesterday, why didnt you use it?
Code:
RegionContainer container = platform.getRegionContainer();
RegionManager regions = container.get((World) player.getWorld());
if (regions == null) return;
ProtectedRegion region = regions.getRegion(Objects.requireNonNull(pl.getConfig().getString("region-name")));
if (region == null) return;
Error:
java.lang.NullPointerException: Cannot invoke "com.sk89q.worldguard.bukkit.BukkitWorldGuardPlatform.getRegionContainer()" because the return value of "ir.skidded.AFKPool.access$000()" is null
how to fix this error?
it isnt the thing im looking for bruh why dont u guys get it?
what are you trying to do then
imma explain fully so uhh im trying to get the string ("Join") from the config as the join message so in that string i have "%player% has joined the game! Welome back." so it isnt using the placeholder its just sayin %player% in the chat..
jesus my plugin is 16mb
Just send the raw config value then?
No don't shade bukkit
thanks gradle
You don't need to
how do I fix this then?
It's a waste and actually causes errors likely
java.lang.NoClassDefFoundError: net/minecraft/server/MinecraftServer
?paste
Actually shaded Bukkit š„²
i change contaianer to RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
fixed
but now give me error for RegionManager regions = container.get((World) player.getWorld());
error:
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_17_R1.CraftWorld cannot be cast to class com.sk89q.worldedit.world.World (org.bukkit.craftbukkit.v1_17_R1.CraftWorld is in unnamed module of loader 'app'; com.sk89q.worldedit.world.World is in unnamed module of loader 'worldedit-bukkit-7.2.11-beta-01.jar' @38358b1c)
Are you reobfuscating the mapped classes
There's a maven plugin to do that
uh can u send me the code i should set to the joinmessage like after e.setJoinMessage("in here)
idk how to with gradle
Shadow jar
I can't help you because gradle is for beta males but yea you need to reobufscate using the maven plugin
I wanted to be trendy and use it, but now i got no idea what im doing
my main plugin uses maven
but ehh
ik
Well Gradle is better if you know what youāre doing
any idea for this?
so how do get the mappings working for gradle dsl?
Shut up conclure get our of here nerd
But provided that your plugin ought not to need an advanced setup stick with maven as you already have knowledge
Facts donāt lie (:
facts
Oh you wanna do the mojang mappings thingy?
Well may I ask what are you trying to do?
get the stupid tps
Same thing goes for hips
m?
He needs to remap his jar using the maven plugin ms5 provides
thats what i sent
default double getTPS() {
MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
double tps = mcServer.recentTps[0];
if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
tps = 20;
}
return tps;
}```
this thing
ruined my entire plugin
i want like how to print the raw config like he said.
why printing the raw
print the raw thing then
whats difficult bout that
thats what youre currently doin
Why ?
Thatās unfortunate
Ah
the way I do it or because it ruins the plugin?
So conclure, where do I start with my remapping journey so I can fix a single import?
I was just asking why it was ruining your plugin, no need to be haughty
yeah true
You have two choices now
Switch to maven and use special source
Persist with gradle and use paperweight-userdev
The issue with staying with gradle is that the paper api will be added to your classpath, altho that afaik is the only alternative for gradle in terms of remapping atm
Actually
ohhhhh
damn it must have many many features
A third option is to use a library
lol
Which provides the tps for you
its does alright
hmm
the third option is enticing
Or using and shading a lot of libs š¤·āāļø
I hide my stuff in it
Personally I use 2000 libs for each plugin just in case
just in case
KyTDK itās a cheap alternative and not a bad one either i donāt know if @tender shard can offer it with his outstanding library
you never know when you need those libs
Since my library isnāt publicly available
So ye Ik redempt also got some good stuff in his library
Im late to the party. whats broke
Redlib vs bluelib the ultimate battle
š„²
Gradlew
They depend on an nms class
my entire plugin relies upon this stupid nms class
I don't have a method to get the TPS currently but isn't it just a private field or sth?
Yeah
which nms class are you using, why, and where
default double getTPS() {
MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
double tps = mcServer.recentTps[0];
if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
tps = 20;
}
return tps;
}```
that should answer your question
getServer().spigot().getTPS();
invalid
That doesnāt exist
yeah idk why people keep bringing that up, its confusing
Why did the guy on the forums post it lol
Idek
good one š„² now PR this
LMAO
bukkit.makecoolplugin()
Forums people do be trolling
Never! Everyone always behaves nicely on the internet
Ah of course I take back my assertive statement :>
I got a fork of a plugin that uses paper to remap
might just use that
quick and easy
hopefully
you can also just run the special sauce plugin manually