#help-development
1 messages · Page 176 of 1
So since images are only artistic flavour, just ignore the issue
just as creative formatting
You can't have 100% on a picture, that is for sure
I like using images only because I have more customisation options than the markdown editor provided on the website.
https://www.spigotmc.org/resources/ecoarmor-⭕-create-custom-armor-✅-premade-sets-✨-upgrades-crafting-custom-textures.88246/ for example has an image transcription below
i told you
wait for 1-2 days
they will reappear
Does anybody knows how I can check, if an item is repairable?
just a spigotmc thing
it usually erases my pictures in threads
and returning them back in 2 days
the thing is people need to see whats on the images lmao
if meta is instanceof Damageable i guess
declaration: package: org.bukkit.inventory.meta, interface: Damageable
As I said, you need to have a transcription
Required by rules
Ayo illusion I got a suggestion: Pass in the menu, this allows you to not rely on outside variables :D
Thats my code, I want to ask in the if(?) line, if the item is an item that can be demaged, but I dont´t know how, does somebody knows what I have to do there?
public static void repairHand(Player player) {
if(player.getInventory().getItemInMainHand().getType() != null) {
if(?){
player.getInventory().getItemInMainHand().setDurability((short) 0);
player.sendMessage(Message.REPAIR_HAND.getMessage());
} else player.sendMessage("This doesn't work.");
}
}
main menu
yeah ill use my 999 iq god skills to guess that
i literally pasted the solution
They correspond to the file name
main can literally mean many things
if (item.getItemMeta() instanceof Damageable)
main is my plugin, module is my module
Screen readers?
- it can be a misspelling of "man"
- it can mean main plugin
- it can mean main menu
- it can mean maintainer
- it can mean main x (replace x with anything really)
Blind people (and people with poor eyesight in general) do exist
Java can be a misspelling of JavaScript
um, that's just an accessibility thing though.
If it's meant to be maintainer I'd call it maintainer
Seems to be ony valid for premium resources (what?) though
Also could spigot please have a dedicated place for rules
does anyone know how to find the binormal of a location's direction?
Okay actually, https://www.spigotmc.org/threads/premium-resource-guidelines.31667/ seems to apply to both non-premium and premium resources I guess
um, what?
But the "Resource descriptions should be of good quality." is exclusive to premium resources though
bruh
fix it
how can i get where the player is looking and spawn a tnt 10 blocks away?
Player#getFacing()
Vector direction = player.getEyeLocation().getDirection();
Vector direction = player.getLocation().getDirection().normalize();
Vector direction = player.getLocation().getDirection();
does anyone knows a way to check if a Path object exists or is Files::exist sufficient?
I wouldnt use Path
I would just use File
I mean i use File for everything, path, files , dirs
ye but im tired of writing so many lines just to create a file on disk
make an utility class so
kinda hot now
aMAZIN
just added support for nested queries
Fourten what repo are u using?
none?
oh ok
coded this stuff myself
private test thing
you dont add 5 letters in a misspelling
except if you have some disability with your hands
java is as much javascript as car is to carpet
JavaScript is the java represention/copy but with less implementation code
lol
i hate that stuff
forgot to change logic smh
why not just fail silently java smh
watch me make a pro gamer move
Fourteen could you help me to make an executor that allow to me to execute task with exceptions without needing you to try-catch them?
glad that works
[20:37:10 ERROR]: Error whilst processing packet net.minecraft.network.protocol.game.PacketPlayInUseEntity@7a3fd9c2 for TheLudoBile[/127.0.0.1:54079]
java.lang.IndexOutOfBoundsException: readerIndex(2) + length(1) exceeds writerIndex(2): UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeDirectByteBuf(ridx: 2, widx: 2, cap: 256)
at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1442) ~[netty-buffer-4.1.77.Final.jar:4.1.77.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:730) ~[netty-buffer-4.1.77.Final.jar:4.1.77.Final]
at net.minecraft.network.FriendlyByteBuf.readByte(FriendlyByteBuf.java:1135) ~[?:?]
at net.minecraft.network.FriendlyByteBuf.readVarInt(FriendlyByteBuf.java:469) ~[?:?]
at net.minecraft.network.syncher.SynchedEntityData.unpack(SynchedEntityData.java:247) ~[?:?]
at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.<init>(ClientboundSetEntityDataPacket.java:27) ~[?:?]
at me.theludobile.shulkon.skyblock.NPCs.PrivateDialogue.talk(PrivateDialogue.java:37) ~[?:?]
JavaScript is basically interpreted untyped language
what does this mean
just catch them within the executor? kinda like cf does
how can it be representation
cf?
what version
completablefuture
ClientboundSetEntityDataPacket metadata = new ClientboundSetEntityDataPacket(new FriendlyByteBuf(Unpooled.buffer()).writeComponent(net.minecraft.network.chat.Component.literal(string.substring(Math.max(0, nextIndex - 41), nextIndex))).writeVarInt(id));
Bukkit.getScheduler().runTaskLater(Main.get(), () -> p.connection.send(metadata), timeTaken);
at me.theludobile.shulkon.skyblock.NPCs.PrivateDialogue.talk
version mismatch for skyblock i guess
seems like you're trying to init a packet through the read constructor, but the data is invalid
just use the proper constructor
true
what can i help with tho
thought it's not your plugin i mean
what is that?
Have you learnt hava before coding?
certainly
ya know what constructor is right?
of course
IndexOutOfBoundsException: readerIndex(2) + length(1) exceeds writerIndex(2):
you messed up data
Im just trying to give the client entity a custom name
and i dont know what messing up data means
ya know move each new method to the next line and then check line which throws error
I'd generally recommend avoiding the read constructor
will see 🙂
hmm yes i love it when my code randomly stops executing without exceptions
Literally only there because the client makes an internal server
I was gonna ask this,
how exactly are you saying I should do it
i didnt know this was a read constructor
This applies both to ProtocolLib and NMS
I'm writing a v2
probably coming around christmas
full crash-course into nms
unsteable is correct for a menu button parameter?*
It will be to enabling/disabling button monving
manually resizing arrays like a pro
System#arrayCopy will fuck up your memory
How do I even make a bytebuf with a byte array...
oh
that was a dum question
What is even the difference between copiedbuffer and wrappedbuffer...
Google your question before asking it:
https://www.google.com/
you're right sorry
How would you guys create like an iceberg for example, would you use particles or blocks or armor stands, please tell me whats the best way (the iceberg will be displayed for a short time)
ij database tab seems to be broken tho
allocate
that's like a 3d shape full of polygons
Copied buffer is a strange name
But they are probably talking about netty bytebuf's not NIO ByteBuffers
ij ultimate is a bitch
Can someone help me get the tangent of a vector?
I failed math, still don't know what a tangent is, can't help
tangent is the red line
the normal is the blue line
normal is basically the direction the vector is pointing to
just broke my ide
tangent is like that direction but perpendicular
so you want a perpendicular vector
the tangent is calculated by dividing the opposite side by the adjacent one
thing is, the red arrow could point left
what if i just want to get rid of that warning?
thanks teacher, but where tf is it used
it's used in lots of things
like say u have a line
and u want to construct a road around it
you'd use the tangent
or in my case
I only know it because we use it on class with triangles
I want to make a particle circle
?
what
I dont know you tagged me?
I didn't though
he didnt lmao
fine trying to coding my menu api
nice nice gud luck
thanks 🤍
np
prev time i let this run for an hour and still it didnt finish
stupid intellij ig
yeah intellj runs sucks a lot
if only vscode has proper support for java
that why i use bash terminal directly
Yes bruh
VScode is amazing but not for java 😡
yeah the support really sucks for java but its amazing for stuff like JS or TS
dunno why they dont just add java support
smh
also good for py
I would love something like Intellij with VSCode optimizations, shortcuts, etc
^
TypeScript?*
yeah
no its built on JS and TS lol
Why not use Eclipse Eierlegendewollmilchsau?
Dont make swear
german?
Eclipse is the best shit i have ever seen
hmm i click on a button and it does nothing
If i have to use eclipse i would rather code in Vscode
yeah it's a german saying
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Eierlegendewollmilchsau basically means something that does everything - hence that edition of eclipse is incredibly bloated
oh shut up please
You are making me feeling diases
ahh
i really want to 🤢 now that i heard eclipse
eclipse 🤌🤌🤌🤌🤌🤌🤌🤌🤌🤌🤌
LMAFAO Eclipse SUCKS
Want to develop for rust? Eclipse Eierlegendewollmilchsau can do it. Want do develop in C/C++? Eclipse Eierlegendewollmilchsau can do it. Want to develop in Java? Eclipse Eierlegendewollmilchsau can do it. Want to do web dev? Eclipse Eierlegendewollmilchsau can do it too
ij can do it too, just with a plugin smh
not for JS neither TS
Im paying ultimate package and its shit
i like the sync feature
Eclipse basically has the same system of having dozens of plugins
Because i paid like $512 and i get access to all the shity jetbrains IDE
And none of them works so amazing than VScode
I had to install a db plugin for eclipse and it's all I need
both the database system and @Language annotation seem broken now brr
I told you LMAO
the other stuff works
System#arrayCopy() breaks everything
500 bucks lmao
i got it for free
Shicks for 5y
got it for free for three years in college
I don't even use it at all. Saves a lot of money
hehe thats a shit amount of money
the only thing i would use is literally ij, webstorm and clion
Same boat. The entirety of the JetBrains IDEs are free so long as you still have access to your student email. (Which I do :D)
no
In my case the student email i used get blocked
So i cannot register with it anymore
Its simply they dont allow more than 1 account with same email
🤔
isnt it like that on every site
Uhh, then change the password?
i mean this shit aint doing anything
he?
wtf the mouse cursed
happens to me but when i need to type
The | doesnt appear but i can write and move to another line
Hold on let me rephrase my question:
How do I find the orthogonal vector to another vector in spigot?
how to find orphans tutorial
only the deactivate and remove button works smh
guess they even havent implemented that feature
How does your computer even function at this point? lol
wdym?
have you tried import from clipboard? @tardy delta
the cursor is cursed on that vid ye but its normal
You had screen tearing of sorts not just a few minutes ago.
maybe you can just copy all your SQL and import from clipboard not sure
ye i created an empty database.db file, clicked import and it keeps running infinitly
tru
I would love to github wiki allows you to upload the content using .md files
No, I think IJ is cursed
I mean, have you tried the good ol restart?
cached cursor position
Are you using the latest version or smth?
now it says an update lol
yeah can happen
smh need my laptop for 5 hours tmrw without charging
Are u sending a buffered image?
lol works now
is anyone aware how to open db-wal file?
Code please
prolly sqlite
Which version?
You can either use SQLite nor H2
db console kinda hot tho
A player cant send § symbols
The coloring has to be done purely on server side
and how does some plugins allow you to use colors?
Sounds ilogic what u telling
🤔
the plugins translate the messages the players dont directly use the colors
I'm a little confused too. I'm pretty sure you can send that symbol, it's just that it won't display visually.
They dont use the '§' sign for this
They use the & sign and translate alternate color codes
they use the &
Yeah as i suppoused haha
The translation is done server side
heh ill just steal electricity of school with my 250 watt charger lol
Yes of course
I dont know what is he doing...
Because he never sent code nor a cap
The notchian client disables this symbol everywhere. In chat, in an anvil etc.
🤦♂️
sorry I only use the jebian
Visually yes, as it is reserved for color codes, but you can still copy and paste the symbol and then continue typing color codes. It won't display visually and show no indication, but you can still use it.
How do I do that?
U can either use SQLite or H2
bro what
The client wont send them
ChatColor#translateAlternativeColors('&', "&3colored text")
./sqlite3 tmp.db-wal
And if the server detects them anyways then you get kicked without the message reaching the server
Let me test something, because I know that you could send them in older versions.
Would be interesting. But you need to do packet inspection for this.
well no quite simply load 1.7.10 or something and send one and see if you get kicked
the thing is, sqlite viewer doesnt read the file
lmao
and idk SQL
onChat(AsyncChatEvent event) {
event.setMessage(Chat.style(event.getMessage()))
}
Ok, it looks like it only works in books, but you can still copy and paste the symbol there. I vaguely remember it working with anvils at one point, but it looks like it isn't the case anymore.
It fixed now fourteen?
Are u usuing reflections to assign the db properties to java?
Ok, now just don't update IJ until like 6 months from now and you probably won't have that many issues with it. lmao
lmfao
Like, deadass, it works. I was using IJ 2021 until recently.
this is basically what my select query is doing
actually wondering why i added a connector as param lol
ah i see
ill implement the rest of it in college lol, have to wait for three hours there
How can I ensure my plugin loads before all others on my server? I know there's pre/post world, but outside of that how would I do it?
you can't guarantee it
that its something that should be implemented for newer versions
you can't. What happens when two plugins ask to be loaded first?
right
What are you trying to have run before everything else?
Worlds!
I think that the only reason for doing that
Design your plugin so it doesn't matter when it loads
I mean, Multiverse loads worlds POSTWORLD and they are just fine.
with worlds that is not posible
yes it is
Because you must load words before everything
that's not the point
the whole purpose of this plugin is to disable another plugin
You can still do that.
oh that why haha
No you can load worlds at any time. there is an event for when they load
I don't want its onEnable to run
I understand I can disable it
I just don't know how to ensure the onEnable doesn't run
getServer().getPluginManager().disablePlugin("name")
Well, I'm not sure if it would disable it at this stage, but you could try calling the disable method in your onLoad() method.
Why are you wanting to prevent another plugin from running onEnable?
because the plugin comes preinstalled on the server by the host
Yeah, not going to help with that
I'm assuming it'll reinstall itself if you try to remove it?
yeah
what is your problem
would you like a random cosmetics plugin on your server running in the background?
Well, shitty host for one.
Second, no guarantee what I suggested would actually work. (Haven't tested it myself)
You are obviously trying to bypass a hosts limits/protections
it's not a protection
look into it yourself
instead of making assumptions about other people you should be a bit kinder
I'll give it a try
Just let it be there or pay for a host
If it comes preinstalled you should respect that since it's a free host
I don;t need to be kinder. you are trying to bypass a hosts requirements.
Thats obviously how they make their money to pay for your free hosting
they are funded by superleague (their parent company) the developers have said themselves they don't even break even
So you want to remove one of their funding models even when you know they are making a loss?
Thats kind of you
they aren't necessarily making a loss, the break even is just with ranks and stuff
not including the massive amount of sponsorships they get with nickelodean
Ew hapily
so theoretically would my plugin have to load after the other plugin since if I load it before it, when I try to disable it, it won't even be loaded?
omg hi outspending!
Hi!
how have you been
Good, you?
I've been solid actually just on my 4 day weekend
I bypassed a host security once
Same
I remember that a friend explain me a vulnerability to inject malwares jars into the JVM
Minehut moment
😬
Host are so amazing that they dont restrict server JVM
Ikr
So you can inject things via spigot
me on my way to host another server on the server 🏃♂️
me
No one?
I didn't see anybody tag you
💀
lol that gif is funny
Because the plugin is disabled. Pretty self explanatory
inb4 your reload command is doing
Bukkit.getPluginManager().disablePlugin(plugin);
Bukkit.getPluginManager().enablePlugin(plugin);```
When I tried this it was able to find the plugin, but it still ran through its onEnable
lol
i mean. it works no?

lol idk if this is sarcasm
but im gonna assume its not
if u disable ur plugin, then the plugin cant reenable itself, because its already disabled
how can i add Booleans that are always like part of the player in a way, like if they are ready or not ready
it was
you should use plugin.onEnable() instead
call them directly 
oh alright
how would I make a bool attached to the player
like a ready and un ready
class CustomPlayer
Reference<Player> player
Boolean whateverYouWant
i want to rotate it 90 degress so its vertical i guess idk
either use a custom player wrapper like above or just have a Map<UUID, Boolean>
Hiii is there anyway of seeing what plugins are conflicting with eachother one of the plugins i’ve downloaded isn’t working and I have 0 idea why
how can i teleport people from one world to another
does it just use the Player#teleport
Player#teleport with a location of different world
Sounds like a question for #help-server
You can just rotateAroundX
yeah but when I look in a X direction it works but when I look in the Z direction it doesnt
does anyone know how i can make an item uncraftable
nvm got it working
why is it going like this
my trigonometry is bad
private Map<String, Command> getKnownCommands(SimpleCommandMap simpleCommandMap) {
try {
final Field knownCommands = simpleCommandMap.getClass().getDeclaredField("knownCommands");
knownCommands.setAccessible(true);
return (Map<String, Command>) knownCommands.get(simpleCommandMap);
}
catch (Exception e) {
e.printStackTrace();
return null;
}
}
Why does this throw NoSuchFieldException?
Wrong code
Bit specific buuut
might be cuz of mappings or smth
CraftCommandMap extends SimpleCommandMap
but doesn't contain the field
as it's inherited
so replace simpleCommandMap.getClass() with SimpleCommandMap.class
CommandMap getCommandMap(Plugin plugin) throws Exception {
Field field = plugin.getSever().getClass().getDeclaredField("commandMap");
field.setAccessible(true);
return (CommandMap) field.get(Bukkit.getServer());
}
that is something completely different
Okay?
it's craftbukkit, not nms
hmn
I dont really understand the diff
Explain how it works
I dont even understand how spigot worrks
CraftBukkit is the abstraction layer that implements bukkit and calls NMS internally
it also does some changes in NMS for things like events
if it starts net.minecraft its NMS, if it has Craft at the beginning of the name its CraftBukkit (implementation). Everything else is org.bukkit (API)
bukkit was previous name of spigot right?
uhh sure
Bukkit is a set of interfaces
CraftBukkit is Bukkit, along with the implementation of those interfaces
NMS is mojang's native implementation
Spigot is a fork of CraftBukkit that originated after Bukkit got DMCA'd
Where they changed the build system to use buildtools
to comply with copyright law
So NMS works together with minecraft-sever right
Ah thank you
NMS is the minecraft server. net.minecraft.server (So yes)
That's not what I'm looking for...
What so?
Wdym
What do you need so
i dont know why spigot api doesnt have a getter for none of them CommandMap nor KnowCommands
hexic already got his stuff fixed
You can use the commandMap to inject commands without needing them on the plugin.yml
or you can inject a custom commandMap to fire new events
Hello, I am having problems with rotating a sign 180 degrees. I am trying to fix my DeathChest plugin and I need to rotate the sign on the chest 180 degrees, and I can't seem to figure it out.
I've used:
- Setting the Yaw
- setDirection()
- Directional
okay ill try that thanks
Can someone link me to a decent tutorial on how to setup Intellij for older minecraft/spigot versions?
IE : If you use the Minecraft generator -> spigot plugin -> you only get options for 1.19.2-1.12 by default ; looking for a tutorial on how to set it up for other older versions ( aka 1.8 )
Sorry, I meant the sign is on top of the chest, not attached to it.
Rotatable dir = (Rotatable) loc.getBlock().getBlockData();
dir.setRotation(BlockFace.NORTH);
loc.getBlock().setBlockData(dir);
// We need to update the state
loc.getBlock().getState().update();```
like this?
so remove the state update?
that may work, or you will want to get a state and work on that before updating
that didn't work
then use teh BlockState
okay
You don’t need to touch the state to modify block data
How do you find out which slots are involved in a InventoryClickEvent when the click type is ClickType.DOUBLE_CLICK ?
Double Click will grab other items in the inventory that are the same and merge them until the stack is at max size
I'm trying to figure out how to get the raw slot ids that would reference where the double click is grabbing items from
Hey guys, how can I create or paste an emoji/chat_tag etc of oraxen on another plugin?
Should I use UNICODE?
if you how?
InventoryClickEvent#getSlot()
So what i want to do is make it so that i can set a person's permission on initial join to be able to create a kingdom and remove it when they create a kingdom. However, i dont want it to be able to give the person the kingdoms.create permission if they are in a kingdom when they rejoin the server.
how would i do this?
if (p.hasPlayedBefore()) {
return;
} else {
//add permission
}
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if (!KingdomManager.hasKingdom(p.getUniqueId())) player.addPermission("kingdoms.create");
}
public void createKingdom(Player player, String name) {
// take permission
}```
or ```java
if (!(p.hasPlayedBefore()) {
p.addPermission("permission");
}
i think he needs another solution
return; else;
cuz not every player create a kingdom before leaving
the else is can be ommited
something like this, i believe
just do that then
PlayerJoinEvent prob
hey guys
as i can see you can't create a util class which works with files
like a full static util class
which works aroung plugin's folder
cuz you would need to pass a folder in constructor
.
so will be forced to have instance
You can, but you'd need to get a plugin instance each time
so singleton or
you can get that from JavaPlugin static
That only retrieves the slot that I clicked on
public static void loadFolder(File f) {
this.folder = f;
}```
in util class
not the other slots involved in a double click
just... dont use minecraft generator
and in onEnable
UtilClass.loadFolder(this.getDataFolder());
add api as dependency
wouldn't it work?
Yeah so I'm asking where I can find a tutorial on how to do that 😛
you can use static getter inside of JavaPlugin
Java Project
yes, but thats not really stateless
JavaPlugin.getPlugin
What is better for overall performance tho
using JavaPlugin you can get teh loading plugin so you don;t need to specify any plugin name, making the util class portable
calling getPlugin everytime or saving it to a static variable with a method called in onEnable
Sounds like a micro optimization
getting the instance is going to be slower as it is retrieving from a map, but not much
i mean isn't this thing better
...
its not a good design pattern
than calling getPlugin() everytime i use util class
for a util class
so basically it's allowed but is a bad choice
yep
tho i still think it's gonna be kinda faster
i don't need instance itself tho
i just need folder
a util class should not really require initializing
yeah, paradigm just conflicts with my real life decisions sometimes
Don't instantiate util classes 😭
isn't Singleton pattern kinda unofficial tho?
I heard it was defined in a book by Gang of Four
But wasn't mentioned in some Java-related books and documentation
You don't use a singleton you use a static
that's another question rn
not about util class for working with files in plugin folder
Back to the previous topic, if you have a loadFolder() method in a util class it won't break your program
just a "horrible design pattern"
but if this method is declared and used, you can easily avoid creating instance
cuz there is no real need in instance of FileManager with 99 static methods
The problem is, it can only get a folder by calling MainClass.getInstance().getDataFolder()
but if you have a loadFolder() method which you call in onEnable(), you can avoid getting instance of main class
so you would completely remove Singleton from your program
and only have DI and one class with static initialize method
Would be faster, but you would have folder path stored in memory as a cost
tho not a big deal
@vocal cloud what do you think about that
You don't name a class util and instantiate it. If you want a config you can instantiate you use a different name
i don't "instantiate" it
i just load a folder to static variable
without creating instance of FileManager
Lemme describe
in code
V "Util" FileManager class V
V Main class V
V and command class V
what is it for?
basically i want to avoid creating filemanager instance
why
and filemanager has all methods static
but the only way to get folder is by having singleton getInstance() in main class
from which you call getDataFolder()
but i want to avoid it too
cuz all of my static FileManager's methods require datafolder
and for each method i would call instance of main class which extends JavaPlugin
hmm well if you don't like typing getInstance() just shorten the method name to instance or get
I still think it's slower than my pattern
Just having datafolder saved in filemanager itself
gonna be faster
but i would need loadFolder() method in onEnable
i would need to write three different constructions tho
ClassName.instanceMethodName().getDataFolder()
2 with static imports
import static me.carefall.course.ClassName.instanceMethodName;
instanceMethodName().getDataFolder()
if i would use static import it would become unreadable
thats just lazy then verbosity can help code clarity
I never use static imports unless I'm dealing with components
Main.get().getDataFolder() vs folder
i can write folder 99 times with stored folder
or have two calls 99 times
without it
getting already pre-saved folder gonna be
a) faster
b) shorter
the only bad thing is guys would complain about it's not a real pattern
In your util class just use JavaPlugin.getProvidingPlugin(this.getClass()) to get your plugin instance
you mean
hol up are you really concerned about 3 method calls?
static {
folder = JavaPlugin.getProvidingPlugin(this.getClass()).getDataFolder()
}
yes
What kind of super micro optimalizations are you doing
umm i'm just vibing
so you promise it would work for basic minecraft plugin this way
don't look at undrline
i just made all of this classes myself with no spigot dependency added
if it were me I'd make it a private static method, then call it in a static final field
I got some motivation to write my NMS crash course
wrote a bit about packets and now I'm writing the entire tcp protocol
you are already writing it, aren't you
it may, test it and see
kinda
so glad i don't give a shit
but it's allowing the class to handle its own initialization
Well as long as Java don't set this as deprecated
It's fully legal
basically found a use for it
if they did that version would die quick as fuck
getting dataFolder from javaplugin in a static class
avoided DI and Singleton and everything else
tho is getProvidingPlugin using reflection
I don't believe so
it doesn;t matter if it is though, it's a static final field so it only ever gets called once
@NotNull
public static JavaPlugin getProvidingPlugin(@NotNull Class<?> clazz) {
Preconditions.checkArgument(clazz != null, "Null class cannot have a plugin");
final ClassLoader cl = clazz.getClassLoader();
if (!(cl instanceof PluginClassLoader)) {
throw new IllegalArgumentException(clazz + " is not provided by " + PluginClassLoader.class);
}
JavaPlugin plugin = ((PluginClassLoader) cl).plugin;
if (plugin == null) {
throw new IllegalStateException("Cannot get plugin for " + clazz + " from a static initializer");
}
return plugin;
}
in case you are really curious ^^
Question how can i support voting to bedrock users with nuvotifier?
Does it work with votifier?
nuvotifier yes
how would i fix this?
at org.bukkit.craftbukkit.v1_19_R1.CraftRegionAccessor.spawnEntity(CraftRegionAccessor.java:400) ~[paper-1.19.jar:git-Paper-81]
at me.outspending.mobgens2.Generators.summonMob$1$1.run(summonMob.java:45) ~[MobGens2-1.0.0.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.jar:git-Paper-81]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.19.jar:git-Paper-81]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1491) ~[paper-1.19.jar:git-Paper-81]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.19.jar:git-Paper-81]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1415) ~[paper-1.19.jar:git-Paper-81]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1188) ~[paper-1.19.jar:git-Paper-81]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:303) ~[paper-1.19.jar:git-Paper-81]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
spawns mob
line:
var entity = spawnLocation.getWorld().spawnEntity(spawnLocation.clone().add(0.5, 1, 0.5), mob);```
[09:52:16] [Server thread/ERROR]: Tag not valid: null
what is this
i want to open menu if knowledge book is clicked
show your code
@EventHandler
public boolean openMenu(PlayerInteractEvent e){
Item item = new Item();
Player p = (Player) e.getPlayer();
p.sendMessage(e.getItem().getType().toString());
ArrayList<Boolean> ability_useable = ability.get(p);
Action a = e.getAction();
Boolean f = false;
if(p.getItemInHand() == null)return false;
if((a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK || a == Action.LEFT_CLICK_AIR || a == Action.LEFT_CLICK_BLOCK) && e.getItem().getType() == Material.KNOWLEDGE_BOOK && e.getItem().getItemMeta() != null){
e.setCancelled(true);
p.openInventory(i);
please use a codeblock
is there no proper error?
tag not valid: null is very vague
so it happens when you interact with the book?
yes
can you show the code where you give the book
Inventory i = (Inventory) p.getInventory();
ItemStack kbook = new ItemStack(Material.KNOWLEDGE_BOOK);
i.setItem(8, item.setSlot(kbook, "§d open menu"));
.setSlot is
public static ItemStack setSlot(Material material, String name) {
ItemStack item = new ItemStack(material);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(name);
meta.addItemFlags(new ItemFlag[]{ItemFlag.HIDE_ATTRIBUTES});
item.setItemMeta(meta);
return item;
}
pls use codeblocks o-o
ok
what version are you using?
1.16.5
ty
according to this you have to set the title as it defaults
looks like a minecraft thing
ill try it
https://paste.md-5.net/ejosaxaqec.java
https://paste.md-5.net/pejukutiro.sql
So... I cant find the problom, :A
Everything is in the plugin.yml
When I removed the case tpall it worked
Any solutions?
so if oyu remove the case it works?
I'll try that.
doesn't really make sense for the error given
no im asking if that is what you ar saying lol
wdym then?
when I removed the code in the red it worked
wait nvm
it doesnt
;c
idk what to do than
do you get an error on startup
that log says the plugin is disabled.
it says plugin is disabled
yea that
lmao just saw that
I used sharpkeys to replace my (shift + 7) with §
Alr, but does anyone have a solution for the error?
the plugin is disabled it must be
plugwoman
Yea
also why not use a command framework
i bind my /bettercommands reload to reload the plugin
will make your life a million times easier
doesnt mean anything
- I like to make changes like tiny text in quotes
reloading doesnt always properly reset your plugin
still could be using old caches, the wrong jar etc
just because it prints doesnt mean it's a definite reload
but it isn't tho
lmao
its clearly spawning it
it cant be
or im trippin
send your full code
Wait does anyone know why it's not sending the debug message?
java is a strongly typed lang
they only added var to avoid generics
not for lazy people to use all the time
no comment
mfw using var for literally every single type except the generic
wait am I tripping or is this guy using multiple maps instead of a basic data class
oh yeah Choco
also hi choco
@worldly ingot how does this make you feel
die
case "tpall", "bringall" -> {
Bukkit.getConsoleSender().sendMessage("Debug");
return true;
}
ma debug message is not bein sent
bet
and see if the method is even being executed
maybe you should add events to Bukkit#dispatchCommand so I don't have to do this tomfoolery
ServerCommandEvent?
Uhh not sure about newer versions but afaik that only fires when the console runs a command
I got both debug messages
uuh how
i have no idea (get it cause intellij ik its stupid) but ill just go with it
There's PlayerCommandSendEvent which is fired when the player first logs in and brigadier sends all commands to the player
ethan you gotta stop copypasting code
wdym?
wtf am I looking at jesus christ
https://paste.md-5.net/qitokafema.bash
https://paste.md-5.net/ecefafogem.java
I dont know what to set "Player onlineplayers = (Player) Bukkit.getOnlinePlayers();" to
you are trying to make a colleciton of players a single player?
use a for loop
also, that if statement is probably unneeded.
CommandSender has a getName method that you can use
so my command works when I do bettercommands:clear but when I do /clear it goes to default mojang clear
That's how it works?
I want it to override?
Fork spigot?
like my /gamemode command overrided it
No idea if you can since it's written that way to prevent overlap
oh wait I just had to restart it fixed itself
time to make a invsee 🙂
holly crap player.openInventory(target.getInventory());
actually lets me edit the inventory too, this saves me soo much time!
How can I set the inventory name?
For this?
https://paste.md-5.net/uvexamuguk.java
Soo I cant edit any of the guis (for the crafting table I cant even craft)
How can I fix this/
It's more difficult than you think
The proper way is to create a fake tile entity so it can fire events
or set it at some very far location
Any quick way to do it?
eh not really no
You know the plugin essentials x?
Do you know how they do it?
So I can get source code
just look at the source code
github... just put some effort ffs
I really dont understand that
oh yeah there's Player#openWorkbench
;P
There are no docs or anything on google that can help me
About opening an anvil inventory thats functional
I doubt that google doesn't have an answer lmfao
spigot doesnt have a method for it i would guess
- i have would have to do this for a loom, carto table, grindstone and more cause thats what my plugin is going to do
take a look at AnvilGui
Where?
?bing
Bing your question before asking it:
https://www.bing.com/
Google your question before asking it:
https://www.google.com/
you only ever use bing becuase its not google
since when was opera a search engine
wait opera is google
correct
;P
?bing
Bing your question before asking it:
https://www.bing.com/
Because you usually have methods like https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#createInventory(org.bukkit.inventory.InventoryHolder,org.bukkit.event.inventory.InventoryType)
declaration: package: org.bukkit, class: Bukkit
Well, if this is the case. I'm just going to halt on this project until they update and add inventorytypes for all guis. If they dont that will just suck.
Because I'm not spending 2 hours creating a gui for every utility when I can just get one from the creative menu
not 2 hours*
or you can be the one and either provide said api or PR it
Welp you gotta do it yourself or wait for it to get done
i'll do it for 35€/h
I'm doing a custom fall damage system using my own custom health system (Scoreboard values if you're wondering) and I'd like to know how I could make fall damage scale with health since even 500 health would require me to fall from 80 blocks high to do any noticeable damage.
It's just an override of the normal fall damage calculation btw.
Does it work?
I saw many people saying it does but only one way to find out :)
Or maybe not idk
CraftBukkit stuff will work for Spigot
Its erroring though
Does it use NMS?
if it throws errors, ?paste the errors
we need cafebabe commands to work mid messaegs
dont question my spelling blame speed
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
i dont think that the bot supports that
it's just REDv3
why do I get zero if I can’t get zero here (code below)
package dice.dice;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public final class Dice extends JavaPlugin implements Listener {
public Dice() {
}
public static Dice plugin;
static float dado;
FileConfiguration config = this.getConfig();
@Override
public void onEnable() {
plugin = this;
this.getServer().getPluginManager().registerEvents(this, this);
this.getConfig().getString("ran1");
getCommand("dice").setTabCompleter(new ComCompleter());
this.config.addDefault("ran1", "ag");
this.config.addDefault("ran2", "op");
this.config.addDefault("ran3", "ov");
this.config.addDefault("ran4", "neg");
this.config.addDefault("ran5", "sha");
this.config.addDefault("ran6", "sluha");
this.getConfig().options().copyDefaults();
this.saveDefaultConfig();
}
String I = getConfig().getString("ran1");
String II = getConfig().getString("ran2");
String III = getConfig().getString("ran3");
String IV = getConfig().getString("ran4");
String V = getConfig().getString("ran5");
String VI = getConfig().getString("ran6");
@Override
public void onDisable() {
// Plugin shutdown logic
}
String dice;
public void main(String[] args) {
dado = Math.round(Math.random() * 6);
if (dado == 1) {
dice = I;
} else if (dado == 2) {
dice = II;
} else if (dado == 3) {
dice = III;
} else if (dado == 4) {
dice = IV;
} else if (dado == 5) {
dice = V;
} else if (dado == 6) {
dice = VI;
}
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args[0].equalsIgnoreCase("1") && sender instanceof Player) {
Player player = (Player)sender;
String nome = player.getName();
Bukkit.broadcastMessage("*" + nome + " get: " + dice);
}
if (args[0].equalsIgnoreCase("2") && sender instanceof Player) {
Player player = (Player)sender;
String nome = player.getName();
Bukkit.broadcastMessage("*" + nome + " gets: " + dice + " " + dice);
}
if (args[0].equalsIgnoreCase("3") && sender instanceof Player) {
Player player = (Player)sender;
String nome = player.getName();
Bukkit.broadcastMessage("*" + nome + " gets: " + dice + " " + dice + " " + dice);
}
return false;
}
public static void reloadConfiguration() {
plugin.reloadConfig();
plugin.saveDefaultConfig();
}
}```
This code makes no sense. Dice isn't even defined
That main method will never run in a plugin
that code is really bad and looks like its come from multiple classes
send the full class(es) on
?paste
mine actually makes sense
if (args[0].toLowerCase().equals("Hacking")) {
F
that's for me?
it is
im send
lmao
i found solution
if (args[0].toLowerCase().equals("HACKING".toLowerCase())) {}```
I was gonna say how can „H“ ever be lower case 🙃