#help-development
1 messages · Page 1523 of 1
...
BlockFadeEvent, BlockPhysicsEvent, or BlockFromToEvent are your best bets
Caused by: java.lang.RuntimeException: Failed to find NMS class: Item
i told you what to do
where I Can found this class and replace?
also, I think I recall your username
use buildtools, look at the new class structure, and get that path
oh townyhavens
Uh oh
detect packet WORLD_EVENT (61) and check if the ID is 1020
posting the same thing isnt going to change the answer
static {
hasProtocolLib = Bukkit.getPluginManager().isPluginEnabled("ProtocolLib") && VersionUtils.isVersion(9);
if (hasProtocolLib) {
ITEM_CLASS = MinecraftReflection.getMinecraftClass("Item");
getItem = Accessors.getMethodAccessor(MinecraftReflection
.getCraftBukkitClass("util.CraftMagicNumbers"),
"getItem", Material.class);
getMaterial = Accessors.getMethodAccessor(MinecraftReflection
.getCraftBukkitClass("util.CraftMagicNumbers"),
"getMaterial", ITEM_CLASS);
}
}
hmm yes thank you for that
cool code, nobody asked for it
it's not my code... I need fix antirelog
did I ask whos code it was?
nope
@broken lava https://gist.github.com/aadnk/10563822
if you're just using protocollib shouldn't the mappings already be available
protocol lib is fucked in 1.17 from what ive heard
ty, also it very much is lol
np
life is pain
the only constant is suffering
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
Hey guys, working on a World Generation Plugin. Is there a way I can override the vanilla generators biomegrid? Id like to modify the biomes during generation, but not the base terrain.
why isnt this working
@EventHandler
public void onEnable() {
startPlugin();
return;
}```
onEnable
onEnable is not an event and you don't need to return on voids
no i like it how it is just please tell me why it isnt working
i like the orange collor
oops
Make that @fresh templethandler an @Override
no i prefer event handler please tell me why its not working
show entire code
😂
do u want me to show u the class
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yes
Let’s see that beautiful code boy
hold on
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
^^^^
public class MainClass extends JavaPlugin
{
@EventHandler
public void onEnable()
{
startPlugin();
return;
}
}```
thats the class
it looks sexier
Also, it’s a troll. Don’t waste your time.
wat?
Yup 100% troll
what ide are you using
@tidal cairn bro.
eclipse
are you seeing any errors in your ide
no
?kick @tidal cairn
Done. That felt good.
startPlugin() doesn't exist 🤷♂️
That’s a good reason to kick someone
For using Eclipse
We should kick all Eclipse users
that's not why I kicked him 😂
Shaking my smh my head
he could have a method called startPlugin
that code on its own would actually work as a plugin, lol
kicking people for not understanding 👍
Damn I wanted to send this link to him https://bit.ly/3iS2517
Rick Astley's official music video for “Never Gonna Give You Up” Listen to Rick Astley: https://RickAstley.lnk.to/_listenYDSubscribe to the official Rick Ast...
Funnily enough I actually had a method just like that back when I was dumb and didn’t understand OOP
🤷♂️ he was obviously trolling imo but you do you
Wdym lmfao he was obv trolling
Hi im having troubles with Voting Plugin, is this a good place to ask for help? Or shall i look elsewhere?
Thank you
not until you ask us properly
what
lol
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
i want md 5 to answer
tough shit
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
sorry i'm illiterate
public boolean banana() {
if (banana) {
return true;
} else {
return false;
}
}```
Imagine using an else
elses have uses you know 😭
public void countdown() {
System.out.println("countdown");
return;
}```
why is that not working
are you calling the method
have you tried turning it off and back on again?
that too
what does that mean
you need to pick up your phone and dial the method
that's why there are letters on the keypad
Lmao
how do i dial it
Learn Java basics, you’ll learn how to press the keys
Guys, this is obviously the same troll
U have you buy another one
what
psst hey kid, want some class instances?
yes
java.lang.NullPointerException: null
20.06 18:34:07 [Server] INFO at dev.bleepo.bleepohelp.Bleepohelp.onEnable(Bleepohelp.java:30) ~[?:?]
20.06 18:34:07 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07 [Server] INFO at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:304) ~[?:?]
20.06 18:34:07 [Server] INFO at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114) ~[?:?]
20.06 18:34:07 [Server] INFO at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:95) ~[?:?]
20.06 18:34:07 [Server] INFO at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
20.06 18:34:07
What is wrong? Im confused
md5 is pretty cool
?paste
first 2 lines give the entire issue
?
Follow the stack trace
I need to learn how to read errors
Yes
That is a very helpful skill
lmao
Look around google of "java understanding stacktraces"
Thank you
java is super helpful with stacktraces
[[core dumped]]
maybe except a jvm crash 🙂
I had a JVM crash once where my research gave the answer of "who the fuck knows" and "couple important bytes of memory corrupted so java saved itself by crashing" were the two answers.
Anyone knows how to ask if the Block is natural or is it placed by a Player
Java is magical
you'd have to track every block placed
its not a great thing to do
if you have a block logger / rollback plugin you can hook that
but its still gonna be slow
Imagine if md5 friended me 😳
i mean u could hook it up to a database maybe?
Imagine wanting MD to friend you
i do
Cause I 100% do so if you don't you shouldn't be here
If md tried to add me as a friend I would file a restraining order
Lol
Friends are overrated
i listened to someones distrack about u
kill.setExecutor(new kill(this));
so this is the line thats erroring
No, it shouldnt
why
PluginCommand kill = server.getPluginCommand("kill");
kill.setExecutor(new kill(this));
thats why
What should i do then?
How can I check if a player's inventory contains any items?
Alright
like here for example, there is an issue of confusion
you have a variable named kill
and a class named kill
wtf
and without syntax highlighting it would be pretty difficult to tell which is which
Good point
wtf is that class naming convention
are u using camelCase for fricking classes
XD
i use Pascal case case for classes i think thats what its called
so its like ClassName
anyway, back to the point. This is the line thats erroring
what's the error
This
rename ur command class to Kill and do new Kill(this)
i did
dont rename the field tho
guess what i forgot to do
LMAO
getCommand is nullable; if the command isn't declared in the plugin.yml, it will return null
i mean u can register commands without doing it in plugin.yml but it isnt recommended
Registering commands in the description file is overrated
Be a man and directly insert them into the command map
that isnt recommended lol
Who doesn't recommend it?
spigot
papers not recommended by spigot either ¯\_(ツ)_/¯
basically all command frameworks and libraries register them programmatically
how?
see the protocol
iirc paper has an event/method for setting that
idk bout splögget
hmm
spigot has a thing i think
what is it called
i have no idea what its called so i have no idea how to google it
oh wait they might not have a way to change it
server ping event on paper iirc
that's for bungee
like, that 100% sounds like its somehow related to bungee
yea, bungeecord has it
serverListPingEvent but that doesnt have a method to set that text
ah, i had to restart the server
so if u wanted to do it in spigot u have to use nms probs
plugman was being dumb
protocollib or nms
probably protocollib
i don't think nms lets you listen to packets arbitrarily
/reload causes memory leaks
it's fine during testing but you need to be aware of it
nah everytime i did it the memory usage would go up
that is, if shit looks like it isn't getting reloaded properly, don't bash your head into a wall for 4 hours
and you don't even know how to measure memory usage
it was on a host
the host doesn't know how to measure it either
lol
well that kept making the memory usage go up for some reason
when i used /reload
yes, because it spins a lot of logic and allocates a lot of objects
which causes the gc to fire a ton and the jvm to allocate more memory
that doesn't mean that more memory is used
no i mean it goes up permanently
/reload works fine for me whwen testing
and it keeps going up
which may or may not rise permanently
because my crappy pc takes a lot of time to start up a server
i just use plugman to reload individual plugins
i think to change that thing on spigot u need protocollib
if it's for your own server, just use paper tbh
Ok, Because It's making me bash my head into a wall, I'm trying to schedule a task to run after X amount of ticks, and every single method I've tried has been Depreciated and thrown errors, Idk what to do here and I'm hoping someone does.
Bukkit.getScheduler().runTaskLater(plugin, () -> { delayed code }, delay);
() -> { delayed code } Can I replace this with a new MyBukkitRunnable()?
you don't need a bukkit runnable, but yes
Well I had this
public class BloodMoonEnd extends BukkitRunnable
So can I just slap it in?
Join the group
Oh fair
you can either instantiate that class or copy the code into the lambda
I just copied it, I'll see if that works
the advantage of it being a named class is that it is displayed better in timings; it has an actual name that gets displayed and tells the end user what the task is
the advantage of it being a lambda is that it's usually easier to read and doesn't clutter your project with redundant classes
Fair, I assume the Delay is in ticks like everything else? lol
yes
Is HttpURLConnection unable to handle bearer auth tokens? Every request I send with a bearer token comes back as forbidden, I can't see the forbidden message, and when I print the headers, the bearer token doesn't appear
I still have not found out how to move a location relative to its rotation
swap the components of the vector and flip their signs
o guys
so yesterday someone helped me inport event handler
but it doesnt do anything..
what do you expect it to do
well allow me to use player.XYZ functions
learn java
i know java
i mean
i did
until i forgot
im stupid
wait
didnt i do all the imports i needed? thats all the tutorial showed
~~How do you get an inventories name again?~~Solved, inventoryview 
idk learn java
cause apparently what 3 ppl have told me so far
theres a difference between not knowing java and not being able to find a method in an api
what the fuck are you even trying to do? lmao
well, if you couldnt fucking tell
trying to fucking call event handler and use the functions no shit
you clearly have absolutely no fucking clue about what you are doing
an event handler does not have functions
you do not call an event handler
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) { event.method().doStuff(); }
no i cant fucking tell what youre trying to do, all i see is a sout and an empty method
an event handler is a method
it must be annotated with the @EventHandler method
it must declare exactly one parameter
the parameter type must extend Event
the parameter type must also declare a static getHandlers method
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
the object declaring the event handler method must be registered with the bukkit event bus with Bukkit.getPluginManager().registerEvents(object, plugin)

