#help-development
1 messages · Page 1370 of 1
getItemInMainHand().getType()
You're comparing an ItemStack to a Material
lol
Just ignore that that solution is overkill
omg please don't
For you can use == instead of #equals()
I will smack u
Jochyoua what have you done 🤦♂️
it works to an extent ig
I mean, it works
No shit
Can't complain
I would laugh if he's gone and @dusty herald just started a new terrible coding trend.

another question, since we are all talking about the same thing here, why does it happen twice when i right click a block and not the air?
like it runs twice
each hand
Bukkit.getScheduler().runTaskAsynchronously(()->{
Thread.sleep(Integer.MAX_VALUE);
});```
@dusty herald the tag works 😔
<3
messup in the code
bro tf is that
that looks like something i would add
a timer for ever
it does
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Directional;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
public class EventListenerTesting implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if (block == null || block.getType() != Material.OAK_BUTTON) return;
Directional button = (Directional) block.getBlockData();
BlockFace face = button.getFacing().getOppositeFace();
Block otherWallSide = block.getRelative(face).getRelative(face);
if (otherWallSide.getType() == Material.AIR) {
e.getPlayer().teleport(otherWallSide.getLocation());
}
}
}
but
won't hault main thread either
cpu stresser
Run this on the main thread:
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException e) {
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException interruptedException) {
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException exception) {
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException ex) {
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException exc) {
throw new InterruptedException();
}
}
}
}
}```
ngl probably won't won't compile without intellij yelling at me
last exception is thrown and isn't handled
could mark it as SneakyThrows :)
I wonder how much time it took to make Lombok
eons /s
Long.MAX_VALUE
Is there a way to get all of a plugin's commands?
yes
loop through EVERY combination of letters
getDescription().getCommands()
public List<Command> getCommands(String pluginName) {
for(Plugin plugin : Bukkit.getPluginManager().getPlugins()){
if(plugin.getName().equals(pluginName)){
return PluginCommandYamlParser.parse(plugin);
}
}
return null;
}```
plugin.getDescription() gets the plugin.yml
Does it now?
It does 
create a method for generating a random String.
Then
for(int i = 0; i <= 2_000_000_000; i++) {
Bukkit.getCommand(generator.nextRandomString());
}
Dont forget to allocate quite a bit of memory for the jvm 
Map<String, Map<String, Object>> commands = JavaPlugin.getPlugin(OtherPluginMain.class).getDescription().getCommands();
@unkempt ore
mem will be fine too

do that
just call System#gc() a few times
It's just on the current plugin
wym
couldn't you use PluginManager to loop plugins
getDescription().getCommands()
@dusty herald
(new Thread() {@Override public void run() {while (1) System.gc();}}).run()
JavaPlugin#getDescription().getCommands()
loop through PluginManager.getPlugins() and do getDescription().getCommands()
Weird
MacOS has always been the bane of society
to get the blockface do i do block.getFace (block is the variable of the clicked block)
to get the vector of a block face is it block.getface().getDirection I'm trying to make it so if a button is on a 1 block thick wall it teleports whoever clicked it to the other side of said wall
?spi
lol trying to get spigot api
?spigot
?jd
package index
thk my memory is bad
Not every block has facing data. So you would need to get the BlockData of the Block and check if this data is an instance of Direction then cast it.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/Directional.html
then how do i teleport the player to 1 block in that direction? (or how many I need to get to other side of wall)
hm, how can i compile my plugin with gradle?
claims some packages dont exist related to vanilla stuff
error: package net.minecraft.server.v1_16_R3 does not exist etc
You get the BlockFace of your Directional.
BlockFace has a method to get the normalized vector which points in that direction.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/BlockFace.html#getDirection()
same for craftbukkit
k
nms
You need to include the spigot artifact and not the spigot-api one.
But make sure that your BuildTools ran at least once with the target version so its installed in your local maven repository.
where can i get buildtools?
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
What is the alternative to data.set(new NamespacedKey(StoringData....
StoringData doesnt get detected in 1.16
any reason buildtools doesnt use the installed copy of git?
Probably just being stupid here but its not working
seems to prefer downloading PortableGit instead
Can a class in the same project cause a ClassNotFound exception?
Becuase I'm getting it
Kind of. This can happen when there was an exception during the <cinit> operation which is executed on class construction.
It happens when I do morphia.mapPackageFromClass(MyAbstractClassFromTheSameProject.class);
likely because you cannot really know what the system git is capable of
What is StoringData? More code plz
And it also infects the git configuration
i mean you'd expect people to have an up to date copy of git
do you want the class i made?
sure
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Directional;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class EventListenerTesting implements Listener {
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
Block block = e.getClickedBlock();
if (block == null || block.getType() != Material.OAK_BUTTON) return;
Directional button = (Directional) block.getBlockData();
BlockFace face = button.getFacing().getOppositeFace();
Block otherWallSide = block.getRelative(face).getRelative(face);
if (otherWallSide.getType() == Material.AIR) {
e.getPlayer().teleport(otherWallSide.getLocation());
}
}
}
I dont know infact I'm trying to learn persistentdatastorage
spoonfeeding 100000000000%
shhhhhhhhhhhhhhhhhhh
Either use the simple
morphia.map(SomeClass.class); or map the whole package. No idea why yours doesnt work
hes been working an hour on it
but I need to learn it on 1.16
give him some credit
When I did that it said Cannot map class
If someone else already made it, why waste my time
This guide from @eternal night lists everything you need to know regarding PDCs
https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
Thank you!
😅
can someone explain to me how to delete unloaded worlds on multiverse?
how can i do this?
should be something like /mv delete (wordldname)
?bt
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
i dont have spigot-api
And make sure you have mavenLocal in your repositories
What's Player's toString()
Object#toString()
well you have now
I'm just looking at someone else's code, and they did String + Player
So like, just kinda caught me off guard
whats the full string? i dont have spigot-api
?jd
package index
Could not find org.spigotmc:spigot:1.16.5-R01-SNAPSHOT.
Did you run BuildTools once?
yes
when i do it with spigot-api it works fine but gives me the same errors about the vanilla stuff
Your version looks janky
it should be R0.1-SNAPSHOT
^
i copy pasted it from the buildtools log
.
BT log [INFO] Spigot-API 1.16.5-R0.1-SNAPSHOT .................... SUCCESS [ 10.193 s]
aside missing vault
and [INFO] Spigot 1.16.5-R0.1-SNAPSHOT ........................ SUCCESS [ 29.482 s]
Btw dont add any jar to your project externally. Then you will instantly see if your dependencies got resolved.
yeah its working now
how do you mean "add any jar to your project externally"
you mean under Project Structure > modules?
i dont have anything in there right now
don;t add any external libraries. only make changes in the pom
i dont have a pom
oh 😦
i only have gradle
ah
How come I get the error java.io.FileNotFoundException: Jar does not contain plugin.yml, what am I doing wrong?
https://paste.md-5.net/qunatoxute.xml
?paste
That's literally all of it, you can read it
Delete that code block
Paste it on ?paste
It's so ugly and no formatting
Please
And it is your plugin.yml that's the problem
Not your pom
pretty sure your resources should be under src not main
name: BlockDrop
main: me.saywhathappened.BlockDrop.BlockDrop
version: 1.0
author: SayWhatHappened
commands:
```How come it's wrong?
That's how it was set up automatically?
why is your last package name with caps?
It should be in src/main
ok. I use a different structure so wasn;t sure
hm, now im getting a bunch of errors
in that case I'd guess you are exporting the jar instead of running maven?
I am running maven, just get a bunch of errors
What errors
how can i send a message with TextComponents?
Just build failure really
Can't help you without the error
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
some upstream of what i was building against had a p.sendMessage(ChatComponent), guess its not a spigot thing
ah yeah no i need to .spigot()
Dude, the main error is only that the plugin.yml file wasn't found and if you check the paste link, you see my full pom file
Nothing you can't cancel that event
I believe that's a Paper-only method, SpaceDash.
ah, i see
You could listen to the damage event instead
and check if the resulting health is 0?
Yeah
How does one make a new PersistentDataContainer to nest them?
Preferably without making a class for it myself.
??? Help?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I have the plugin.yml file
^^ Ignore him
Where did you get that POM from SayWhatHappened?
here is my problem
That method isn't static, tho, so I don't think that really helps much.
Delete everything in your <build> </build> and add
https://paste.md-5.net/decozayaqu.xml
lol that formatting
Hold on let me make that a paste
@hollow bluff ^^
We have javadocs for a reason
Okay gimme a sec here
I have no idea where you got your POM from
Why were you compiling to Java 6 and all of those useless settings ;/
Still getting the same issue
What error did you get this time?
same one
Impossible since you removed the cause
It won't make a new file if it's failing the build
I need more info than just Build Failure
Paste the full log
oh lol
It's compiling to Java 5
Add this: https://paste.md-5.net/okufegujoq.xml
Not to the build
Just inside the project
exactly that?
Yes
Player timeGetter = Bukkit.getPlayer(args[0]);
if (timeGetter == null) {
timeGetter = Bukkit.getOfflinePlayer(args[0]).getPlayer();
}
double time = timeGetter.getStatistic(Statistic.PLAY_ONE_MINUTE);
time /= 20;
time /= 60;
time /= 60;
time /= 24;
String timeString = String.format("%.2f", time);
p.sendMessage("§b" + timeGetter.getName() + " §3playtime is: §a§l" + timeString + " §bd.");
return true;
}``` it throws null pointer exception, any ideas?
okok build success, but still says that plugin.yml wasnt found
Make sure you use the new jar and not the old one
Where is the npe?
npe?
NullPointerExeption
so how to get player with offline player?
do you know?
You don’t
Check if they are online first
OfflinePlayer.getPlayer()
yep
Can't update project
if its null they are not online, or check isOnline()
🤷♂️ I don't use Eclipse
Intelij Idea > Eclipse
^^
The error message is the thing you should just look at tho
That error shouldn't happen since you removed the cause
Or at least you should have
if you did what I told you to
yeah i've already done checking for online players
now i want to get player from offline player
Well I did but the jar file just says BlockDrop-SNAPSHOT, and It still doesn't find plugin.yml
There is no Player object unless they are online
no
There's always a way. But don't
check out
how did you get that universe background
dirty screen 🙂
someone from here sent me it
do you want it?
They are programming in space
Smart
how can i replace PlayerInteractionEvent.getInteractionPoint()?
Error getting block in another world
Aha
idk why
it is just background image
Send code
how can i get the point a player interacted with a block?
String world = Excavation.getOreData().getPlayerConfig().getString("ores." + str+ ".world");
double x = Excavation.getOreData().getPlayerConfig().getDouble("ores." + str+ ".x");
double y = Excavation.getOreData().getPlayerConfig().getDouble("ores." + str+ ".y");
double z = Excavation.getOreData().getPlayerConfig().getDouble("ores." + str+ ".z");
Location location = new Location(Excavation.getInstance().getServer().getWorld(world), x, y, z);
location.getBlock().setType(this.material);
do you mean location?
yes
which event are you using if any?
something upstream of yatopia (probably paper), provided PlayerInteractEvent.getInteractionPoint(), which would return a location
You might want to add a few if statements so none of those settings are null
im using PlayerInteractEvent
um, a point is confusing. its not a part of Spigot. We use locations
thats not a Location
a location is a World, x,y,z, pitch, yaw. He is talking about a coordinate on the block face
I know they are not as I debugged the location and everything
Each point on the block face can map to a point in the world
Wait the world was actually null
no i mean, its a Location
Which is not a part of Spigot.
Yes, you probably want to ask whatever fork it comes from
It's Paper
new Location(p.getWorld(), 1233.1d, 34.3d, 632.5d);
this is valid code even in spigot
You are asking about Paper method. Not a part of Spigot. You need to ask them about it.
it won;t give you the intersection point
True
wouldnt it?
No
say i were to do this: p.rayTraceBlocks(5).getHitPosition().toLocation(p.getWorld())
um, thats possible
Does someone know how to fix this error https://mystb.in/StemJoyNever.prolog when getting something from the datastore? The metadata class looks like this: https://mystb.in/CompressedMarkerReveal.java (Morphia)
It's on the server
Then why can't it find it's class?
Idk, I have it on the server. It accesses it at startup just fine
Make sure the jar you're using is up to date
It is
and/or is the same version your dependecy is
Turns out spring boot doesnt work with spigot or i am very stupid to make theme both work, how do you recommend me to make an api endpint then (i need to get discord user id from get and then respond with there username uuid and vault balance on the server - this will be used for a discord rpc mod for farbic that will have more details about the game and what the person is doing using the new discord game sdk)
Dont worry i have already a database ready with user id - uuid links
Yeah and the plugin is also a discord bot too (JDA)
So a Fabric mod is sending a request to your server for data?
Yes
No its not using it
Do that it will make you're life easier
It needs to be just an api on the plugin
That's what it was created for
can you link me some guides or wikis about the messaging channel and how to use it
You can send a request over the messaging channel and then reply with the data directly no need for extra dependencies here
since i never worked with fabric before to this extent
This looks promissing then
You can look here on how Choco does it with his VeinMiner plugin: https://github.com/2008Choco/VeinMiner
It's not much required
Yeah most of the work is done for you
are you trying to get teh default config?
wait i can use YamlConfiguration.loadConfiguration()
thats for modifying spigot.yml tho @quaint mantle
Ohhh
i guess i should use YamlConfiguration.loadConfiguration()
Wait, you are you trying to make your own config?
p.spigot().getConfig() for teh spigot config
ah
Is this bungeeAPI?
no
I thought p was player
well yes
I guessed it was plugin
p.getServer() gets the current server
because its current server
What are you trying to do?
what?
disable xp orb merging
through spigot.yml?
If you're running this on a spigot server, you don't need to get the players current server
p.getServer().spigot().getConfig()

heres my old code
how would i get the server then? @dusty herald
its not in my main class
getServer()
or Bukkit.spigot().getConfig()
Why was that being run for each online player
i dont have plugin
Please give me some project name idea for a plugin that runs a heavy discord integration and is custom to only one server (for now), not just but but many more things
I kinda dont want to call it DiscordIntegration that is boooooring
every 2 ticks* @young knoll
JavaPlugin#getServer or Bukkit#getServer
Wow don;t do that for every player
get instance of onEnable and then make a getter.
Just in constructor parse the JavaPlugin instance of your plugin name and that is it....
you can call the server outside of the loop, spigot.yml doesn't typically need to be reinstitized more than once
didnt know .getConfig() returned the spigot config
it does when you reference getServer
it was the simplest way i knew of to get spigot config
teh getConfig() from spigot() is the spigot config. getConfig() from Bukkit or server is the plugins config
regardless its out of my loop now
good
what are you doing again?
it returns the milliseconds per tick as a double
Making your server 40tps? /s
From Bukkit?
From downstream
ah
yeah from downstream
i was compiling against a cached Yatopia jar
well, fat jar
before migrating to gradle
I like maven better. Probably because that's what the only thing I have used lol
Gradle good Maven bad
Gradle is fast as fuck
:fingerguns:
but i prefer maven
I mean, gradle is fast if it doesn't have to cold start
well yeah
most of the time though, Gradle can be dragged down by having to start a daemon and still beat Maven
and maven is slower than that ? xD
yes.
rip
I can build a plugin with maven in like 5 seconds
Gradle makes Maven look like it hasn't been updated since the year it was released
¯_(ツ)_/¯
like it's not even close
to each their own
https://gradle.org/gradle-vs-maven-performance/ here's some official benchmarks (before you say it's biased, look at the facts)
I prefer Intellij but the light theme of eclipse is nice
I love a good executed light theme
my objectively superior opinion
And I think maven is the better build tool
it is
^
just out of curiosity, what are your reasons again md?
I remember you saying something about declarative vs imperative, even though Gradle is heavily declarative anyway
Maven is what I'm used to, it's simpler to set up rather than gradle
.
Gradle is up to what, 7 now
not really true but using something that works I guess is a good reason enough
and I also remember you once saying that Gradle was almost always invariably slower than Maven than actually building
not always worth going outside your comfort zone
which is factually incorrect
but even so you shouldnt then go around here saying maven is better than gradle if you havent barely messed with gradle
I'm on the verge of using gradle but sticking to maven atm
at least he said "I think" this time
he has a right to express his opinion
and we have a right to destroy said opinion with pure facts :fingerguns:
indeed
I can see maven is a benefit due to the fact that it is actually used more commonly
well at least in spigot deving
i mean, i come from Apache Ant, soooo...
😮
oh dear
oh god
I swear Ant isn't even close to Maven
ive been using Ant for years, up until a few days ago
let alone Gradle
I mean ant works ngl
everyone keeps shouting at me to use gradle lol
so i had someone migrate my project to gradle and uh, it didnt even work
yeah I advocate gradle but I respect anyone who chooses maven still
XML is way way way way way too verbose for my liking
at the end of the day they accomplish roughly the same
so ive been messing with my gradle config for a few days
100%
FINALLY it almost compiles, aside missing APIs in spigot
but I suppose, I am a Kotlin user, that just says it all about how much I hate too much verbosity lol
yeah
why is there a big mess in here
I like verbosity tho
^
if someone needed help they'd just get flooded away
regardless, how can i get the current mspt as double?
?
excuse me sir?
What
kotlin is nice but java works just fine tbf
It does
Kotlin scares me
Gradle works great too tho
exactly!
I use Kotlin because it allows me to write absolutely diabolical compact and hardly readable code whilst spending less time writing
more wood into the fire
less code, more or less same result
that's my reason
my style is fucked though ngl
lol
I'm personally completely against that. I consider code quality to be more important than it actually functioning.
Never used kotlin. is it a standalone language?
Can i lose something if i use AsyncPlayerPreLoginEvent instead of the synced one?
If your code is fucked to maintain, there's no point in it working
loose ?
7smile7 was claiming that if your code has comments it's bad
I mean
I need to make sure the person cant join

like no chance
Oh, no both events work
private fun buildRawArgumentsLiteral(
alias: String,
brigadierCommand: com.mojang.brigadier.Command<Sender>,
suggestionProvider: SuggestionProvider<Sender>
) = literal<Sender>(alias.toLowerCase(Locale.ENGLISH))
.then(argument<Sender, String>("arguments", greedyString())
.suggests(suggestionProvider)
.executes(brigadierCommand))
.executes(brigadierCommand)
.build()
```I think that just says it all about my coding style
what? that makes no sense
lol yeah
I mean, clean code advocates say otherwise
^
if you follow clean code guidelines to like the last detail and do not expose an api you don't really need comments
i always follow the outline and never let my code pass it
that will make it much more readable on smaller screens or resolutions
https://paste.md-5.net/ebovejiguf.m that just about says it all
can anyone help me?
with?
the collection extensions Kotlin have though make streams look awful
collection.stream().anyMatch(value -> true);
```vs```kotlin
collection.any { true }
to a certain extent I concur
I prefer streams over that
One more question if there are 2 plugins listening for a async player pre login event and one plugin allows it can that inpact the other plugin? and if yes how
also, inlining and reification mean you never need to worry about frustrating generic shit ever again
if one plugin allows it the other can still say no afaik @ornate hollow
since reification allows you to use a generic type as if it were an instance, allowing you to get a class reference from it
It’s based on event priority
so the other plugin has a chance
yes
Lowest -> highest
Monitor?
Monitor is the highest but shouldn’t be used if you are going to make any changes
im getting flooded out here xD
ranges are really useful as well
I have no idea what a mspt is
ms per tick
milliseconds per tick
oh
So if my plugin says dissalow and the other plugin says allow person will join? And there is nochance for 2 plugins to confuse and let a person in?
Depends which one runs first
they do this to for loops: java for (int i = 0; i <= 10; i++) into this```kotlin
for (i in 0..10)
Idk if its like result based or just instantly would react on method invocation
damn that is sketch
try and see
i think you can use ranges too in c#
MSPT should be double by the looks of that ss? Double.parseDouble(String)
C# is literally Java++
If you want yours to have the final say you probably want HIGHEST
🥲
with fucked up conventions
lol
yes but no
Get
Where can i set that?
IntStream.range(0, 10).forEach(i ->);
smh
@dusty herald problem is idk how to get that in spigot
since i was using a paper overload
In the @Eventhandler annotation
looks cumbersome ngl
what? You don't know how to calculate mspt but you want to parse it?
(0..10).forEach {}
```smh
it's a range
no i want to know how to calculate
for n in 1..=10 {}
i know what a range is lol
.. is rangeTo
damnnnnn this is why people were able to fuck my plugin up.......thanks
but i think internally it uses an array
is it inclusive exclusive or the other one?
oh yeah, that's another thing
.. is inclusive
oh
operator overloading is one of the most useful features there is
i think in C# you can do foreach(int i in 1..10) but im not sure
like you can override things like +, *, /, %, -, etc. with your own shit
oo
seems useless ? xD
class MyClass {
private var total = 0
operator fun plus(other: Int) = total + other
}
```absolutely awful example but you get the idea
you can override those
so you can define your own logic for them
also, ```kotlin
val myMap = mapOf("hello" to "world")
println(myMap["hello"]) // prints "world"
you can overload that too
operator fun get
same for put, which is just setting
var map = Map.of("hello", "world");
``` is valid java xD
e.g. ```kotlin
val map = mutableMapOf("hello" to "world")
map["foo"] = "bar"
println(map["foo"]) // prints "bar"
also, notice the built-in mutable collections
Map is read-only
MutableMap is read/write
gonna save me those valuable 2 seconds of my life 🙏
and there's no more throwing errors or anything either, the write functions for Map just don't exist
pretty sure something like Maps.newHashMap(K k1, V v1) exists but not as convenient
that's from Guava iirc
yeah
imagine having to add an extra dependency just to get some useful collection stuff
Well kotlin on its own is an extra dependency, its std lib for instance?
raw types
fair point I guess
only 1.4 MB though
somehow
yeah well nothing remarkably large on the contrary
I still don't understand how you can fit an entire standard library into 1.4 MB
lol gotta be wizardy
it's smaller than kotlinx.coroutines lol
🥲
kotlinx.coroutines is 1.6 MB
I wish java had something like that
😮
I want valhalla first
CompletableFutures 🤡
gimme
yeah Valhalla's gonna be great
it's good to see Java actually finally getting a grip
I mean, if I wanna write highly async code I won't use java in the first place
with sealed classes and records
still doesn't make sense to me why sealed classes aren't abstract though by default
java rips off kotlin heh
kekw
lol
data classes are still kinda better though
the componentx functions and copy
and the fact that they can easily be destructured
lombok 🙂
e.g. ```kotlin
data class Person(val name: String, val age: Int)
val (name, age) = Person("Callum", 16)
greetings
how do I send text like this?
you can feel free to depart now
oh shoot no uploads
that mess of a compiler hack should be banned
like it should just be disallowed
denied
I mean it wOrKs
also, as I've said enough times before, if you're using Lombok to reduce verbosity, you might as well just switch to Kotlin
true
since reducing verbosity is literally Kotlin's middle name lol
I dont use it myself but just as an argument.
hmm yeah the reduced verbosity is truly something one should pay attention to
I want whatever you take in the morning to maintain your sanity
private final volatile MutableAbstractBeanFactoryBase
private @NotNull @Nullable @NonNls volatile transient final static MutableAbstractBeanFactoryBase
idk I don't code in kotlin, my sanity is pretty good
:>
lmao java be like that ngl
I was talking about you liking verbosity lol
don't see how verbosity is an issue o.O
it's just so much extra writing
is it ?
yes
not true
are you using emacs ? xD
have I finally found another one of those who programs in a text editor?
lol
the most popular text editor people seem to use for programming is vim
IntelliJ?
I am saying that any modern IDE, including vim, can autocomplete or auto generate most keywords, functions etc for you
meh
pYcHaRm
Eclipse is so 2014, and NetBeans, well, https://tenor.com/view/we-dont-do-that-here-black-panther-tchalla-bruce-gif-16558003
int or long wont hurt?
Paper ServerTickEndEvent
ServerTickEndEvent
yeah but im buidling against spigot
you can convert?
that is an oof
md_5 you should add the tick start/end events to Spigot
I assume someone has PRed them
you can open PRs brady xD
yeah ik
or add Bukkit.getAverageTickTime()
I don't know whether Spigot accepts PRs for stuff from downstream projects or not though
coz thats how im doing it
I mean, why would spigot care
They do
if I wanna PR I've gotta learn how BitBucket works lol
wat
BitBucket?
that's what the stash is
yeah but how is that a challange xd
yes
For spigot to accept your code you have to give some private information.
Correct, there is a CLA
spigot lives on bitbucket?
private information? like what?
as long as it's not my address I'm mostly fine
full name or age don't count as private information for me
Name, email, address I think. IDK all the info I just know its required.
btw @solemn shoal I believe the recent mspt values are in MinecraftServer.h
or email address
on 1.16.5 at least
this isnt C++ lol
what ?
oh wait nvm you meant the field h
Yes
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
i was like "wait what, header files?`
LOL
Has their own website with private convos. Uses google docs for a CLA xD
I mean to be fair google probably has a better privacy record
They don’t leak data, they just consume it to target advertising
Yeah they sell it to advertisers xD
I don’t think they sell the data technically
Just the systems that use it for targeting
I swear that custom CLA isn't even allowed, since Spigot is licensed under GPL
or can contributions technically be licensed under other licenses
That’s something to take up with MD
IDK honestly.... so... ^^^
same
question, spawn reasons in spigot?
im trying to target naturally spawned mobs
What event is that
CreatureSpawnEvent looks like
CreatureSpawnEvent uses getSpawnReason
thats not in an event
but i probably should do that instead of a loop there
e is an entity in this case
I don’t see that method in the javadocs
game.addImage(new ImageIcon("player.png").getImage(), 0, 0);
Exception in thread "main" java.lang.NullPointerException
at me.imaginedev.imengine.GameWindow.addImage(GameWindow.java:26)
at Main.main(Main.java:16)
public void addImage(Image image, int x, int y) {
board.getGraphics().drawImage(image, x, y, null);
}
alright so I have a dilemma here
this isn't relating to spigot but it's forge so yeah
I can't run decompileMc because I need more ram
I've given it everything I have
I've closed everything except terminal and tried it
so I can either just give up on it because I have no better computer available to me or I can illegally have someone else do it and send it to me
very fun :/
I really wanna make this mod but I don't wanna illegally have someone distribute the results ://
new BukkitRunnable() {
@Override
public void run() {
player.kickPlayer(reason);
}
}.run();
}
}
That kicks player asynchronous right?
because?
because? that's it?
Also that’s not even async
my dev did that!11!
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class PlayerUtil {
/**
* Kicks a player, and ensures that it's asynchronous
* @param player The player to kick
* @param reason The reason for the kick
*/
public static void kickPlayer(Player player, String reason) {
new BukkitRunnable() {
@Override
public void run() {
player.kickPlayer(reason);
}
}.run();
}
}
eww
dear god
imagine not using lambdas
is my dev a poopy head
please fire your dev
yeah there's no point in doing it async?
making everything async is worse than doing it all sync
its not even async!
he use it for this
public void onInventoryClickEvent(InventoryClickEvent event) {
if (isLargeItem(event.getCursor())) {
Player player = (Player) event.getWhoClicked();
event.setCancelled(true);
PlayerUtil.kickPlayer(player, ChatColor.RED + "Your item's NBT data is too large.");
} else if (isCrashItem(event.getCursor())) {
event.getCursor().setItemMeta(null);
}
}```
wtf
i'd find a new dev
^
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
i will fire him then
but i think he will leak my plugins source code
if i fire him
sad coder hours
oh it gets worse
I mean
well nobody would want that source code...
An anti crash plugin doesn’t seem that premium to me
who cares if its leaked tbh
its a exploitfixer
NBT exploits?
doesn't matter if it's bad
also
is there a better way for this
public void onEntitySpawn(EntitySpawnEvent event) {
try {
event.getEntity();
if (event.getEntity() instanceof LivingEntity) {
LivingEntity entity = (LivingEntity) event.getEntity();
entity.getEquipment().getBoots().getItemMeta();
entity.getEquipment().getLeggings().getItemMeta();
entity.getEquipment().getChestplate().getItemMeta();
entity.getEquipment().getHelmet().getItemMeta();
entity.getEquipment().getItemInMainHand().getItemMeta();
entity.getEquipment().getItemInOffHand().getItemMeta();
}
} catch (Exception exception) {
event.setCancelled(true);
}
}```
very
also if they'd do that you shouldn't have hired them
THAT DOES NOTHING!
because items throwing exceptions are bad
they can't?
if a plugin does that then fuck that plugin
that's not even what crashes the server
look
he's trolling, right
i have a skull
with a skull owner tag
that throws an exception
without the code above you can spawn entities with that skull
1.8?
1.16.5
doubt
x
try paper anyway
i use paper
doubt
x to doubt
also is that good
as a give check
public void onCommand(PlayerCommandPreprocessEvent event) {
if (event.getMessage().toLowerCase().contains("/give") || event.getMessage().toLowerCase().contains("/minecraft:give")) {
BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(main, new Runnable() {
@Override
public void run() {
Player player = event.getPlayer();
for (ItemStack item : player.getInventory().getContents()) {
try {
item.getItemMeta();
} catch (Exception exception) {
player.getInventory().remove(item);
}
}
}
}, 0L);
}
}
}```
what
he's trolling
how am i trolling
that looks like the stuff that 'id write ngl
nobody's code is that bad
eww deprecated
Why do we need a listener for that
Permissions exist
public void onInvOpen(InventoryOpenEvent event) {
if (event.getPlayer() instanceof Player) {
if (event.getInventory().getHolder() instanceof Container) {
Container container = (Container) event.getInventory().getHolder();
StringBuilder inventoryString = new StringBuilder();
for (ItemStack item : container.getInventory().getContents()) {
if (isLargeItem(item) || isCrashItem(item)) {
item.setItemMeta(null);
}
inventoryString.append(itemToString(item));
}
if (inventoryString.length() >= 120000) {
event.setCancelled(true);
container.getInventory().clear();
}
} else if (event.getInventory().getHolder() instanceof StorageMinecart) {
StorageMinecart container = (StorageMinecart) event.getInventory().getHolder();
StringBuilder inventoryString = new StringBuilder();
for (ItemStack item : container.getInventory().getContents()) {
if (isLargeItem(item) || isCrashItem(item)) {
item.setItemMeta(null);
}
inventoryString.append(itemToString(item));
}
if (inventoryString.length() >= 120000) {
event.setCancelled(true);
container.getInventory().clear();
}
}
}
}```
is that good atleast
if <chest contains a bunch of items with nbt> clear chest
so if i have a mob farm, and have a chest with enchanted armor from mob drops, itll get cleared all the time
Paper, and probably spigot, fixed this stuff
^ that too
but alright
Except air
and did it in a safe way, unlike the shit you wrote
no its not really fixed
go open an issue then
i dont think creative items will be fixed
i have over 5 server crash exploits lol
should i report all of them
wait
anything that isn't that tbh
lol
The server trusts the client too much in general
i mean this is why boatfly/entityfly exists
boatfly ez to ban
wait, theres a field called TICKTIME
Current or max
Probably
guess ill do this then Arrays.stream(MinecraftServer.getServer().h).average().orElse(0)
h is a Long[]
Great for startup stuff
agree