#help-development
1 messages ยท Page 244 of 1
If you decide to no longer have config.yml and remove it from source, it will still remain in target folder as package will just overwrite files
maven moment
ohh ok
just use clean to, you know, keep it clean
I was confused cus when I just use package, i get my plugin name-shaded and if I use clean, I dont get that
i don't think there is any connection
huh
between having clean in goals and having projectName-shaded.jar
maven shade plugin beat
does this not work when I use clean?
yea ik
.๐
ok
Graven >>> Maven >>> Gradle
no
dafuq is graven
i mean gradle isnt perfect
but its far better than maven as soon as you need sth a bit more powerful on the spot
i personally like the 80% smaller build files
mine are normally shorter than all the maven ones i ever used
how do i import nms?
maven?
while this thing compiles, or whatever its doing
what does it mean that nms is not cross version compatible?
does that mean i will have to update the imports if i want to recompile the plugin again in the future?
or the jar will literally stop working on future versions
and ill have to compile it again with the updated nms?
from what i know about nms, most of it is version specific but you can implement multi version support
version specific meaning
the jar will stop working
or that ill have to update the source if i want to compile it again
and this thing just finished compiling
where do i have to put the jar? so that maven, or whatever, can know it exists and use it
if you only add and build spigot for the 1 version , it will only work on that version. if you build multiple versions and add the deps and tell the plugin to run certain classes according to version
once thats done you dont need to do anything else with it
just change the dep to spigot not spigot-api
yea but that will only be backards compatible, not with future versions, right?
its all on here
yea, i just did that
should be set to go with nms
magic
i would like to know how it knows that a jar has just been created in a random folder somewhere
something about a local repo i think
i remember using nms like a year ago
it builds spigot, it also builds the api and minecraft server to your maven local
iirc users/.m2
m2 meaning maven 2 i guess?
no idea
it works anyhow
well, it seems like net.minecraft.server.v1_16_R3.WorldServer no longer exists
any idea how it may be called now?
or where is it
might be craftbukkit stuff i think
im getting this error with mvn package, which part of pom.xml do i have to send
[INFO] --- specialsource-maven-plugin:1.2.2:remap (remap-obf) @ databaseinventories ---
Downloading from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.pom
Downloaded from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.pom (5.2 kB at 16 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.jar
Downloaded from central: https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.jar (84 kB at 154 kB/s)
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR] supported. Please add the goal to the default lifecycle via an
[ERROR] <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR] remove this binding from your POM such that the goal will be run in
[ERROR] the proper phase.
[ERROR] - You removed the configuration of the maven-jar-plugin that produces the main artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.579 s
[INFO] Finished at: 2022-11-30T23:07:51-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-obf) on project databaseinventories: Failed to create remapped artifact, project main artifact does not exist. -> [Help 1]
?paste your pom
all of it?
yeah
you have 2 different versions i would guess
ln 96/96
<remappedDependencies>org.spigotmc:spigot:1.18.2-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
but you have 1.19 spigot
lol
but
apparently thats not the cause of the error
wait, this thing is doing stuff, i think
Usually helps to create custom properties for versions. This way instead of multiple places to change you just have one
yea, same error
Something to look into after you fixed your problem for organization purposes
Did you make a remapped 1.19 jar?
how are you building?
yea, i literally have no idea how to do that, im not familiar with java at all
how do i do that?
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Just follow those steps
the plugin? mvn package, and the buildtools thing was java -jar BuildTools.jar --rev 1.19.2 --remapped
Well I am at work currently. So limited in what I can do until I get home
quick question, whats the exec plugin for
Have you tried doing a clean build?
mmm
running scripts
i think
idk, i made a boilerplate tool like a year ago
bc i didnt want to learn maven again every time i wanted to make a plugin
like, i literally forget the very basic things
What does it do?
the scripts?
yeah
nothing, just moving the jar to the sv and reloading the plugin
mvn clean
and adding a command to plugin.yml if i forgot to do so
It clears out build stuff from prior building as if you never tried compiling. Occasionally caches and the likes give problems so you just know clean them out and see if that helps
i still get the same error
frostalf do you know what the validate phase is
why does it say BUILD SUCCESS when deleting stuff
It comes before compiling
i have a feeling that phase on the exec plugin might be causing it
Its a phase to let you check and do stuff before compiling actually happens
However do something wrong then and it can throw compiling off because it was expecting something that might not be there anymore
and those placeholders
well, im going to sleep rn so, ping me if you have any idea of what to do and ill do it tomorrow morning
gn
Is it possible replace other plugin`s command executor to mine?
I wanted to get it but i got null
PluginCommand#setExecutor just, no?
is there an event for a mob like piglin despawning
I got nullPointerexeption
set not get the executor
xD
means the u never got the right command instance
You should first check if its registered or check get to ensure not null
Thx i fixed.
coped this guys about me lol
np ๐
copied?
drag click
lol
cool symbols ๐
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโ
dose anyone know how to make explosion physics?
I have this in my code:
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
``` but when I build on intellij I get this stupid error
cannot find symbol:12
?paste a full class or method
sure
I'm beginning to believe that something is wrong with my intellij
is that the correct place where the error is? nothing looks wrong with that
Exactly.
mind sending a ss of the error with the code its surrounding
can't send SS
?img
Not verified? Upload screenshots here: https://prnt.sc/
that works
does anything appear while hovering over the code or if you click on them where does it put you
nope
that's the thing
yk when u type like CommandExecutor and then it goes red and alerts u to import the class?
that didn't happen this time
just to check does anything appear in text at all anywhere when clicking on any of those
nope
im more confused
same here.
cus like building is done with Maven not intellij
so maven and intellij both hate me today?
?paste ur pom
shore y nawt
what
this just gets more and more confusing
Dangi t
Clear intellij cache
target.getWorld().spawnEntity(target.getLocation(), EntityType.PRIMED_TNT);``` I currently have this, how could I make it explode instantly?
Tried restarting ide?
Have you tried doing clean build on project?
Set the time to 1 tick
declaration: package: org.bukkit.entity, interface: TNTPrimed
Do I store the tnt to a variable, then set it? I am quite confused ๐
?basics
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Think I spotted the problem
You are using java 1.8
Need to update to java 17 for newer versions
Storing it worked, I took a look at the TNTPrimed on the docs and there doesn't appear to be a way to set the power. Is this possible?
that is impossible.
Its in your pom at top. Java.version
Ohhhhh
Crud
I figured it used my default value
facepalm moment inc
Yeah thanks dude
appreciated

is there like a karma system on here?
Seen some servers that have bots, you use a command on a member who helped you, does one exist here?
Tntprimed extends explosive so yes
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Explosive.html
declaration: package: org.bukkit.entity, interface: Explosive
You want setYield()
Okay, I'll try it out!
Yes but don't know how to invoke cafebabes command for it
But no one checks that stuff or uses it here lol
It worked, thank you!

oh well. thanks again lol
and if you are using 1.16+ then just add this to your plugin.yml: ```yml
libraries:
- org.jetbrains.kotlin:kotlin-stdlib:1.7.21 #Set the version you need
Np
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
for me
Already found that 2 days ago lol. Thank you anyways
how do people load html elements from other pages in single page applications in a way that is scalable and maintainable long term without using something like angular, just using vanilla js and html/css?
I've tried a few solutions before but they just don't feel right
best solution I've found thus far is basically just ajax which I really am unsure is a great idea
Components?
like templates?
Not sure but Yea you can say that ig
I've used them before and they're useful to an extent but it doesn't really feel scalable, I made a relatively basic webapp with them and that thing is sitting at like 3k lines with maybe a third of the features I wanted in it
I guess maybe I can offload them into different pages and load them in with ajax-like requests but then I'm just back to where I was
Anyone help? My command just isn't returning anything, no errors at all...
ahh yh I'll give it a go as i just realised the "remove" is working
!timer.checkDoubleXP() you got it top without reversion
and you never add them btw
wdym by this?
Yeahh? I'm checking if they are in the hashmap, and if they aren't. Am i missing something??
is your guy on the timer list?
yes and remove works. It's adding that doesn't
so when i type "add" as args it adds then straight away removes and spams the deactivate title
yes but you at the point he executes "add" is he on the List or not
nope
can you send your new formatted code
?paste
check if the add methode gets executed
it does
I can see it for like 1 second, then it deactivates again
and i got a debug message for an event
its double xp
which broadcasts when i get xp in the hash
yeah your deactivate title spams to much in order to see activated title
Yeah i can see it and i use xp bottle straight away and it broadcasts
It is executing
wait
It is putting me in the hashmap with the "add" but for some reason just spams that title??
so it is working
you just said its executing so I guess
looks like it
idk actually
looks like its either a timer or in your level update event
I'll remove the timers and check - I've never used timers so i probs messed it up
Damn yeah it was the timer
?paste
how to create falling block with material?``` BlockData blockData = Bukkit.createBlockData(Material.CHORUS_PLANT);
Entity fallingBlock = projectile.getWorld().spawnEntity(projectile.getLocation(), EntityType.FALLING_BLOCK);
declaration: package: org.bukkit, interface: World
Its deprecated isnt it?
โจ click the link and see โจ
Ok its not with blockdata, confusing ;D
declaration: package: org.bukkit, interface: World
Its depracted with material, with blockdata is not, i was just confused
Hello, I want to do Nametags on protocollib packets. However, when trying to join the server, I get an error.
Error:
Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 1 is out of bounds for length 1
at com.comphenix.protocol.reflect.FieldAccessException.fromFormat(FieldAccessException.java:49) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:289) ~[?:?]
Code:
public void createNameTag(Player player, Player other) {
this.packetContainer = this.protocolManager.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
String playerName = player.getName();
this.packetContainer.getStrings().write(0, playerName);
this.packetContainer.getStrings().write(1, playerName);
this.packetContainer.getStrings().write(2, getPrefix(player, other));
this.packetContainer.getStrings().write(3, getSuffix(player, other));
this.packetContainer.getIntegers().write(0, -1);
this.packetContainer.getIntegers().write(1, 0);
this.packetContainer.getIntegers().write(2, 1);
this.packetContainer.getSpecificModifier(Collection.class).write(0, Collections.singleton(playerName));
this.protocolManager.sendServerPacket(other, packetContainer);
}
Anyone can help?
the exception says it all
Yes, but do you have any idea to do it right?
by not trying to access a field which isnt there?
hey any one can tell me how do u get in that github editor
which looks like visual studio or something
like in browser
What is that?
ah u press .
when u are in git hub project
and u get your project open in visual studio
in browser
Also you are looking for GitHub codespaces. I Personally would recommend the usage of a dedicated IDE though. A Browser is Not meant to be used as an ide
Ah, english confused me again
I was just looking for some specific line of code in my github project and needed editor to search thru
I am using intellJ
isnt it github.dev/projectowner/projectname
How can I create an explosion that destroys blocks but doesn't damage players?
by canceling the damage event
ok
sup morice ||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ||||โ|| _ _ _ _ _ _ @last temple
does he know
ยฏ_(ใ)_/ยฏ
How can I get Explosive variable from this player.getWorld().createExplosion(player.getLocation(), 5, true, true);
because it returns boolean
and I need the instance of the explosion
use teh method that accepts an entity
then check in teh damage event for that entity so you know to cancel it
ie, if you pass the player as the explosion source entity
how
that returns boolean
and all of these methods
still boolean
you don;t need the return
I want to get the explosion as a variable and none of these methods return it
you can;t get teh explosion as a variable
thats not how explosions work
pass the player as the source entity, then in the player damage event if the source is the player cancel the damage
I think I'll just summon an invisible creeper and force it to explode
why?
hello
?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!
can i skip this function in learning java or its really important?
https://programmingbydoing.com/a/alphabetical-order.html
38 to 40
I mean, you wouldn't need to learn this specifically. Most important part is that you learn the basic principles of java and programming in general
oh ok
so i can skip it
lets gooo
i will start doing randomness
!
ty @daring maple
CompareTo is really neat to use if you have sorting algorithms tho
But I highly doubt you'll need it in your case
idk how to use it
i will learn it later
i dont think i really need it for plugins
My eyes
should I put those click in array or set and then use for loop
instead on click
would that be better
sorry wrong chat
You ever heard of a switch statement
well I could go with switch to
That's pretty dope ngl
but I don't like it
My God it looks so much less aids
would for loop have less preformance
And you can have drop through
how
Yes it would be
I see no reason to use a loop here
Couldn't you just have a generic handler method which itself handles the logic for which action does what
It looks like the generic handler method to me
yeah it is one general handler
Do a Map though if yoh want to clean it up
I was planing to put it in map
will do
I think in your case Function<Void, ActionHandler> would work well
Void parameter with return of action handler
How would a void parameter work?
Whats the point in specifying a parameter like that
You just pass in null
Tho actually
You should use a supplier now that I think of it
I changed my mind Supplier<ActionHandler>
Iirc that's the one that returns
My brain died fir a second there
really not sure how would I use that
you got any example tutorial of what you have in mind
how can i get source of EntityExplodeEvent or BlockExplodeEvent
getEntity and getBlock respectively
no i mean the player who made the explosion happen
what like the person that lit the tnt?
Detect and create Optifine Dynamic Lights ?
yeah
Yes
dynamic light is handled client side
see earlier message
You need to include the driver in your plugin
Seems to explain things pretty well
I'd go for SQLite since it's quite common and already included in Spigot
I'm guessing h2 is in memory and dumped to a file whereas sqlite is written each time?
Yep i use sqlite
You need to shade it
with the maven shade plugin
one moment
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.h2database.h2</pattern>
<shadedPattern>your.package.name.h2</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
if I do this in the InteractListener :
private HashMap<UUID, Integer> buyingShopNumbers = new HashMap<>();
buyingShopNumbers.put(player.getUniqueId(), shopNumber);
//this prints out 2
System.out.println(buyingShopNumbers.get(player.getUniqueId()));
and then that in a different file:
InteractListener interactListener = new InteractListener();
if (interactListener.getBuyingShopnumbers().containsKey(player.getUniqueId())) {
}
why is the if statement false?
okay and how do i fix it
but getBuyingShopnumbers() is the getter
yeah
then you need to make your listener instance accessible
in main class for example
InteractListener interactListener;
public void onEnable() {
interactListener = new InteractListener();
}
public InteractListener getInteractListener() {
return interactListener;
}
and then you can use mainClassInstance.getInteractListener().getBuyingShopnumbers();
tho you'd better have map outside of listener class
put it to your main class or create util class for your maps and lists
but is this best practice kinda seems complicated for just getting the map over there
ohhh okay
wait dont i get the same problem when I get a new instance of the Utils class everytime I need a map
if you need a JavaPlugin instance add JavaPlugin plugin to the constructor
that would also work
but who the fuck does that ๐
can confirm
Hello, I have absolutely no idea on why but for some reason my server is just printing "/Hello" instead of "Hello World!". Here is my code, if anyone can help:package com.example;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class CommandManager implements CommandExecutor{
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
String commandName = command.getName().toLowerCase();
if (commandName.equals("Hello") && sender instanceof Player){
Player player = (Player) sender;
Plugin.LOGGER.info("Hello World!");
System.out.println("Hello World!");
return true;
} else {
Plugin.LOGGER.info("Command not found!");
return false;
}
}
}
thx!
my god
Isn't supplier the one that returns its just functional programming pretty simple
You return x action for click type
command name will never equal "Hello"
mvn update
I saw it online. I also tried:
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args){
if (command.getName().equalsIgnoreCase("Hello") && sender instanceof Player){
Plugin.LOGGER.info("Hello World!");
return true;
} else {
Plugin.LOGGER.info("Command not found!");
return false;
}
}
yeah, but it still doesnt work
Bro remove getName
what exactly is not working
Why you need that?
you should never need to check the command
have you registered your command in plugin.yml
So, whenever I type /Hello, it should print "Hello World!". It instead print /Hello
if you have several commands registered in 1 executor, you need
.
and through getCommand().setExecutor() in your code
Yes I have!
public class Plugin extends JavaPlugin
{
public static Logger LOGGER=Logger.getLogger("demo");
private CommandManager commandManager;
public void onEnable()
{
LOGGER.info("demo enabled");
LOGGER.info("Hello World Pluggin Enabled");
commandManager = new CommandManager();
getCommand("Hello").setExecutor(commandManager);
}
public void onDisable()
{
LOGGER.info("demo disabled");
}
}
Here is my Plugin.java
my main
What should I replace it with?
just remove it
My yml:
name: demo
main: com.example.Plugin
version: 0.0.5
api-version: 1.19
commands:
hello:
description: Make the world say hello!
usage:
/Hello
aliases: [H]
your command is wrong
and plugin is printing usage
from yml
instead of what you have written in your code
Oh, ok?
You should never do that thougj because that's kinda dumb
how do I fix that?
but still
No yeah, I only have the Hello World command.
Firstly remove the name check and make sure it returns true
cuz your statement returns false
and then you print that command is not found
and your onCommand returns false
when onCommand returns false, server send you usage example from plugin.yml
That is true, in the server, it says that the command is not found
So how, do I make it return true?
change your if statement
Is it throws any exeption?
maybe your sender is not a player
No it doesnt
or yeah, you might have errors in console
when your plugin enables
just change your if to this
It used to, saying that the command was not right, but I fixed it
if (sender instanceof Player){
alright
also check if you imported org.bukkit.entity.Player
Is it possible to replace EssentialX's command executors? It throws nullPointerExeption ๐ฆ
It worked
but for some reason it is only printing in the console
and not in game
How do I make it log in game
cuz you use sysoutprintln
instead of player.sendMessage()
or Bukkit.broadcastMessage()
((Player) sender).sendMessage("aaa")
they are pretty pointless
it is
you have ConsoleSender.sendMessage(), Entity.sendMessage() and Bukkit.broadcastMessage()
what throws
when I tried to setExecutor() to essentialX's command.
full stack trace + your code
Thanks Guys! It finally worked
Wait
have fun
cool
Hi im having a problem with this code
Manager https://sourceb.in/UwsakJlEmQ
Code to call the Manager: "new KitsManager().give("Test", player);"
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!
i don't know even i tried everything but doesn't work or the code getting called
explain better please
i made the code tried it and doens't do nothing when i do the command with the Code to call the manager
public class CountdownCommand {
final MainPlugin plugin;
@Nullable CommandExecutor commandexec;
String command;
ConfigurationSection commandSec;
long interval = 20;
int countdown = 10;
ConfigurationSection BossbarConf = null;
ConfigurationSection TriggerColorsConf = null;
ConfigurationSection PlaySoundConf = null;
public CommandExecutor getCommandexec() {
return commandexec;
}
public String getCommand() {
return command;
}
public long getInterval() {
return interval;
}
public int getCountdown() {
return countdown;
}
public ConfigurationSection getBossbarConf() {
return BossbarConf;
}
public ConfigurationSection getTriggerColorsConf() {
return TriggerColorsConf;
}
public ConfigurationSection getPlaySoundConf() {
return PlaySoundConf;
}
public CountdownCommand(String cmd, MainPlugin i){
command = cmd;
plugin = i;
commandSec = plugin.getConfig().getConfigurationSection("commands").getConfigurationSection(command);
plugin.getServer().getPluginCommand(command).setExecutor(new CommandChanger(plugin, this));
commandexec = plugin.getServer().getPluginCommand(command).getExecutor();
BossbarConf = commandSec.getConfigurationSection("Bossbar");
TriggerColorsConf = commandSec.getConfigurationSection("TriggerColors");
PlaySoundConf = commandSec.getConfigurationSection("Playsound");
interval = commandSec.getLong("Interval");
countdown = commandSec.getInt("Countdown");
}
}
and trying making player.sendMessage to get where the error is, is not doing nothing
why are you creating new instance of KitManager everytime
Safe to say he needs NukerFall free java lessons
true
because i use one for register and one for commands
๐
...
oh
Bruh I wanted to reply to this :(((
you forgor
nuker get your jree fava lessons out
see you later alligator
@quaint mantle
you fucking what
VirtualMachineMemoryAllocator
that's from MrSteep's bio
minecraftworldgenerationalgorithm
Handlers wut
:|
Nullpointerexeption at plugin.getServer().getPluginCommand(command).setExecutor(new CommandChanger(plugin, this)); But command exist.
wheres jvm as pronoun?
?
hey there, I'm seeking help with MockBukkit, I've sent this message to their support server a couple times but don't seem to get a response
Getting a weird error with XMaterial, basically parseItem uses XMaterial and for some reason server is null?
com.roughlyunderscore.enchs.TestUE.testParseItem1() Time elapsed: 0.279 sec <<< FAILURE!
java.lang.ExceptionInInitializerError
at com.cryptomorin.xseries.XMaterial.<init>(XMaterial.java:1570)
at com.cryptomorin.xseries.XMaterial.<init>(XMaterial.java:1579)
at com.cryptomorin.xseries.XMaterial.<clinit>(XMaterial.java:69)
at com.roughlyunderscore.enchs.parsers.action.ActionUtils.parseItem(ActionUtils.kt:119)
at com.roughlyunderscore.enchs.TestUE.testParseItem1(TestUE.java:39)
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.Server.getVersion()" because "org.bukkit.Bukkit.server" is null
at org.bukkit.Bukkit.getVersion(Bukkit.java:112)
at com.cryptomorin.xseries.XMaterial$Data.<clinit>(XMaterial.java:2198)
... 19 more
@BeforeEach
public static void setup() {
MockBukkit.mock();
plugin = MockBukkit.load(UnderscoreEnchants.class);
Bukkit.setServer(MockBukkit.getOrCreateMock());
}
private static UnderscoreEnchants plugin;
@AfterEach
public static void unload() {
MockBukkit.unmock();
}
@RepeatedTest(value = 25)
public void testParseItem1() {
final ItemStack item = parseItem("stone:3");
assertTrue(arrayContains(arrayOf(new ItemStack(Material.STONE, 3)), item));
}
sorry i don't go by jvm
server is null
wait Bukkit.setServer being a thing?
?
declaration: package: org.bukkit, class: Bukkit
wait what
@quaint mantle are you alive
cannot be done if already set
4gb ram moment
reflection time
Can I add tabs after a text in spigot? I tested \t but this just gave me a weird character
depends
i don't think it's possible in chat
but probably possible in server name
hi
Well now it doesn't
but now it errors that server is null
and we are spigot-related here
basically MockBukkit.mock() should change it to NOT be null
..it's a dependency for testing?
not a fork of spigot
then you probably placed your getOrCreateMock() or setServer() in wrong place
this is from the documentation
Sad
but enhanced because it stopped working
basically MockBukkit.mock() and plugin declaration should be just enough
and the rest I added because maybe it'd work
If I understand it right it will be like a Stream#map, right?
When I open my plugin project I see this on the side of the IDE and then 5 seconds later I only see this.
What is happening?
that happened to me
send pom.xml
it cant find the build script or it wont register it
where
look on the maven tab and import the project
im using maven tho
right click pom.xml
right click your pom.xml, should be able to reload it from there
this?
do you have a maven option'
if it dont work try using the add framework thing
i dont see maven option
one sec ill open intellij rq
maybe
WHAT IS HAPPENING
backup your project
you literally have a "add as maven project"
and create a new one
under the create gist
Lol
ohhhhh
lol
Thank you so much
blind moment
yeah
well it's 00:00 for me
I want a text to be gray and italic so I did this:
player.sendMessage(ChatColor.ITALIC + (ChatColor.GRAY + ("[Server: " + player.getName() + " is no longer a server operator]")));
and it is just gray and not italic. any ideas?
it most likely cant parse it
try ChatColor.GRAY.toString() + ChatColor.ITALIC + "[Server: " + player.getName() + " is no longer a server operator]"
colour before formatting
and if you need to stack them .toString() on the first one
more like Optional::map
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
Bukkit.broadcastMessage("clicked");
Bukkit.broadcastMessage("title: " + e.getView().getTitle());``` tf? ```this.getServer().getPluginManager().registerEvents(new InteractListener(), this);``` nothing happens when i click in a gui
any errors
no
Is the click canceled by any previous plugin?
nope
only thing that could possibly effect it is this @EventHandler(priority = EventPriority.HIGHEST) public void onBlockClick(InventoryOpenEvent e) { if (e.getInventory().getType() == InventoryType.BEACON) { e.setCancelled(true); } } dont think it would though
Well, I have no idea what would produce this issue
Is the inventory open and you are clicking somethign in it?
yes to both
then your event can;'t have been registered.
it is its with my other events that work fine
instead of showing us copied pasted code
how about showing us the actual class or something?
?paste
obviously you are doing something wrong
but you keep showing us what you think isn't the problem so that doesn't really help
main https://paste.md-5.net/ogodalaxar.java
listener class https://paste.md-5.net/zuyapaxepo.java
you have a wildcard import for all listeners, you don;t need the extra one. But thats not the issue
ah its under inventory
If that is trully the code it's fine. you can;t have updated the jar on your test server, or you are not building
Make sure you don't have 2 versions of the jar in your plugins folder
Can lead to an old one being loaded
it only works when i drag an item from my creative inventory to my inventory
it doesnt work in the gui
yeah, mentioning Creative would have told us all we needed to know
Creative is all client side and has minimal server side events.
They are all labelled "Creative" in the javadocs
in other words, don't test your GUI while in creative
as it really won't work
you should also add checks to your plugin as well to check if there is players in creative opening the gui and prevent it
i dont want it to be my inventory though? its a default bukkit inventory
ive never had an issue with me being in creative and ive used guis for like 6 months
also still doesnt work, still only happens when dragging in my inventory
creative has its own interact event
if YOU are in creative, those are the events you will see
im just saying it only works when dragging stuff in my player inventory
/gamemode survival
no no no
u are missunderstanding
It will work fine in survival, IF you are building/updating the jar on yoru server
im saying it ONLY works when i drag/drop in my player inventory but using the InventoryClickEvent but in a normal bukkit.createInventory gui it doesnt work
It works fine for everyone, so long as YOU are not in creative
in survival it still doesnt work
Throw your PC out the window then as it works for everyone else
it says "Error occurred while enabling Plugin (Is it up to date?)"
what did i do wrong
?paste the full error
^
You probably forgot to register the command in the plugin.yml
do i need to do that
yes
i thought that was only for the "/help" command
or use some kind of command framework
its 1.8 so how many even exist
ok thx
me writing an algorithm for 6 hours now and it's still full of bugs
it is working
well you never showed the rest of the code for your gui
as I stated before, you can't expect help if you are not willing to show the code you are using
interesting
is this your code?
ah good, because that wouldn't really work on the main thread
eastergg: Thread class will have Thread.onSpinLoop
and there is no check in there to see if the runnable is on main thread either lol
well, actually it would work on main thread however that is only if you make the main thread sleep which as we all know is a bad thing anyways XD
the person who wrote this knows what hes doing XD
oh I am sure they do lmao
well at least it is being ran in a thread
but there should still be a check to ensure its not on main thread just in case
i should be looking into how to interpret benchmarks
they are not usually difficult to look at
the hard part however is knowing the caveats
i once wrote this and i had no idea what i was doing
better way to test the parsing would be to have a file that has quite a bit of expressions on their own lines
and then having your parser select one at random to parse
hmm ig
otherwise kind of hard to benchmark a simple expression lmao
the expressions that are rn in the file are of format "x * y" lol
ez
lets see what happens when i run it
ah fuck i left debug on and now its flooding the terminal
22k lines debug lmao
Whats benchmark do
Hello how can i get the nether wart block drops ? when i use block.getDrops() the collection is empty only for nether warts
it doesnt drop anything without silk touch iirc
๐คจ
Might wanna double check that one
If youโre talking about the actual block pretty sure you can do that by hand
i thought that one needed silk
Says you can do it by hand
I misspoke, I was talking about the nether warts I said "block" because in 1.8 the material for the item is NETHER_STALK and the block NETHER_WARTS
im not breaking the block
its looking like a mess https://paste.md-5.net/evetuhokam.cs
Too old! (Click the link to get the exact time)
Lol
thats a world name, not a pitch
Also you have a comma after get yaw
if you want a playable player from 1.8+ i use spigot 1.8 i don't see why you tell me that? Just don't answer i think ur trolling me but its ok
1.8 to 1.19 is so different itโs very difficult to remember the state of the api from nearly a decade ago so generally people will be unwilling to help. Just a heads up
having fun debugging ๐
you are literally doing
int a = 5, b = "abc";
/* those two are the same */
int a = 5;
int b = "abc";
of course it will be red
I understand you, but there are still people creating plugins in 1.8
Then Iโd go ask those people instead of these lol
i tabbed the wrong shit
i wasnt asking to him ? Or maybe it is a 1.19 exclusive spigot discord server ?
believe i found the cause of my bug
older versions just arent lts anymore and not everyone here has or does make plugins for 1.8 anymore
1.8 sucks in every way except peformance
Performance-wise it is especially trash-tier
Yes i already said that i understand this part, but almost all pvp/minigames servers are 1.8-1.19. You talk about it as if nobody plays on it anymore
we know people play on it and that its just that not many small servers or the ones that wouldnt have their own devs exist so people dont make 1.8 plugins and dont remember how they were made back then
That #getDrops() method he was asking about I think was even changed in 1.9-1.12 sometime to allow a itemstack parameter as an example
we have this method too in 1.8
Maybe it was before that, perhaps that one was a bad example
no it wasnt a bad example bcz my question is about this example
looks like it finally worked
wouldnt surprise me if others wont work
fuck i cant do math
whenever this one works, other ones wont work
for anyone who loves to look at code https://paste.md-5.net/udozocefuy.cs
this one works but some others dont
Do you have this on github?
I'd like to have a look
To learn ๐
only my ancient code
i can make a quick push if you'd like
and ofc the push is rejected
Lmfao
im getting this error when running mvn package
[INFO] --- specialsource-maven-plugin:1.2.2:remap (remap-obf) @ databaseinventories ---
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR] supported. Please add the goal to the default lifecycle via an
[ERROR] <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR] remove this binding from your POM such that the goal will be run in
[ERROR] the proper phase.
[ERROR] - You removed the configuration of the maven-jar-plugin that produces the main artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.859 s
[INFO] Finished at: 2022-11-30T23:25:53-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.md-5:specialsource-maven-plugin:1.2.2:remap (remap-obf) on project databaseinventories: Failed to create remapped artifact, project main artifact does not exist. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
try mvn clean package
โโโ AsyncExecutor.java
โโโ commands
โ โโโ GetInvCommand.java
โ โโโ LoadPlayerCommand.java
โ โโโ MigrateCommand.java
โ โโโ OpenInvCommand.java
โ โโโ ReloadCommand.java
โโโ database
โ โโโ Database.java
โโโ DatabaseInventories.java
โโโ events
โ โโโ DatabaseInventoriesEvents.java
โโโ OfflinePlayerLoader.java
โโโ SerializablePlayerState.java
what about the main folders
โโโ pom.xml
โโโ scripts
โ โโโ check_commands.py
โ โโโ post.sh
โ โโโ pre.sh
โ โโโ project_version.py
โโโ src
โโโ main
โโโ java
โ โโโ io
โ โโโ github
โ โโโ misdocumeno
โ โโโ databaseinventories
โ โโโ AsyncExecutor.java
โ โโโ commands
โ โ โโโ GetInvCommand.java
โ โ โโโ LoadPlayerCommand.java
โ โ โโโ MigrateCommand.java
โ โ โโโ OpenInvCommand.java
โ โ โโโ ReloadCommand.java
โ โโโ database
โ โ โโโ Database.java
โ โโโ DatabaseInventories.java
โ โโโ events
โ โ โโโ DatabaseInventoriesEvents.java
โ โโโ OfflinePlayerLoader.java
โ โโโ SerializablePlayerState.java
โโโ resources
โโโ config.yml
โโโ plugin.yml
target isnt necessary right?
in pom.xml on like 11 change the D to lower case
wait dont do that
imb lind
im more confused
just to test something, remove the exec plugin and the stuff that it has, and see if it will buiild
comment from line 33 to 67 right?
yeah
i dont use maven or exec plugin so i have no idea what might cause that
i need those scripts so
The poms formatting is strange or is that just because of the pastebin?
whats wrong about it exactly?
Wait nvm I viewed it on phone, why its weird
seems like the post execution is the one thats making it throw an error
<execution>
<id>post</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
<argument>./scripts/post.sh</argument>
</arguments>
</configuration>
</execution>
the script:
mv ./target/databaseinventories*.jar ~/servers/Minecraft/plugin_dev/plugins/
if i comment that line in the script, and i leave just some printfs, it doesnt fail
so... why moving that makes it fail?
and apparently it was trying to move the plugin jar, and the plugin name + remapped-obf, what is that? there are 3 jars on target after mvn package, is that normal?
databaseinventories-3.0.1-SNAPSHOT.jar
databaseinventories-3.0.1-SNAPSHOT-remapped-obf.jar
original-databaseinventories-3.0.1-SNAPSHOT.jar
It is normal, original- one is without shaded libraries and -remapped-obf is one with remapped nms code (assuming you are using nms in your plugin)
-remaped-obf
thats the plugin now?
nms is normally obsufcated, special source remaps it and re obsfucats it for usage
im getting NoClassDefFoundError: afh
`how am i supposed to find out what class is that?
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 1) {
sender.sendMessage("specify a player UUID");
return true;
}
UUID uuid;
try {
uuid = UUID.fromString(args[0]);
} catch (IllegalArgumentException e) {
sender.sendMessage("invalid UUID");
return true;
}
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
if (!offlinePlayer.hasPlayedBefore()) {
sender.sendMessage("that player has not played before");
return true;
}
sender.sendMessage("loading player...");
Player onlinePlayer = new OfflinePlayerLoader(plugin).loadPlayer(offlinePlayer);
sender.sendMessage("player inventory:");
for (ItemStack item : onlinePlayer.getInventory().getContents()) {
if (item != null) {
sender.sendMessage("" + item);
}
}
return true;
}
OfflinePlayerLoader class (i took it from the OpenInv plugin):
https://paste.md-5.net/kuniwogogo.java
uhhh
i just tried using the jar without -remapped-obf and now it works
wasnt i supposed to use the remapped-obf?
thats the pom, the hastebin link
i havent modified it
you should be good to go with that
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.ABSORPTION, 200, 10))); when im setting the duration is it measured in ticks or seconds?
Ticks
Ok thanks
1 1 2 3 3 1 3 2
1 2 3 3 3 1 1 1
1 2 3 3 1 2 1 2
3 1 2 1 3 1 2 2
3 2 2 1 1 1 1 1
1 2 3 2 1 2 2 3
3 2 1 3 2 1 2 1
1 2 3 1 1 2 3 3
Output:
0 1 2 3 3 1 3 2
0 2 0 0 0 0 0 0
0 2 3 3 1 2 1 2
3 1 2 1 3 1 2 2
3 0 2 0 0 0 0 0
1 0 3 2 1 2 2 3
3 0 1 3 2 1 2 1
1 0 3 1 1 2 3 3```
it's replacing all of sequences which are longer than 2 with zeros
both horizontally and vertically
for example
3 2 1 1 1 2 = 3 2 0 0 0 2
AND
= =
3 3
2 2
1 0
1 0
1 0
2 2
why do you need it
i made it smaller
Integer.valueOf((resulth.charAt(index) + ""))
is there like any way to optimize it
just cast one of the chars to int
without it giving you char + 42
Why does file is empty? permissions HashMap contains 20 elements
guess some of your if's are false
both if conditions trigger configruation.set()
also don't return
omg thx
๐
i should use continue
well, anyway it is not working
file should contains permissions: but its empty
In theory you could, yes. You would have to change the delimiter
what do you mean by delimiter?
Something like getConfig().options().pathSeparator(';'), then you could set your values like getConfig().set("parent;child.with.a.dot;another.child")
gr8
Basically instead of separating children with dots, you're doing it with whatever you set the separator to
Bear in mind that will continue to be the case until it's changed again
That's not a temporary change
thanks it works, and last question how can avoid {} at the end of each section?
I don't think you can. That's just how Bukkit treats empty objects
WOW
i never knew that
ye then I just load file again and remove those symbols
how would i run a command using bungeeapi
vscode moment
What is a simple way of checking for inventory in InventoryClickEvent?
Nvm I got it
Does vscode have tab complete
Might check it out
it requires configuraiton to do literally anything tho
it doesn't ship as a full blown IDE
I'd stick to IntelliJ if your already used to it
its "technically" better according to everyone on here. I personally don't see such a big improvement when using it, but thats cuz I'm a weirdo
Only problem i have with intelllij is the ram usagr
how much does intellij use
Like 2gb on a normal project
mine uses 3gigs but thats because I configured it to

