#help-development
1 messages ยท Page 72 of 1
Without saving or creating each key individually, by creating an object you could instantally serialize, deserialize and do much more
- a map isn't space friendly, but it seams memory isn't a problem here x)
irony?
Yes ^^
Well since you're happy and familiar with what you do it's fine
hey, any idea why I can't add the spigot 1.19.2 depend?
I can add 1.19.1 but not 1.19.2
Maven ?
gradle
Have you run buildtools?
do I need to?
I am trying to import spigot-api not spigot
For me bigger problem would be actually integrating it into what I already have. I mean, for some reason it just doesnt feel right
Im completely open to that idea, in fact I was about to actually write the class, yk
CoolPlayer player = Players.get("UUID");
player.getFirstJoin();
or
player.firstJoin;
makes way more sense to me
But it's maybe because you're too familiar with js
Well I'm not sure there is a difference between the 2 apis, I'd use 1.19
I know, that is why I even wanted to rewrite the thing with classes, but just creating a new file at all puts me off
huh
In cpp its much simpler and so it is in js
yeah I guess ima use 1.19.1 tho
thanks anyway

ping me if anyone has another idea
But hey Ill give it a shot now, until its not too late to rewrite shitton of code later
uuid is jdk provided
Oh
I still searching for pvp legacy code, event found this string xd
if (this.getName().equals("Notch")) {
this.a(new ItemStack(Items.APPLE, 1), true, false);
}
No way ๐ญ
he looks like a js dev to me
Hello, can someone explain me why my string is empty when called ? i sysout my list and my string and only the list contains stuff
List<String> rewardsname = new ArrayList<String>();
String list = String.join(", ", rewardsname);```
Could you show your sysouts
^
rewardsname
lets follow naming conventions and let class names start with an uppercase character
You're gonna have to show more code. Where are you populating your arraylist?
in my "saveConfig" method
I wish you could define local methods or even have subroutines (maybe even have GOTO)
Hey, don't say anything about my eclipse
The greatest IDE to have ever been made
never used ij then?
Oh I have, but their default keybind layout is stupid
hmm i cant really say much here ๐
And I am not too fond of their UI
If you consider a recolor a new UI I have to disagree
Although I have to say that is less worse than what was before at first glance
uhh they changed the placement of things and how thing are looking etc
well anyways, my Config class extends YamlConfiguration, would it be possible to reload the config from disk while this config object still stays valid, my current implementation doesnt seem to reflect the changes on the current object
would probably mean i have to reassign config object
that would suck as the current object would become invalid then
reassign is the way to go
i could store an yamlconfig field in that class but then i have to delegate all the get methods :/
imma do that ig
When I try to use the command in game it doesn't show up and doesn't work. any ideas?
I have this in my main file: getCommand("toggle").setExecutor(new toggleCommand());
and this is my plugin.yml: name: PvP Manager version: '${project.version}' main: com.ytg667.pvp.Main api-version: 1.19 permissions: togglePerm: description: "Access toggle PvP in the server" default: op commands: toggle: description: "Toggles PvP in the server!" usage: /<command>
I have op
Have you tried debugging?
you didn;t add a permission line to your command
none. it's like the command doesn't exist
would work without permission added no?
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender.hasPermission("togglePerm")){
if (isOn){
isOn = false;
sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.RED + "disabled!");
} else {
isOn = true;
sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.GREEN + "enabled!");
}
}
return true;
}```
the permission is here
Does anyone know what this is? (String from Entity Human) (some kb calculations)
entity.g((double) (-MathHelper.sin(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
i = 1 if sprinting
isOn = !isOn lol
pointless checking in the command when you define it in the plugin.yml
Is there a decent API for making right clickable items that show up GUI menus?
how would I do it otherwise?
you add a line to the command in the plugin.yml permission: togglePerm
What do you need ? Formula explanation or just explanation of what g is ?
no need for any checks in the onCommand then
Formula explanation, g is the same as setVelocity
but it still doesn't work
the command doesn't show up
then you are not registering an executor
but i am
show
im trying to create a custom entity using the mojang mappings of nms and im getting this error: https://paste.md-5.net/dabofiwoga.txt
with this code: https://paste.md-5.net/mebajepogi.java
any ideas?
it's exactly like in the message that i replied to but I made the permission check like you said
show where you are registering the executor
brr had to add 300 lines of delegate methods
Send it to mp, I'll answer once I reach home
getCommand("toggle").setExecutor(new toggleCommand());
in the main
Your method simplifiedjava @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { isOn = !isOn; if (isOn){ sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.RED + "disabled!"); } else { sender.sendMessage(ChatColor.GOLD + "PvP is now " + ChatColor.GREEN + "enabled!"); } } return true; }
thx but that does not solve the problem
check yoru log you will have an error
it just says that there is no such command
new ui preview
check yoru startup log
How do you get it
I have currently a mod for dark mode
Plugin*
But yours looks so much better
its a plugin
Thx
add via "install plugin from disk"
I'm betting yoru name is invalid. Never seen a space in a name
Pretty sure Spigot doesn;t allow a space
Hello people, i want to know which is the equipvalent of YamlConfiguration from Spigot on Bungeecord
hows your claims plugin lol
Really bad im not mainly active
I think i didnt told you
fixed so much stuff today
But these last days i was having hevay stress problems. I was diagnosed with a possible heart attack. Since days before he had had tachycardia
oh no
And the first thing they told me is to stop smoking seeds
no more bird seeds for you
hey guys im wondering
question about sql
in general
if there 2 queries by the same time
from some reason it just does only a one
new to sql (used flatfiles before..)
How do I send a JSON message to a player?
oh alex
You have an example of this?
Shouldnt be possible
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ty
Since it uses some locks and stuff to make sure the database is safely manipulated at your command
thanks
Could I pass in a JSON message that can be used in (eg: /tellraw) in TextComponent#fromLegacyText?
Well what I mean is that both queries should be executed
But not at the same time
Use a connection pool
Yes
i hope he have either replacement for the boiler code..
I mean generally connections are made to be long lived
(connectionhandler...)
but thanks i guess ill just switch to an hikaricp to save the whole headache
But this indeterministic behavior of yours might just indicate that your design of code is at fault
I mean thats a possibility
is there bungee.yml documentation?
Yeah iirc in the bungee section of the wiki
any ideas?
Do you remap back?
i can send my pom.xml if you want
more importantly I you putting the correct jar into your plugins folder
it should compile 2 or 3 jars depending on your setup
do not put the one named remapped into your folder
put the normally named jar
you are not properly remapping back. are you compiling using "mvn package"?
im sorry, im pretty new to maven, what folder?
your target folder
contains all the outputs of the process
or your custom output location
it should contain atleast 2 jars with the mojang remapping plugin though. One plugin that is the remapped and the other which contains the reobfuscated code
Code issue, don't know the right line of code
@cold tartan Are you compiling using mvn package?
yes i think so
erm well
what exactly do you click on to compile?
in intelliJ, you have to double click on "package" here. DO NOT use intelliJ's builtin compile thing
to compile the plugin into a jar for the server? i made an artifact in the project structure thing
Alex needs to update his intellij
yeah, thats why it doesnt work
you have to use maven to compile, otherwise the remapping thing won't happen
you can make maven automatically copy it to your server folder afterwards
(im on 1.19.1)
Im creating a block populator for a chunk generator and i am trying to use the limitedRegion.generateTree method to create a tree, but not a single tree actually gets summoned, is there anything i should look out for? i have no idea why it doesnt want to work, this is my populate function: java @Override public void populate(@NotNull WorldInfo worldInfo, Random random, int chunkX, int chunkZ, @NotNull LimitedRegion limitedRegion) { int x = random.nextInt(16) + chunkX * 16; int z = random.nextInt(16) + chunkZ * 16; World world = Bukkit.getWorld(worldInfo.getUID()); assert world != null; Integer topPos = u.HighestBlockOfMaterialAtXZ(x,z, Material.GRASS_BLOCK, worldInfo, limitedRegion); // ^ just a helper function if (topPos == null) return; limitedRegion.generateTree( new Location(world, x, topPos, z), random, TreeType.BIG_TREE ); }
is topPos maybe null?
what was it?
toppos is the position of the highest block, while i want to put the tree above that block
toppos + 1
yeah that would have been my next guess - check the return value of generateTree ๐
yeah i thought of checking it but then i thought again
sry for the stupid question, my brain sometimes just turns off lol
thats not a stupid question lol
forgot to say it worked, tysm for helping me
do you have any idea how can I enchant create offers?
I've tried event.getOffers().set(0, new EnchantmentOffer(Enchantment.ARROW_DAMAGE, 1, 30)). it works on enchantable items but not on unenchantables
my custom "brainless" (no ai goals) entities seem to be saving as just the normal versions of the entity type. is the best way to fix this just tag the entites, then on startup replace the tagged ones with the brainless ones?
Have a look at Minestom if you'd like to have dumb entities ๐
https://minestom.net this?
Yes, but be careful:
It's a server software that is ... Empty
There is no feature at all
For instance you'll even have to code a chest
But if you want something really lightweight, this is the solution
ok, i think for now ill stick to spigot because im using the spigot api etc., but ill look into that
It requires lot of work of course !
what would be the best way to save an arraylist after the server restarts etc
that seems pretty helpful: https://www.spigotmc.org/wiki/save-load-data-files/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
^
yeah
i mean sort of an easier, but much worse way would be through persistent data containers and just like a frozen entity that is inaccessible lol
Hello, Im currently making a plugin (https://www.mediafire.com/folder/4asbnge2onquq/TrollingPlugin), but it doesnt work on a 1.17.1 server. Can someone please help me?
why does it not work? is there an error in the console?
in the BetterTrolling.java file try replacing Troll with troll
it might not accept capital letters
When I do /pl the plugin is red
There should be an error in console
And when I try a cmd it says internal error
Says the same as in chat
It's the same
the full text if possible
.
.
The text
.
We don't need the type
Please then the "caused by:
Blablabli
Blablabla
CoolStuffHere"
ok, do you mind copy & pasting your console into this chat?
not your chat
the place where you run the server
The console says the same as in chat
do you mind sending a picture or screenshot?
prob a picture because you are on your phone
bro
making spigot forks
without knowing wtf ur doing is funny
so this is a huge server called
and they had a bug for years and didnt fix it
it was so a weakness potion gives u more dmg
(the opposite of what it should do)
@robust light
lol how did they even manage that?
they prob had to override default minecraft functionality
Metadata is non-persistent right?
in items it is persistent
I can't send Screenshots
Then we can't help you until you give us the log
can you take a picture of your computer screen?
Metadata is not persistent. NBT data is persistent.
oh waht? what about item.editMeta(meta -> doStuff); thats persistent right?
with the place where you run the server open?
So for storing data on a player such as an array of IDs using persistent data is recommended, correct?
Using the method PersistentDataHolder#getPersistentDataContainer()
Yep
that helps
I've used it before
I want to avoid having to host a database for as long as possible
Would anyone be interested in helping to beta test my new command library? It's already rather stable from what I can tell but I'd like to have some people try it out and make sure it works for them as well as get feedback
And storing those IDs in persistent data is probably faster aswell
depends, what are you trying to do?
just because you can doesn't mean you have to
like if the player is part of a certain group they have a certain tag?
It's kinda the opposite
You can purchase tags from shops using items
This is for a server I'm a dev on
Right now it overrides your tag if you apply a different one
I'm making a tag menu which allows you to swap your tag
Yeah PDC are fine for this purpose
oh yeah def pdc
So I just need to store a list of the tags and their current one
๐ฏ
I did it in Skript but that required some hacky methods
Can i send it per dm?
sure
I'm sad now
And getting some experience with Java and faster load times is better
Better than a easier language
That's a great beginning
wanna make a dm with wadamka?
No ahah ! You can handle it, if you need help feel free to dm
Do you know any alternative for the YamlConfiguration but for Bungeecord??????
TOML ๐
Nice to hear another who is starting by the correct way - Learning the lang before getting in touch with the api directly
Oh you mean you still want to deal with yaml
Sorry, in that case I thought there were something integrated in bungee... But I'll have to check
Oh something else im having issues trying to recreate the config section? - Im really dumb haha
Yep you can use ConfigurationProvider or something related, but i want to find the exact class which i can extend and use it to load/save and do CRUD operations
Okay what the fuck
I really like TOML it's pleasant to type
Tom's obvious markup language is not at all obvious and I refuse to understand why people can understand it
I understand it can hurt people
It is okay if you have simple key -> object pairs, but beyond that it gets complicated (especially arrays of objects are kinda difficult)
Though I guess a fair bit of that pain comes from a stupid implementation of the format by the forge devs
Have you seen that microsoft is developing a Markdown server interpreter?
What is that?
srry idk what you mean?
hey sorry to interrupt but is someone willing to hear my problem? it's super odd
Markdown "lang" the readme.md files
Yes I know that but I was rather asking what a server interpreter is
The one that looks like Html but simplier
Oh ok, they are designing like a server where they can execute that markdown code
While I have an idea what it could be, I am not 100% sure about this
It can't hurt to try
sure
I am developing a plugin using Gradle, I am getting this error when I build (not in IntelliJ itself):
https://i.imgur.com/w7CKboV.png
again, there is no error in the IDE itself:
example code: https://i.imgur.com/9XC4a7y.png
example error:
D:\...\src\main\java\...\AdvancementHandler.java:31: error: cannot access AdvancementDisplayType
System.out.println(display.getType());
^
my gradle version is 7.5.1 (latest)
my java version is 18 eclipse temurin (I have tried others such like OpenJDK)
I have tried java 17
spigot dependency looks like this:
compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT'
this does not work on spigot 1.19 either
I also have specified in the gradle.build the java version:
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_18
let me know who has any ideas
I had a whole 10 minutes to type up my question
Hi mate, a small suggestion: "when you have any problem just ask it directly on the chat" - Not wondering to sound rude
Hahaha
?jd-s
felt I'd ask bc you guys were talking
This is REALLY strange
since this is gradle I'd just do ./gradlew clean followed by ./gradlew build which may solve it
I have seen similar issues in the past, but they have always been related to inner classes
unfortunately didn't work
compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT'
for that line is it supposed to be spigot? or spigot api
?
ok
?stash alternatively that AdvancementDisplayType class could be package-private which would be interesting to say the least
Nope, all public
Then delete the .m2 folder (in your user home) and rebuild spigot
Anyone please help me.. In my server the damage of mobs are increasing or the sword powers are decreasing.. I cant understand what to do
tried that lol
The classes you are referring to were only made public a month ago
Damage rate is much decreased
#help-server is more adapted. Probably a problem of your plugins
I am aware, I am updating my plugin from 1.18 at the moment
was very excited to not have to use reflection anymore
No one is replying :))
This channel is full of developers, not server admins
ok and
BE pacient bruh
Very different thing
@grave charm The only remaining thing I can think of is to try to use the eclipse compiler
Also, could you give the full build.gradle file?
plugins {
id 'java'
}
group 'dev.luaq'
version '1.1'
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_18
processResources {
filesMatching('plugin.yml') {
expand(ver: getVersion())
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly fileTree(dir: 'libs', include: [ '*.jar' ])
compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
testImplementation 'junit:junit:4.13.2'
}
test {
useJUnit()
}
add the spigot repo just in case - although building spigot should already mean that you have the spigot-api in maven local and should never cause this kind of issues
So unlikely that it does anything, but it does not hurt to try
Bungee ChatEvent also applies to commands, how do i make sure that message is not a command?
Check the first char, if it's a / it's a command
when do entities load into the world?
im running this code:
sendConsole(ChatColor.GOLD + "TESTING 123");
for (World world : Bukkit.getWorlds()) {
sendConsole(ChatColor.GOLD + world.getName());
for (Entity entity : world.getEntities()) {
sendConsole(ChatColor.GOLD + entity.getName());
if (entity.customName().equals(makeID("brainless")))
makeBrainless(entity);
}
}
``` after the world is loaded with: ```yml
load: POSTWORLD
``` but for some reason no entities are listed even though when i join entities are visible
The chunks may not be loaded however
entities are only in loaded chunks, to my knowledge, so assuming you're calling that onEnable it wouldn't work
If the chunks are unloaded the entities are generally too
Too quick, but chunks are the one that loads entities
so i guess EntitiesLoadEvent is the best option
D:\...\src\main\java\...\AdvancementHandler.java:31: error: cannot access AdvancementDisplayType
System.out.println(display.getType());
^
bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/advancement/AdvancementDisplayType.class)
class file is invalid for class org.bukkit.advancement.AdvancementDisplayType
Please remove or make sure it appears in the correct subdirectory of the classpath.
still occuring
this is post-.m2 deletion (again), post-buildtools --rev 1.19.2 (again), and post-adding the spigot maven repository
oh that error is actually more interesting
try to put the spigot maven repo above maven local, but I'll see if that class file is really as corrupt as javac thinks
while setting a block of a LimitedRegion (in a block populator), how can i set the "half" property of grass? im currently using limitedRegion.setType and theres no way to do it with it
ordered as such already:
repositories {
mavenCentral()
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
mavenLocal()
}
What's the "half property of grass"?
org.clyze.jphantom.exc.IllegalBytecodeException: Instruction: 5, occurred while analyzing
Class: org.bukkit.Registry$SimpleRegistry
Method: get(Lorg/bukkit/NamespacedKey;)Lorg/bukkit/Keyed;
Caused by: org.clyze.jphantom.exc.InsolvableConstraintException: java.lang.Enum <: org.bukkit.Keyed
at org.clyze.jphantom.exc.IllegalBytecodeException$Builder.build(IllegalBytecodeException.java:84)
at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:113)
at org.clyze.jphantom.constraints.extractors.TypeConstraintExtractor.visit(TypeConstraintExtractor.java:46)
at org.clyze.jphantom.JPhantom.run(JPhantom.java:84)
at me.coley.recaf.util.JPhantomUtil.generate(JPhantomUtil.java:76)
at me.coley.recaf.util.CompileDependencyUpdater.createPhantoms(CompileDependencyUpdater.java:55)
at me.coley.recaf.util.CompileDependencyUpdater.lambda$install$0(CompileDependencyUpdater.java:37)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.clyze.jphantom.exc.InsolvableConstraintException: java.lang.Enum <: org.bukkit.Keyed
I mean there is something wrong with the jar, but nothing specific to that class. All decompiliers work as intended too which usually suggests near-valid class files
either upper or lower
my bad, im talking about tall grass, it can be either "upper" or "lower"
BiSected
And elgar beating me to it
Oh I was thinking about the grass block
It's because you have to set not one block but two
Delete C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\ then
The issue we have most likely is that spigot is built using the eclipse compiler, which javac may not necessarily like
couldn't you toss all the urls into a single maven block?
that is possible?
also the top one doesn't have = while the others do, not sure if that makes a difference
It shouldn't
I hate gradle, I only use it because this is a collaborative project
but the = shouldn't affect it
yes
Considering that you are using arbitrary jars, gradle is the only sensical solution I am afraid
and programming knowledge tells me that defining the same thing in the same scope is bad so I don't think so..
you don't have to declare all the maven urls in separate maven blocks
but you can if you want to
ah nvm then
this didn't either
it downloads it again then fails
What error are you getting?
.
You are using a normal buildtools generated jar? Not something you've compiled yourself?
Basically some class file (AdvancementDisplayType) is invalid according to the compiler (or maybe the annotation processor, but I doubt that)
that isn't a problem with dependencies
that is complaining about the class file not existing
I hadn't mentioned this earlier because I was hoping that solving this would be easier than it has been; but the InventoryEvent class is also yielding a similar error:
D:\...\src\main\java\...\AnvilRepairFix.java:12: error: cannot access InventoryEvent
AnvilInventory inventory = event.getInventory();
^
bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/event/inventory/InventoryEvent.class)
bad RuntimeInvisibleParameterAnnotations attribute: InventoryEvent
BuildTools from jenkins, downloaded it today
apparently it's number 5 in my Downloads folder
having the full log might help a tiny bit
does PlayerHeldItemEvent gets called if an item is set in the current held slot or added to inventory ?
like when slot not changed but item changed
Try manually adding https://mvnrepository.com/artifact/org.jetbrains/annotations-java5/23.0.0 to the deps
it should be a transitive dependency of spigot, but we can never be too sure
5:15:16 PM: Executing 'build'...
> Task :compileJava FAILED
1 actionable task: 1 executed
D:\...\src\main\java\...\AdvancementHandler.java:33: error: cannot access AdvancementDisplayType
System.out.println(display.getType());
^
bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/advancement/AdvancementDisplayType.class)
class file is invalid for class org.bukkit.advancement.AdvancementDisplayType
Please remove or make sure it appears in the correct subdirectory of the classpath.
D:\...\src\main\java\...\AnvilRepairFix.java:12: error: cannot access InventoryEvent
AnvilInventory inventory = event.getInventory();
^
bad class file: C:\...\.gradle\caches\modules-2\files-2.1\org.spigotmc\spigot-api\1.19.2-R0.1-SNAPSHOT\50be78d8de2d77eb4fa460033d83a7c003b1834c\spigot-api-1.19.2-R0.1-SNAPSHOT.jar(/org/bukkit/event/inventory/InventoryEvent.class)
bad RuntimeInvisibleParameterAnnotations attribute: InventoryEvent
Please remove or make sure it appears in the correct subdirectory of the classpath.
Note: D:\...\src\main\java\...\PlayerConfig.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
5:15:17 PM: Execution finished 'build'.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileJava'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
^ that is with stacktrace
do I even need to say it -- nah didn't work
might say fuck it and just move this to my Mac lol
Windows is the only OS I have issues deving with
clear out ~/.gradle and .gradle and then run gradlew setupDecompWorkspace
your gradle stuff is corrupted
of course it is
I thought setupDecompWorkspace was a FG-specific task
I always have trouble using gradle with Windows, even if I always do the same thing on linux it just doesn't wanna work
personally I only use maven
maven is nice ๐
Mayvan
Gradle is great for other stuff than spigot
So as I'm used to it, I use it for Minecraft
tell that to paper
its good for payper :{
Yeah setupDecompWorkspace is forgegradle specific
wonder what minecraft is actually built on
Probably regular java archive ๐
๐คฎ
Maven is great until you need to define dependencies that are not in a maven repository
it is the only thing I can really find in regards to this particular problem. In either case the workspace directories are screwed up for some reason for them
best they start with a clean one
its still pretty easy you can install it to your m2 pretty damn easily
you can declare local dependencies
that as well ^
Right, you can do that trickery
it isn't trickery
but I should have learned my lesson a long time ago; windows just ain't it
Still not fully as intuitive as gradle
it is literally setting the attribute on the dependency in maven that it is a system dependency
That is deprecated as far as I know
it isn't
At least it is highly discouraged
Im getting error null
nice
/paste
?paste
Maven will print a wall of text if you use an artifact which declares a dependency with the system scope
it is highly discouraged the more encouraged way is to install it to the m2
which is also pretty easy
mvn install :P
And do you know the arguments without looking them up?
๐คทโโ๏ธ I made a script
it isn't even discouraged
there is valid reasons for specifying local dependencies
well depends how you do it if you do absolute path its kinda shitty
is there any way to fix this error?
Show us SongPlugin.java line 38
Name your variables better 
if i have a player stored in a hashmap does the value just dissapear or smthn when the player leaves? cus this is happening to me
p is definitly player lol
Yeah but still
Player objects are not reused between sessions
ops
Only store UUID
use UUID, that never changes
how could I play the actionbar the person that sent it
Version ?
?paste
show your full method
Player p ๐ญ
what the fuck how does that even work
I see too many things wrong here for this to even load properly
Hello I'm having a problem with my code, someone can help me please?
?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!
๐
nice xD
funny guy
beats me
Okay first off why the fuck is your command in the same class as your main. second what the hell is setPlugin what does it do. you should define the command as another class for organizational stuff. Thirdly because of all above factors I'm surprised you aren't getting syntax errors.
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Learn dependency injection and properly make a command
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Fourthly you don't need to manually create the plugin directory it does it for you if you have a config
you're just wasting processing power very little, but still a complete and utter waste
Fifthly, add ActionBarApi as dependency and put it in the plugin folder too
i have a hashmap where i store a boolean with a player UUID and whenever i leave the game and join back the varialbe just dissapears from the hasmap why is this happening
So it's a Map<UUID, Boolean>?
You're storing it by Player
HashMap yes
If you store it as a UUID that won't happen unless you remove it when they leave
If so, are you sure you are not explicitly removing it only player join/leave
the entry can only vanish if you remove it
no just leaving and im not removing it
yeah 1 sec
?paste
else if (!toggle.get(e.getPlayer().getUniqueId())) { is going to reurn null if its not there, so you already cover it in teh first if
oh right, you are checking the return
clean that all up by reading the value into a boxed bool
?
How did you get the CraftEntity instance ?
you can cast it safely
actually im just trying to cast org.bukkit.entity.Entity to net.minecraft.world.entity.Mob
CraftEntity entity = (CraftEntity) ent
if mob is the handle you'd do CraftEntity#getHandle
Yeah I know, but I mean that's maybe the way to get the Mob instance yk
so something like this?
((Mob) ((CraftEntity) entity).getHandle()).removeFreeWill();
looks a bit janky
is that it tho?
ill try it
UUID id = e.getPlayer().getUniqueId();
Boolean test = toggle.get(id);
if (test == null || test.booleanValue()) {
schem.resetDisplay();
schem.hideAll();
toggle.put(id, Boolean.FALSE);
}
else if (!test.booleanValue()) {
schem.resetDisplay();
schem.hide();
toggle.put(id, Boolean.TRUE);
}```
as you are using boxed Boolean
a boxed primitive is used differently to an unboxed
it worked
but when the messages get broadcasted the schematic variable is null
:D
is there any efficient way to create an ellipsoid out of blocks, like very very fast?
This line you are still storing a Player object as key SpawnCommand.schematicHashMap.get(e.getPlayer());
maybe look into marching squares
that might be pretty fast
idk
you changed toggle to use a UUID, but the schematicHashMap is still using a Player
- marching cubes
ahh that works ty i didnt know player variables would just dissapear
im getting this error:
[18:08:31 ERROR]: Error occurred while enabling ExtraShitIDK v1.0-SNAPSHOT (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event com.defiantburger.extrashitidk.extraevents.EntityCollideEvent. Static getHandlerList method required!
at org.bukkit.plugin.SimplePluginManager.getRegistrationClass(SimplePluginManager.java:771) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:703) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at com.defiantburger.extrashitidk.ExtraShitIDK.onEnable(ExtraShitIDK.java:62) ~[ExtraShitIDK.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:542) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:565) ~[paper-1.19.2.jar:git-Paper-131]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:479) ~[paper-1.19.2.jar:git-Paper-131]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:636) ~[paper-1.19.2.jar:git-Paper-131]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:422) ~[paper-1.19.2.jar:git-Paper-131]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.2.jar:git-Paper-131]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1125) ~[paper-1.19.2.jar:git-Paper-131]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-131]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
ive never gotten it b4 so im not sure what it means
package com.defiantburger.extrashitidk.extraevents;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EntityCollideEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
private final Entity collider;
private final Entity collidee;
public EntityCollideEvent(Entity collider, Entity collidee) {
this.collider = collider;
this.collidee = collidee;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
public Entity getCollider() {
return collider;
}
public Entity getCollidee() {
return collidee;
}
}
thats the code that it seems to have an issue with
oh
Static getHandlerList method required!
You need both ;p
Aha
why doesnt md_5 combine them? if they return the same thing
wait nvm
one is static
Static/instance
yeah
just create a new instance through the unsafe class and invoke the non-static method that way - problem solved
now im getting this error: https://paste.md-5.net/ojirazuzas.txt
with this code:
package com.defiantburger.extrashitidk.extraevents;
import org.bukkit.entity.Entity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
public class EntityCollideEvent extends Event {
private static final HandlerList HANDLERS = new HandlerList();
private final Entity collider;
private final Entity collidee;
public EntityCollideEvent(Entity collider, Entity collidee) {
this.collider = collider;
this.collidee = collidee;
}
@SuppressWarnings("unused")
public static @NotNull HandlerList getHandlerList() {
return HANDLERS;
}
public Entity getCollider() {
return collider;
}
public Entity getCollidee() {
return collidee;
}
@Override
public @NotNull HandlerList getHandlers() {
return HANDLERS;
}
}
might have fixed it
bruh
u do Bukkit.getPluginManager().callEvent(collideEvent); rather than collideEvent.callEvent();
yes
Hello,
If I use NMS for example for particles in 1.8, should I create it also for each version higher than 1.8 or just with the spawnParticle method would be enough? I have tried to use the spawnParticle but it doesn't work, maybe I'm doing something wrong, I have set that if the version is 1.8 use NMS, if it is higher than 1.8 use spawnParticle()
What are you trying to do with spawnParticle
Simply spawn a particle when the player mines a block ๐คทโโ๏ธ
I have tried to use spawnParticle when it is version 1.13.2 for example and it doesn't work, but if I use NMS it works. So my question is if I use NMS in 1.8 for example does it force me to use NMS in every version?
I use NMS in 1.8 because spawnParticle() does not exist, but in 1.9 this method already exists and it should not be necessary to use NMS
simply create an interface and two classes
one class for teh 1.8 NMS implementing the interface. The second class wrap the Spigot spawnParticle method while also implementing the interface
at startup you detect if teh spawnParticle method exists, if it doesn't instance your NMS class
if it does you instance your wrapper
All yoru code simply calls the same interface method no matter the version
This is how I have it set up, but when using the class where I have the spawnParticle() method from version 1.9 to 1.19 it doesn't work, it tells me that the particle is wrong :/ Right now I'm not on PC and I can't pass the code, but simply what I do is to convert the String containing "REDSTONE" to particle with the Particle.valueOf("") and it throws an exception that it is not a particle, when it should be
I feel like im doing this wrong.
use path.separator instead of putting them in yourself
this way the Java API will ask the OS what path separator it uses and then plugs it in
shit thanks for reminding me.
otherwise it looks fine to me
i want to make sure i do this right before i start uploading it to git, so all criticism is welcome.
oh e.getUniqueId().toString() if you want to be more cautious
i heard the .toString() wasnt important?
its not, just semantically correct
ahh gacha, ill put a mental note on that
ayy you have a nice day at work man. thanks
Hello, my plugin is giving an error and searching I could only find 3 threads about it and people instead skipped the error and didn't actually help to fix it.
The error is:
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.BlockFace.getOppositeFace()" because the return value of "org.bukkit.material.Sign.getAttachedFace()" is null
Code where the error is:
Sign sign = (Sign) e.getBlock().getState().getData();
if (sign.getFacing() ....```
(Import for Sign: org.bukkit.material.Sign)
**How the error is happening:**
When finishing writing a sign, the plugin will check if it's attached to a chest so it's checking it's facing to see the location of the chest. This is working fine for every locations except the sign is facing NORTH specifically(Every other direction doesn't give error.
**I'm using server version:**
`Paper version git-Paper-56 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT) (Git: 41238a4)`
**And for the plugin maven it's:**
```java
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>```
plugin.yml does contain `api-version: 1.19`
hope someone can help. thanks ๐
I've also tried adding a check for:
if (sign.getAttachedFace() == null) {
return;
}```
but IDE warns with "**Condition 'sign.getAttachedFace() == null' is always 'false' **".
Sorry for asking this nooby question but the first line is only displayed on Intellij right?
incase anybody is interested in a follow up, I was able to compile by adding paper-api as a dependency
it has its own built in method for doing what I want to do: https://i.imgur.com/4toj6u9.png
this isn't an ideal fix, however, I was using paper ANYWAY
so figured I might as well reap the benefits
Anyone that's worked with Fabric, is it similar to spigot?
Modding is a lot lot harder
main thing with modding if you don't know java its 10000x more punishing than spigot
open the jarfile yourself
its not distributed online
you need a decompiler to open it
Wonโt really help tho as itโs obfuscated
it actually helps quite a bit even though its obfuscated
atleast the ones with the spigot mappings do
I just decompile the one with spigot mappings thats in my m2 after installing remapped and use screaming sandles to find equivelant fields
What I usually do is create a new fabric mod, it's deobfuscated and you can view the source code easily as a library
how can i disable mob AI for only certain players? bascially a zombie wont attach player1 but will attack player2
EntityTargetEvent or something like that I think?
It's a bit of a spammy event so be careful what all you're doing in there
I would like to have an armorstand without gravity that can still be affected by velocity
Currently, I have a custom ArmorStand class that extends NMS's ArmorStand
I tried setting this.setNoGravity to true & then used:
public void travel(Vec3 vec3d) {
if (!super.isNoGravity()) {
super.travel(vec3d);
} else {
move(MoverType.SELF, vec3d);
}
}```
But the armorstand still doesn't want to respond to velocity and I dont really know what I should be trying next
doesnt seem to be spammy enough lol. the event doesnt get called if the mob is already attacking me
basically i want mobs to stop attacking once a player reaches a level but the mobs continute to attack cause the event isnt called when they are already targeted
LivingEntity#setTarget
cp -r minecraft minecraft-build
Javac minecraft-build/net/minecraff/client.java
Zip -r minecraft.jar minecraft-build```
how hard is it to update a players name in a custom config smh
sorry im fuming dont mind me
aight i give up. im not getting an error, it just updates every time i join.
while that is useful, its not really what im looking for. My issue is that when it checks the config I.E. (myuuid).yml, it keeps running even if the name is equal to the name in game.
so you want to keep track of player name changes in a file?
yeah basically
your problem is because you only load the data AFTER checking
YamlConfiguration also has a static method of loading
which means you don't even need to create a new YamlConfiguration instance, you can just do YamlConfiguration.load
how can i teleport a player but not change their head movement/body
get their current location, store their pitch and yaw
then set the target location's pitch and yaw to those values
ahh lemme try
works amazingly
but it is a little glitchy
but i dont see any other way
yeah that's just how teleporting is unfortunately
Is there a better solution to allow players rotating their head but not move than this? (PlayerMoveEvent)
if(e.getTo().getYaw() != e.getFrom().getYaw() || e.getTo().getPitch() != e.getFrom().getPitch()) {
return;
}
//else do whatever```
just compare the X Y Z of the to and from and if they don't match, cancel
how can i make it so it doesnt drop the block in BlockBreakEvent
there is a gamerule for tile drops, but you should be able to setDrops iirc
ah ty
I would rather check the position because a player can have both positional and rotational movement at once.
So if he rotates then he can move during the rotation.
What is "it". Because for that you would listen to the BlockDropItemEvent instead
i just did event.setDrop(false) and it worked
Well... You are always creating a completely empty YamlConfiguration and then check if it contains a name. Which it never will of course.
Ah that has been solved already
Question, for database stuff
How do I mass edit every value for a row?
I.e; updating somebody's information when they leave
Is it something above the lines of UPDATE userinfo WHERE UUID=?
And then set the values accordingly..?
Well you simply dont add a "WHERE" clause
Oh, you can just add multiple values
What do you mean?
I never knew you could specify multiple columns in the UPDATE statement
if you do
UPDATE playerdata SET points=0
Then every row in playerdata will have 0 points
Oh, I'm trying to target 1 specific Key, UUID
Ah so its
UPDATE playerdata SET points=0, name='SomeName', lastseen=10032155530 WHERE playerid=someUUID
But in java you should use a prepared statement
UPDATE playerdata SET points=?, name=?, lastseen=? WHERE playerid=?
and insert your variables
I was told this would work.. and it wouldn't cause lag, and this is for my plugin specifically:
UPDATE userinfo UUID=?,RANK=?,SHARDS=?,DISPLAYRANK=?,JOIN_MESSAGE=?,DISCORD_ID=?,CHAT_ROOM=?,NAME_COLOR=?,HIDDEN_FROM_USERS=?,HIDE_COORDINATES=?,RECEIVE_STAFF_NOTIFICATIONS=?,RECEIVE_PRIVATE_MESSAGES=?,RECEIVE_TPA_REQUESTS=? WHERE UUID=?
If this causes lag greatly depend on where you call this query
It shouldn't cause lag, I'm running it async --- quick question, do I set my UUID as PreparedStatement#setString(14, uuid string)
As it's the 14th value in the statement
Which DB are you using?
MariaDB
But it is the 14th value, yes?
Index starts a 1
That doesn't answer my question well, I tried storing things as UUID and I got errors in my console about invalid characters
So they are just VARCHAR's
I know that, and I used the method you had told me to when I had that issue, days ago
And make sure the field type is UUID
When creating the table
And I still got errors
what can cause my plugin to be red when doing /pl?
Can someone help me fix it?
An exception is being thrown
like an error in the source?
the code for integrating translations into my plugin is as genius as it is profoundly dumb
I sent it to u per dm because I cant send it here
?paste
And the problem is clear. You are creating a new instance of your JavaPlugin class. Thats not allowed and will
crash your plugin.
wdym?
You can take what i said literally. If you dont understand something then specifically ask about that.
This happens in BetterTrolling.java line 9
public final class BetterTrolling extends JavaPlugin implements CommandExecutor
do I just remove "extends Javaplugin"?
I have no idea how your code is structured so i cant answer that.
Is BetterTrolling supposed to be your JavaPlugin class?
Because you can only have one
https://www.mediafire.com/folder/tsnoa7sr71nam/TrollingPlugin
this is the full project
I followed some tutorial for the command registering
You should create a separate class for your commands.
There is so much wrong here that im not even going bother explaining it all.
Just create a separate class.
๐
wdym a seperate class for commands?
I mean that you create a separate, dedicated class for every command you want to create.
do you mean like plugin.yml?
sorry if I have pretty stupid questions, Im just starting out with spigot
It sounds to me as if you are just starting out with Java.
Spigot is not beginner friendly and if you dont know the basics of Java then you will have a very hard time.
I kinda know the basics of java, I learned it a few years ago. I just really dont remember much abt it
Well then: Create a separate class for each command.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Here is a basic guide for commands
thats the exact guide I followed
The guide tells you to create a separate class. Which you didnt do.
is there event when player leaves?
PlayerQuitEvent
god im so dumb lol
What could InventoryHolder be used for?
To hold inventories
We need more context
one final question: would I use player.sendMessage or sender.sendMessage?
Doesnt matter for your case
does PlayerItemHeldEvent gets called if the item in the main hand of a player changes ?
declaration: package: org.bukkit.event.player, class: PlayerItemHeldEvent
yeah not enough info
slot change yes
but if item in hand changes
does it get called ?
Those 3 events should cover most hand interactions. (Plus the drop event)
Static instance ๐
Is it like a way to store an inventory in a class?
No
Its an API interface. You dont implement it yourself of course
Thats all you need to know
How can I check equality between inventories? I'm making an inventory menu where users can click to get teleported to certain places. (or should I even check if it's the right inventory they're clicking or should I just check the items being clicked?)
Are you trying to create inventory GUIs?
Yes
I would recommend using a library for some time. GUIs can be very complex and you need a lot of java knowledge for a proper implementation.
Which library would you recommend? Though I would still like to know the answer to my prior question if possible
how can i center text in scoreboard
Which of those questions?
Which library would you recommend for making inventory GUIS?
&
I'm making an inventory menu where users can click to get teleported to certain places. (should I check if it's the right inventory they're clicking or should I just check the items being clicked?)
You should abstract a button which contains delegation for events like a Consumer<InventoryClickEvent> and decoration for
the viewer like a Function<Player, ItemStack>
What you are attempting to do is very fragile and error prone.
There are plenty. I think Triumph is decent. (But its quite advanced)
This is also a recommendation im seeing a lot
https://www.spigotmc.org/resources/if-inventory-framework.57216/
never tested it though
Just making sure, is it this one? https://github.com/TriumphTeam/triumph-gui
Simple lib to create inventory GUIs for Bukkit platforms. - GitHub - TriumphTeam/triumph-gui: Simple lib to create inventory GUIs for Bukkit platforms.
They are actually pretty easy to make, I made my own not too long ago
How did you go about it?
have a look
And you can add some cool stuff like auto pagination
It makes life a bit easier, so I would certainly recommend using a lib or making your own
Is there a reason why "GUIAction" is an abstract class rather than an interface?
If you use an interface you can always implement multiple of them, but only ever extend one class
The bit I'm talking about:
public abstract class GUIAction {
public abstract void action(InventoryClickEvent event);
}```
GUIAction is an abstract class even though it has no fields. This should be an Interface.
Which makes it effectively just a Consumer<InventoryClickEvent>. So this class can as well be deleted.
Your InventoryUtil class has fields and is therefor not a util class anymore. InventoryManager does not belong in there.
Your InventoryManager#getMenuItem() method is very inefficient. You should do a simple Map<Integer, InventoryItem> inside your
InventoryGUI class and then get the InventoryItem by the clicked slot. Iterating over all ItemStacks and checking for equality is quite slow and error prone.
uuid dont deletes when player leaves
but lets say i store in sql database
at the moment i store uuid's and convert them to bytes
to save storage amount
are there any tools to check what plugin uses certain event?
decomplier ๐คฃ
hell no im not decompiling 60 plugins
how can i hide a player armor
packets
maybe stick to protocol lib
should make it easy
mm
didn't retrooper make packetevents
yes
nice what does packetevents all do
packetevents 2.0 > protocllib
pain to maintain
seriously though remapped is better than protocollib lol
packetevents is protocollib without all the bullshit
not really, you just change the mappings in pom.xml and you can compile the exact same code again
i've never used protcollib lol
just dont
how often do mojang mapped names change as far as packets go that you've had to deal with
I never encountered any change since I started using remapped in 1.17 (which was the first version spigot remapped was available)
the only weird thing about packetevents is this weird init stuff
behind the scenes there are some still using spigot mappings
you need to call like 4 init methods lol
.load()
.init()
.anotherThing()
.andAnother()
literally the server I work for does this lmao
how do I get the index of an item that was added using inventory.addItem()
you don't
okay thanks
it may have been added to a stack or a slot, no way of knowing
so the best way would be to create an addItem method and set the item by gettings inventory size-1
for(int i = 0; i < size; i++){
if(inventory.getItem(i) == null){
inventory.setItem(i, item);
// logic
break;
}
}```
I think I might stick with my solution
eh thats shotty at best its not always guarenteed to be at that slot, but you can try
Hey can someone tell me what a plugin api is?
an application programming interface
You have been here long enough for me to know you are trolling
Explain more?
What
Okay lets say you had a plugin called car, and it goes honk. You can get the plugin's api to call the honk method. It basically allows you to use things contained in that plugin
It allows communicate between that plugin and yours
Spigot provides an API between Minecraft and yoru plugin. A Plugin API provides an API between your plugin and theirs.
Can someone explain or link a resource on how bigger plugins handle and register commands?
command framework
boilerplate code.
I don't see a command package in every single platform (bukkit, bungee) but I do see one in common (luckperms is this plugin). Do they use adapters or something?
oof
Its an external library from great people that make that stuff for you
isn't ACF by aikar a command framework?
I've heard numerous people talk about it
If I'm talking complete bs, where can I learn about how plugins actually get loaded?
And about how Minecraft registers commands?
So you want to make your own commands for your plugin?
Um ok
I know how to do that but where can I read about how they actually get loaded by the server software?
?stash
Oh so you want to understand the actual workings?
thats teh Spigot code
Yes
Yep, have fun reading that
Is teleportation through a compass a built-in feature in spigot 1.19? (looking into a solid platform and left clicking apparently teleports you there)
I think I fixed the things you pointed out, can you take another took and make sure I got everything?
It's a WorldEdit feature
Does the same as //thru
Is there a way to disable that?
You'd have to check the config
Oh i found this:
directory:
--- delete start
navigation-wand:
item: minecraft:compass
max-distance: 100
--- delete end
scripting:
timeout: 3000
dir: craftscripts
Can i remove the entire clause?
Anyone knows about this?
I don't wanna repost so will just reply towards it
You could change it to a different item you'll never use
Or set the max distance to 0
Change to "carrot_on_a_stick", I believe that's the name of its material
Nobody ever uses that and if u do, u don't click with it
I found something
Set the whole section of navigation-wand to -1
navigation-wand: -1
oh okay
thanks
Okay
That's a awesome finding
These are the 2 solutions I found on the Bukkit forums
Yes, it's from 2014 but it probably works
Well world edit hasn't changed much anyways ๐คฃ should work
bosjoer
I'm looking trough the Bukkit code but I can't seem to find an implementation for Server
CraftServer
Almost all implantations are in craftbukkit
And where do the commands from a PluginDescriptionFile get loaded into commandMap?
because that variable isnt final
as far as i know i cant change final variables right?
yes
you can change teh value of a final variable, you can;t change its assignment
wdym
how can i get "muted" variable out from this runnable?
make it a one element array or an atomicboolean
what?
Validjava final List<String> strings = new ArrayList<>(); strings.add("test");Invalidjava final List<String> strings = new ArrayList<>(); strings = new ArrayList<>();
is there other easier ways?
Greened, you cannot change the muted variable because the Runnable is not ran on that thread (Elgar, correct me if i'm wrong)
The code after the runnable will run before the runnable
Your muted variable only exists inside that event/runnable
You are of the mistaken idea everything waits for your runnable to finish and sets muted.
Your event finishes and is gone by the time your runnable exits
what can i do then?
if you want to change a value thats going to be accessed elsewhere, it needs to be a field or stored in a Collection somewhere
why wouldnt collection be empty if second runnable is running first?
something like java PlayerRegistry.getPlayer(id).setMuted(true);
if you were storing a registry of players with settings you could change
hmm i dont like the lack of documentation for acf
i used litebans api for not storing mutes myself :/
you don;t get to decide the execution order of runnables.
๐
what if i run both runnable in same runnable?
no
why
if you create a runnable it doesn't even start until your current code execution ends
everythign happens in a sequence, one after another
what??
even async doesn;t start the instant you ask it to
how can code execute if runnable is not runned?
what?