sorry guys
@wraith rapids @quaint mantle im sorry, imma go learn java again sorry for being rude
Hey guys. I'm making a plugin that utilizes PersistantDataStorage and data serialization to capture and release various LivingEntities with their important unique properties.
Everythin has gone well up until trying to add items back into the new Llama's inventory.
llama.setDecor(decor);```
doesn't work, even if I make a ```new ItemStack(Material.CARPET)```
I don't know if these functions related to a Llama's inventory are bugged or if I'm doing something silly wrong.
I can't get any items including any in the Storage contents, even when accounting for a llama's strength and not exceeding my arrays.
I'm open to PMs if anyone has an idea
The creation and retrieval of all the items appears to work.
The Llama's data serialization starts at line 264, and is reconstructed starting at line 463.
The code in the two Llama areas is very messy, as I've been trying many things to no avail.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What works:
Entitytype
Everything from and below interface "Tameable"
setCarryingChest
setColor
setStrength
Itemstack deserialization (Items are shown in Console on reconstruction, but they never get applied)
Got me dead :3
Why do people write event handlers without registering listener
That does not work because I would need to find how much of a variable goes into the x, y, and z. Like, going forward would change both the x and z if it has a certain rotation .
Does any know why,
Bukkit.getEntity is not available during async, but
Bukkit.getPlayer is available doing a async?
Seems a bit werid
I need to cancel the EnchantItemEvent so I can change the behavior of the enchanting table, but I also want to keep the random enchant offers. The problem is that because I'm cancelling the event, the enchants are always the same. I tried without cancelling the event but I also want to remove the item from the first slot but I can't because its changing it to an enchanted book. is it even possible to do this?
look at how IllegalStack does it maybe
i meaaaaan, officially none of the bukkit api is to be used async
aight
How do you register a plugin
i know how to do it just I think my intelji is broken?
Doesn't getEntity get an entity by UUID?
I imagine that has to interact with the world somehow
Which is a big no-no
Meanwhile all the players are just stored in a list internally
And a map
When you call getPlayer it just checks the map for that player
No interaction with the world happens
And it's interacting with anything that is related to a world that causes issues async, generally
Also certain things related to players need to happen asynchronously, like chat
I think that is list based also
Well it's stored in the world
Specifically they are stored in the chunks
It's possible that it loops over the chunks
Though I think there might be a UUID entity map
I remember looking into that at one point, don't remember what I found
Hmm true chunks hmmm
I can check again
Yea been a while since I looked at that myself.
I will have to take a look at the resolve of the method
Is there a way to make a command "sandbox"
Ok so it iterates the world and calls getEntity on each world
like run a command without any actual effect
Well
Ok so each world has a map of entities by their UUID
But it's not a concurrent hash map
And it's definitely more frequently mutated than the player map
I imagine that's why it has issues async
Hmm, I will have to see if I can grab them from the world without the bukkit get.
What are you trying to do async
Npc plug-in to adjust there moment and head spin and player moving
Why would you do that async
How the fuck is doing it async safer
And unless the math is incredibly heavy it's probably pointless to async it
The way I coded it safer with a sync call back when the main thread is needed
I have to disagree
When trying to do something you can take it of the main thread and not effect the game with the proper call back
If nothing else you could retrieve the entity sync, then do the math async, then apply the changes sync
Not at my Pc
I wanted to run a command multiple times, but if the command doesn't exist or the argument is wrong, only output one unkown command message instead of a lot
Well what kind of math are you doing
In what context?
That is why I do already get it with a call back await and then keep going async
Run your own command multiple times?
basically I'm trying to make a /loop command but currently it's flooding the user and console
Oh
Anyone know how I could strike a lightning where the player is looking?
I've tried:
player.getWorld().strikeLightning(player.getEyeLocation());
But it didn't work
like /loop 10 summon creeper
Well why are you trying to do that
Just wondering why the 2 where different in the lock.
that would run /summon creeper 10 times
Right but why not just use something like the essentials command that summons a certain number of a mob
In what other case will you need to loop a command like that
It doesn't have to be this command
The eye location is the location of the player at eye height
I can dig more into it and see might find a way to be able to get the entity a different way 🙂
You want rayTrace I think
declaration: package: org.bukkit, interface: World
Have you even tried running it on the main thread
I feel like whatever math you're doing is probably nowhere near as heavy as you think it is
sometimes I need to run my own commands for testing purposes aswell
And if it's really that heavy then you should try to optimize it rather than multithreading it
it's not just about /spawn
There is no need to. Not everything has to be on the main thread.
I would like it to not spam the console/user, thats all
If you do it right, you don’t have to
Trust me it’s no issues been coding for 15 years for living.
Well there's no way to do that without losing command output
Then why won't you even say what the math you're doing is
you mean gamerule sendCommandFeedback?
I am not near my PC I am in bed cause I have to work in the morning. And I said what it does
I see what you mean
I can just add an exception flag right
Head look or something, right?
Isn't that just basic trig
Trig is not slow
Well here's what I'm thinking
It's really hacky but would likely produce the results you want
But how experienced are you with java?
This is a solution that isn't going to make sense unless you're experienced
And by that youre saying it is possible to run multiple commands while only keeping the result of one?
Better
oh?
You can run the command multiple times and compress the results by count
So for example if it says You do not have permission to run this command 10 times
I see like those client side mods
You can make it say You do not have permission to run this command (x10)
Though there's a catch
I didn't that's possible
This would only work for non-vanilla commands
I didn't know you can see the result of running a command
It's possible, but again, you need to be experienced with java to do this
So i have to use something other than dispatch then?
No, you'd use dispatch
oh ok
Which is why it wouldn't work for vanilla commands
you can dispatch vanilla command wdym?
How experienced are you with java
Decently?
Alright
I mean all I have it time so XD
Are you familiar with proxies
Player player; //Assume this is set
Map<String, Integer> map = new LinkedHashMap<>();
Player proxy = (Player) Proxy.newProxyInstance(player.getClass().getClassLoader(), new Class<?>[] {Player.class}, (proxy, method, args) -> {
if (method.getName().equals("sendMessage")) {
String msg = (String) args[0];
map.compute(msg, (k, v) -> v == null ? 1 : v + 1);
return null;
}
return method.invoke(player, args);
});
for (int i = 0; i < loopNum; i++) {
Bukkit.dispatchCommand(proxy, "some command here");
}
map.forEach((k, v) -> player.sendMessage(k + ChatColor.GRAY + " (x" + v + ")"));```
Haven't tested but I think something like this would work
It's very hacky though
Essentially, we create a proxy instance of the player
did you just...
And if something tries to call sendMessage on it, instead of sending them the message, we add it to a map tallying the count of each message that was sent
code in discord?
So it's not like I just wrote the entire thing in discord without stopping
But try it and let me know if it works
I'm curious
It should work for non-vanilla commands because they all call sendMessage
Vanilla commands are not built on top of the spigot API
So they don't call sendMessage and they don't interact with the Player object at all, they do it at a lower level
Another day of learning java
The only other way to do this would be to intercept the packets but that would be even messier
A bit, I guess?
send to me instead of directly the target, and I will relay it
It allows you to implement interfaces at runtime
no more like reverse proxy for networks
Yeah in this case that's what they're doing
But they can be used for other things than proxying method calls
You can use it to fully implement something if you want, though I'm not sure why you would
so that's kinda what Im thinking when I said "sandbox"
so like some wrapper I have control over and can overwrite the results
so yeah idk why I didn't think of a proxy
Maybe cause my english is bad :P
Imma try it out and tell you the result
Alright
wait but what if the sender is console :/
You should be able to just replace Player with CommandSender
But you'd want to do it like this
Class<?>[] interfaces = {sender instanceof Player ? Player.class : CommandSender.class};```
Then toss that in place of just {Player.class}
why do we need to know if it's a player tho
Well
Player is also CommandSender righgt
Consider that some commands require the sender to be a player
If you only ever make it a CommandSender
Those commands will never work even as a player
Because instanceof Player will return false
wait what
On the proxy instance
oh cause the proxy is commandsender?
Yeah
proxy instanceof Player will be false
Mhm
so all executors will thing it's not a player
ok makes sense
so it's like this?
CommandSender proxy = (CommandSender) Proxy.newProxyInstance(sender.getClass().getClassLoader(), new Class<?>[] {sender instanceof Player ? Player.class : CommandSender.class}, (proxy, method, args) -> {```
Yep, that should work
bruh
?
proxy and args is alr defined XD
Oh right lol
Just rename the lambda parameters
proxyObj, method, cargs
And make sure to replace them within the lambda
what does the c in cargs mean
k
if this the sh*t Im doing for the first change today, today's gonna be craazy
Is it working?
1m
it's throwing errors when running vanilla commands
and nonexistent commands
:/
at least running custom commands work
org.bukkit.command.CommandException: Unhandled exception executing command 'loop' in plugin CommandLoop
that's when the command doesn't exisit
Well can you show the full stack trace?
?paste
Ahhh
Change if (method.getName().equals("sendMessage")) to if (method.getName().equals("sendMessage") && args[0] instanceof String)
how long have you been making plugins? I can't get anything from the stack and I think Im ok at it
bruh
What's happening here is that it was intercepting all sendMessage calls
But there's a variant that doesn't take a string
And it was intercepting those too
oh
That will be an issue for some commands, surely
Because calling sendMessage(BaseComponent) will break some things, undoubtedly
it still seem to be doing that :/
So this will cause it to still spam if the command uses base components as feedback
Easiest fix is to convert the strings to base components
Show full code?
full?
The method at least
?paste
Where is line 51?
Change it from args[0] to arguments[0]
wait
You're checking args which is the command arguments
You want to be checking the method arguments
Yeah
also do you use Intellij
Yep
StringBuilder loopCommand = new StringBuilder();
for(int i=1;i<args.length;++i)
{
loopCommand.append(args[i]).append(" ");
}```
Is there a way to trigger deployment at the end of a run task?
I know there's prob a better way that like trims it but I just dont know how to work with Strings
String loopCommand = String.join(" ", Arrays.copyOfRange(args, 1, args.length - 1));```
Would you be interested in trying my command manager?
It'd make this much easier
You could do something like
is it open source?
@CommandHook("loop")
public void loopCommand(CommandSender sender, int times, String command)```
Yeah
Does it require the project using it to be open source?
nice
It's fully-documented and has a wiki
cause I wanted this project to be private
I've used it for loads of private projects
can I check it out
Sure
Go to the wiki/Command Manager for info on that
But it has a lot more than just the command manager
currently I have some really jank extending code for my commands :P
Command manager is the most useful part though
Yeah commands are annoying as hell without a framework
But my command manager would make your command look like this:
Command file with metadata
public class CustomCommand implements CommandExecutor {
String[] command;
public CustomCommand(String[] CommandString)
{
this.command = CommandString;
}
public CustomCommand(String CommandString)
{
this.command = new String[]{CommandString};
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args) {
if(CheckArgs(args,sender))
{
return run(sender,command,label,args);
}else
return false;
}
protected boolean CheckArgs(String[] arg, CommandSender commandSender)
{
return true;
}
protected boolean run(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, @NotNull String[] args){return true;}
public String[] getCommand() {
return command;
}
}
I jsut did this
wait
yeah
loop int:times string...:command {
help Loops a command
permission loop.use
hook loop
}
Then the method
wow
@CommandHook("loop")
public void loopCommand(CommandSender sender, int times, String command) {
// Do stuff
}```
frameworks man
It handles argument types checks and conversions for you
And you can add your own types and such
wow
- tab completion
I fu*ing needed this
yeah I was thinking how hellish it would be to make tab completion
It can also check and provide context (i.e. make sure they are holding an item, if they are pass it to the command hook)
And it supports unix-style flags
shading time
Not shaded
can I not shade it?
oof
Messages for RedLib are globally configurable and it has standalone features for developers though
Everyone always complains about it not being a shaded library 🙃
Why can I not shade it ;-;
Because there are both advantages and disadvantages to shading
Shading inflates jar sizes
RedLib is a rather large library
yeah?
Shading makes it hard to update for all your plugins that rely on a dependency
You have to recompile them all after modifying the build file
Having it be external also means you can configure the messages globally very easily
It auto-generates help menus, and you can tweak the colors and messages and such for those, among other things
but by default it does nothing right
It won't do anything unless you enable dev mode, and enabling dev mode just adds a few handy commands and tools
yeah I hated those plugins(like ess) who just replaces everything
It doesn't do anything at all except register a few events
and I have to manually disable them
Same, I keep it very lightweight
instead of enabling only things I need
Mhm
youre very pog
Dev mode enables a selection tool for the multi block structure library to easily export them
And it adds an in-game profiler and browser for the profiler
A command called cchain that lets you run multiple commands in a row, like /cchain say hi; say hi will say hi twice
That's all though
So even with dev mode enabled it's not intrusive at all
I love non-intrusive plugins
Lemme know if you wanna try it out, I'm always willing to answer questions about it and it has a slew of very useful APIs in it
Command manager is only a small part of what it has to offer
I dont know how to exclude things from being shaded
lol
The readme does say implementation
So I'm guessing that's what you want
I just copied that from jitpack though
So it could very well be wrong
I see how it is
also do you know how to, if possible at all, trigger a deployment at the end of a run config?
Yeah I added a deploy task to my buildscript
I type gradle clean deploy and it builds the jar and drops it in my plugins folder
oh Im using sftp :/
You could do it with sftp too
You'd just need to use scp
With an RSA key so it can skip password auth
sounds complicated as heck
you spend a lot of time sharpening those tools ey
auto deploy to all versions for test.. damn
You'd just need to have it run scp build/libs/*.jar name@ip:~/server/plugins or something
I never even thought of multi version
Yeah it's compatible with every version from 1.8 to 1.16
Should work on 1.17 but I haven't had time to really test it
I don't see any reason it wouldn't work though
Some of its features do not work with 1.8 though because 1.8 is a piece of shit 👀
I heard a lot has changed
Internally in nms yes
But spigot has a history of doing everything possible to not break backwards compatibility
And I doubt that has changed
RedLib doesn't touch anything nms
Its abstractions are built on top of the spigot API, not nms
nice
any one know why i cannot get a unreported exception java.io.IOException; when i try to load a config
Because it can throw an IOException
if file doesn't exisit im guessing
Well it's because it uses io
and you dont have code to handle it
And everything io throws IOException 🙃
I hate checked exceptions
So you need to either catch that exception or put a throws declaration
Alright, it's late and I have work tomorrow so I'm going to bed
@keen kelp Feel free to ping or DM me if you have any questions about my library, I'm always happy to answer
the file it ther
Put a try/catch around it
seemed to fix it according to the compiler
What the variable should be. like getConfig().getString(path);
whats the packet for when creepers expand before exploding
nms is going to give me a brain aneurysm, i swear
can someone do some very instruction clear on how to work and set up a config
I legit can't find anything useful
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
yeah like I said that was useless for me
how so
it doesn't really show how to format it, and also it was to much information that wasn't needed tbh.
Manually writing the file is quite simple. Stick to YAML formatting standards. ALL spaces, no tabs
?learnjava first
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
I don't know what it is but I can't cancel/modify any Async events (chat, login)
@EventHandler
public void onJoin(AsyncPlayerPreLoginEvent e){
Bukkit.broadcastMessage("Get the fuck outta here;");
e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_BANNED);
e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "test");
Bukkit.broadcastMessage("The player is still there...");
}```
Like this kind of shit just lets the player login no problem
Hello, how can I cast IChatBaseComponent to String?
do you get the broadcast?
both of them, yes
You are using a deprecated method by the looks
You probably need to set a
setKickMessage(String message)
nope PreLoginEvent is deprecated not AysncPreLoginEvent
Nah it's not depreccated
I said method not event
Still
there is two same method one take enum from PreLoginEvent thats deprecated
disallow(PlayerPreLoginEvent.Result result, String message)
Deprecated.
This method uses a deprecated enum from PlayerPreLoginEvent
They're using the first one
ah sorry
ye
I missed the constructor diffrence
In which case, I see no reason for that to not work
Anyway, did you try this ?
void
setKickMessage(String message)
Sets the kick message to display if getResult() != Result.ALLOWED
It might be necessary
unless you are doing something else in the code that you haven't show us
Is it possible to set a NBT data on an item without Bukkit modifying the key? They use NamespacedKeys that just completely changes the NBT entries.
not through the api
that the server uses NBT to store data is an implementation detail; it's not part of the API
The only way I found is to use reflection on the NamespacedKey class, I guess that's better than using reflection on the entire nms nbt system
Is there an alternative to java file to copy folders that won't will slowdown whole server when copying large folders?
do it off the main thread
doesn't it would slow down the server more? and how do I copy files over the main thread?
nvmm ye im dumb, I now see what u mean
how can i add a recipe?
bukkit.registerrecipe or something
current code:
ShapedRecipe rcp = new ShapedRecipe(
new NamespacedKey(this, randomString()),
getRandomIS()
).shape("abc", "def", "ghi")
.setIngredient('a', getRandomIS())
.setIngredient('b', getRandomIS())
.setIngredient('c', getRandomIS())
.setIngredient('d', getRandomIS())
.setIngredient('e', getRandomIS())
.setIngredient('f', getRandomIS())
.setIngredient('g', getRandomIS())
.setIngredient('h', getRandomIS())
.setIngredient('i', getRandomIS());
this.getServer().addRecipe(rcp);```
throws:
java.lang.NullPointerException: Cannot invoke "[Ljava.lang.String;.clone()" because "this.rows" is null```
On which line ?
ShapedRecipe.java:194
and which line is that
wait
No it should point at a line in your code
its not showing a line in my code lol
the exception is happening inside bukkit
but it will still show what in your code invoked it
yeah
what is that line
its showing my for loop
Send it
there is no for loop in the code you sent
one second im putting it on a paste servcie lol
ok
Can you send the whole error please ?
the exception itself is caused by addrecipe
Like the full stack trace
that IS the full stack trace
this ?
it's just one line
i'm not sure why but the internal shape string array seems to be null
im defining the shape from line 23 onwards
yeah i see you're defining the shape
that's why I don't know why it's null
try maybe not chaining the methods?
ShapedRecipe rcp = new ShapedRecipe(
new NamespacedKey(this, randomString()),
getRandomIS()
).shape("abc", "def", "ghi");
rcp.setIngredient('a', getRandomIS());
rcp.setIngredient('b', getRandomIS());
rcp.setIngredient('c', getRandomIS());
rcp.setIngredient('d', getRandomIS());
rcp.setIngredient('e', getRandomIS());
rcp.setIngredient('f', getRandomIS());
rcp.setIngredient('g', getRandomIS());
rcp.setIngredient('h', getRandomIS());
rcp.setIngredient('i', getRandomIS());
this.getServer().addRecipe(rcp);
Oh
time to fix that
Yeah
int leftLimit = 48; // numeral '0'
int rightLimit = 122; // letter 'z'
int targetStringLength = 10;
Random random = new Random();
String generatedString = random.ints(leftLimit, rightLimit + 1)
.filter(i -> (i <= 57 || i >= 65) && (i <= 90 || i >= 97))
.limit(targetStringLength)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
.toString();
oh
Found this online
i was just gonna define a char array lol
faster this way i guess
int length = 10;
boolean useLetters = true;
boolean useNumbers = true;
String generatedString = RandomStringUtils.random(length, useLetters, useNumbers);
System.out.println(generatedString);
even easier way
String generatedString = RandomStringUtils.randomAlphanumeric(10);
public String randomString() {
char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();
String str = "";
for(int i = 0; i < 32; i++){
str += chars[rnd.nextInt(chars.length)];
}
return str;
}```
One liner
return "4";
Lmaooo
That's bound to happen since you create 5K recipes
Nice
That's what you're looking for isn't it ?
Ahah
lmaoooo
It can't load anything else ?
Isn't your computer like dying rn ?
nah it has 1GB
Hmmm
hmmmm
you can use air as an ingredenti
Oh you just can't craft it
oof
Noice
nice benchmark ngl
jvm flag testing
not really a viable benchmark for testing memory related flags
just need to dial it back
all of the memory impact is from you stuffing old gen to the brim
actual memory usage patterns that happen on a real server mostly involve young gen spam
?paste
anyone knows what's happening here?
https://paste.md-5.net/tokegeqibo.coffeescript
From the information you have provided there is no reason this does not work. Provide more information
Pretty sure you are able to read a stacktrace by now
yeah but idk what it wants me to do
well, whats on line 62?
new CommandParser(this.getResource("command.rdcml")).parse().register("prefix", this);
well actually
clearly you havn;t setup redlib correctly
for debug reasons a removed a part of it
new CommandParser(this.getResource("command.rdcml"))
there's no setup guide
I dont see where a guide to set it up
You probably have to call some init method
there's no "getting started" section
No clue, never used it
every plugin gets to see every event
you can give the eventhandler a priority if you mean that
how can i get all registered recipes on a server?
read the docs
?jd
i cant find a way to get them by key tho
When I type ChatColor, it always tells me to choose between Chat API and Spigot, is there a way to prevent this? From my understanding they're the same thing.
they arent
then which do I use
i'd say chat api
i think i use chat api
oh right