#help-development
1 messages ยท Page 781 of 1
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
Hello everyone again. It's me again with my stupid idea to shove a spring website into a plugin on Spigot. I read a little bit about how to put a site in a jar and even compiled a plugin, but when I launch the site itself, I get an error over and over again: Application run failed java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. If you are using a custom packaging, make sure that file is correct. Can anyone tell me how to fix it?
I apologize in advance for my stupidity
You guys apologize for stupidity?
help please i cant send messages on โ help-server it says "failed upload"
You can't send images/videos/attachments unless you verify
?verify
oops
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
I 'm sending normal messages
You need to verify your discord account with spigot account
how?
Type !verify on #bot-commands
hey does anybody know the kotlin/jvm/internal/Intrinsics bug? Never heard of it and now it stops my kotlin paper(bukkit) plugin from working...
I canโt tell by this message alone
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
?stacktrace
We cannot help without the full stacktrace; Please paste it here: https://paste.md-5.net
@young knoll nub
do you want the build or the code?
The error
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at one.cawatech.smashv2.SmashV2$Companion.setInstance(SmashV2.kt) ~[SmashV2-1.0-SNAPSHOT.jar:?]
at one.cawatech.smashv2.SmashV2.onEnable(SmashV2.kt:11) ~[SmashV2-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-100]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.1.jar:git-Paper-100]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:639) ~[paper-1.20.1.jar:git-Paper-100]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:550) ~[paper-1.20.1.jar:git-Paper-100]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.20.1.jar:git-Paper-100]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:435) ~[paper-1.20.1.jar:git-Paper-100]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.1.jar:git-Paper-100]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1101) ~[paper-1.20.1.jar:git-Paper-100]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-100]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:183) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:150) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
... 14 more
you need to shade kotlin's stdlib or use the library loader
already have that on jdk8
What zlataovce said
clearly not
dependencies {
compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
clearly yes
not yet am trying that now
not ignoring

acknowledged, in fact
not like there's a bot command channel
if you care so much about channels stop complaining and keep this one dedicated to coding
Fight
but in the fights channel pls
true
done that still crashing
Lies
paste the stacktrace now
is there any specific packet for a player jumping
Here u go, less work for us https://www.spigotmc.org/resources/kotlin-stdlib.80808/
None
cringe
the joys of client authored movement
๐๐ป
Rather stupid question, but how the hell do I disable IJ doing wildstar imports that really should not be used
Like I understand it sometimes, but for java.awt.*? Are you drunk? This is the exact opposite of eclipse's behavior (it used to completely ignore AWT for a while)
settings, code style, java, very far right tab
I was unsure too but in the code style java tab you can set the amount of imports needed for a star I set mine to 999 lol
you can also add exceptions to the suggestions list
don't remember where that is
fortunately there is a search bar
its below where you disable if you use them or not
Why is the default threshold at what seems to be a single class? Whatever, I do not question it
IJ has some stupid ass defaults
sometimes I wonder what genius thought of them
and how they still have a job
I mean, maybe they don't :^)
fair
Okay, apparently AWT and swing are treated exceptionally and ALWAYS wildcard imported, regardless of thresholds or whether wildcard imports are on. Whatever, found and nuked the relevant settings - thanks!
lol
gotta love it
Yeah, makes IJ default to java.awt.List each time in any swing applications
Under eclipse that class is completely invisible and hidden from autocompletion (including it's members), so I am getting a bit of a culture shock here lol
https://paste.md-5.net/odajatusod.pl
the console spam this error
Please someone help
when I first swithced to IJ i had to spend 3 hours configuring so it seemed usable
there is no get name method for Inventory
so ofcourse it will error confused how your compiler even let you compile that into a jar
what ?
you're not coding are you
i use some gpt's -_-
lmfao
only for java
ChatGPT can't code never do that
other langages i code
my lord
my brain
I think that is not an error produced by eclipse
what?
You are using the wrong bukkit version
how can i fix?
isn't that a 1.8 or earlier method
Either at compile-time or at runtime, depending on how you see it
I don't remember Inventory ever having #getName
Probably I guess
i think its because if i do /stats i can "grab" the items in the gui
Yep, it exists in 1.8, but not on newer versions
I highly recommend using the same versions of bukkit for runtime and compile-time
10/10 API choice classic 1.8 moment
Saves a lot of trouble
I honestly think that choice isn't too bad
Inventory's don't have names
its a quirk of the API
granted idk what the code looked like back in the day
but now adays its true
Yeah, but from a logical perspective it made sense
These days viewing is highly decoupled though so I guess there is that
I was still a child back in 1.8 days didn't code :P
Also god, someone really gotta upload 1.8 bukkit javadocs compiled with J11+
lol
Java 8 javadocs makes me puke
I already have - but sometimes you just wanna look up this stuff
package index
What are some libraries that you guys feel like makes your plugins much better? (not looking for anything specific just wanna see what people say)
https://hub.jeff-media.com/ anything listed here under "Libraries for Spigot Devs"
Facts Jeff makes great libs
Oh wow! My prayer had been heard! Thank you so much
?1.8
Too old! (Click the link to get the exact time)
8 year olds legit gonna be playing 1.8 now
Yeah 1.8 sucks but i agree that its useful to have modern javadocs for it
Don't worry, I don't actually use anything but 1.19.3
Especially the search feature
I wonder why the search function was simply ... Absent
Like how did they navigate back in the days?
Oh so this was a feature?
Did it even exist in java 8?
I had to manually declare the javadoc plugin to enable it even on java 20
Thought it was a java 9 thing
Yeah the official J8 javadocs have no search bar
Because java 8 is ancient also the javadoc source code is cursed
Which is why I don't like the fact that google recommends the J8 jacadocs
this + using java 20 to compile was needed to get the search working
Have you ever had a moment when you needed to modify the vanilla chunk generator?
ok the links are pointless ofc, I just copy pasted it from another project. but when not declaring the javadoc plugin, there was still no search bar (it was just greyed out)
I believe there was some kind of bug in the search bar a few years ago
I tried to find the default generator but I had a lot of problems when trying to get the source code for spigot, so I would like to know if you have it?
I think it's because bukkit 1.8.8 uses oss-parent-9 as parent pom and that uses javadoc-plugin 2.7
it would probably have been enough to simply set the javadoc-plugin version to 3.5.0 or whatever is newest
Well the bug is more due to javadoc having problems with the undefined modules
But that bug probably did not persist for long, regardless I still have the workaround in most my projects
I think it actually is caused by not using modules, but could be wrong
Index: pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/pom.xml b/pom.xml
--- a/pom.xml (revision 01d1820664a5f881665b84b28871dadd132deaef)
+++ b/pom.xml (date 1699387824165)
@@ -19,8 +19,8 @@
<description>A plugin API for Minecraft servers.</description>
<properties>
- <maven.compiler.source>1.6</maven.compiler.source>
- <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.compiler.source>1.8</maven.compiler.source>
+ <maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -98,8 +98,19 @@
</dependency>
</dependencies>
+
<build>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.5.0</version>
+ <configuration>
+ <links>
+ <link>https://docs.oracle.com/javase/8/docs/api/</link>
+ </links>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
this is enough to get the javadocs working properly
did 1.8 really use java 6? o0
or is it just bukkit using java 6 for 1.8?
Do entities have a UUID like players ?
pretty sure they have a EntityID
That works.
how i can get spigot code no usage Buildtools?
what
spigot doesn't even really have any big amounts of code, it's just a bunch of patch files on top of craftbukkit
how can I get the source code of the spigot server without using buildTools I have problems uploading with the certificate
oh soryy i mean
craftSpigot
there is no craftspigot
also wdym with "uploading with the certificate"
just download buildtools and run it and then you have all the compileable code
During the download process an error appears related to the certificate.
he can't find it
or some kind of problem
?paste
Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Can you paste the whole log?
error log or?
?paste
is your system time set correctly?
yes
are you using a weird proxy / anti virus software that does HTTPS MITM?
like norton shit
i use kaspersky
try disabling that completely
kaspersky probably opens more vulneribilities than it fixes anyway
It can be built. Not an issue with mojang's servers.
100% kaspersky issue
they are known to do weird shit and dirty hacks related to HTTPS and stuff
e.g. postbox-inc.com mentions this
Kaspersky will scan encrypted connections, including IMAP/SMTP over SSL between Postbox and your mail servers. Kaspersky will intercept your mail connections, inject itself between Postbox and your mail server, and use its own certificates to protect the "last mile" of your connectivity. This will cause Postbox to complain about invalid certificates.
i have so many option for protection disable all?
and java doesn't trust the stupid kaspersky certificate
is that a buildtools flag?
hm yeah that might fix it
Ye
the proper solution is to get rid of kaspersky though
Wouldn't have to disable antivirus that way.
Although yea, agree with this.
https://support.postbox-inc.com/hc/en-us/articles/204602300-Invalid-Security-Certificate-Error-when-using-Kaspersky-AVAST-or-other-Security-Apps here's an alternative solution on how to exclude certain domains from kaspersky's MITM
@upper hazel Try running: java -jar BuildTools.jar --rev 1.16.5 --disable-certificate-check if you don't want to disable Kaspersky
or just disable "Encrypted connections scanning" completely in kaspersky
fixed screenshot of a screenshot
yo why the hell does Entity.PRIMED_TNT not have a setFuseTime()?
declaration: package: org.bukkit.entity, interface: TNTPrimed
What api version
EntityType != TNTPrimed
^
EntityType is just an ordinary enum, not related to any individual entity
now - https://paste.md-5.net/ogomizirug.makefile java.net.SocketException
Spawn the entity as an instance of TNTPrimed and set the fuse ticks on that object instead.
okay.. so how can I spawn a TNTPrimed then?
just disable kaspersky or ask their support
Same way you spawn any entity
I got world.spawnEntity()
World.spawn(location, TNTPrimed.class, consumer)
https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/ like this but using TNTPrimed.class instead of Pig.class, then set the fuse ticks in the consumer
When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. Iโll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...
Oh yea, consumer events. Forgot about those.
Use that instead.
location.getWorld().spawn(location, TNTPrimed.class, (tnt) -> {
tnt.setFuseTicks(0);
});
no clue
generics prob
Make a PR for it. :p
it's because spawnEntity takes an EntityType
so you couldn't know which class it is
spawn(...) takes a class hence you can have a consumer with the correct entity class
those methods are in RegionAccessor btw https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/RegionAccessor.html
declaration: package: org.bukkit, interface: RegionAccessor
what's incorrect?
okay looks all good on compile errors
ill see if it works
now onto spawning creepers
you can get it at runtime but not at compile time
by providing the class however, you have the correct type at compile time
@tender shard give pls 1.16.5 spigot sourse in zip))
lmao
ok
this is 100% the 1.16.5 source code, it's definitely not my shitty adventure game written in lua
oh god
๐คจ
last time I heard kaspersky I was at like 3rd grade
bruh....
during IT lessons this shit would eat half of our barely working PC's manpower
just disable kaspersky, it opens more security issues than it fixes anyway
then run buildtools
using ur common sense and adblocker is more than enough tbh
just don't download arbitrary .exe files from weird pr0n sites, then you're fine
It may also help to run it in a directory without spaces.
Current Path: C:\spigot sources 1.16.5\.
C:\BuildTools
unless the malware causes more pr0n, then it's fine
depends on the genre but sure
all the genres at once
NOT THE JAR!!!!
probably not even google has enough disk space to download em all
you prefer a .war?
yes, you. after you ran buildtools after disabling kaspersky
There's a reason spigot doesn't have a direct download.
also I got a question just to make sure that I got it right
why didn't they just put this on github?
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
lambda is a nameless function that you call -> { //somecode } when you want the code into the parameter once and not anywhere else?
i was disable but java.net.SocketException exists
no
anyway
even if it was on GitHub you'd still need to run buildtools lol cuz patches
// valid lambda
Consumer<Entity> printOutEntityConsumer = entity-> { System.out.println(entity.getName()) };
You'll probably have to disable it completely, then restart your computer.
wait u used consumer I havent learned it yet
one thing at time
unless its needed to get idea of lambda then ill switch to it
Lambdas and Method references can be used to make your code way shorter, and (sometimes) more readable by getting rid of anonymous classes. What are Anonymous Classes? Anonymous classes are like local classes without a name. Imagine you have the following code: We hereby declare and instantiate a class implementing java.lang.Runnable that just p...
you first have to know what an anonymous class is
oh, that means the politics are guilty...
fair ill do it myself I dont support self advertisement
lol that website doesn't even have any ads
It does have an annoying cookie banner that doesn't work in Vivaldi.
it's not a problem, just send the source code via discorde ))
no
That's not how that works.
my brother just uninstall Kaspersky, it's literal spyware
just send him some random .exe file
1 sec
dw he's protected by kaspersky lol
yeaaa not hard.. so read this decomplie code...
should have renamed it to BuildToolz.exe
why exe
yeah it shows the splash screen for 50ms then exits
maybe but you have anti-virus better then kaspersky?
java
Windows Defender
windows)?
Windows defender
whats hash and how do i use it someone under a tutorial video said to use hash instead of array
bro why exe
because that's the usual packaging for BT GUI for windows
cool
it's not like it could do any more harm than a .jar could
but i no need it
but it doesn't work on my Arduino
I don't know how to decipher this.
it is can
Use the jar file then. :kek:
a can is not a jar
I trust jar more than exe
jars are usually made out of glass while cans are made out of aluminium
Sheesh
oh
There's a jar file.
It's the exact same, just not wrapped in an exe.
wth
are you telling me you didn't write a win32 api implementation for your arduino yet? noob
Almost as if I have the source.
does that mean all applications are jar in exe? ๐คจ
Idk though.
no
Still can't trust it though
it just means that both a .jar and an .exe can run arbitrary code so one is not any safer than the other
unless you don't have java installed in the first place
Why do you think there's more warnings placed on .jar downloads than other formats? It's cause they are unsigned executables capable of running arbitrary code.
a .jar and an .exe are like cocaine you bought from a weird stranger at the train station. it could be anything inside
oh
which of these databases would be more suitable for a large server,
username
- skywars
-- kills
-- deaths
- bedwars
-- kills
-- bed breaks
- smp
-- farms
or
skywars
-username
-- kills
-username
-- kills
bedwars
-username
--bed breaks
-username
--bed breaks
Probably the second one. The data is separated better and can be moved easier while affecting less.
wdym moved
Asuming you wanted to split the data away from that one file.
hmm okk
assuming youre not storing this in a yml file but rather in something like mongodb or mysql, def the 2nd
its probably the 2nd even if its in yml files
but thats not really scalable for a large server
why would any sane person store it in a yml file
why
i mean yml isnt scalable
yeah
idk
beginners do that sometimes
thats horrible
Yaml backup is better than nothing.
imagine having to scroll thru a 1000 lines
ofc but not as a primary db
Ye
mongo takes backups ๐
also id store it as like bson or smth
yeah
like mongo
less space used
yml syntax is prob inefficient asf
for data
just use json syntax and call it a yaml file lol
snakeyaml can minimize yaml files so they aren't any bigger than a normal json file would be
yeah space wise bson is just superior
also load and save times prob
because it doesnt have to parse shit
its just not user friendly
unless u have some editing program or smth
well parsing bytes is more efficient than parsing utf tokens which there are like 2x as much of, especially when parsing numbers and shit
yup
but yeah bson isnt magical instant object load
Ay alex is here ๐
that is what telepathy is for though
@worldly ingot
how do you use the PR flags on BT I keep getting random errors from CB that shouldn't happen given I use the correct bukkit PR https://paste.md-5.net/davonipuka.coffeescript. The source code itself compiles and works fine too I've been using java -jar BuildTools.jar --pr BUKKIT:926 CRAFTBUKKIT:1282 I double checked these are the proper PR #, prs for CraftBukkit and Bukkit too
ngl, never used them
๐
do I add PDC tags to armor stands just like to entity?
Choco entity confirmed
how can I loop through every entity type in world?
I just used them correctly wow! Turns out its cuz BT caches fucked over my build
world.getEntities() will get you all loaded entities in the world
From there, regular foreach loop and calling getEntityType() on them
alright ill be able to work from now on
Ah no it is a List
even better
Honestly not totally sure why lol. It could definitely have been a generic Collection
I just wanna to make ability that spawns armor stands with PDC and then runs scheduler that would get rid of them after X time elapsed
Yeah, keep track of the entities you spawned in your own List so you can remove them later
What is the Minecraft client verification plugin when entering the server for the first time?
You're probably thinking of AuthMe, though I'd seriously advise against an offline mode server
and what is that option for that?
not sure I understand the question
is it uh, a proper way of doing that?
or is there something to make it less redundant?
You could have getters in your plugin class instead so you only have to pass the plugin instance
private final EntityPDC entityPDC = new EntityPDC();
// etc.
public EntityPDC getEntityPDC() {
return entityPDC;
}
// In your other class
private final Rpg plugin;
public DamageListener(Rpg plugin) {
this.plugin = plugin;
}
@EventHandler
public void myListener(MyEvent event) { // Anywhere you want to use it
this.plugin.getEntityPDC().doWhatever();
}```
so I make getSomething for each utility class?
Correct
If they're utility classes though, maybe consider if instances are even necessary. What do one of these types look like?
Oh yeah for sure that EntityPDC class can absolutely just be a simple utility class with static methods
There's no state associated with it. If there are no fields or anything like that, instances aren't going to benefit you in any way
and using static methods is just importing methods like UtilityClass.myMethod?
Correct
The proper way to make that a utility class would be to make the class final, make the constructor private, and make your methods static
public final class EntityPDC { // Don't allow it to be extendable, it doesn't need to be
private EntityPDC() { } // Don't allow it to be constructed, it doesn't need to be
public static void setPDC(String keyname, String value, LivingEntity entity) { // Mark as static
// ...
}
public static String setPDC(String keyname, LivingEntity entity) { // Mark as static
// ...
}
}```
At least for that specific class it makes sense because those are very clearly utility methods and probably can't take advantage of state or member variables in any way
For some classes maybe it makes sense to use objects to design things but in this case specifically it doesn't make all too much sense
I've come across an interesting quirk while working on my Inventory PR. If you create an InventoryView like below
final Player p1;
final Player p2;
final InventoryView view = MenuType.GENERIC_3X3.create(p1, "placeholder title :3");
then you first open it with p2
p2.openInventory(view);
it syncs p2s inventory with p1s inventory (this could either duplicate or destroy items depending on the situation.
Not sure exactly why, but its quite strange. I could add a precondition to the method openInventory(InventoryView) but that wouldn't really be ideal I'd assume it works like that in legacy otherwise their would have been a precondition prior.
The only other thing I can think of is instead of exposing MenuType#create to bukkit rather expose openInventory(MenuType, Consumer<InventoryView>) Unsure though looking for suggestions
You can probably ignore that. Just letting you know that it's replacing a file but that file has little to no effect on your plugin
alright
You should see how many it lists when you build craftbukkit :p
Yeah it's like 700 files or something
adding a precondition that should have been there in the first place 

why it doesnt read it as armorstand?
because you have the variable type as Entity
you cast it to an armor stand but the variable is still entity
you need ArmorStand armorStand = ...
Yes
read the javadoc on the deprecation
impl Runnable pass your Player via constructor
many ways but depends on you ๐คทโโ๏ธ
show your code and what u tried
sorry if this is a basic asf question, but im stuck at the point where i want to read the data from a YML file and beable to find the specific subsection of the player: and each sub section is a player.getUniqueID().toString() with the players twitch username stored inside of that subsection.
the goal being to loop through the subsections or what ever i have to do, find the player who its running on, then compare the twitch name associated with a separate list of names to find that name on said list
here is my PlayerHandler class, and my ViewerCheck class
public class PlayerHandler implements Listener
{
public PlayerHandler(Cumbronco plugin) {
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
Player player = event.getPlayer();
new ViewerCheck().getPlayerData(player);
}
}
public class ViewerCheck {
public void getPlayerData(Player p)
{
//the idea here is to open the file, and then some how read through everything til i find the player whos unique id
//is currently being requested in the YML then when it finds the match in the YML it then compares the data in
//the subsection to another location that will store a list of twitch names
if(p.getUniqueId().toString() == /* yml file location of player*/)
{
}
//i also forgot if its .equals() for strings in java :P
}
}
also not trying to take away from dusktalers question so please answer their question before mine if they post their code ^-^
cant you just do config.get("player." + p.getUniqueId().toString())
not sure i just started learning how to make plugins yesterday lmao
if so that is infinitely easier haha
if you have yaml file structured like
player:
someUUID:
# SOME INFO
someOtherUUID:
#SOME MORE INFO
you can get someUUID by doing "player.someUUID"
current formatting
players:
testplayer1: testplayer69
testplayer2: testplayer001
96acd1f6-c7ec-4bf7-ae5e-0883357d8002: imach
yeah, you can get imach by doing config.getString("player." + thatUUID)
so instead of thatUUID i could do player.getUniqueID() right?
hell yeah that huge tysm ^-^
ohh yeah i didnt add that cause the getString threw me off haha
if you concat string to Object, toString is called implicitly
What is the HandlerList in bukkit events
List of handlers for that event
Any time you register a Listener, each instanceof @EventHandler is an instance held by the HandlerList
Think of it like a List<RegisteredListener>
Only... a few more methods
I tried the other way of setting up runnable
and it actually works now
I know I could make it more scalable
But rn I want to practice and set sort of template for it
How can I make armor stand with turned off gravity move?
What if, im not going to automatically recognize the most optimal way and I will rewrite a code sooner or later
so when I try doing it this way, it seems to only output failed to find user and im not exactly sure why that would be the case
public class ViewerCheck
{
public void getPlayerData(Player p)
{
File file = new File("C:\\Users\\imach\\Desktop\\minecraft server\\PlayerStreamData.yml");
FileConfiguration data = YamlConfiguration.loadConfiguration(file);
if(Objects.equals(data.getString("player." + p.getUniqueId()), "imach"))
{
Bukkit.getLogger().info(data.getString("player." + p.getUniqueId()));
}
else
{
Bukkit.getLogger().info("failed to find user");
}
}
}
players:
testplayer1: testplayer69
testplayer2: testplayer001
96acd1f6-c7ec-4bf7-ae5e-0883357d8002: imach
player/players
I read it and didnt find anything that could help me
Setvelocity doesnt work
Cuz gravity is false
LETS GO SPELLING ERRRORS lmaooo
I tried setting gravity to true, adding velocity and turning it off but didnt work either
Did you apply it a tick later?
Why?
and I'm a lil confused as to what that means
How else would Bukkit know about event listeners?
They have to be stored somewhere
I mean as far as you're concerned, it just works. You don't need to know how it works, but it works and it's the reason your event listeners are being called
PluginManager#callEvent() will get the handler list, run through its registered listeners, and call all of them
Yes
Quick question:
Is there a certain way to transfer data/ event from one plugin to another?
The Messaging Channel should work.
u guys wont undersatand how complete my life is rn
Any way to change server.properties without having to reload the server? i have a plugin that automatically uploads a resource pack to dropbox when the sevrer starts.
declaration: package: org.bukkit.entity, interface: Player
Alternative if you dont want to restart
Downside is you would need to loop through all players online and send it to them
tysm
oh hi frosty
Using the PlayerPortalEvent, why is it that the return of getTo() is a location that's no where near where the player actually appears when entering a portal in the nether and arriving in the overworld?
Yes
anyone know how it would be possible to zip a resource pack folder into a zip file that is compatible with minecraft? i have tried like everything and it either corrupts the zip file, does it in some weird way that isnt compatible with mc and no textures load, or just does not work at all. anyone know what to do?
closest ive gotten is this from a stack overflow post. minecraft recognizes it but no textures load and only works once i unzip it.
private static void zipFolder(Path sourceFolderPath, Path zipPath) throws Exception {
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipPath.toFile()));
Files.walkFileTree(sourceFolderPath, new SimpleFileVisitor<Path>() {
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
zos.putNextEntry(new ZipEntry(sourceFolderPath.relativize(file).toString()));
Files.copy(file, zos);
zos.closeEntry();
return FileVisitResult.CONTINUE;
}
});
zos.close();
}```
i wouldnt think it would be this hard to zip up a file
ive always just done it with an assets folder and a pack.mcmeta file highlight the two files and send it to a zip
nothing special
yeah. trying to do it automatically as im programically generating the resource pack each time the server starts.
yep, still didnt work
minecraft recognizes it but for some reason none of the assets load.
they only load once i unzip it
anyone know why i would be getting this when i build after importing another library?
and possibly how i should fix it
credentialmanager-0.2.2.jar, events4j-api-0.12.1.jar, events4j-core-0.12.1.jar, events4j-handler-simple-0.12.1.jar define 1 overlapping resource:
- dependencies.txt
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
.
when someone clicks on something in chat probably, like when you do /seed in a server you can click on it in chat to copy to clipboard
there are multiple classes named Action
This is not one of PlayerInteractEvent's Action
it refers to an action that can occur when you click on a chat component
alright
what is a good way to get extra players to help with development?
I'm recreating telestrations in minecraft and I'm running up against a wall because I only have one account but need at least two others to adequately test my current program
game pass
because I can't easily simulate a "Player" object even though that's how I refer to players throughout my program
how does that work?
minecraft's free on game pass
you can use it for a secondary acc
At some point in your development career you'll want a second or third account
yeah I might have to buy two more but that just sucks D:
like are there not other ways to somehow like offline boot Minecraft with a random account name?
are you allowed to give me a pointer to a dec cracked account launcher?
no because I don't crack the game ๐ฟ
fair :(
omg this makes me wanna make a fun java application
just ofund this at work
dude that was working on this was fired and all his projects were passed to me
what the actual fuck
I think ik why he was fired
fun fact
GriefPrevention does some fucked shit
Fun fact #2
this shit uses libraries that do some fucked shit
liskov substitution principal when
it's gonna be one long ass night
lol we rewriting this crap
lol i am useing this https://www.spigotmc.org/resources/knokkos-custom-items.88182/ to make custom items i dont know how to make a plugins but i can model lol
wtf bad OOP practices?
this might be a me thing but why does that readConfig method have nothing to do with reading a config
What's the issue with this other than it uses slow reflection
does Bukkit.getCraftingRecipe() get also custom recipies from which were created by other plugins?
How you think this passble create plugin no usage api? )
yes
How this do? Need use reflection or NMS
the better question is what the heck is it and what is it even supposed to do besides calling all private void methods on a given class object
and why does it catch and throw Exception
and in general, what the heck is it
what
spigot sources?
wdym exactly
F
seems reasonable, look at his code
I mean I use reflection but that's just weird
no generics, and what is "config" even used for
and what the heck is the point of calling all private no-args void methods of that object
ยฏ_(ใ)_/ยฏ
imagine your config thing relying on the idea that your methods must be private
otherwise "readYaml" method won't work which does little else anyway
I mean wtf is that even
Though generics can sometimes cause pain in my experience, like expected T extends B, got T extends B
or is that maybe a joke about paper like the comment suggests
Well it sounds like the static analyzer or whatever did a poor job explaining the issue which is pretty much just type erasure, or how you design it (that is not following PECS)
I forgot what it was because I just ran type erasure at compile time (<?>)
wait I think I still have it
Like I had a function <T extends SomeType> something(Class<T> clazz) and it couldn't take in a class class SomeClass extends SomeType
(Expected T got SomeClass)
Yeah, and then you need to remember to develop against covariance and contravariance whichever one is which, idk what u call it; think it was site declaration variance
Oh yeah cuz that class would be a Class<? extends SomeClass> and the expected type erases to just Class<SomeType>
? extends T may work, idk
I feel like the compiler is constantly disagreeing and every time there is one of these bs errors it just got mad for a bit
lmao
Lol truly
I mean I do be giving it a hard time
11.2k lines over almost 200 files should be shrinked down
Not sure about shrinking it down, it sounds reasonable vooodoooo
For what it does it feels way too big
but then again it is pretty much a very specialized "plugin API"
What does it do? Voooodooooo
Under NDA but it is basically a plugin loader/manager (not plugins like Spigot plugins, each is very small depending on at most 1 or 2 classes)
remember the vooooodoooooo lady from monkey island?
Yeah that voooooodooooooooo!?
what's that
are you 12 years old or sth
who the hell doesn't know monkey island
I may know it but I probs forgor
duuude you should play monkey island 1 - 3
4 too but the graphics suck
it's like the most popular point and click adventure games ever
ofc you don't like them if you haven't played proper ones
If I was given the option I'd rather choose some puzzle stuff
well they are puzzles
I mean literal puzzles
brb downoading monkey island 1-4
I'll do some procrastination and play some stickfight online
Yesterday I played ~400 matches with my friends lol
๐
Did you test for memleaks on the classloader?
yo frosty
not saying it's the case
but I might need a benjamin this week
ppl going on holiday and not paying :/
need to buy some formal clothes for the conference
check on popular escort sites, I'm sure there must be a benjamin somewhere
Need better employers
well
dude is generally reliable
we've been working together for like
over a year
some weeks he's just busy
just happens that timing is fucked
don't worry the class loader gets obliterated properly
There is never a case of being too busy to take care of your employees
my employer pays me on time always, except some days where he can't be at his computer he'll pay me one day late
yeah in my case my dude doesn't work weekends
this weekend he was travelling with the kids
so he's probably somewhere remote without internet
I'm not stressing, I'll get paid eventually
send him an angry invoice
p much
Shouldnt have to do that if they are employing you
"always - except sometimes" lol
well exceptions exist, like hospital runs and stuff
Well shit happens
though for the last like 6 months he was on time every time from memory
Dude's always paid on time every week, lately not so much because he opened a new business
who knows where CraftChunk is located in the source code, I'm trying to find it but there are a million of these directories
?stash
oh thenks
who knows whether the class(es) in craftbukkit are responsible for vanilla chunk generation or not?
some say it can't be found
Why would they be
Why would cb have classes for vanilla chunk gen
Cb is an implementation of bukkit, if bukkit doesn't have something, cb doesn't have it too, most likely, I guess. Please correct me if this information is wrong.
to use it in your generator but with modifications
add "new ore" for exemple
If you want to add new ore use the BlockPopulator: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/generator/BlockPopulator.html
declaration: package: org.bukkit.generator, class: BlockPopulator
Bukkit consists of interfaces that craftbukkit implememts, if bukkit doesn't have something, craftbukkit is most likely not gonna have it either. Makes sense, right?
a need modify, not create new
but yea if this so i try find BLockPopulator in craftBukkit
Whatever you're trying to do, you can probably do with a datapack
There's no need for you to be digging around in craft bukkit
i need modify VANILLA chunk
not create NEW
just add ore in VANILLA generator
if i use BLockPopulator this change all chunk or not?
new chunks
yes this will be new chunks
but
I just need to change it a little and not create a new one
blocks
So you want to add "ores" to already generated chunks ?
yes
You said just a few messages ago that you only wanted new chunks
nothing like BlockPopulater, whatever it may be, will help you
You gotta do that manually
MC has no way (that I know of) to retroactively generate something in already generated chunks
Then look at NMS
and use it
Probably mark that chunk with PDC after you're done with that.
^^
not this not option cuse it will require a lot of resources
Where is... Illusions(?) workload thingie ?
Could use that if you worry too much
Nothing you can do about that
i need check biom how you think this will be in event?
for loop in all blocks not option
You'd calculate where your blocks would be
and only place them if it's the correct biome
Vanilla tries to generate ores in this sequence (I think)
Randomly select x, y, z
Check if location is suitable, if yes, place blocks
If not, re-try x times.
Do that loop however many ore nodes you want in your chunk.
that is, is it normal to sort through a 16x16x16 chunk?
?
wdym by oversample
translate error
depends on what you're doing, if you're generating ores tho, def. not.
Do not iterate through so many blocks for no reason.
in the settings there is a minimum number of blocks that should appear, so you still have to sort through
sort?
I mean that at least 1 block should appear in a chunk if the chunk has the desired biome and the radnomizer wonโt help much here
Unfortunately, you canโt get all the blocks of the required biome...
In that case, if Spigot gives access to the raw biome data (biomes are stored in cubes of 2x2 so 8x8x8 per sub-chunk)
iterate over that instead. Not sure if you can iterate over every second block since the biomes have noise.
and even if there is no requirement to find at least 1 required block in a chunk, the chance of its appearance may be small
or is it 4x4?
Not sure
Who here has knowledge in ACF?
?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!
beat me to it :D
Another optimization could be (if you ignore underground biomes, which is Deep Dark only) to scan only the world limit biomes, so 16x16
then try to place an ore in that column instead (and probably check the biome again, in case you get Deep Dark)
Geniune question,
I have such code:
@Default
@CommandCompletion("@players")
@Description("Toggles vanishing")
public void vanish(CommandSender commandSender, @Optional Player target) {
if (target == null) {
if (commandSender instanceof Player player)
target = player;
else {
getCommandHelp().showHelp();
return;
}
}
}
I have to understand, Aikar mentions in this wiki about @Optional exceptional with player arguments, does that mean the current code is not possible?
Your current code won't work very well
What is brigadier
It doesn't do anything if target is missing
Mojangs command lib
yes
It'll not even return a null check that I did there?
Hmm
??
What do you mean
Notice the null check I did inside the method
It'll not go through with it?
i not ignore underground
If target is missing it will go through the null check, or you mean the whole code block won't proceed because there's "a missing argument"?
target will be null
yes
oh okay that's fine
scan top 16x16 for your biome
if you find it, try to place block in that column but check for biome again in case you get underground biome (just remembered, lush caves exist)
Unless you want to place your block in underground biome, than this method will not work
it's like "if instance = null -> instance = new Instance();
no
def no
I am pretty sure it does exactly what I thought it does.
what the "instaneof Player player"
To check if its a player and to make target = the command sender
why here player object
That's a bad idea as I mentioned earlier
How come
this not do error ? i mean this shold look like: if (commandSender instanceof Player)
assuming your vanish code will be under that*
No, it's a pretty old java feature already. If you weren't stuck on java 8 or 11, you'd know ig
So there should be an extra check if such player is even online
The player will always be online
what the version?
7
??
It won't give a player object when the player is offline
OfflinePlayer be like
14+
Java is so ancient ._.
So then, it'll return what?
If I run /vanish - I vanish myself
If I ran /vanish Olivo while you're offline = I vanish myself?
True but it does exist in 14 if you enable it ๐
and what is the point of checking a class object
Yes
You're going to need to rework your command logic a bit
also this
ik that yeah
oh
soz
Alr so I need to rework the code, but its not entirely dead code in that turns out that way
All I need to do is to precheck if the @optional player is even online
if not throw the player out of the vanish equation and send back error message player is not online
wdym I'm not talking about checking the class, but about why the class object is there
oh
@chrome beacon dude I just got my mind exploded jesus
I rather change the Player argument to a String argument and that's it ;-;
Olivo is a genius
ik
that lately I've been seeing a lot of strange principles in code
dude probably runs logic in his mind and run tests in his brain
I am 7 years into coding and my brain melts from my own code sometimes
I see solutions to coding problems in my dreams, it's really cool waking up and being able to do something in 5 minutes you were trying to do the whole day before
I'm not sure if you can call that healthy, but it works
Happens to the best of us
I take a toilet walk and then suddenly god brings me the logic I need to my code
I suppose if they were nightmarish it would be worse on the health
"Booh, the solution to that code is right in that box on which there are exactly 357 spiders right now"
Ever think about your programs just like one day breaking your system because you coded some weird flawed logic
I sometimes implement a temporary solution and base all code on it making me change like 90% of all my code
Wait, can I use BlockPopulator to overlay my block generator on an existing one? For example, a chunk with biomes loaded with vanilla BlockPopulator. Then I overlay my BlockPopulator on the existing BlockPopulator. I do not know how to explain it
Yes you can add custom block populators to the vanilla generator
but i know what i can add in BlockPopulatorList my class
What
declaration: package: org.bukkit, interface: World
What about it
can I get all the blocks of the generated chunk at this moment so that I don't have to check everything through for loop?
How would you get all the blocks in a chunk without a loop
I'm just trying to add customBlocks to a vanilla chunk.
during generation, for example.
I want to add customBlocks and from all the information I've gotten this in
- modify the vanilla chunk and load custom blocks at the SAME TIME the chunk is created
- modify the blocks AFTER the chunk is created
3)a lighter strategy of option 1. Somehow overlay your generation on the existing one
demm this hard..
- this hard cuse i think i need read vanilla generation code and somehow use it in my custom generation
2)this it's easier but I think the server will lag
- so here i dont know how do this but I read about this somewhere
You can easily overlay your generation onto vanilla
Depending on what you want to generate it's easy
paste custom block
hi everyone
or find after
You can easily check biomes inside your populator
i need check biome in vanile populator
and paste block if need biome exists
just modify vanille chunk
Is there anything related to withers that makes them invicible to mobs ?
I've spawned mobs with setTarget on the wither, they go straight for it, attack it but the wither isnt taking damages for an unknow reason. I've no plugins other than mine, and I can hit the wither, but not the mobs.
Yes you can do that in a block populator
not create new, or create but with vanille logic
Maybe withers take no damage from mobs
it's applying the changes to the vanille chunk?
yes
and i not need create new biome or blocks?
For example, I presented the task as follows: to get the necessary biomes of a chunk and then get cooridans for all blocks of the biome and use the randomizer.
Just pick a random location within your parameters
Check if the biome matches
And then do whatever
The chance may be small and there must still be a guarantee that at least 1 custom block must be in the desired biome
so this x loop
mhhh yeah; wither skeletons as a boss did took damages
this can be create lag i gess
does anyone happen to know if within LootContext.builder() killer or lootedEntity need to be specified if, for example, the player is fishing or something
would the killer or lootedEntity be the player or would both parameters be null
or another question, im gonna have a mechanic which involves having to scan the player's inventory for a valid consumable in it which requires me looking at the item's meta. Frequently looping through the entire players inventory, getting the meta for each item, seems rather excessive. would it be more optimized if i did something like this where i skip any item that's basically just a plain item (which is most items)
for (ItemStack i : inventory){
ItemStack plainCopy = new ItemStack(i.getType());
if (i.isSimilar(plainCopy)) continue;
// check meta
}
or would that be even worse lol
ItemStack.hasItemMeta
the alternative would be to have a configurable list of materials acting as a filter, like if i know the custom consumable is only x type it'll only scan items of that type
oh thats a thing
darn
How should I increase my mob view distance ?
it's stuck at 48 blocks right now
server.properties is at 16
my client is at 22
i've set entity-tracking-range to 256 each one
i dont understand why isnt it changing anything
can someone help me with this
what's it doing
looking like a texture ๐๐ป
factz, I'm confused how they even got a textured block
what kind of black magic system are they using
so when you place it turns into that blue color glass when its suppost to look like whats in my hand
or just overengineer it like hypixel did and set a hash in nbt
you set the wrong texture on the block
that's synchronized
It has no opacity
how would i fix that this is what i am using to add the block to the game https://www.spigotmc.org/resources/knokkos-custom-items.88182/
if this is not something you're developing but rather another plugin made by someone else
you're best off to contact them
unfortunately they don't have a discord so the most you can do is a github issue
wait nvm they do
@rough harness https://discordapp.com/invite/bmF3Zvu
is there any way to simulate a player catching a fish? right now im trying to call a PlayerFishEvent but im not allowed to spawn in a fishing hook to put into the event params
When you say "simulate", what kind of simulation are we talking here?
Are you just wanting a random loot drop that you'd normally get from fishing?
Because you could do this:
LootContext context = new LootContext.Builder(location).build();
Collection<ItemStack> loot = LootTables.FISHING.getLootTable().populateLoot(ThreadLocalRandom.current(), context);
// In theory, "loot" would just have one entry, but it's a Collection so you can just iterate it
no that part is fine, but i would like it simulated because other parts of my plugin need to also listen to it
i implemented a custom fishing loot table and want to also implement a mechanic that allows players to fish several items at once. for the multiple fishing items i would like this to fire the appropriate event so the loot table can properly replace them
Well I think ideally the other parts of your plugin should have methods that you can invoke yourself rather than relying on the Bukkit event API to do it for you
@EventHandler
private void myListener(PlayerFishEvent event) {
this.doSomeFishingLogic(event.getPlayer(), event.getItem() /*, ... etc.*/);
}
public void doSomeFishingLogic(Player player, ItemStack item */, ... etc.*/) {
// Do your logic here that you want to be able to "simulate"
}```
Then wherever you want to simulate multiple times you can invoke your doSomeFishingLogic() method with the appropriate arguments but not have to include the fishing bobber
i would have preferred to use the event method because it would then allow other plugins to possibly interact with that and put custom drops of their own
but so be it
It is enogh
I meant getCaught() to get the caught entity, but my point is made
hi , what would be the best way to handle data transfer bettwen servers?
so for example
send some arena data to the lobby such as :
game arena info , if the game is restarting , playing , full and other status ..
ik about redis but i just want to make sure there isn't a better way?