#help-development
1 messages · Page 560 of 1
maybe spigot has support for it now tho
Yikes
Oof
Smells
how do you do it tho?
I just tried to understand the abstraction layers
And how different objects relate to one another
And the event system
I know JavaFX is kinda recent… but it feels so… obsolete
Fr
Javafx being recent?
Obsolete I concur with
Javafx used to be bundled with java until it wasn't
both is true
but html5 is the future
Try using swing
nah
🙃
otherwise we end like intellij
and intellij is shit
and yet the best ide you can use
Wasn’t it like, JDK11 when they removed JavaFX?
yeah
Or am I insane
I ran into this earlier https://media.discordapp.net/attachments/839628675947298840/1117954797056835675/image.png
Yeah intellij pretty shit but still best out there
JDK11 feels pretty recent to me
they even removed my beloved Pair with it
ngl I used to love using eclipse
Okay I think this will start me up...
How do I listen to some sort of "player broke a block" event?
Where are my plugin's local files in a server?
./plugins/<PluginName>/hereshould.filesbe
?jd-s search blockbreak
(BlockBreakEvent)
You can technically have your plugin files saved anywhere, but the standard is to use Plugin#getDataFolder
Ummm pretty sure there is a block break event
I mean, yeah, but is there not a... "Main.GetLocalPluginFolder()" kinda deal?
And a block damage one
Yes Plugin#getDataFolder
i always save mine in system32
Altho it returns File and not Path
I prefer File, why would it be Path?
Gotta love the File(File, String) constructor
nio > io
coll you are 12 or smth
<file>.resolve(<path (str/path)>)
I wish I was still 12
Experience terraria and minecraft again 🤤
This Java tutorial describes exceptions, basic input/output, concurrency, regular expressions, and the platform environment
Get a nice do over for the teenage years
I’m surprised it’s not deprecated or obsolete
Because it works
and so widely used
And its gonna be deprecated sooner or later
For instance its not as “serious” as Object#finalize
Which if use that, lets just say I wouldn’t go near physically
Aight, I'll use Path from now on! I used to use File for everything because of how practical it was
Nice :)
Do we need a Plugin#getDataPath now
i always write the last bit to my file in that method
Yes, pr that 🙏
Is the nio stuff in java 8 XD
Mhm
Nice
I guess I can do the PR later… if I remember
But I seriously need sleep now
Been up for 41 hours
Oh I posted on the wrong chat... I'll delete and post here
ReferenceQueue, SoftReference, PhantomReference, WeakReference, Cleaner, AutoClosable + twr
Goodnight ppls
I love kotlin. It's just beautiful
Cleaner
Goonight
That’s the one
cough scandalous java interop cough
I see I need to register listeners on enable for my plugin. Can I do it with reflection?
you can but it's annoying
Its a bad practice I’d say
yes, in onEnable. I mean that I have to make listener classes, then instance those listeners, then register them.
That means that for every listener I have to make a new instance and a new register and I wish to avoid that
Is there a good way to do it?
Well not rly
I mean just do it for now
Altho later on, registerEvent may be favorable
I still don’t fully get registerEvent
I've never used registerEvent what does it do lol
What don’t you get lol
you can lambda but it's much better to just create a class
This is what the tutorial teaches to do
You still need a listener for it don’t you
try {
Class<?> evnt = Class.forName("org.bukkit.event.entity.EntityDamageByEntity");
Bukkit.getPluginManager().registerEvent(evnt, new Listener() {}, EventPriority.NORMAL, (listener, event) -> {
// Do your thing here
}, this);
} catch(ClassNotFoundException ex) {}```
EventExecutor which is basically
Event, Listener -> void
the listener being new Listener(){} in elgars example
But like its there because, u can reuse the same event executor for multiple listener instances
I see
Why would you do that though
When do get registerEvent(Class<T>, Consumer<T>)
Na
It uses registerEvents
not registerEvent
hint: s at the end
🥲
That's evens fault
sacrebleu! I gotta pay more attention
Reminds me of Java's File and Files
Yeah classic one
void <T> registerEvent(Class<T> event, Consumer<T> handler, JavaPlugin plugin) when?
Tho
Think of Files, Objects, Collections etc as utility classes with factory methods, helper methods and utility methods
I mean it’s doable
Just replace T with T extends Event
well isnt there like Event and then CancellableEvent that doesnt extend Event for some reason?
oh, wtf was i looking at then
some event api i had looked at accidentally made it very hard to (nicely) generify bc of that
Sponge iirc does this
Mmm, no, Sponge doesn't do that. It has a Cancellable interface too lol
void <T extends Event> <T> registerEvent(Class<T> event, int priority, Consumer<T> handler, JavaPlugin plugin)
interface EventCallback<E extends Event> extends Listener {
void onEvent(E event);
static <E extends Event> void register(Class<E> type, EventCallback<E> callback, Plugin plugin) {
plugin.getServer().getPluginManager().registerEvent(plugin,priority,type,callback,(listener, event) -> callback.onEvent(type.cast(event));
}
}
Maybe?
Hello, i got a error with build.gradle trying to include all Jars in libs folder: https://paste.md-5.net/weyayosawe.cs
This is my actual build.gradle: https://paste.md-5.net/tivukugalo.rb
This is what my proyect looks like: https://i.imgur.com/0ayOv9Q.png
I havent use the BountifulAPI instance so, idk!
just wait for Valhalla
cant wait for List<int> instead of List<Integer>
does player interact event not fire if the player right clicks air AND is holding nothing?
tragic
~laughs in listOf()~
Well I mean its not really that much of a difference in the end
Cuz kotlin has to adhere to java and interop
I'm making an RPG plugin as a first plugin. Is it a bad idea?
Ambitious
I see...
You see, the thing is that after seeing mcmmo's codebase (and the original author's own distaste towards it) I thought..
What if I could make an rpg plugin that was SO complete and modular it was essentially an API any server owner could configure via YML?
Ye go for it

I have this code for custom configs: https://paste.md-5.net/avikohudiv.java
It is actually saving the file into the plugin folder, but not writing the stuff i write into resources:
Supposed to write this:
Actually looks like this:
Oh man it's worse than I thought
It's practical, sure, but not configurable at all!
It's like if SlimeFun decided it wanted to be an MMO
A lot of the big plugins have horrendously bad codebases. SlimeFun, McMMO, GriefPrevention (omg don't get me started), LiteBans
big != good 😉
Choco, a little help? 🥹
once the project is big enough, you really aren't in the position to refact it properly anymore
so you just add add add
and there you go
and most likely you dont even know anymore what the most shit is doing and you just see a gap where you can place another shit like
"huh, wonder what that does but i can place that feature here. the other stuff is not my beer"
Tech debt
this is why modular systems are cool :)
Can someone help this doesn't set the top half of a door
public void ReplaceDoor(Location location, Material doorType, BlockFace face)
{
Block bottom = location.getBlock();
Block top = bottom.getRelative(BlockFace.UP);
Bukkit.broadcastMessage(doorType.name());
bottom.setType(doorType, false);
top.setType(doorType, false);
Door d1 = (Door)bottom.getBlockData();
Door d2 = (Door)top.getBlockData();
d1.setHalf(Bisected.Half.BOTTOM);
d2.setHalf(Bisected.Half.TOP);
d1.setFacing(face);
d2.setFacing(face);
bottom.setBlockData(d1);
top.setBlockData(d2);
}
okay will try ty
When creating my own event, after adding the static stuff, will creating event listeners (with the right event parameter type) just work?
In other words, do I not have to register the listeners?
depends, are you calling the event?
I'd probably call the event off of another event.
yes you have to register a listener to listen
d'Oh of course you do, I meant something like.. nevermind it all makes sense now
registerEvents manages registering listeners for all the events I've set up?
registerEvents registers all the events you have IN a listener class
so long as you created an EventHandler for each in the Listener
great, thanks
Is a Player object able to represent an offline player or can they only be represented by OfflinePlayer?
A player does not have to be online
But you won’t get a Player object if they aren’t online
However it’s possible to get a Player object and then have them disconnect
Technically it is also possible to create a semi quasi player object too
Generally however it isnt needed nor really recommended lol
ngl i hate updates to mc as its always effort to udpate
and 80% of the time like 2 cool things r added
heyy how do you get the direction a door is facing? I want to spawn a door exactly the way it's looking, so I'm doing this:
Door d1 = (Door)bottom.getBlockData();
Door d2 = (Door)top.getBlockData();
d1.setFacing(world.getBlockAt(location).getFace(world.getBlockAt(location)));
d2.setFacing(world.getBlockAt(location).getFace(world.getBlockAt(location)));
I don't think I'm using it correctly
Then it sounds like you need to look into that. maybe i can give you ideas
Any way to get an Evoker or Illusioner to play their Celebrating animation?
There's no API for it so I assume it's packet based if even possible server-side
Ah, there is NMS code actually
net/minecraft/world/entity/raid/EntityRaider
isCelebrating()
setCelebrating()
so maybe a different way within the bukkit API?
Yea no, you can't set those two via the Entity API. You can only get the celebration sound
Is it possible to set via metadata?
Sometimes you can use that to set such things
Nope
It's something that's gotta be added to the Raider class
Ah
And then of course, implemented on the NMS side
Time for a pr
Paper has it kek
Pr it anyways
I haven't signed the CLA, nor do I plan on doing so
Lol
Then maybe i will
[Kotlin] What should I put as my Main in the yml?
Not too sure where it gets implemented on the NMS side actually
I built using gradle's jar task, and plopped the jar in the plugins folder of my spigot server
yet it doesn't appear in the /plugins output
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
That page has no mention about kotlin's main, which isn't as easily inferred
The plugin.yml is the same as java's
yes the class paths are not though
Help me out then; my JavaPlugin is MKRPGPlugin
nvm I have exactly 0 idea where tf it's being implemented in craftbukkit or nms kek
aight
The first line of the file
import org.bukkit.Bukkit
import org.bukkit.ChatColor
import org.bukkit.plugin.java.JavaPlugin
class MKRPGPlugin : JavaPlugin() {
val rpgSystem = MKRPGSystem(this)
override fun onEnable() {
Bukkit.getLogger().info(ChatColor.GREEN + "Enabled " + this.name);
}
override fun onDisable() {
Bukkit.getLogger().info(ChatColor.RED + "Disabled " + this.name)
}
fun registerEvents() {
val pluginManager = server.pluginManager
}
}```
To be clear
This ain't java
Or the whole file that works too
Can we see your gradle
Build.gradle
Also consider
?paste
Okay we’ll it’s one of two things
Im pretty sure you have to add a package statement to the beginning of your kt file
Your main class
But assuming you don’t try your group.project.classname
I don't think they've even got a proper package
You don’t need to put the package for the directories I’m pretty sure
But I still think you need a package statement at the beginning of your files
kotlin.MKRPGPlugin xd?
I'll try this out
oh, so I can just add it to a package and it should pretty much work. Aight
Yea
And you should probably have one anyways instead of having it in the root
Oh and also
You probably should’ve checked the console for an error
If the main is wrong it’ll show up there
And tell you
Just did, says jar doesn't contain plugin yml
I'll review the tutorial
Is it in your resources?
smack dab in src
Move your plugin.yml into the folder called resources
Any file in the resources folder (for gradle and maven at least) will get copied into the jar exactly as is
As opposed to in the java or kotlin folders where they would be compiled
Presumably
Alright. it took me for an error and debugging loop and now I'm at trying to get the correct supported api version
I'm using spigot 1.20.1; and api-version: 1.19.4, console says Unsupported API version 1.19.4
I guess this is because that spigot version is not compatible with that api version? but I don't know
1.19
Great! now the issue is the main's location. I'll try and if I fail I'll just add the package clause thingy
src/main/kotlin
create your package on that
So can you try just doing the class name it should be the root
Kotlin doesn’t need folders for packages I think maybe
Idk, didnt use kotlin
That's it
We’re a bunch of java users trying to solve a kotlin problem
Okay we’ll if it worked then add a package anyways
New error~ though: org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
and that seems like a hot one
You don’t want your classes to be at root because you’re going to deal with conflicts and what not
You need the kotlin stl
There’s a plug-in for it
Or you could include it in the libraries section of plugin.yml
Probably better off using the plugin I'd guess
Probably
Just google kotlin spigot plug-in
There’s like 3 different ones
That all do exactly the same thing
Finally in business~
so, if I were to develop plugins with kotlin, I would have to tell the developer to add stdlib?
Should I somehow bundle the stdlib?
Is it an api for a plugin or a library (not a standalone plugin)?
what is it?
Ur thingy
my plugin right now is just a plugin; which I eventually wish to make into a library.
what I am wondering about is the kotlin stdlib
It’s just another plugin that yours depends on
so, it's normal for kotlin developers to require their users to add this extra lib? (like fabric does it?)
And anyways you could shade it too if you wanted
If you don’t want to depend on another plugin
What does it mean to shade a plugin?
Meant shade the std lib
To include it in ur jar when compiling
oh
so essentially, bundling it?
Yes
But when you shade you usually have it change the package of the things your shading
So that it doesn’t interfere with what other plugins shade
gotcha.
I think I'll keep it separate for now. Thanks for the info
one last thing. In java, something like this works Bukkit.getLogger().info(ChatColor.GREEN + "Enabled " + this.name)
what I'm doing in Kotlin is Bukkit.getLogger().info(ChatColor.GREEN.toString() + "Enabled " + this.name) but that doesn't seem to work. What's the right way to do it?
Mannnn idk
use plugin logger, but use console sender if u wna send colored console messages
Roger. Thanks for everything! Console sender does use color~
Wait didn't they add rgb to minecraft in game text?
(as in, not locked to a set amount of colors?)
They did
Any idea how I can get my hands on that? is it getHexColor? That one seems slightly complicated (for what it seems to do)
You would use components for such things
declaration: package: org.bukkit.command, interface: CommandSender, class: Spigot
There is other methods, just an example so you get the idea in regards to using hex colors
Thanks!!
declaration: package: org.bukkit, interface: Tag
1.16.5
have not ?
it better aint gone by now then
Help how to solve this
try to add first respon to last line
refresh maven
and add dependency
I am a beginner and know almost nothing.
did not help, I rebooted left
how to install it
and figured out how to install
I installed but everything is still the same
@sullen marlin did you deadass use chat gpt for that forum post lmao
Tell us what you actually did
not something this vague
Reason I ask is i was bouncing ideas off it earlier for a PSA forum post i was gonna make and it came up with the exact same format lmao
first, as I was told, I restarted Maven, then I followed the link and downloaded BuildTools
read this then
ok
Wat
idk bro thinks everything is written with an AI now
On review I think its cause GPT is dumb and sees those things like "Hey spigot community" lines and is like "mmmm yes.... start any potential thread with this" lol
mb
Wait we can just tag md_5 with random stuff ? Cool.
Can you please look at SPIGOT-7118 once more ?
(tho I guess I could check if it still affects latest version)
I use commandMap to register commands so is there anyway to register tabcompletioner as well?
I'll add it to a list, but I'm not sure what the real fix is aside from just removing items for activation range since the 1/4 tick rate in vanilla is basically the same as the item always being inactive
I did propose either an additional entity-activation-range just for items but I can see how that could be silly.
Thank you for looking at it again tho. <3
Won't that still have the issue though?
How do you register your command, could you show some code ? Registering TabCompleter is basically the same process as commands
Well yes, but you could have the option to enable this if you really need this small performance boost.
At least that was my idea when I made the report - keep spigot functionality while having the ability to go back to vanilla.
for (Class<? extends Command> clazz: new Reflections(packageName+".command.commands").getSubTypesOf(Command.class)){
try{
Command command = clazz.getDeclaredConstructor(VendingMachinesPlugin.class).newInstance(this);
this.commandMap.register("vmp",command);
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
e.printStackTrace();
}
}
}
@smoky anchor I downloaded Build Tools but nothing helped
Did you run the it as is said in the post ?
Why do you use reflection?¿
:l I don't want to spend my day to just add things to plugin.yml
And what is "command Map" ?
and also I got how to fix it thanks^
Hmmm
@smoky anchor Are you talking about a bat file?
It's map with all registered commands
org.bukkit.command.SimpleCommandMap;
It's used to add commands at runtime
java -jar BuildTools.jar --rev latest
Yes, I just ran the error: Exception in thread "main" org.eclipse.jgit.errors.RepositoryNotFoundException:
repository not found: C:\Users\User\CraftBukkit
at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilde
r.java:627)
at org.eclipse.jgit.api.git.open(Git.java:93)
at org.eclipse.jgit.api.git.open(Git.java:73)
at org.spigotmc.builder.Builder.main(Builder.java:401)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
ok that I can not help with...
Hope someone smarter comes here :D
You need to run the command from the folder that has the buildtools jar in it.
how to run if my BuildTools is in downloads
Open the terminal (command prompt) navigate to where the file is located, then run the java -jar command
how do i ignore java version in start.bat ?
wdym ignore ?
Like use a different one ?
i have java 17
but spigot 1.16.5, only support java 16
can i ignore this?
You can't just "ignore" something
You have to use some java to run something.
You can specify a path to a different java version.
Instead of java -jar ... you do "path_to_java" -jar ...
You said that thrice
Have you ran the command ?
Did it succeed ?
yes
omg u still doing maven ?
install minecraft plugin dev plugin for intellij
That still would not help him with maven dependency no ?
But yes, download this.
he started new
I have it installed
did u create new project for 1.20?
no i just created a project
yes like 1.20
i wll show 1m
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.craftbukkit.v1_16_R3.block.data.CraftBlockData and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')```
I believe you don't do getBlockData but getState
Tripwire tripwire = (Tripwire) e.getBlockState().getBlockData();
e.getBlock().getState()
○6java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState cannot be cast to class org.bukkit.block.data.type.Tripwire (org.bukkit.craftbukkit.v1_16_R3.block.CraftBlockState and org.bukkit.block.data.type.Tripwire are in unnamed module of loader 'app')
wdym
wut
😄
?jd-s
Are there any custom world and ore generators API?
You could do it yourself using ChunkGenerator
Using math?
I would like made ores rarely or smth
This way you could hook to the default minecraft generator and change the ore generation
What's default minecraft generator
The generator that generates overworld as you know
Because making your ChunkGenerator basically overrides all generators
There is no easy way to change the default mc world gen
Would datapacks not work ?
I believe so long you only override the rarity of ores it should be fairly easy.
Well I hadn't played with it since the apparition of datapacks, so maybe you could do so with them!
anyonme good with packets here
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?paste
On join im trying to get it to tp the player to the coords (works im not 100% stupid) and make the sky look the end without putting them in the end error and code in link
https://paste.md-5.net/tadonicasa.cs
makes the overworld sky look like the ends sky
sorry im tired and learning packets
say i have a new ItemStack(Material.DIRT, 8);
If i have 2 stacks of 4 dirt in my inventory, this method would fire false right?
could of swore there was some universal method for checking if a player had x amount of item with data
correct, would return false
and i dont think there ever was a method for that
So only way is looping and manually counting then, sadge
Contains at least
Wait i rem
Copy code for remove
this wording is weird
It's what u want
why couldnt it just use the amount from ItemStack if i need to specify an amount
ah prolly for checks larger than 127?
yeah its not bound by that item stack
i shall give it a whirl, ty 
why not just return false
that code is confusing lol
only 3?
its 6 am for me
it might not even be a flex lmfao
for example it's 6am for me as well
but i've been up for 4 hours
"only" 3 makes it a flex
though I don't see the problem so help me here lmfao
true some people are built different and wake up at 6am, i could never 
oh
thats the goal 😉
they roasted me for this
not the other

