#help-development
1 messages ยท Page 805 of 1
I got an error while compiling
Could not find artifact org.spigotmc:minecraft-server:txt:maps-mojang:1.18.2-R0.1-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
did you run buildtools --remapped?
this one
did you run the buildtools command it says to run?
yes
are you building against 1.18.2?
no 1.19, but i replaced the version in the command
your error says you still have 1.18,2 in your pom specialsource entry
alright ill try running bt again
I use this https://paste.md-5.net/ecamepifar.xml with a line in properties <project.spigotVersion>1.19.2-R0.1-SNAPSHOT</project.spigotVersion>
yeah you didn;t update teh version in specialsource
which is why I use mine so I only have to change the version in the properties entry
so i should change the special source version to yours?
wdym
it givesme now this errpor
Could not find artifact org.spigotmc:minecraft-server:txt:maps-mojang:${project.spigotVersion} in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)
@eternal oxide
cannot access com.sk89q.worldedit.world.registry.WorldData
class file for com.sk89q.worldedit.world.registry.WorldData not found
how i can fix this?
trying to build my plugin
Add the WorldEdit dependency to your project
reload?
and my java version is 17
FAWE and WorldEdit are different
Pick one
also don't use System Path dependencies
@chrome beacon
i use both
It can't find your variable
To prevent conflicts use two different modules
hmm
how do i fix?
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
define your variable correctly
if you need help with that show us your pom
?paste
You aren't defining the spigot version variable anywhere
so ofc it won't find it??
oh
how do i?
ElgarL showed you
@chrome beacon now it says
Unsupported class file major version 63
ok
what should i replace?
<maven.compiler.target>19</maven.compiler.target>```
change to 17
this shoudl be your pom fixed https://paste.md-5.net/ucefasunaz.xml
you now only have to change the version in one place
why location is not null but location.getWorld can be null? why intelji think so
?paste
for this library loader, https://paste.md-5.net/guforikixi.java, i am getting this error
org.bukkit.plugin.InvalidPluginException: java.lang.RuntimeException: Error resolving libraries
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.2.jar:git-Paper-260]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.2.jar:git-Paper-260]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.2.jar:git-Paper-260]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.20.2.jar:git-Paper-260]
at net.lenni0451.spm.storage.SingularRuntimePluginProviderStorage.enter(SingularRuntimePluginProviderStorage.java:54) ~[PluginManager.jar:?]
at io.papermc.paper.plug......```
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact com.github.retrooper.packetevents:spigot:jar:2.0.2 in central (https://repo.maven.apache.org/maven2)
even tho i did this
LibraryLoader libraryLoader = new LibraryLoader(new RemoteRepository.Builder("codemc-releases", "default", "https://repo.codemc.io/repository/maven-releases/").build());
im confused why it isn't using the repository i specified
You should ask in Paper about the paper loader
im using paper to test it, it has nothing to do with paper
code is in my plugin
not relying on paper
screw paper
LibraryLoader is not spigot
correct
its in my plugin
i copied the code
and put it in my plugin
as legally as possible
regardless
why is it using a different repositiory
curious behaviour
updated code
why are you reading the plugin.yml from the plugin's config folder ๐
What is the reasoning behind
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "plugin.yml"));
After having the PluginDescriptionFile already?
Guys help @eternal oxide @chrome beacon
yeah so you're trying to use 1.19 internals in 1.20
because im using 1.8 and there isn't getLibraries
so i gotta pull up my sleeves and do it myself
sleeves
no one asked
how do i fix it
in game
either run 1.19 server or compile against 1.20 internals in your project
ok
see the package name, it contains v1_19, 1.20 will contain v1_20 instead
you are using NMS so you have to build against teh exact version your server is going to run
thats me!
How are you going to load the libraries?
i copied the load library code
which is this
and im running it like this
LibraryLoader libraryLoader = new LibraryLoader(
new RemoteRepository.Builder("codemc-releases", "default", "https://repo.codemc.io/repository/maven-releases/").build(),
new RemoteRepository.Builder( "central", "default", "https://repo.maven.apache.org/maven2" ).build());
libraryLoader.createLoader(this);```
but its ignoring my repositories
Is your repo public or does it need authentication?
check your builder actually applies the provided repository
yeah thats the problem
goofy ahh builder pattern
does anyone know how to override the /summon command
Define it in ur plugin yaml
And if that doesn't work listen for the command event
But yeah plugin commands should take priority
remove summon from the default spigot.yml config
plz no
man that is so stupid
If you are going to override a vanilla command at least leave /minecraft:<command>
Which part?
the default settings for command replacement in spigot.yml
commands.replace-commands or smth
basically I want the /summon minecart command to summon a special nms minecart
and not the default one
im actually joe biden
gotta use a different flag
problem fixed
lmao
finally a human being with a sense of humour
lol
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0046-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch#76-77 testforblock does not even exist anymore why is this even here lmao
silly defaults, but yeah you'll want to remove those from the spigot.yml if you want to have /summon be for your plugin
ofc /minecraft:summon will still be accessible
What should the defaults be
well certainly not commands that don't exist
Well that too
My nuts yeah
yeah idk about the "wise" part if that was the case

essentialsx command list
why isn't this getting my plugin.yml? ```java
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "plugin.yml"));
because i do this and it says its empty ```java
List<String> libraries = config.getStringList("dependencies");
your plugin.yml is in your jar not the plugins data folder
why not just use the description file as its API
the spigot code is good to copy and stuff right?
im using 1.8
and it doesn't have getLibraries
Sure but you can still get the contents of the YAML file via code
it still has description
plugin.getDescription().getDependencies() should yield you a List<String>
orjava YamlConfiguration description = YamlConfiguration.loadConfiguration(new UnicodeReader(plugin.getResource("plugin.yml"))); List<?> libraries = description.getList("libraries");
Also works
dependencies doesn't already exist in plugin ymls
i made it up for my library
so add them
You're telling me that in the 1.8 API, plugins had no concept of dependencies?
That seems hard to believe
im saying plugin.getDescription().getDependencies() isn't a function
its literally a text file.
Oh, right, depends vs dependencies
yeah
spigotmc contributor
LISTEN
i can't use libraries because 1.8
๐
and i need additionally repositiories
Gotcha
anyways
Shading
no
Well, ^ :p
use the code I just gave you
its gonna be thiccer than those pound girls on my tv
Can't you just do
sounds like brazil
YamlConfiguration.loadConfiguration(getResource("plugin.yml"))
Or does getResource not work for plugin.yml
I think there is one that can
Do keep the license in mind since you're using Spigot code
Clearly we need YamlConfiguration.loadConfiguration(nio Path)
I honestly did consider potentially exposing some NIO stuff, like a FileSystem for your plugin directory
you can just create an InputStreamReader to read the config from a resource
oh wait
i have a util that reads the plugin.yml
forgot about that
i guess i could use that
ffs i gotta shade maven resolver
yes
why?
idk
i think the error code says that
something about java.lang.IllegalStateException: The super POM /org/apache/maven/model/pom-4.0.0.xml was not found, please verify the integrity of your Maven installation
wait maven resolver is in spigot isn't it?
since 1.16
I do it all myself in pre 1.16 versions
idk what java.lang.IllegalStateException: The super POM /org/apache/maven/model/pom-4.0.0.xml was not found, please verify the integrity of your Maven installation means
While building or wha?
Well soon enough my custom maven resolver will release. It should only be in embargo for 5-10 more months
would having a long array (an array containing the banned players) cause issues? It wouldnt be permament just for stuff like whenever someone gets banned on my server it shows a count of how many bans there are, so I would put them in an array and get the array length then
Sounds a bit scarce, I mean you probably want to save and load it somewhere (like to a database or a flatfile), then also it may not be nice if you plan on having a large amount of players
What made you decide, not to use the servers ban system?
Like it scales relatively poorly
Servers ban system? Like the default papermc one?
because rn our ban system is in skript ๐
So your plugin fetches this data from skript somehow?
Or do you mean an array in skript?
You mean the default minecraft ban system?
Youโre joking right?
nope
No I dont have a ban plugin at all. Im planning on switching our ban system from skript to a java plugin
Im slowly migrating my entire server from skript to java
Sounds reasonable
Sounds like an amazing must do plan
I wonder how much of a performance difference there would be
Not only about raw performance
Well I had an old skript that had a database lookup on block break event and the lag was extremely large, but I moved it to java and made it async on a different thread and now its much better
For now you can have all bans in memory. Its probably fine for 99% of servers.
Server start: Load all bans
Server stop: Save all bans
I would def not use an array for your bans. A Map or Set are probably the way to go.
What if all skripts got their own thread
Does skript count as an interpreted language
How could I move my sethome variables to java?
No I mean like I have 500 unique players
How could I migrate their skript variables?
Save them in a db or a local file
Oh
you have the locations
and wnat to move them
I mean like, the player's sethomes are currently stores in the variables.csv file of Skript. and if I remove skript completely players wont have access to their /sethome anymore
A csv file
gotta check what it looks like
Ye csv is fine
you can look online
Or
hm
you can have java use some api to read the csv to a different method of saving
If you wanna use a db like mongo, you can just import the file
home::00000000-0000-0000-0009-01f2f10a4d99, location, 8605776F726C6480FF0000000181046E616D65208005686565736501780940942E5A1CAC08310179094051000000000000017A094080C8EBB98C7E2805706974636808419198280379617708C2AE7673
heres an example of a player's sethome in variables.csv file
wth is the jamble of garbage behind location,
Probably some bytes or something
base64?
Its the sethome location
but in some sort of encoding
h::00000000-0000-0000-0009-01f139125f95, long, 0000000000000003 for example this variable represents how many hours a player has played
It seems to be hex
Weird shit
Then you have to decode the hex and then insert into a database
ig
or
you can insert into db
then pull via java, decode, and insert decoded
its skript
๐ฎ
can I make a database without making a database? I dont want to pay for a seperate database outside of my server? Like can I run a database inside of my own server somehow?
I've done some custom hitbox detections before but is there any known solution to be particularly highly efficient at scale to detect if players have hit an arbitrary hitbox (e.g. not a hitbox that exists in-game insofar as minecraft is concerned)
Mongo has a free tier
SQLite is an SQL db which is really just a file
epic
does a .isBanned method exist? (true/false)
or int bans = server.getBanList(); or something
why would it be an int
Why would the banList be an int
it would be a hashmap
Or atleast a list
server.getBanList().size()
That's a Count then, not a list
or .length()
ah ok
I have to renew my domain ๐ข
int profileBans = Bukkit.getBanList(BanList.Type.PROFILE).getEntries().size();
Or for all types of bans
int bans = 0;
for(BanList.Type type : BanList.Type.values()) {
bans += Bukkit.getBanList(type).getEntries().size();
}
Not sure how duplicates are handled
I dont think it allows them
DOes it return a hashmap
or a list
cus hashmap doesnt allow dupe keys right?
I mean IP ban + profile ban with the same ip
Are you Bettanation?
Is it about minecraft Beta
what is that
I deved some beta plugins before
Someone else with a pinguin profile pic. He always creates new accounts because his previous persona wasnt cool enough or sth.
Lmao
Yeah you talk a bit too much sense for being him i noticed
xD
Is this kind of a particle or how do you spawn them?
Texture pack
left clicks can be detected via PlayerInteractEvent right
If ur talking abt the rgb
sometimes
or
no
it was rightlick
that sometimes
dies
Could also be just armorstands or display entities with colored unicode characters.
Could be, but seems way to much a performance impact spawning idk 30 of those
Meh, for the server its nothing
Ye
Yeah those are def nametags
if you're lagging with 30 text displays, stop running on a raspberry pi
ESP32
Im not lagging, but if you want to optimize (everything)
I run it on my ipad thanks
free vbucks
Front and back of your credit card maybe.
your ssn
anyone know off the top of their heads what the melee attack range is?
3 blocks?
Pfff nice ip bro
192.168.0.192
Ur gonna get haxed
the hacks are coming from inside the house
I'm trying to make a edit mode thing for my plugin to select a region using a wand.
This is what i've got so far and the code works perfectly fine but in the isInEditMode method for some reason it is not detecting the player is in edit mode or the player is not getting added to the Map
My EditModeManager class - https://pastebin.com/MVjJ6bFk
My CreateCommand class - https://pastebin.com/yTLSNUxd
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
how can i shade spigot into my plugin?
You don't god don't
and will i need to shade java into it as well?
What the fuck
how do i shade windows 10 into my jar file?
Ahhh just use iso
not add, but rather, change; the contrast on those images is horrid. People with poor contrast perception, color blindness, or even just slightly blurry vision, are going to struggle to read that
๐ง
๐ซ
how to shade government classified documents
how do i get pregenant
walk alone at night
step one is to go to an underdeveloped country
dAYUm
what if someone raps me
Working for the US government sounds fun especially higher up you go the more fucked up shit you get to know about then
failed successfully
You dont like my text?
I mean, I don't care about your text.
But there will be people who literally will be unable to read it
Just dont be color blind
wrong channel, sorry
was abt to say
#Unknown
don't know how much of a "spigot" question this is but is there "Google Sheets API" for maven?
the gradle dependencies can be adapted to maven fairly simply
Just checked there, but it's only gradle
gradle dependencies can be adapted to maven
how? ๐
<dependency>
<groupdId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>2.0.0</version>
</dependency>
here is example on the first one
too break it down
implementation 'com.google.api-client:google-api-client:2.0.0'
com.google.api-client -> Group ID
google-api-client -> Artifact Id
2.0.0 version
" Provides transitive vulnerable dependency maven:commons-codec:commons-codec:1.11 Cxeb68d52e-5509 3.7 Exposure of Sensitive Information to an Unauthorized Actor vulnerability Results powered by Checkmarx(c) "
ignore that or upgrade
the version if one exists
its letting you know of a vulnrability
like this?
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.34.1</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-sheets</artifactId>
<version>v4-rev20220927-2.0.0</version>
</dependency>
๐คทโโ๏ธ idk does it work properly?
no error message at least from intellij, maybe try with some code ig
did you refresh maven
yes
what are mob effects and how does one use them
MobEffects rae just Potion Effects iirc
Why are your empty maps are final?
uhm because they don't ever need to be reassigned?
final makes sense here
you can still insert entries into an empty collection
true, I didn't look at the whole code
collection fields in most cases should just be final. Especially in manager classes
yes
startEditMode() is not called
yes it is
if(player.hasPermission("afkarea.commands.create") || player.hasPermission("afkarea.commands.*")) {
if(args.length <= 1) {
player.sendMessage(utils.s(player, utils.getConfig().getString("messages.no_args_provided")));
} else {
if(utils.getConfig().contains("afk-areas." + args[1])) {
player.sendMessage(utils.s(player, utils.getConfig().getString("messages.area_already_exists")));
} else {
editModeManager.startEditMode(player, args[1]);
my guess is one of these else statements aren't reached
I'm trying to add various items to a Barrel on block place, here's my attempt but the items didn't get added into the barrel inventory.
Code: https://paste.md-5.net/xekeyakawu.cs
is the insertion code being run?
You mean the setItem part? If so, then yes.
I'm assuming Executor#sync is the thing that delays the action 1 tick
Correct, delaying the action by 1 tick.
try delaying it for 2 ticks
Yeah I was thinking the same thing however I haven't tried that but I'm gonna try it now.
It still doesn't work. I'm thinking about setting the BlockState again but I forgot on how to do that. I'm not sure if it's a thing but I kinda forgot and remember that I need to do something about that.
Okay I fixed it, apparently updating the BlockState will remove the items from the inventory.
how can i make this return the entity i spawned so i can further do stuff with it
Well you allocate the creature (entity I assume?) that you add to the world. Just declare a local with your entity that you pass as the argument no?
by casting the world to craftworld instead of casting the entity to craftworld ig
or are you
nvm
I'm blind, sorry lmao
the PlayerInfo packet is sent to others after the PlayerJoinEvent, right?
It's being called in line 45 of my command
I managed to read from the spreadsheet document but when entering the data I get this error:
{
"code": 403,
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
}
],
"errors": [
{
"domain": "global",
"message": "Insufficient Permission",
"reason": "insufficientPermissions"
}
],
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED"
}```
My code:
```java
ValueRange appendBody = new ValueRange()
.setValues(Collections.singletonList(
Arrays.asList("This", "was", "added", "from", "code!")
));
try {
AppendValuesResponse appendResult = sheetsService.spreadsheets().values()
.append(SPREADSHEET_ID, "congress", appendBody)
.setValueInputOption("USER_ENTERED")
.setInsertDataOption("INSERT_ROWS")
.setIncludeValuesInResponse(true)
.execute();
} catch (IOException e) {
throw new RuntimeException(e);
}```
how can you install logs on the code in the plugin so that it is not so tedious
and do not check whether the log is enabled or not
or without it itโs not like
and what are the standards for logs and what is the best way to log everything that happens in code
I don't want to reinvent the wheel
Tried to read a bit about this problem and it seems that I didn't give enough access to the server when I ran my code the first time as it would only read data then and this leads to me not being able to enter data.
But I don't know how to get that form up again have tried with new credentials etc
EDIT: btw, solved by creating a new spigot server ๐
I don't know the API I just did a google search
while using worldedit to load a schematic into the world i get this problem :
stopTiming called async for anti-xray - obfuscate
is this from how i handle it , or is it like that?
I have subcommands like /pl a or /pl b. Every subcommand needs it's permission, but i want player with op have all permissions, how to do this? Now it works if i use luckperms or add permissions manually to player, but by default player with op don't have permissions
Yo bro, how are you? is your command library still up because i have been looking it for a while
yeah
I just moved it into my main lib
oh okay, really thanks brother
question im using papiapi and i want to add this placeholder %ultimateautorestart_seconds% whats the command to add it again i forgot
yes thosens of them, just moved out from latest version to 1 version old
and everythign fixed
What do you mean by the comand? You should mean code right
yes
Create a PlaceholderExpansion
Yeah exactly that, if you need help with papi you can contact them on their discord
no s
They are really nicefull to help you and its more appropiated for help
no so i have a plugin with comes with extensions i need to download using papi im asking how do i download them
oh thats not programming question?
That should be posted on #help-server
oh
this is programming help
right my bad didnt know which one
no you didnt at all
right, i hope you find how to fix your isssue
me too
@EventHandler
public void onPlayerPlace(PlayerMoveEvent e) {
if (e.getPlayer().getInventory().getItemInMainHand().getType() == Material.PAPER) {
Block block = e.getPlayer().getTargetBlockExact(5);
if (block == null) return;
Location loc = block.getLocation();
for (int i = 0; i < 5; i++) {
Location currentLocation = loc.clone().add(i, 1, 0);
e.getPlayer().sendBlockChange(currentLocation, Material.GLASS.createBlockData());
for (int j = 0 ; j < 5; j++) {
Location upperLocation = currentLocation.clone().add(0, 0, j);
e.getPlayer().sendBlockChange(upperLocation, Material.GLASS.createBlockData());
}
}
}
}```
i made this and how do i edit offset ?
Just offset loc
I want it to start from here
aigt im checking
also you don\t need to manually clone each time
what do u prefer for this ?
and how do i add offset to the location? that was my real question, sorry.
Just use the add the method?
Is there any other method?
i'm not very familiar with the spigot library
?
oh sorry, i fell victim to google translation
you dont need to clone the location itself, you can directly apply the add to the location you are working with
cuz look at this
That's the whole point of the method though?
I know
Seems to be working
what
because dont set the ServerFolder? (MultoverseCore API)
I don't see any spaces on the start or end
it only removes them on the start and end?
yes
uh
That's what it's always done
Well guess am a fool
If you want to remove all spaces use .replace
it's like I eat my bananas
I've been living for years
thinking it removes all spaces
and never once until now discovering the truth
i learnt that String#trim() removes starting and ending spaces, they changed what it does so?
It does same as it did since first versions of java
Nothing changed
oh okay, i got mixxed up to what Shadow have said
๐ธ
I don't understand the question?
dont do "core.setServerFolder." https://github.com/Multiverse/Multiverse-Core/blob/main/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java line 1024
what about it
set the folder of the new world
How to add all permissions to people that have OP
set it to op in your plugin.yml
how...
If you have a permissions plugin then ideally you're not using op at all
oh..
really?
yes
I mean yeah. You would have some sort of owner group or something that either has all permissions or all that is required
* if you really want
Better to do only what is needed to limit damage if someone gets compromised
But yeah
That's more what I was hinting at
Or to avoid stupidity like with me when I used to run /stop out of habit after testing something, and then me literally doing that on my production server at the time
:p
I suppose this is why [redacted] has a confirm arg
./reload confirm
Phantoms don't exist in 1.8
Help, my clicks are getting cancelled and the only event i have isnt cancelling it
eh
MultiverseCore is ๐
how i can resolve?
must not support 1.8 anymore
wait no
ye i need help
so
this method is for my GKit inventory:
and its only called when i click the GKit Inventory
and idk why
inventoryclickevent is cancelled
even when the onClick() method i showed doesnt execute
this is the main listener
delegates to:
oh nvm i think i found the error
yeah i just found the error
but now, when i transfer a item from my inventory to the gkit inventory, how do i identify that?
anyone had this error?
in "'reader'", position 0``` , nulls being saved to my config lol, just changed the directory of configs from defualt to .\customconfig
is there a quick and easy way of calculating how much damage a player would deal to an entity? I want to fake a hit to an entity while simulating the right amount of damage
and the only way I know how to do that is, uh, laborious
I do have the specific entity they would damage
You can make one attack the other via the api
sooo how can i add an 200 whiter skeleton limit to the nether?
my code is:
package me.uwunugget.uwunugget_plugin;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.block.Block;
public class Uwunugget_plugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
Block block = event.getBlock();
World world = block.getWorld();
if (block.getType() == Material.NETHER_BRICKS && world.getEnvironment() == World.Environment.NETHER) {
org.bukkit.scheduler.BukkitTask task = new org.bukkit.scheduler.BukkitRunnable() {
@Override
public void run() {
if (block.getType() == Material.NETHER_BRICKS) {
world.spawnEntity(block.getLocation().add(0, 1, 0), EntityType.WITHER_SKELETON);
} else {
this.cancel();
return;
}
}
}.runTaskTimer(this, 200l, 1600l);
}
}
}
Why do you need the time that the player got whitelisted?
Then just save the time yourself
That wouldn't get you the time whitelisted
Is there any performance impact to using infinity over a real number
hi is there a way to store a velocity vector in a persistentdatacontainer?
Depends is it for int or double
Serialise it
I'm real happy
I think I might be able to release my custom model animation plugin today
how?
float our double
anyone know a good builder generator
I need one that works with records
cause im not typing all that out
im not using lombok
why not
Then get bing to write ur builder i guess if ur too lazy
Usually works fine sometimes
For imprecise numbers, yes itโs worth it but not a massive diff over MAX_VALUE
IF itโs an int itโs functionally the same as MAX_VALUE
What is the easiest way to make it look like a player is sitting down on an entity without an entity should I just make the entity invisible then?
Sure
okey ๐
I know you're not using it but: Lombok
Can the distance between the player and display entity be increased?
is there a builtin bukkit function to check if an itemstack can harvest something's drop
as in air should be able to get a drop from a log for example
declaration: package: org.bukkit.block, interface: Block
Never thought about getDrops
Sadly it's not perfect
For example, tall grass can be harvested by anything
But iirc getDrops respects chances, so it may still return an empty list since seeds aren't a 100% drop
Even then some stuff just doesn't have drops regardless of what tool you use
hmm okay odd
Just run it 100 times ๐๐ป
you basically don't, you just change it to what you want it to be
i think this was actually it
i dont actually care about the drops i just needed it to know if the item could produce some drops from the block
rip budding amethyst
what is wrong with budding amethyst
nvm something is off with budding amethyst
shit
nvm something is off with small_amethyst_bud
It drops nothing
how would I get the proxiedplayer obj from connection im listening ot the proxydefinecommandsevent
Can I move a display entity with a passenger using setVelocity
display entities ignore velocity
You can move displayentities with interpolation
If I get a display entity to move with "interpolation" will passengers then move along with the entity?
do I have to empty my cache HashMap everytime I disable server?
or just save that map into database?
Oh I don't know about that, sorry
Cache shouldn't be persistent
I know as much
im asking if I should clear it on server disable
or just not care about it
Just don't care about it lol
Donโt need to care
alright
when u put the cursor on an inventory slot, and hit a number to get the item in that hotbar number to the slot ur hovering on, what event is triggered in that case ?
okay thats... way easier than I thought it would be
is it an okay way to check for invalid arguments in command?
Seems alright
would Float.parseFloat(something) change the type to float (if possible)?
as in
would it do it permamently to that thing or just once?
what?
Does anyone have major experiences with CI/CD and knows whether are tools for deploying libraries (using maven or gradle) that are developed in a rolling-release form? I don't want to deploy like spigot does, as it should still be possible to address individual versions
On what platform do you want to setup CI/CD?
Atm I have been working with Jenkins but given that I've just started setting everything up I am still rather free
Imo github actions are nice and easy for start
Oh, and stuff will be self-hosted if that is the question
Well not self-self-hosted but run on a VPS that is owned by me
What about artifacts, you wanna to store them on private machine or send to Maven center?
While sending them to OSSRH is an option given that I have the keys I'll likely only do that for "stable"/final builds. The other builds are likely going to be dumped into a bog-standard http fileserver, at least that is the idea atm
Float.parseFloat will parse a String and turn it into a float. It will throw an exception if it isn't valid though
I don't understand what you mean by permanantly or just once
I was asking if it could change this datatype permamently
into float
well im not using float rn but the thing is that I made this line of code
Uh, do you know how objects and variables in java work?
to check if provided arguments are numbers
turned out I needed integers but thats just semantics
yeah?
Then I don't comprehend what you are asking for
I was asking how it works
you have to assign the parseFloat to a variable
or wait
i mean
i guess that works
if you want argument checking
Without using wrapper objects such as AtomicReference you cannot change the type of vars and objects without redefining them
Ok, I've never been using Jenkins however if you would have aby questions about setting up pom.xml file or github actions feel free to ask
Technically that's a really janky way to check if a string is a number
However java doesn't provide nice ways to do so
well im here to listen for improvements
It's better to use a regex or Ints.tryParse
The setup I have in mind right now and with whom I'll probably go with if there isn't an already-made solution is to have the Jenkins instance start a custom-made daemon. Make jenkins run maven or gradle which publishes to the daemon. Then have Jenkins send a command to the daemon that will commit all changes to the http fileserver (renaming the versions accordingly, creating index files, etc.) and kill the daemon.
You should try using Ints.tryParse and get the Integer out of it and check if its null -> which would mean parse failed
What about versions? I guess Jenkins Has some kind of autoversioning module
I have no clue, I might look into that beforehand I guess
it's so much better than parseInt
doesnt work
string.chars().allMatch(Character::isDigit) :trollface:
No
goes straight into last line and throws NPE
You don't understand how it works
Ints.tryParse doesnt throw an exception
it returns null if parse failed
Integer tryParse = Ints.tryParse(args[index]);
I wonder if it internally uses parseInt
then check if null
hopefully not lmao
and also it kinda doesnt really follow the general idea of an exception
like it doesnt make sense
So there is this nice command that bump up version in pom file and all its nested modules mvn versions:set -DnewVersion=${{newVersion}}
Although even that isnโt ideal as you would need something separate for floating point vs integer values
In the future Guava will change the result of Ints.parseInt to OptionalInt
but not for a long time lol
that's true, it's kinda like a bandage
I mean ideally you would store the variable
and then just use it later on
structured bindings ๐ฅบ
var [a, b, c] = someFunctionThatReturnsATupleOrSomething()
Ah
๐คฏ
int, boolean parseInt
ook lol
I mean i don't see Long.parseLong in there
soooooo
maybe we're good ๐
Pretty sure java is still jank
Integer.parseInt can only produce NFE but Double.parseDouble can also produce NPE
What about the basic version
would this work?
No
you are unboxing so if its null it will produce an error
well thats why I used try and catch?
not a far reality with record patterns tbf, you still need to destructure them in a switch/if pattern matching which is eh, but you know, one step at a time
No that's not the point
but wait
is this assuming all the arguments are valid numbers?
Yes but you are forcing it to be unboxed
or are you still checking?
thats the check
then you still need to check if its null
Integer num = Ints.tryParse(args[index]);
if (num == null) {
sender.sendMessage(ChatColor... blah blah);
}
That's the whole point of Ints.tryParse
to avoid catching the exception
Also uh, check your indexes in your array too
they look kinda weird
Oh wait
nvm they're fine I can't see subtraction lol
!=
idc tautology works
I used to do that but i stopped cause it was kinda weird
!(x != nullnโt)
~(something = something') rather than something ~= something'
But do you understand why your original code would throw an exception
It's cause you are esssentially converting the Integer back to int so if the original Integer was null to begin with, it will throw an exception
The point of Ints.parseInt is so you don't have to catch an exception, and you just perform a null check
Catching exceptions are expensive and also in this case, not rlly appropriate because it doesn't rlly make sense from a design standpoint
why does player#getClientBrandName return null?
According to documentation
Returns player's client brand name. If the client didn't send this information, the brand name will be null.
For the Notchian client this name defaults to vanilla. Some modified clients report other names such as forge.
because the client didn't tell the server
So ig sometimes it doesnt tell the server yeah
okay
i got a question about my custom damage plugin logic
should I manage enemy healthbar and their actual health separately?
or should I make separate method for calculating damage and then apply this damage to a method that would damage entity and update their healthbar at the same time?
probably this option? I don't know the full story but it makes sense that when u deal damage to just immediently apply it
Id like to also make indicator of damage dealt
so I was thinking about latter
so I could get how much damage I'd deal without actually dealing it
Yep
okay im getting a bit better at making plugins now
I only need to add weapon database and I can push further with it
I can then just remove config managers
well throwing exceptions is expensive but not try catch since the compiler uses optimization at build time
But yh it adds cost ofc but idk if that's that costly
Yeah sorry that's what i meant
I agree tho that it's a design flaw when parsing numbers
But you shouldn't prematurely not use a specific thing if it adds minor cost when there's no realistic bottleneck to be made through this
Especially when it comes to something that requires only 20 ticks per sexond
We encountered certain modifications during the endeavor to generate a config.yml from the plugin resources. This occurred subsequent to an upgrade from version 1.20 to 1.20.1. Would anyone happen to possess information regarding alterations in this regard?
Idk if you agree on this @paper viper, but overall you're rigut
can you provide more information
I doubt the version upgrade has anything to do with configs
Yeah the issue wasn't the performance
I think honestly I'd just prefer Ints because it looks cleaner and design stuff yeah
To quote an old stackoverflow post on it
Honestly just use NumberConversions from Bukkit
You can use parseInt if you want to troll the people that do your code review
NumberConversions.toInt is better integrated since it's using Integer.parseInt under the hood
@paper viper
Ints.tryParse doesn't use Integer.parseInt tho, it has it's own process which returns null if it doesn't work
point of conversation is not to use parseInt xd
Yeah
Speed doesnโt really matter much here since itโs a command
However who wants to benchmark it :p
Hi, the problematic Code is from me so i can provide more Information. We try to load a .yml file from the Plugin resources via plugin.saveResource and plugin.loadResource. After that we save the file itself, so user can edit it. The Problem is now, that we get an empty .yml file although our file in the resource folder isnt empty. I assume that the problem is something with the save or loadresource Method on the Plugin object.
Omg 20 nanoseconds faster ๐
Again tbf micro speed shouldn't matter too much when you have 50ms between ticks
Hey
Itโs hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
50ms isnโt a lot
It is tho if you worked in other games
Wtf
what if everyone on my server used a chat macro and typed the command 100 times per second and i had a 1000 players
could you add me? dont feel well sending the Code in this public chat ;-;
and i wanted to run my server at 100 tps
Lol commands are bound to the tick loop
What if a meteor decides to destroy one of my servers
what if the server building burns down
Actually
Maybe you can send multiple commands in the same tick, idk
These are questions that should be asked at enterprise level when high availability is requested but not for anything else
nope
Trust me
dam โ ๏ธ
Your config loading code isnโt revolutionary
If you're looking for cleaner, I would sanitize all inputs before I even start geting into the meat of a function
its the decompiled code, dont complain about naming and shit pls xD
if (isInitialLoad) {```
for starters I dont think that does what you think it does
?jd
Yeah getResource will return the same thing on every load
You talking parsing of numbers?
Unless you change the jar contents
Yeah there are better things to worry about
Yeah definitely just go with one solution that fits your needs and move on ๐
It would actually be cool if spigot support command argments similar to how python does with the typer CLI library because it's such a common use case
That's the thing with premature optimization and shit you could start arguing without any end, and at the end you change the compilers behaviour yk
I mean you can have a library to do it however you want
Brigadier
Or you just do it easy asf using a map and bukkits api like I do xD
well the docs tell me, it returns the file or null if the file is not found - if the file is not found i want to save it.... or do i have a mistake in my thinking?
nah i prefer brigad
file not found in the jar
your code says if file not found in jar then save file in jar
obviously that doesn't work
You gotta check if the destination file exists
Or you use my library that enables you to create configs off of plain old java objects
ยฏ_(ใ)_/ยฏ
Not the internal one
brigadier + commodore is really good
?
what
It's included in libraries u just set to compile only and use it
U dont need NMS
How does it work on the server then
Bukkit doesn't wrap the types
okay ur right, but could this be the problem? when i open the jar file with z-zip the .yml file exists. So the getResource wont be null... that means the saveResource gets skipped am i right?
But then you don't get to leverage what makes brig cool and stuff
The beautiful colored arguments and such
Oh commodore handles the nms for thst?
Yes
added to that, this exact code works just fine in 1.20 but higher versions cause trouble :/
brigadier is like the worst way to make a command library ever
I doub tthat
Commodore, not to be confused with commodore
Leave it to mojang ๐ฏ
People really like their weird ahhh builders
u dont need the builders
well
it doesnt have to be messy
thats what i meant
Divide the separate literals into its own classes
not just one fat builder
congrats, you invented a map
subcommands.get(arg[0]).execute(..)
Commands aren't trees change my mind
ye they're flowers
Factz
okay well then i go try to fix my issue by my self xd
Acf on top
Can someone help me debug my Cooldown Manager?
i got some trouble
i start by getting my CooldownLoader (its a abstraction class for a Map of <Kit, CooldownManager)
i give the cooldown
but the user does not have cooldown
Cooldown Loader: https://paste.md-5.net/ufiyoqiyoj.cs
Cooldown Manager: https://paste.md-5.net/porulezofi.cpp
whats the .shit
A builder?