#help-development
1 messages · Page 531 of 1
Because a cause will never be an entity type...
e.getCause()
how can i check if it was a crystal then?
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent, enum: DamageCause
Iirc a crystal will call the entity damage by entity event
like this?
compare e.getCause()
Yes
It's an extra method call!!!!!
default equals impl just does == internally
Muh performance
It actually needs updating now that signs changed slightly
I'll update it tomorrow probably
InventoryView#setTitle()? Already did that before I committed
Most likely
1.88
2.0
will we ever get to 2.0
2.0 Would imply the game would be entirely reworked
Yeah Mojang has no plans of going to 2.0
At least atm
Public Service Announcement: Version numbers are not decimal numbers. 1.7.10 is no more impossible than 1.7.9. 1.7.banana is also acceptable
Ye exactly
I'm still sad they didn't actually release a 1.7.banana after that
With banana trees
Could have more i guess, like with snapshot versions i think
So is there a way to set the title with Paper without needing to use NMS currently in 1.19?
So inventory?
How do i do it
We have just been lacking API for it for a long time
No
So how else would I do it? Using NMS?
Not even paper has an API for that strangely enough
Like I said I think it's because setTitle is <1 month old
Well it has a InventoryView#title() method for getting Components but not for writing it
Yeah that method is much older
uh I have no idea what you're trying to say
nvm i do this
im guessing you mean adding the exceptions to the method, so you have to wrap it in try catch
dont make that a one liner
why
it will make everyone who reads your code hate you
Then don't send it as an image?
Also why not use try-with-resources here?
wdym
You could also have done
Connection connection = null;
public void onEnable() {
try {
connection = getConnection();
getLogger().info(ChatColor.GREEN + "Database successfully connected");
} catch (SQLException ex) {
showError(exception);
} finally {
connection.close();
}
}
instead of sending an image
ah is good
With try-with-resources (Should Connection implement AutoCloseable) you can do:
Connection connection = null;
public void onEnable() {
try (Connection conn = getConnection()) {
getLogger().info(ChatColor.GREEN + "Database successfully connected");
} catch (SQLException ex) {
showError(exception);
}
}
😄
Well I included the AutoCloseable
ah i understand i can't add finally at this code
acutally i need close mysql ?
Using try-with-resources automatically closes the AutoCloseable
what is try-with-resources
Remember: the finally {} block is ALWAYS called should the try {} block get executed.
The thing I just showed
if server close
t-w-r will close ?
or
wait
i need add close method to ondisable ?
if i do t-w-r ?
you should close on disable if the connection isnt null, if you dont use a connection pool
you are an npc
no im pretty sure thats you
wanting to run a 1.7 server
problem?
could it be that some of the protocols in https://wiki.vg/ are outdated or just a completely different type than in actuality?
you have hundreds of bugs and exploits
Ok
and someone can join ur server and almost entirely hijack ur computer
Seen some tutorials on the AnvilGUI by WesJD which I presume is the most common Anvil API. The problem is however that they all use the #onComplete method which does not exist anymore. Could someone please explain to me how I would achieve the same with some different method thats currently available?
This plugin is supposed to create a inventory for each person and basically when using /badges give <playername> <badgetype> it must add the badge (in this case a diamond) to the players badge inventory. When firing the command it works perfectly but when restarting/reloading the server or the player leaving the inventory does not get saved. Anyone a idea why?
I've already tried seperating the classes where it saves the data but that did not help
can i close my database onDisable with t-w-r ?
no, just check if the connection isnt null and close it
idk what you want try-with-resources there for
Well it was in direct response to them using the finally block
No. It will be closed as soon as you exit the onEnable block
the finally without twr would be called as soon as your try block is done, not when the server closes if thats what you wanted
or be smart and use hikariCP with its connection pools
true
Hello guys , i have created a mini /duel command for my server but idk how to do for "PlayerDead" when is in the duel
https://paste.md-5.net/tesabamozu.coffeescript
How i can do?
i need get player uuid for offline server
or only getname is fine ?
you should always use uuid, but if you are forced to use name use it
player uuids for server or mojang ?
what
i mean if my uuid is = 4545 if connect to another server my uuid will be = 3535 ?
that isnt a uuid
your account uuid never changes
Is the uuid generated when entering the server?
No
for offline server ?
no, its generated when you create ur mc account
It's generated when account is created
for offline server ?
You don't need offline server then
does anyone have a command framework example that doesn't need the command in the plugin.yml for me to look at? I'm alittle curious about it.
what
acf
and i be customer and he wanna plugin for offline server
Simpilar than ACF
just want source code?
yeah
how to insert into commandmap?
mhm
ur staff?
smth like this
someone can help me?
too lazy to write it myself
nah man just flying aorund
How would I add tab completion to this?
isnt #setTabCompleter in PluginCommand?
it has the tabComplete method
but for some reason my tab completions aren't working
Which one should I use in my configs (yml files)
kebab case (no-permission) or
lower snake case (no_permission)
kbab
kebab imo
^^
i have no clue actually, would help if i had access to the internals
dont have any spigot project on this pc
all good, thanks
til that is called kebab case
Does anyone here have a bit of experience with saving data to .yml files when the server restarts/
?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!
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
i need use char or varchar for uuid why ?
nah that one sucks (atleast the last time i looked at it)
for mysql
doesnt mysql have UUID support?
TEXT or varchar(36)
So i'm trying to save data on the player when the player receives a badge. For some reason the data does save when the player restarts so leaves and joins back again but when the server restarts the data gets lost and the inventories are empty again.
is there ?
probably want binary object though, storing text in a db is awful anyways
nah doesnt seem so
varchar is probably fine
I use a binary object
UUIDs should be stored in binary
But iirc it does have a uuid type
MySQL UUID with mysql tutorial, examples, functions, programming, mysql, literals, procedure, regexp_like(), regexp_replace operator, regular expression, crud etc.
i use blob but thats sqlite
I use UUID but thats PostgreSQL 😎
i only use postgres in college
i wonder if mysql/sqlite has a way to define var type saving
instead of explaining why they use a certain db they just say "use it"
college nowadays
var type saving? like text type?
like how you can make type adapters for json
does that exist in some form for mysql/slite
sqlite
you probably dont want to save their name, as it may change and no longer be correct
i believe primary keys are implicit indices
You never save any information about the inventories.
alright i delete
wdym ?
that primary keys are a lookup index by default
not sure about this in mysql, i dont use that db
So i would need to save the inventory whenever i add a badge?
you are complaining that there are no inventories.
and primary keys must be unique too
You save playerBadgeData but nothing about the inventories
Well not complaining, the inventories open up as normal it's just that the stuff inside the inventories dissapear.
you may be better creating the inventory when its needed and just saving a Map<UUID, List<String>> with the list storing keys to the item and have a central map with Map<String, ItemStack> and just saving that to a file
Line 99 is when the server is fresh, no inventories
It will create a new empty inventory
are there supposed to be badgeItems in that inventory?
Yeah it's basically supposed to be a general inventory that every player can open but they're personal. So when a player earns a badge it gets added to their personal badge inventory. And then it adds the badge item
then you'd probably do as Epic said, don;t store the inventories. populate a new one from the playerBadgeData when needed
You save and load the badge data fine, you just do nothing with it after
So i would have to just create a new inventory from playerBadgeData when the player fires the command and if it receives a badge then save it?
mhm
how do i constantly check if a player has an effect?
check if a player has an effect...
i don't need to provide context
use runnables
it's irrelevant
could you provide me a documentation or something on that
runtasktimer
use javadocs
the repeatedly bit
code that runs once isnt repeatedly
it wasn't really needed so nah
I would just use the event to check when they get the effect
And/or when they lose it
the issue is that other plugins/people will just simply override it
if he wants to do it constantly he wants to dp it constantly
override the effect...
why are you trying to correct him on his use case
.
i dont bother trying to tell people they have no clue what they are doing most of the time
how do i instantiate a villager
people tend to take that as a challenge and i dont feel like arguing with people
spawn an entity and cast it to villager
World.spawnEntity
Villager villager = (Villager) x
You can skip the cast if you use the method that takes a class instead of an EntityType
i want to store entity.. remove it and respawn exactly the same entity
what is the way to go about that?
The only real way you can do it with the api is to manually store all the data for the entity
Or you could be kinda janky and save it into a structure
wait is that possible
yes
i thought thanks! @young knoll
You'd need to store name, health, and any entity specific data
Sadly we don't have a good way to copy entities yet
that feels like the kind of thing that would be good
trick around and make it invisible
😔 i know
to actually fully serialize an entity
lol good way to trick the user!
like magic
i actually had another project i worked on once trying to do something like this
ended up having to just use nms
before i'm teleporting the entity... i should make it immortal
dam i wish i could just copy the entity and set uuid to a different uuid
what even are you trying to do
It's quite easy with NMS
😨 NMS
Sadge, I know
but preferably you wouldn't need nms
entities arent by default serializable iirc
maybe Entity MNS API?
just use gson ¯_(ツ)_/¯
sure but then you cant load it with api is all in saying
true i faund that out on first try D;
copying all the traits and everything
anyways, to just keep your entitys instance could be the best way
otherwise make your own value object which you can serialize and deserialize with everything you need
teleport the entity to shadow realm
why
and return them later
you can just remove it
😂
and respawn it
You can't re-add an entity if you remove it
nothing is impossible
dude i wish there was an api for this shet
just force yourself into craftregionaccessor and add the entity manually back to the world
😮 woaw
Whats a good library for 1.19 to change the users display name above their head
NameTagEdit
how pathetic of me asking, but whats a good pathfinder lib
u got smthn against paper or smthn?
yes
?whereami
paper's shit
All im saying is it exists in paper's api lol
if you want to use that or not is ur choice
👍
From GoogleUsing Bukkit you can use methods "setDisplayName" and "setPlayerListName" on a Player to do it. For the chat part you should use the event fired when a player talks in chat.
Wanted to know as well
But these are accessed using the player instance
You tested it?
Yes
Can you show me a screenshot along with source code?
This was last updated in 2016
There are two ways: 1. Use ProtocolLib. But there is a limit of 16 characters. 2. TAB plugin API
Tab allows to set the name above the players head?
And yea but protocol is a lot of work
I wouldn't say that much, but yea, it's easier to use the TAB plugin
I didn’t know tab allowed that ngl
Yea it’s just how mc works
I need to read up and see if tab can
If not I’ll go the other route
how can i use hex color code in chat or title ?
I want to know where Jeff went
who
He might be recovering, he comes here sometimes and help with the development
oh alex
Yes, that is who I meant. I seen Jeff somewhere, it might be on his discord server
You seen him here recently?
he was here a few days ago, most likely just sleeping a lot
it is like 1:22 rn for him in germeny
here was here in discord like some few hours ago lol
oh
10 hours ago
anyone in here know coding
im trying to compile java code into a plugin and i was wondering how
do you use maven or gradle
no idea lol
i had someone write me up something real quick and i wanted to test it out but i really dont know how
i can sent a .txt if you want
do you have a pom.xml or a build.gradle
all they gave me was java code
can i send the code and you like glance over it and see if it would like work first?
Idk why would they send you uncompiled source lol
?paste it
Just ask them to compile for you ig
bet chatgpt wrote that
probably
so the article you sent above should get it to work
it would help, you would also need to make a plugin.yml for it
<maven.compiler.target>1.8</maven.compiler.target>
should it be 1.19.4 instead of 1.8 because thats the version i want?
so it should remain the same?
yeah
<version>1.19.4</version>
is this correct it said syntax errors when i tried reloading
its 1.19.4-R0.1-SNAPSHOT
Thanks
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
now it has this whole bit red which is mostly just pasted in from the article
are you using intellij
yes i did something wrong and copied a bit of text its working now
alright so i followed the guide and tried to compile and it says "illegal start of type"
Why returns getVelocity() always 0 on boats? (land, water, ice)
because their movement is sent by the player instead of being like
processed by the server
which is why Player#getVelocity also returns 0 when a player is moving
unless the server actually applies a speed to it
It seems that there is no way. Setting the boat's velocity works, but is very clunky.
Though it might be still good enough for my use case.
Still thx.
Isn’t there like an actual boat speed variable you can set or am I remembering incorrectly
Let's say I have a library that does some code. Is it possible for the library to know what the name of the spigot plugin that ran the code is called? Or would I need a function argument.
It would be preferred to pass in a Plugin instance or something, yeah
got it
At least then you could use .getName()
yep yep
I just have to refactor a lot of code now
wouldn't mind reflection fuckery rn
https://paste.ethannetwork.net/ugehuziyuy.java
Anyone know why this is not working?
Logs:
https://paste.ethannetwork.net/eqoroqigug.md
Ik it says the file is not found but it is?
You could probably do some disgusting reflective shit through the call stack
you are now
I DO NOT CLAIM RESPONSIBILITY
wow that sounds disgusting
private static final StackWalker STACK_WALKER = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
public static Logger getLogger() {
return LoggerFactory.getLogger(STACK_WALKER.getCallerClass());
}```
Mojang does this in their LogUtils lol
StackWalker API is Java 11+
Oh, sorry, 9+
since when did itemstacks gain legs
true
File updateFolder = Bukkit.getUpdateFolderFile();
Never knew this was a thing
but still does anybody know?
yes, your repo is private
cause if you call in any class except main class it would probably be a pain
or get a file server
google?
Bing your question before asking it:
https://www.bing.com/
why is that a command
can I use like github tokens or webhooks?
well not works but ill try it
frick
https://gist.github.com/maxim/6e15aa45ba010ab030c4
how about this?
I can run this from java
can you limit a token to just downloading releases
well then people could just use the token to get your source
so this seems like a bad idea
I want something that only the plugin can access but it will be on the same internet so can you do that with ftp?
people can just modify your plugin
for example going to 10.1.2.84 will just download the plugin
but I will also need a easy way to upload releases too
whats that?
github workflows
what issue are you trying to solve
an auto updater on restart
f.e.
but not a manual updater?
isnt an update checker enough
why cant you just make a public github repo for the releases
its technically a private plugin for a server I own
then make it a public private plugin for a server you own
then why does it need an auto updater
Wait... yeah
lol
Most established networks will have some form of version controlled distribution. Whether that be a Git repo, CI like Jenkins, Docker, etc.
because the server has lots of other servers so it will be a QOL
normally youd have an out of band system to do the update
like a script, or all plugins loaded from a single source
not built into the plugin jar
I wanted to do that with a localhost connection
you lost me
+1
like lets say you go to 10.1.2.84/LManager/ it will send you the jar file
youre just describing a web server with a jar now?
well yeah
well yeah
you said that was workflows
no i answered this with "workflows"
im confused
should I account for users 1.8-1.12 when developing my plugin
no
does someone know ?
For my custom zombie horse entity, I'm trying to replace its AI with a zombie's. I begin it by removing all the goals that AbstractHorse gives the ZombieHorse class, but it doesn't do anything. What am I doing wrong?
public void clearHorseInstinct() {
this.goalSelector.removeGoal(new PanicGoal(this, 1.2D));
this.goalSelector.removeGoal(new RunAroundLikeCrazyGoal(this, 1.2D));
this.goalSelector.removeGoal(new BreedGoal(this, 1.0D, AbstractHorse.class));
this.goalSelector.removeGoal(new FollowParentGoal(this, 1.0D));
this.goalSelector.removeGoal(new WaterAvoidingRandomStrollGoal(this, 0.7D));
this.goalSelector.removeGoal(new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.removeGoal(new RandomLookAroundGoal(this));
this.goalSelector.removeGoal(new FloatGoal(this));
this.goalSelector.removeGoal(new TemptGoal(this, 1.25D, Ingredient.of(Items.GOLDEN_CARROT, Items.GOLDEN_APPLE, Items.ENCHANTED_GOLDEN_APPLE), false));
}```
Another thing, I can't make horses move whatsoever when they have a passenger. I'm pretty sure it's because of their method isImmobile(), which checks to see if its saddled and has a passenger, which then sets its velocities to 0
I keep trying to override the method but it doesn't affect anything
Anyone have any better way to set the players name that displays above them besides pro bc i keep messing it up and not getting it to work.
any plugin ideas?
I don't really have much experience in this area but as muxh as I know you can't override it, as I remember there is a method to turn of AI and so you can code your own
id imagine its probably? because ur instantiating a new goal instead of removing the already existing one?
Doesn't seem so, right? If you still find one, you can let me know.
ah yes they using unsafe to allocate an uninitialized packet
Why not
?paste
Does anyone know about this error? : https://paste.md-5.net/ninegegiga.pl
I'm trying to make instance world system but this error always happen after world deleted.
Umm... I think it can be cause by remain entity
I didn't remove entity before world deleted
I'll try it after delete entity.
doesnt unloading the world do that?
anyone know where ~/.m2 or ~/.gradle is located on Jetbrains Spaces?
I'm using this where I basically got an IJ running but it's connected to the space, everything actually runs on spaces
the website is more like gitlab or sth where you can only see the files of repositories
anyone got any idea how I can avoid the duplication of declaring repo + credentials here?
subprojects {
// ...
publishing {
// ...
repositories {
maven {
credentials {
username = System.getProperty("jeffMediaRepoUser")
password = System.getProperty("jeffMediaRepoPassword")
}
url = 'https://repo.jeff-media.com/public'
}
}
}
}
publishing {
// ...
repositories {
maven {
credentials {
username = System.getProperty("jeffMediaRepoUser")
password = System.getProperty("jeffMediaRepoPassword")
}
url = 'https://repo.jeff-media.com/public'
}
}
}
With maven you set it in the config/settings file
might be able to use the def thingy
ignore me. not awake
yeah I thought so too, but then how do I "load" it again from the definition?
but where can I do that on jetbrains spaces
id guess just add the name of it
def repo = maven {
creds
url
}
publishing {
repos {
repo
}
}
``` mayb
tried that, it claims it cannot find "rep"
idk if its not that, ask chatgpt
chatgpt tells me something that doesn't work
I have now tried to define it like this at top level:
def publishRepo = repositories.maven {
credentials {
username = System.getProperty("jeffMediaPublicUser")
password = System.getProperty("jeffMediaPublicPassword")
}
url = 'https://repo.jeff-media.com/public'
}
the definition works
I then try to call it like this:
but it just errors out ```
12:35:12: Executing 'build'...
FAILURE: Build failed with an exception.
-
Where:
Build file 'C:\Users\mfnal\IdeaProjects\lunatic\build.gradle' line: 121 -
What went wrong:
A problem occurred evaluating root project 'lunatic'.
Could not find method call() for arguments [] on object of type org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository.
- 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
12:35:16: Execution finished 'build'.
uh idk, see if it outside of the repositories section works
i'm trying to schedule a task to check if a player as an effect. it doesn't work:
BukkitScheduler scheduler = getServer().getScheduler();
long duration = ConvertFromIntToTicks(config.getInt("delay"));
scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
@Override
public void run() {
App.getInstance().getLogger().info("hello");
final FileConfiguration config = App.getInstance().getConfig();
List<String> players = config.getStringList("players");
for(String name : players) {
Player player = Bukkit.getPlayerExact(name);
if(player == null) {
continue;
} else if(name != player.getName() && player != null) {
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
}
player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 255));
}
}
}, 0L, duration);
note: duration is 4 in this environment
it's in app.java too
that is the wrong way to use the scheduler api
i have tried to follow a wiki but it just doesn't make sense. can you assist me in making this work?
does it log the hello
no
add a sysout before the scheduler and see if that runs
you are removing night vision and adding it right back ?
that isnt what hes trying to do
no?
i'm removing the night vision if the player is no longer in the config, else ensure it's still added
thx, I have managed to get it working like this:
def publishRepo = {
maven {
credentials {
username = System.getProperty("jeffMediaPublicUser")
password = System.getProperty("jeffMediaPublicPassword")
}
url = 'https://repo.jeff-media.com/public'
}
}
publishing {
// ...
repositories(publishRepo)
}
however I still have the issue with javadoc.jar being contained in javadoc.jar and it becoming 127gb in size 🥲
Your logic is flawed. name == player.getName() will always be true if player is not null
then i can fix that later.
i mean no cuz its string
strings should be compared with equals
not ==
also second && player != null is never gonna be false
oh wait i just realised i forgot to change the jar file lol. it does print out.
yea it does work
my bad lol
also it does work as intended
so
you will get an npe though
oh wait
there isnt a need for the != null, and use #equals for strings
name and player.getName() will always be same
it doesn't make sense to make that check
alright
a lot of that looks flawed tbh
How can get spanwer type by digging it up and then make itemstack with that mob type
is this good
if(player == null) {
continue;
} else if(!(name == player.getName())) {
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
}
use uuids not names, and use offline player insteada
you arent listening, use #equals for strings
name.equals(player.getName())
what do you means equals
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.
name and player.getName() will always be true, dont make that check
i'm new to java but i know the basics from cs
if(player == null) {
continue;
} else if(name.equals(player.getName())) {
player.removePotionEffect(PotionEffectType.NIGHT_VISION);
}
you are getting player from name here Player player = Bukkit.getPlayerExact(name);, thenfore, their name and variable name will always be same
save their uuid to string instead, and use get offline player
no? the 'name' variable is from a string list
and you are getting player from that "name"
oh yeah
how do i update by spigot build?
yeah
maven, whats the latest version?
1.19.4-R0.1-SNAPSHOT
.
yeah im using that but was told to update to latest to fix an issue yesterday but didnt have time to
wdym with "itemstack with that mob type"
read pins btw
that is latest
they probably wanted you to update the actual server software?
I want to pick up spawners by block breaking
FileConfiguration config = App.getInstance().getConfig();
Bukit.getScheduler().runTaskTimer(this, () -> {
List<UUID> playerUUIDs = config.getStringList("players").stream().map(UUID::fromString).toList()
for (UUID uuid : playerUUIDs) {
Player player = Bukkit.getPlayer(uuid);
if (player == null) continue;
player.addOptionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 1200, 255));
}
}, 0l, 1200l);
``` @fringe yew
thanks
if you only add it for a minute you never need to remove it bc it would have expired by the next time the code runs
Look on the Docs, there should be something like spawnerblock#.getEntity()
btw what import is UUID
or smth that tells you what mob is in the spawner
java util one i believe
in BlockBreakEvent, get the block. get the state. cast it to Spawner. get the entity type and save it in a variable. then create a new itemstack of type CREATURE_SPAWNER or however it's called. get the itemmeta. cast the itemmeta to SpawnerMeta. set the entity type. set the meta back to the itemstack. drop the itemstack
and no semicolon!!!!!
make sure to also update ur saving to use uuids too
so you arent trying to get a uuid from a playe rname
@fringe yew
import java.util.UUID;
Ty
can anyone help me with this 🥲 https://github.com/freefair/gradle-plugins/issues/798
Hello :) I'm using the aggregate-javadoc-jar plugin like this: https://github.com/mfnalex/lunatic/blob/master/build.gradle However, whenever I wanna build, it creates an infinite javadoc.jar in...
so what's the issue you are facing
That's the issue, but im not sure what ive done wrong there.
so the issue is that you place a custom item in the result slot, but it disappears after a tick or sth?
Yeah that’s what I can’t figure out why
when i place it spawner is empty
nvm i have to be on creative to place it and not be empty
show your code
.
huh, why?
guys someone can help me?
i made a class for duel but the listener don't work ( PlayerDeathEvent )
https://paste.md-5.net/erucoyalut.java
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
did you register it?
ye Bukkit.getPluginManager().registerEvents(new DuelCommand(), this);
this.command("duel" , new DuelCommand());
no, you only said "the listener don't work"
listener for duel
💀
okay this is leading nowhere, all you keep saying is it "doesn't work"
btw you never even register it
you only register DuelCommand as listener
also you create two instances of it, that's pretty pointless
Excuse me then how should I record it being that listeners are in the same class?
It's a different class
public class DuelListener implements Listener
public class DuelCommand implements CommandExecutor, Listener
you should have one listener, and one commandexecutor. and of both, you should always only create exactly one instance
oh ok thx guys
how hard is it to make these clickable nps and is it worth it making them on your own
Bukkit.getPluginManager().registerEvents(new DuelCommand.DuelListener (), this);
this.command("duel" , new DuelCommand()); like this?
well you need nms so its probably a bit advanced
Do you know why this isn’t working?
@remote swallow if you're bored, wanna try to check out my javadoc issue again 🥲
i don't think so
yeah anyway kacper you use gradle too right?
do you know how I can create a "fat" javadoc.jar that includes all submodules?
that's the issue I'm currently facing
idk ive never done that
the aggregateJavadocJar plugin is broken
there's also a few issues about this on github but none has been answered
i saw it being done with the built in javadoc support
that's why I hate gradle, you gotta rely on third party plugins to do simple things that maven has builtin, and then it simply doesn't work
and those plugins are abandoned, nobody ever answers or fixes issues
the funny thing is, it works on macOS but not on windows
def exportedProjects = [
":",
":module-a",
":module-b",
":module-c"
]
task allJavadoc(type: Javadoc) {
source exportedProjects.collect { project(it).sourceSets.main.allJava }
classpath = files(exportedProjects.collect { project(it).sourceSets.main.compileClasspath })
destinationDir = file("${buildDir}/docs/javadoc-all")
}
from stackoverflow
that does not create ANY javadocs for the whole project
all this does is create one javadoc folder per module. But I need a javadocs .jar for the whole project
Can someone help me figure out why this happens with smithing table recipes?? They disappear after like 1 tick https://cdn.discordapp.com/attachments/741875863271899136/1111711612601106574/broken-recipe.mp4
bump 🥲
That plugin creates nothing but issues
also where the hell is the source of the plugin?
yeah very hard to find lmao
I used github's file search to look for it
and yeah the plugin is annoying as hell
I wish I could go back to maven but... paperweight
oh no wait, wrong one
why the heck is that class deprecated
Probably because it is broken
If I had to guess it is including itself (via Copy#from) and thus the Jar task JiJ's the outputs of the aggregateJavadocJar jar (which is itself).
But I wouldn't know where the issue lies even if my assumption was true
yeah very annoying haha
the weird thing is, it works on macOS
and it worked for lynxplay on linux, but I also tried on linux and epic tried on linux too, didnt work for us (created a 10518261 gb jar)
so I wonder, why the heck did it work for lynx on linux
@eternal night or do I remember this incorrectly? the aggregateJavadocJar thing, you remember?
Yea it worked for me
how do I add this /lang/ folder into the plugin folder?
that'd be nice
haven't changed anything in 5 days
gradle aggregateJavadocJar
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.0/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
:executing 'download minecraft manifest'
:executing 'download minecraft version manifest'
:executing 'download vanilla minecraft server jar'
:executing 'download mojang server mappings'
:executing 'extract libraries and server from downloaded jar'
:executing 'filter vanilla server jar'
:executing 'generate mappings'
:executing 'remap minecraft server jar'
:executing 'fix minecraft server jar'
:executing 'access transform minecraft server jar'
:executing 'decompile transformed minecraft server jar'
:executing 'apply patches to decompiled jar'
:executing 'apply mojang mapped paperclip patch'
:installed server artifacts to cache
:done setting up paperweight userdev workspace for minecraft 1.19.4
BUILD SUCCESSFUL in 1m 47s
21 actionable tasks: 21 executed

yeah it also works on macOS for me, as said
but not on windows nor linux
so weird haha
Welp I'll clone on linux then
thank you
I'd really love to get this fixed, I switched to gradle for paperweight and somehow it worked... but not on windows, it's really weird haha
[geolykt@fedora lunatic]$ ./gradlew aggregateJavadocJar
bash: ./gradlew: Permission denied
💢
chmod it
Yeah I was joking. The bigger annoyance is that I don't have the publication props set
just remove the publications part
it's there twice, on top level and on subprojects
how do i put a folder in the plugin folder?
or just set it to "asd"
Already done. Now it fails to resolve the deps due to mismatching java versions....
new File(myPlugin.getDataFolder(), "name-of-the-folder").mkDirs();
IntelliJ?
tysm
oh no wait you run it from CLI. yeah it needs java 17+
Yeah realised
And now
* What went wrong:
Could not determine the dependencies of task ':nms:1.19.4:compileJava'.
> Could not resolve all files for configuration ':nms:1.19.4:remapper'.
> Could not find tiny-remapper-0.8.6-fat.jar (net.fabricmc:tiny-remapper:0.8.6).
Searched in the following locations:
file:/home/geolykt/.m2/repository/net/fabricmc/tiny-remapper/0.8.6/tiny-remapper-0.8.6-fat.jar
Guess I'll add the fabric repo to the plugin repos
that shouldn't be needed
weird
anyway, I got a response from someone else about this issue:
haha
?paste
that is so weird
Quick question, im currently using https://paste.md-5.net/orelabovog.cpp but when i run it in my console it turns into an unknown char, is there anything im doing wrong, or does the console just not like icons/symbols
bash / linux?
cmd windows
oh then no clue
windows cmd does not support UTF8
😦
The issue you have is that the input and output directories of the aggregateJavadocJar task are the same @tender shard
bump
ooh ok thanks. you got any clue how I could fix that?
MacOS probably uses a different FS where this is not an issue
I'm looking into it
I already tried to exclude "**.jar" from the aggregateJavadocJar but that didn't help
why it doesn`t work? it gives my nothing
pretty sure you're looking for map#put not map#replace
Yea
you cant replace something that doesnt exist
You should also check on the getPasswordPlayer(), if that player exists in the HashMap
thank you, please ping me if you found a way to fix this :3
?
@tender shard Add
aggregateJavadocJar {
getDestinationDirectory().set(file(getBuildDir().toPath().resolve("docs")))
}
to the end of the buildscript file
Missing "return"
Without it, you will first put the password and then replace it
thank you, I'll try that out!
hmmm
Is there a way to create a configurations section from a class without the !!org.joml.AxisAngle4f?
To do what is shown in the image I did config.set("leftRotation", new AxisAngle4f())
I guess I could create the section and the properties myself, but that would take longer and even more if there are multiple sections I want to create...
Did you remove the plugin in the meantime?
ConfigurationSerializable.registerClass(YourClass.class, "SomeAlias")
uuugh yeah my bad. I actually reset to latest git but somehow IntelliJ is weird
quickly checking, gradle decided to re-decompile paperweight stuff
oof
Dude! It works! Thank you so much ❤️
I have been struggling with this for days
I will comment this on all the GH issues I found about this issue, what's your github name?
I'm currently making the comment on your issue
great, thank you!
@remote swallow geol found a fix for the javadoc issue
see above
Though to be honest a bit of luck was involved because I had a vaguely similar issue a week or two ago
I do not exactly know why MacOS isn't affected by this issue, but I assume that it is due to differences to when the OS commits files to disk.
that makes sense, that also explained why it worked for lynx on linux, but not for epic and me. @eternal night which filesystem do you use? I tried on ext4
you probably used sth else, I guess?
It can also be due to caches
Cleaning wouldn't have an effect as the Jar task would read and write the same file at the same time
Only if the OS keeps a complete copy of the jar in memory you won't have the issue.
bump
are you using any other plugins?
nope
then I have no clue, sry
alright
@tender shard did you figure out javadocs?
yes, geol came up with a fix, see the github issue above
Hello :) I'm using the aggregate-javadoc-jar plugin like this: https://github.com/mfnalex/lunatic/blob/master/build.gradle However, whenever I wanna build, it creates an infinite javadoc.jar in...
Done, but is the "==" property removable?
infinite file :o
no, only thing to avoid this is to do it like this:
Map<String,Object> deserialized = myConfigVector3f.deserialize();
myConfig.set("translation", deserialized);
and then to load it again, you do it like this:
Map<String,Object> serialized = (Map<String, Object>) myConfig.get("translation");
ConfigVector3f myObject = ConfigVector3f.deserialize(serialized);
lmao happened to me today
and how do you publish that later on
one sec
epic thanks
i was like
why is the task running to slow
and then i saw the 10 gig jar
haha yeah it runs until the hard disk is full
https://paste.ethannetwork.net/pumejutuvi.md <- Logs
https://paste.ethannetwork.net/agepumaped.java <- Plugin updater
The image below is the website files, 10.1.2.74:7776/admin_panel
idk why this is happening
crep
hardcoding IPs is a bad idea, do you not have any domain name?
[11:02:11] [Server thread/INFO]: Latest file:
its going to be a local server but yes I do
its a static ip
running nginx ubunti
im going to try going a different route again, I made the github public https://api.github.com/repos/ethangarey/enlobbymanager/releases/latest
how can I download that ENlobbymanager.jar
works amazingly thanks
how can i stop a smithing table copying the lore of an item? and then use the lore of the result itemstack
I want to send a fake block to a player using NMS, the ClientboundBlockUpdatePacket constructor takes a BlockPos and BlockState. How do I create the default block state for an oak sign?
I mostly just want to practice NMS, trying to do stuff without the protocol for the sake of practice
Fair enough.
(Material.OAK_SIGN.createBlockData() as CraftBlockData).state
I can do this apparently (kotlin code)
why does CraftBlockData have getState() but BlockData does not?
It does
What is keeping most livingentities from moving when they have a non-player passenger?
Oh, sorry, you mean API vs implementation. BlockData is the API. Bukkit has no knowledge of NMS whatsoever. So having a method that exposes that field (which is exclusive to server internals) wouldn't make sense
They can move just fine?
I would imagine this is to do with how behaviours are controlled. They likely won't have anything in their AI to handle a passenger. Think a chicken jockey for instance. The chicken just moves towards a player so the zombie's AI can be satisfied. I don't think the same will be true however if a zombie rides a pig.
when you put a mob on a horse (or any mob that aren't most water animals) they can't move through anything like AI or setvelocity
they still have AI, but they just can't move
would there be a goal/target that allows for that?
I'm a bit confused, there's an NMS BlockState and a org.bukkit.block blockstate, so I'm assuming the former is the implementation right?
bump
No. BlockState is implemented by CraftBlockState, CraftBlockState wraps an NMS TileEntity
Any interfaces you find in Bukkit will be implemented by CraftBukkit
I see, the names confused me. Thanks
I now have this block state of a sign: var blockState = (Material.OAK_SIGN.createBlockData() as CraftBlockData).state (kotlin, again)
How would I set one of its lines?
if it were a org.bukkit.block Sign I'd just do .setLine() but how would I do this seeing as it's NMS?
why are you using CraftBukkit to just set lines on a sign?
I'm sending a fake sign to the player to get input, using NMS for practice
bump 🥲
Wdym "use the lore of the result itemstack"
i cant tell what you are actually asking
so the result item has a custom lore, but the smithing table is using the lore from the item that gets used instead
Question: has the bug found when including Hibernate in plugin libraries throwing Entity Class not found error been fixed? I still get it.
https://www.spigotmc.org/threads/spigot-bungeecord-1-17-1-17-1.510208/page-13 <- bottom of page
on inventory interact, if its a smithing inventory, update lore of result item
This is what I tried:
var blockPos = BlockPos(player.location.blockX, -64, player.location.blockZ)
var blockState = (Material.OAK_SIGN.createBlockData() as CraftBlockData).state
var craftSign = SignBlockEntity(blockPos, blockState)
craftSign.setMessage(1, net.minecraft.network.chat.Component.literal("test"))
var packet0 = ClientboundBlockUpdatePacket(blockPos, craftSign.blockState)
val packet1 = ClientboundOpenSignEditorPacket(blockPos)
listener.send(packet0)
listener.send(packet1)
But the sign remains empty.
alright thanks.
https://hub.spigotmc.org/jira/si/jira.issueviews:issue-html/SPIGOT-6569/SPIGOT-6569.html Since this is still open. I assume it hasn't been resolved
-64 on Y?
You could also do all this using no NMS and just the API https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#sendBlockChange(org.bukkit.Location,org.bukkit.block.data.BlockData)
Does anyone know a Hibernate alternative that works with plugin libraries?
lmao -64 would be inside the bedrock xD
i get this error https://hub.spigotmc.org/jira/browse/SPIGOT-6569
You can always shade it
You can probably minimize that a bit
Is there a resource that explains how to do that? I am using maven
i can research it. just figured i would ask
<minimizeJar>true</minimizeJar>
It's just a setting in the shade plugin
It will try to strip unused classes
Which usually works fine, but it can cause issues when a class is only accessed via reflection
That stripped my API which needs to be shaded but thanks for the right direction
oh nevermind threw an error ha
I see that brought it down to about 16 mb which is better but still large. Would be nice if I could include hibernate in the libraries to begin with ha
hrm
Anyone know how Synched Entity Data works?
nvm
it's like this btw
// List<SynchedEntityData.DataItem<?>> eData = new ArrayList<SynchedEntityData.DataItem<?>>();
// eData.add(new SynchedEntityData.DataItem(new EntityDataAccessor<>(6, EntityDataSerializers.POSE), Pose.SLEEPING));
// if
//
// craftPlayer.getHandle().connection.send(new ClientboundSetEntityDataPacket(entityID, new SynchedEntityData(craftPlayer.getHandle())));
does IJ not allow you to rename a package to just a singular word
What is the best event to take when it comes to an arrow popping a chorus fruit?
why are you using var in kotlin 😭
im confused this command works bcs they is gray ?
I mean it is DROP TABLE IF NOT EXISTS so CREATE TABLE IF NOT EXISTS would make more sense
just weird highlight, run it, if query fail, smth is wrong
I guess because they have been added in "newer" sql versions
But I always use DROP X IF NOT EXISTS; CREATE X instead of CREATE X IF NOT EXISTS
sus
just confirming if anyone knows an alternative to Hibernate that works with the plugin.yml libraries flag?
DROP X IF NOT EXISTS ? why
Does that lead to an error?
Guaranteeing a pristine slate
Well how would it drop if it doesn't exist? Or do you get an error and catch that?
idk
Well to get a pristine state that is fine. For anything persistent, not so much
im using last version of mysql
code no errors btw
just gray words confused me
can i ignore ?
Tbh I haven't gotten further than the prototyping phase when working with databases
haven't ever used one in a plugin either. Only for spring mvc apps
alright
i know this was ages ago but how do I also put all the files from the folder into that folder in the plugin folder
if you are saving resources from teh jar you don't need to make folders. just include the whole folder in resources and when you saveResource it will preserve the directory structure
thanks
does anyone know if theres a event when a wall or a fence sets direction with nearby blocks?
im trying to prevent this from happening
place it without physics
and only allow it when you place the fence agains another fenc
wdym?
How can I get the motivation to relearn Java?
u dont, learn C.
I’m trying to for plug-in development
i have a psychological problem i don't wanna se intellij warnings
but when i do try with resource
i got variable is never used warning
public void runDb() {
try (Connection connection = connectDb()){
getLogger().info(ChatColor.GREEN + "Database successfully connected.");
}
catch (SQLException exception) {
showError(exception);
}
}```
so show your code
yeah, you dont use the variable
that code is entirely pointless
you never use the connection
there isnt a point of doing that just to say it connected
once again you should use something like hikari cp with its connection pools
without it iirc you have to use 1 connection and keep it open
no clue
this is how i handle mysql https://github.com/The-Epic/EpicSpigotLib/blob/master/epicspigotlib-core/src/main/java/me/epic/spigotlib/storage/MySQLConnectionPool.java and i just save the instance
why the = null
coll made it
he made it once and i just use it
aah i don't understand soo this
i will write example 1m
you can just copy the class that i sent here and add the dep, you can shade it or use the libraries feature
i know but i wan't to learn connection pool
1m
if i have connectionpool i can connect my database from two program or plugin ?
you would have 1 instance of that class per plugin
you would call getConnection() when you want to get, update or add stuff to the database
and you would do it async
yeah, just don't forget to close the connection
alright
public void runDatabase() {
String userName = "root";
String password= "12345";
String dbUrl= "jdbc:mysql://localhost:3306/players";
try (Connection connection = DriverManager.getConnection(dbUrl,userName,password)){
Statement statement = connection.createStatement();
String sql = "CREATE TABLE IF NOT EXISTS playerstats(test int)";
statement.execute(sql);
getLogger().info(ChatColor.GREEN + "Database successfully connected.");
}
catch (SQLException exception) {
getLogger().info(ChatColor.RED + "There was an error in database -> ");
exception.printStackTrace();
}
}```
i change my code to this
I sampled this
just because you take the info doesnt mean you use hikari
without hikari or a lot of effort you dont have a connection pool
if anything you should shade hikari and copy the class i sent
look at hikaris code then
i didnt find
explanation for my language