OH
mfs hating on my holder variable 

yeah you've been up too long 
#verified message no where near as bad as this baby
nah i got this 60 minutes documentary about some british SAS officier who did war crimes were chillen
wait

it wasnt even joke code either
accurate representation of "make it look as complicated as possible and use the most lines to make it seem like more work"
that's why I like kotlin, you don't even need 3 lines to do that you just need one
tbf why even use a method for that 
i.e. fun String.validStringLen(): Boolean = this.length > 5
vs. ```
public boolean validStringLength(String str) {
return str.length() > 5;
}
unless its some api
when you get paid by the amount of lines of code you write
GOD i WISH
exactly
i recently saw the shit with node js having tens of one function dependencies
checks project line count
1400
mfw still broke
public boolean validStringLength(String str) { return str.length > 5; }
i got you
one sec!
well no shit I can also write an entire class in one line
but you get the point lmfao
the point is that it's unnecessary to have hte brackets
https://www.npmjs.com/package/is-ten-thousand
BEST NPM MODULE!!!!! (Check source code btw)
I remove the brackets on 1-line if's as well
YES
I used to do that but my colleagues started hating me for it
https://www.npmjs.com/package/is-ten-thousand?activeTab=code why so much bullshit
it's really fucking annoying when you need to add debug lines
because then you need to go back and add brackets
the official NPM repo had a leftpad function that failed
it's especially annoying if you want to add something to that if and you don't notice the missing brackets
nodejs devs are fuckin lazy
Array.isArray smh
I don't know what's worse. The fact this is downloaded that often or the fact that this is how you check whether something is an array
LMAO
880,000 is astounding
im sorry
we aint have all this fancy shit years ago 
pre es6 javascript was ass
or 5
idk so many
heehee [10, 1, 3].sort() // -> [1, 10, 3]
wdym was?
you gotta point
still is ass
anyone hate when that tiny project u were supposed to make turns into some collosol monster
i tried to make a js class on my webdev exam but i didnt even have classes 💀
like holy fuck this was just supposed to start out as something to make crops grow back instantly after x ticks 
your js doesnt have classes?
it should if its modernish
class Something {
constructor() {
}
get something();
set something(s);
}
wasnt using some modern version or smth
das lame
i missed types lol, it kept saying that my date was a string and i couldnt figure out why lol
thats why typescript is nice :p
you can even mix the 2
have your data schemas in ts and handle logic in js
dunno i just remember using TS and variable types for mongodb schemas and it worked doing that
im currently refactoring a discord client written in ts and its absolutely horrible lol
I made a paid resource and it's stuck on "This resource is currently awaiting approval." for exactly 2 weeks
From what I read on the forums they have a weekly routine of checking paid resources for approval, so it should be either approved or denied after 1 week no?
how do i check if a creeper exploding
The staff are volunteers and there is a limited amount of them. They have personal lives that come first and so sometimes there may be multiple staff members unavailable to clear the queue or help with it. Just be patient and they will get to it
Are you trying to disable the explosion or something else?
somethjing else
but i dont wanna check if it exploded
i wanna check while its exploding
don’t think that’s possible with just the API
it can take anything, from 12 hours to 4 months
just wait
so like i gotta do it myself?
my first plugin took 3 months to get approved, my last one was approved within 12 hours
If by yourself you mean packets or another form
then yes
Technically the event is fired before the entity actually explodes otherwise it would be difficult to cancel it
is there an on creeper explode event?
just do what you need a few ticks later after the entity explode event
There is entityexplodeevent
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
Check the entity for it being an instance of creeper
4 months is crazy, that's almost half a year just for a plugin approval, I have submitted it way in advance and it need it to be approved before a certain date
I understand the staff are volunteers but that's not an excuse for it not being approved
They could make it automatically approve after a given time (like 2 weeks) and then deny/block it later on once a staff gets to review it
or, you just wait
Like I said, I can literally not wait
You said 2 weeks. Now its 4 months? Doubt you been waiting that long
@tender shard said up to 4 months
staff needs as much time as they need, if you're unhappy with that, upload your stuff on another website
i dont see why you cant
Theres other places to upload in the meantime
It depends, the staff are volunteers. It rarely happens but that has happened in the past. You are not entitled to anything on spigot nor are they obligated to do anything if they so choose.
uh oh
Best option is to just wait
md5 gonna set em straight
Also you are not the only one waiting either
angelchest plus took 3 months to get approved, hence I just randomly said that it could also take 4 months lol
There is others just like yourself who have plugins in the queue too
off topic but i like your pfp
imagine uploading a premium resource with a very strict deadline😅
I know, that doesn't help my situation though
i dont see a reason it would need a deadline anyways unless u gotta pay rent asap
there are many jobs that require no degree that can help with that aswell ¯_(ツ)_/¯
it took two weeks lol, I just looked
literally no idea where you got 3 months from
While unfortunate there really isnt much anyone can do unless one of the staff members or md decides bump your plugin to the top of the queue and check it etc
hm then it was another plugin
Is there a way to replace all same words into another only in 1 java class using Intellji ?When I use it, it replaces all words from all classes
i definitely know that one of my plugins took 3 months because when it got approved, I already forgot it
ctrl + shift + f for entire project stuff
The reason doesn't really matter, right now it's not that urgent, but I do have a deadline that needs to be met
Not entire project, just 1 class
Ctrl+R
or Cmd+R on mac
are you renaming a variable? right click -> refactor -> rename
whats ctrl r do
Its ctrl r
So what's the maximum time/average time for a project to be approved?
1 month
That's more reasonable than 4 months yea
Well its all estimates. Afterall it is a free service
You cant expect anything when it is free and not costing you anything to use it lol
friendly remind that #992483541126496266 is the best thread to ever exist
whats that laughing bruh
I need help with the protocollib api
I have this event it works fine and everything but I need the enderdragon to follow players pitch
like go down/up
Question I have this defualt config.yml
name: "Test"
And I have this method on my plugin class:
private void setupConfigDir() {
this.saveDefaultConfig();
String name = this.getConfig().getString("name");
this.getLogger().info("The name I've got from my config file was: " + name);
}
All good, I got "test" as the name string.
But, just to see if it would error or something, I decided to empty the config.yml file and save. Then I reloaded the server, and it stll said
The name I've got from my config file was: Tet
Why didn't it error or re create the line?
and even after reloading config.yml is still empty.
If I manually re-add
name: "Something"
to the file it actually prints Something instead of Test
If I have
name="One name"
name="Two names"
in the file only the latter will be printed.
Apply the player direction velocity to the entity
@deft thistle saveDefaultConfig() will fail silently when the config.yml already exists, this is why the file stays empty.
As for why it still return "Test", if my memory serves me well Bukkit will look in the default config.yml if it can't find a key in the regular config.yml.
That's correct
Entity#setVelocity
It takes a vector as paremeter
You can use the Player#getDirection vector
you have to use getDirection
Bro
player.getDirection()
Just multiply the vector according to what you want to do
Paul extends a televised classroom lecture on vectors to explain the resultant velocities of airplanes in wind.
that depends on a whole bunch of factors
thanks for the explaination 🙂
Basically it would double the power of launch
think of it like this: How far will a ball go if you accelerate it to 10m/s?
The answer will depend on things like friction and the angle you launch it in. A ball shot straight up into the air won't go for, a ball shot in a balistic curve will go far. A ball that goes over the ground won't go very far due to friction with the ground
Yes, ish, as MC has drag and gravity
Calm down and use google thank you
the direction should be a normalized vector, so a length of 1 which I assume leads to a speed of 1m/s
And basically you can compute vector by substracting locations for instance
See the vector as the arrow showing where the entity will be launched
And it's like for the power
Is there a way to limit customnames viewdistance?
example. If the entity is 10 block away, you wont be able to see its custom name
You can manually toggle the nametag on and off
I guess you could use a text display entity as a passanger for the entity
If you're on 1.19.4+
teams are enough
im on 1.19.4
No need for additional entities
what
I'm currently using onPlayerMove function wich can be laggy if too many players are on and move
I mean you could just let the client handle that "logic"
Theres no other way?
well I am sure your algorythm for the toggling could be more optimized
But I would go for display entities, tho others might have a better idea
alright thanks
put each player on a team and disable the name tags once out of range
calculate in the player move event, but ONLY when a player moves a full block
would this work per-entity ?
I imagine they are working on something similar to HP display
yes, a team per player
yes but if you have two zombies, one 5 blocks from you and one 15 blocks from you
Only the first one should have the name visible.
Would teams work like this ?
I thought it was just player names?
From this message I would assume any entity.
But they have to answer that
possibly. perhaps armorstands
Text Display is more efficient I am sure
if it's more than just players then text displays may be better
but it all hinges on what specific entities they want to hide the names of
Like you can just set a view distance for them and the client will handle all of that itself
No custom logic for that needed on server
yes
what if the entity is coming towards you tho?
while the player is standing still
first, what entity names are you wantign to hide?
Every entity with a custom name basically
every?
so could be zombies, armorstands
In that case use teh passenger/text display entity method
well then the text display passanger would not work as a player could not mount a horse for example
You'd have to handle those edge cases for rideable mobs
set a text display as teh passenger of any entity you spawn with a custom name
That wouldn't work on older version tho would it? 1.12.2 1.16
no
you said you're on 1.19.4 tho -_-
Yeah I forgot that I try to support older versions too
then dont :D
then give up
haha
idk why ppl try to support old versions anyways
Like I understand 1.8.9 but anything between that and latest is pointless imo
maybe 1.12.2
I was just asked for an old build for 1.4.7
Well im making a 1.19.4 plugin I heard usually all 1.12 plugins are supported all the way to the newest
huh ?!
many plugins support older version but generally because they've been around that long
Yesterday someone wanted a build of GroupManager for 1.4.7
lmao
I currently only write plugins for the latest API
if more devs did the same a LOT more servers would update quicker
everyone wants teh latest and new plugins
It's just that we use some specific outdated versions of plugins that we patched
but we also have like 40k lines of code in a single project so it's on us to update
Damn
yep, only so much you can abstract away from Bukkit
we use a bit more than bukkit
Many times I've written my own abstraction layer between a plugin and Bukkit, but it's so annoying
closest I have to that is the Module system at work which is basically a mini javaplugin
For most plugins it's a waste of time, but 40k lines and it is
and we just have a little registry system that checks for dependencies
So that modules that depend on each other can be accounted for
And all the utilities support both JavaPlugin and modules
(the module class always has an instance of the real plugin injected)
Don't you have like some NDA ?
Or was that a different person :D
Not for this project
I've signed like 4 NDAs in total and they're all for projects I'm no longer related to
One of them was kinda useless, I just went there, worked for like a week and just wasn't feeling the vibe
is there a logging method that displays a different color in console? i want one to communicate a specifically good event but it has to stand out, severe is red but obviously for bad events, info is white and doesnt stand out, and fine/finer/finest doesn't show
so do i just log in fine/finer/finest and manually message the consolesender
get the consolecommandsender from bukkit then use the CommandSender#sendMessage method on it with colour codes
nope
Yeah, nah you just Bukkit.getConsoleSender().sendMessage("§agreen chatcolor or "+ChatColor.AQUA+"aqua");
and then you miss out on logging levels
I never saw the point tbh
you'd be doing both
the message doesnt log
so thats why you log again in finer
or fine or finest or whatever
wdym? The messages do go into the log file
yes and they make logs MESSY
the Logger exists for a reason
The colors is just windows/jansi or whatever its called being shit
Depends on what you want to see ig. I like to use prefixes like §7[<plugin name>]§c<error message>, makes them easy to find
I really dislike how the logger looks though
im gonna cry 
dont send console messages then
XDD
Whyever not?
you have a logger
Which, as I said, I dislike. Looks gross.
theres nothing different
just because you dont like it doesnt mean ur end users dont too
why does it give me java.util.UnknownFormatConversionException: Conversion = ' '

In my 10 years of hosting, I have only needed to look at the log file twice. I only normally need to see the console window.
the single % ig
The only thing bad about the logger is you can;t change the logging level at runtime.
have you ever needed to?
oh wait its %s
yes
fucks sakes im dumb
many times. It used to be a very handy debugging tool
but the switch to log4j removed that ability
doesnt setLevel work at runtime hmm?
so thats why mongos logger kept yelling at me
probably because of this
idk
How can I remove this message, when I am clicking on Interaction? I can't find info about it
is it your own debug message?
If so ctrl + shift + f your project
You probably have a debug message you forgot
hahahah, lol
i love my good ol bukkit.broadcastmessage debugs
so useful but embarrassing when they get left behind xD
Probably everyone here has make a release and forgot a debug message at some point
My solution is to have a debug toggle and not get rid of them.
lazyness
This^. I had all mine in a different logging level, but log4j broke all that
Helps to debug issues when other users have a problem.
I never used the log levels or the built-in logging, so I had no log4j issues.
I just know it was a big stink for a bit
Then paper add that stupid nag to prevent you using sysout 😦
I didn;t care as I only use Spigot, but I got enough complaints
paper is all about telling you how to code your own plugins
yep
I've never bothered looking at paper. Spigot does everything I need.
paper does some cool async stuff and events, thats about it
events can be made by anyone tbf like the ArmorSwapEvent one
It is more performant, but it gets a lot more credit than it should
concurrency vs parallelism go
Tbh spigot is one of the best-organized, well-put-together, intuitive libraries out there.
Its the most solid
Kudos to md_5 and team.
Oh noes!
someone just sent it like 2 days ago
how can i get and store all the metadata of a player inside of a map or an object ?
tried this approach but it returns an empty obj :
public JSONObject getPlayerMetadata(Player player) {
Map<String, Object> metadataMap = new HashMap<>();
for (MetadataValue metadata : player.getMetadata("")) {
metadataMap.put(metadata.asString(), metadata.value());
}
return new JSONObject(metadataMap);
}```
i know this isnt right place to ask but its related to minecraft. why is nt there my integrated graphics? my cpu is i3 2100
my GPU dies when setting fps to unlimited
so i want to use integrated graphics
instead
go into nvidia settings
ok wait
nvidia settings i think
and you disable it
or
plug the hdmi into the motherboard's video output instead of your gpu's
ok im here
and restart your computer, way easier
not a fan of opening case
just plug your hdmi in the mb directly
you dont have to open it, just plug the cord in the motherboard IO instead of your gpu's IO
how would i create a smooth moveable cursor like the one shown in the video?
this is what i have so far
// Inside the CustomMenu class
@EventHandler
public void onPlayerMove(PlayerMoveEvent e) {
if (e.getPlayer() != player) return;
Location movedFrom = e.getFrom();
Location movedTo = e.getTo();
if (movedFrom.getX() == movedTo.getX() && movedFrom.getY() == movedTo.getY() && movedFrom.getZ() == movedTo.getZ()) {
e.setTo(e.getFrom()); // same effect as e.setCancelled(true)
e.getPlayer().sendMessage("Moving cursor...");
}
}```
well, it works but it's very jittery and not smooth at all
https://cdn.discordapp.com/attachments/1107361652891979830/1109611622521122908/2023-05-05_12-28-08.mp4
i have no idea how to do that and where. lets do it on nvidia
change your starting display to mobo in bios first,
sounds better
3d settings
man unplug the damn cord and put it in the other hdmi slot 💀
cord of what
your hdmi dude
uhh sorry what?
you are freezing the player in place constantly
the video cable, the one that runs from your monitor to the back of your computer
What is the thing plugged between your monitor and your PC?
ah yes you cant even set preferred graphics
yeah, that's what im supposed to do

uh oh
why
does your mobo have VGA? (the blue thing) female port?
when the player moves his cursor, the snowball moves to that point on the screen
mobo?
send a pic of the back of your computer please
montherboard
uhh ok ill send pic
don;t set pitch and yaw
where did u get that picture from
his nvidia control panel
if i do e.setCancelled(true) it produces the same effect
motherboard
so i need to send pic of my monitor's back or case's?
Don;t set pitch and yaw
case's
got discrete graphics enabled in bios or smth?
ok wait
pitch and yaw are elements of the players location
huh? but the player head isnt supposed to be moving
man doesnt know what an hdmi cable is, dont make him go through bios
the user's mouse moves the player's head, changing the yaw and pitch values
💀
yea ik, but in the video, the snowball moves whenthe playermoveshis head
you shoudl only set to to from if the x,y,z do not match
there is no need to, just show us the back of your computer
allowing pitch and yaw to change
ok wait im opening discord on phone
because it reads the yaw and pitch
that's what i don't want to happen tho
what?
if they dont change the cursor doesnt move
see the vid, the player's head isn't moving at all
yeah I didn;t watch the vid
its only the snowball that's moving
the player head somehow stays in place
take the blue cord the one at the bottom
while still being able to move the snowball
and plug it in the motherboard's correspective port
the blue port
the one under the white port
turn off your computer then unplug this :
how will that help changing minecraft's usable resource to integrated graphics? ;-;
plug it in here, then turn the computer on
Its jerky because you are resetting the location on every single interaction/movement of the mouse
No way around that
it does
can you explain little bit
your computer wont be able to use your graphic's card to process the video
only video?
so it will default to your motherboard's video output, which uses the cpu's integrated graphics
how did the guy in the manage to make it so smooth?
will it need additional setup when i turn it on?
no
ok ill do it
go
calm down ;d
im chill
All videos cards have passthrough
you shoudl not move the cable as you will never use yoru expansion graphics again
pretty sure he doesnt need a 430
For what reason do you want MC to run on your onboard video?
better off his iGPU
What is their dedicated gpu
gt 430
didnt specify
if it has an add in gt 430 it's going to be better thasn their onboard
They might not even have an igpu
no point in adding the card if it's worse
Why did you assume
if they have a 3rd gen i3 probably better off the 430
how is the thing in the video possible tho? i doubt even packets would be able to do that, cuz its more of a client thing
@charred blaze don’t move the cable
because they asked how to use the igpu, they didnt ask if their igpu was better than their dgpu
ok
I don;t see that it's possible
Oh
@charred blaze can you please provide us some extra information
since they just asked how to switch from dgpu to igpu without providing extra information i just told them how to do what they asked for
What cpu does it have
Thats faur
Fair
However if they have a gt 430 then they probably don’t even have an igpu
thats what i also thought
i3 2100
it think its time to upgrade big man
@charred blaze why do you want to switch
gpu is dying when unlimited fps
its crashing
so ill try idk
yeah no dont switch
can i boot it now ?
lol, no point in running unlimited fps on that rig
what
you can try
but the gt430 is better than your igpu
intel hd2000 graphics sucks
suck even worse than gt 430
can i booooot?
yes
exactly
ok
Then limit fps
limit fps to 60 or even 30. you will never use above that in MC with a normal display
Don’t switch gpus
limit it at 60 and run optifine
just enable vsync
dont switch cables, run optifine and vsync
no video input
or even better, sodium
