#help-development
1 messages ยท Page 364 of 1
Its saved as long value
1m please
Im opening mongo compass
Wait no, the time is saved correctly into the db
The issue is while formatting it
okay so how are you formatting it?
Getting the time he (played - current milis) / 1000L
what are the current millis
System#currentMilis()
the time he played saved as long
okay
well then it would very likely be a negative number
unless they have been playing since before unix time
Hmnn im confused, what would you recommend to fix this?
well the time a player has played is a duration
while currentmillis is an absolute time
okay, so ?
im playing in same server since 1969
???
so you need to keep track of when a player started playing vs when they stopped
that is what i mdoing tho
i can send my code
why dont you create hashmap with <UUID, Integer> which will be player UUID and Unix time stamp
like what kinda value are you aiming for
Just create a simple proxy counter, which counts how much time he has played in the server
okay
the updater() is because redis, dont give importance
you need to keep track of this for each session but basically do what emsar said where you store the time a player started playing against their uuid
Redis cache
and in this method you get currentmilis - that timestamp
Creating thread for each player will decrase your performance
What threadd?
I dont understand what you say sorry, i mean like some messages are not related
dont wory about it
use this
right, so what you suggest?
Cuz of how the plugin works i must have a centralzied cache
I mean im thinking you are trolling, because its exatly what im doing but with Redis ๐
whats redis
Redis is a memory database, used mainly creating data caches or publising/subscribing to messages
anyways to get a players total playtime, you need to know when they started vs the current moment in time
Yes, its called github packages
Dont troll please
?
Hmnn let me use fkg translator that the reason
u dont udnerstand mean
I'm 100 that they are trolling because how am I going to use a hashmap when I'm using the redis cache. It doesn't make sense, besides using decentralized cache (in each plugin) would cause me problems because when you leave the server your cache will be updated, but when you connect to another server, it might not be updated yet. But it has nothing to do, they are different things. The problem is that it is telling me the time played but in a negative way, instead of saying that I played 1m, it tells me to play -1 minute.
Translated with www.DeepL.com/Translator (free version)
You can always host your own public repo on a website using dav
dav ๐, that is like telling people to use Eclipse in 2023
Also php dang ๐คข
Deno >>> Php
Map<UUID, Integer> playTime = new HashMap<>();
//On Player Join
playTime.put(player.getUniqueId(), System.currentTimeMillis() / 1000);
//On Player Quit
System.out.println("Player played the game for "+System.currentTimeMillis() / 1000-playTime.get(player.getUniqueId())+" seconds.")
playTime.remove(player.getUniqueId());
https://maven.miketheshadow.ca works just fine for me
public void onEntityExplode(EntityExplodeEvent event) {
if (event.getEntityType() == EntityType.PRIMED_TNT) {
for (Block block : event.blockList()) {
if (block.getType() == Material.RESPAWN_ANCHOR) {
event.blockList().remove(block);
}
}
} else if (event.getEntityType() == EntityType.ENDER_CRYSTAL) {
event.blockList().clear();
}
}
}``` am tryna make it so that crystals and anchors done destroy items.
anyways, if thats your only problem, you can just use Math.abs()
Wait steaf
A question
wait wait i wil ltes
tbecause it will came 0 iq spigot dev and to tell me try and see
I can smell it kms away
LMao
today spigot devs are just trolling
One told me to use a hashmap, when i tell him 3 times im using redis cache
use hashmap ๐ง
Math.min(Math.floor(log(n/3))) whats wrong here
doesn't math.min take 2 parameters
oh yea I am stupid
Math.min(1,4) -- 1
Math.min(2,1) -- 1
still negative, im reallyconfused
how
how does Math.abs return negative
if you use math.abs it literally cannot be negative
cap
hmn, when u told me to use that
๐ค
I mean how did you use it
Math.abs will just make it positive. the value is still wrong even it was positive
What?
logf where
I dont understand
i mean its really weird this help i mean i just get more confused
because i dont really get clarify explanation of why is negative
user.SetPlayed() got negative parameter
that's why it's negative
u set it to negative value
probably
I dont setting any value ๐ค, is just the counter values
it is negative because played is smaller than currentmillis
user.SetPlayed(user.GetPlayed() - time) is negative
because
time is bigger than
user.GetPlayed()
do user.SetPlayed(time - user.GetPlayed())
yes thats what I have been saying these past 20 mins
it's last join unix time stamp i think
yeah
nice method name then
idk what Played actually means
it the last long milis he left
oh
played == "jugado" ?
do this
on join or quit?
? I mean what does is mean in this context
On disconnect
replace with that
just switch the things around
is there a way to replace all the keys in a hashmap through a function?
yes its called a for loop
I need to convert all the keys from string to integer lets say
you make a new map
So players are still able to harvest xp from a plugin that removes xp from furnaces... if they break the furnaces instead.
Any quick fixes to rectify this issue?
so would be setPlayed(currentMillis() - getTimePlayed())
yes
Happen the same tho, it was how i have it in first place
that much I know but can you just get the indexes out of the hashmap through a for loop like you would with an array?
what
And till negative
use math.abs then
ok... i will try thanks
Math.abs(user.getPlayed())
public String format(double n) {
String[] l = {"K","M","B","T"};
double i = Math.min(Math.floor(log(n)) , l.length);
double i2 = Math.pow(1000, i);
if (n <= 0) {
return String.valueOf(n);
}else {
return n / i2 + l[(int) i];
}
}
Just finished this little thing to format integers, is that the right way to do it?
what does an illegal arg ex has to do with not being able to load user data?
but that wont be seconds tho
abs removes the -
its short for absolute
instead of telling me to use a hasmap ๐ฌ
idk๐
because its not the core issue
and because it was really unclear what you actually wanted to do
no
I explain really clarify
I say it many times, i lit said "i want to create a counter which conunt how many time he has played in the network"
You cant exopect somth more clarify
๐คฃ
yes that part was clear
So, you were trolling.... that is the final conclusion
so why u told me to use a hasmap ๐คฆโโ๏ธ
na its oaky
Let me see if it get fixed
because thats by far the easiest way to keep track of things in your case
and I didnt know about teh redis thing
Oh you should read about redi
Is fuckinga mazing for working with centralized data, whiw you dont need to be persisten. Mainly is the fatest software for catching in memory data
oh so you are you like working on a server network?
Multi proxied network to be exactly
Even worst, because i odnt have only to sync a proxy with some servers, they servers with proxies and proxies to proxies
Just saying the project its a 20 maven multi module, you can imagine the project specs ๐
little concerning that you dont know about math.abs then but oh well
what is the best way to serialize a list into string
list of string
I will save them as index-a, index-b, index-c and them split
and here is the error
https://paste.md-5.net/agahuvebaj.bash
public String format(double n) {
String[] l = {"K","M","B","T"};
double i = Math.min(Math.floor(log(n)) , l.size);
double i2 = Math.pow(1000, i);
if (n <= 0) {
return String.valueOf(n);
}else {
return n / i2 + l[(int) i];
}
}
Why does l.size give me an error?
?send-issue ๐
Cannot resolve symbol 'size'
size is only for collections, i mean they dont exists on that type of arrays
Is there some way to get the remaining time on a delayed task in the Bukkit Scheduler?
Why dont directly seriliaize/deserialize from/to base64?
would lenght resolve the issue? Like does it output the same thing as size?
the object?
yes, Arrays have length instead of size()
how should i get player by its ip in bungeecord api
It's length for array
and length() for string, cry about it
Caused by: java.lang.ClassCastException: class org.bukkit.configuration.MemorySection cannot be cast to class java.util.HashMap (org.bukkit.configuration.MemorySection is in unnamed module of loader java.net.URLClassLoader @18769467; java.util.HashMap is in module java.base of loader 'bootstrap')
anyone know what this means?
stop casting a Config section to a hash map
atleast use a map
is there a way to create a temporary instance of a world (multiple at once) for like bedwars or games like that? like the world will be initialized, a match will happen, then it will be gone
cant use a map either
how would I store two linked variable with each other in yaml
idk what you are trying to do
store a string linked with a double
likeyml something: "some string": 1.2
?
yeah basically \
whats not working with that
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 ...
hi , i have problem with something , so i made a sumo plugin this is what achieved :
- broadcast a clickable message with the avillable arena
- player can click on the message to join to the desired arena
- spawning player to the lobby
- after 10 second spawn players in the list of location that is set in the arena config
- game mechanic
i do have one problem left , and i have no idea how to slove it
when 2 players join the arena , after it start , it automaticlly end .. and the first player who joined will be announced as the winner
i add player player UUID , and arena when i join the arena :
arenaSumoMap
idk if this wrong , but its semi-working that's the only problem iam having for now
uh oh calling get after contains
i dont follow?
i have been on intellij idea from 6am
Just do a null check on the value returned by get
and now its 11:20pm
call get, assign it to a var and check if its not null
weak
oh alright
you are talkig about JoinArena method correct?
yeah i know
i will revmap it
i just want to make it work for now
so how does the join work :
it broadcast a message every 15 minute :
it tell the online players to join
when you click on it
you will join
:#
IntelliJ IDEA constantly tells me to put Objects.requireNonNull in certain parts of code, should I just put it there as it never seems to have any effect?
What does that mean?
So should I just use the Object.requireNonNull as the program suggests?
oh i understand
hey was wounding if someone can help me with PaulGG's Chests are OP Challenge is there a place where i have to put the mod
Ummmm is a good practice if I need to depend on someone elses plugin just to git clone the entire thing and run mvn install?
Even if the plugin is massive like https://github.com/EssentialsX/Essentials
Its not the worst approach. But if a dev exposes an API then there should be
a private repo of him which provides the dependency
Something really stupid, but what cause to a command not giving any output, but its registered on the seveer
"command not giving any output" what do you mean by that?
Yeah, it doesnt output the logs, neither msgs
And the command its registered, i have already checked
So this?
/yeah, just appear that, and the code seems not to be run
Lit Like if youregister an empty command
Do your other commands work?
Hi, I still need help for this
I have this function reloadPlayerHologram(Player player, Location location) which reloads whatever hologram at a given location for a given player
If player1 updates a gen, I'm calling reloadPlayerHologram, it become 2 coal generator and both players see it
When player1 disconnects, then reconnects, only player1 sees the hologram and player two sees an armor stand (see picture)
On player join, for each placed block of theirs, it will reloadPlayerHologram for that block
why does it not work?
Yeah, i using the same command register, for other commands for same plugin and they works
Im pretty confused tho
Make sure you send the hologram packets to all players. Not just the one creating the hologram.
how do I send that? I'm creating an armor stand, shouldn't the server send the packet of that armor stand getting created?
Wait if you are using an actual armorstand then its not possible that two players see them differently.
If this is the case then your whole server is broken.
Do you cancel the command preprocess event somewhere?
How can I add CMI as a dependency in maven
That plugin is too massive and terribly documented
A massive plugin with 300+ features that's absolutely terrible
Yes
But I need it as a dependency
via maven?
Yeah
i don't think you can do that
Get they dependency credentials
They don't provide them
??
I assume I gotta do the jar local repo method
So any solution, to my commands not getting any reponse, like if they were just an empty command?
if (getServer().getPluginManager().getPlugin("CMI") == null) {
//Couldn't find CMI
} else {
//Found CMI
}
My guy, this is beyond repairable...
Im not reading this code
I'm talking maven, not that
You are gonna make your server crash with that at some point
what's wrong?
More like whats not?
This is my first project ever in Java (other than exercises)
Does anyone have a pom example to add CMI as a dependency
Sry im showing the usual developer zynism
This should work I think
dont use it as dependency, their coding looks like if a 5y child with no xp have written it
That's not what I'm saying
I still need to add support for it cause people buy it
Not using it not really an alternative I'm asking how to use it not avoiding it. I know it's asbolute ss
Not even close to what I said
I'd like to improve myself
can you tell me one thing that's wrong at least?
With that mentability your plugin wont scale easly, because that plugin is really harcoded not even well designed, So thatwill make your product look awful
You don't even know what I'm trying to do but that's behind the point. I just asked if anyone knew how to add it to maven
First of all: Never do anything database or file related on the main thread.
- Never make data structures public.
- Never ever make data structures public & static.
You should create at least 3 different classes for whats in this one class.
Try to follow this principle:
Every class should only have one (1) purpose.
Also their api bruh, look that shity api impl
For example here is a listener for my GUI library
It has only one single purpose: Listen for events and delegate them to where they are needed
Does it support gui paginations?
Sure
oh wolw
ok
how you do it? I want to do pagination with guis, but i dont get their logic to be written
And auto updates. And animations etc
Yeah I'm more used to javascript and python and in theese projects I did seprate my files but the features themselves would be written in a single module
But going back to my old question, what can be causing that my command doesnt give any output, like if it where an empty command
I have decompile it and checked, but the command is not empty
did you register it plugin.yml?
CommandMap, and its working because im using to register other commands in same plugin and they all works
Except this command
Command could be blocked by cancelling the preprocess event.
Is there anything blocking in your command? (DB or File access for example)
Yes db access, but its being done async
So /invites works but another command doesnt?
Add a sysout in your first line of the command
No, /invites doesnt owrk
Like if it jsut where an empty command, wuth no code
Ok but thats not what you described at the beginning...
I'm not writting my code correctly at all then ๐ I'm using my data hashmap in many classes other than this one
Then add a bunch of debug messages and see where your code stops
Wait let me restart IDE, yesterday i were having issues similars, and where caused because maven wasnt updating the jar
It doesnt even show any output

Send the command
Ok I think I'm gonna spend the next 3-5 days re coding everything
?paste
Try to not use static at all. It will force you to write better object oriented code.
Jesus christ I did it. I was able to add CMI. It's gotta be the most terrible plugin ever made
BRUh we told you 20 times but u didnt listen to us
๐
When did I say it wasn't terrible. But I still needed to add it
I mean you could just download the jar and add it to your maven repo.
Not really related to their code quality.
It's not even close to that simple
Just a heads up
Smile also this is really clown
Because the command was working few days ago and i didnt modify it never
๐ก
Well no other option to see, just left this
You literally download this (latest release) and call mvn install:install-file for this jar
Nope
Doesn't work
I was trying for 30 minutes
You need to install CMI-LIB
Build it
Get the jar
Paste it manually into CMI-API/libs/
And then mvn install CMI-API
And finally it worked
Ok let me try...
Didn't work for me I guess
I just downloaded the jar and installed it
mvn install:install-file -Dfile="CMI-API9.3.1.2.jar" -DgroupId="com.zrips" -DartifactId="CMI" -Dversion="9.3.1.2" -Dpackaging="jar"
lul
But now you got it at least
Just remember: You can install literally any jar into your maven repo.
Without downloading the project
how to make minecraft server use all threads and cores?
lol
Minecraft is single threaded. There is noting you can do about that.
Why?
minecraft servers already use multiples threads
It's just that it uses a whole thread for chat and another for everything else
(It has more than that, but it's a quick summary) You can't just change that
that' why when lagging, sometimes the chat will still work
Optimezed spigotmc why download?
I read somewhere that spigot-type kernels are also multi-threaded
nop
mc servers arent multi threaded, because of how worlds and chunks works
Advise another engine, spigot is outdated
?whereiam
๐คฆโโ๏ธ
This is spigot != paper != glowstone
???
yeah you cant get supported from other paltforms, this is only for spigot and bungee apis
Spigot sucks, doesn't even support multi-core
So go to paper shity comm
Dont came here to fuck
๐
LMAO another paper lover
I love to swear them because they dont even have good arguments
If it does not add, do not subtract, in other words if you are going to come to break things to this community do not bother to do it, because you will be banned at the touch and well done.
๐คฃ
ban me because I'm pointing out engine problems? stupid
where engine
multi-threading and cores do not finish large servers for normal operation
I think it's no use just complaining, wouldn't it be better to act directly on the problem yourself and solve it, instead of coming to break things.
use minestom then
my processor is 10% loaded, but in Minecraft it says that 90% is loaded
multi-threading and cores are diff things
its a mojang issue
right
no the problem, is their game is not designed for working multi thread
Microsoft can?)
their codebase is already fucked
idk why they dont put diff worlds on diff threads
and sync them
but they dont
Clearly, then you need to take the processor at a higher frequency ...
Yeah if microsoft really where interested on minecraft, they already will code them from scratch instead of using mojang shity bases
Remember that the issue came about chunks conrrencies
or it could use multiple cores if you have them available and run worlds in parallel
but worlds barely interact with eachother
Why is Minecraft written in obsolete Java? Why not write your own engine))
no one thought)
I sincerely believe that it would be a very bad investment, since it is no longer a profitable game to invest in.
java really isnt that slow, tho it is pretty memory inefficient
That why if minecraft were coded on Rust would be atleast +30/40% better in terms of resources
the very concept of the game is not profitable
yeah that hy they didnt re code it on another lang or form the scratch
๐
no a concept can not be profitable but the game has clearly shown itself to be profitable judging by the 230 or so million sales
I thought spigot is a custom modified multi-threaded kernel...
nah its a fork of craftbukkit which is just minecraft with an api and plugin loader
I will modify the core myself, it wonโt work, one core per lane does not take out loads
it introduces some optimizations
Are there any optimization plugins or something like that?
I love how everyone complains, but instead of complaining, start looking for a solution or solve the problem just saying the problems wont change anything
๐ค
purpur is a fork of paper which is a fork of spigot which is a fork of craftbukkit which is a fork of minecraft server
and with each tier it gets more optimized
I'm not complaining, I'm confronting the fact that the system can't even load my processor... I'll optimize the lazy nerds myself)
idk if youre going to succeed in making Minecraft multithreaded without completely rewriting the server
Why would you be surprised by this, knowing that minecraft was bought from Microsoft as a throwaway, they just bought it for the sake of buying it.
do spigot plugins work there?
But craft bukkit doesnt have plugin loading system
Dont just contain the NMS?
no nms contains the nms
craftbukkit is a fork of nms which implements the bukkit api and therefor allows plugin loading
But Bukkit is built on top of CraftBukkit
nah bukkit is an api
you could make a stupidly simple mc server
and implement part of the bukkit api
and load simple plugins
im on phone but whats problem
Papermc does not support 1.16.5?
yeah or you can go a bit faster and use purpur
Have you seen any library on github which allow you to write commands, scheduling and common things between bungee and spigot, but in the same way
you probably need to find some specific downloads page
no but i wrote it in a private project
you can use a message broker like rabbitmq
What do you think about it?
you mean like an abstraction layer
Yeah basically
for scheduling and shit
good idea
could be useful in some cases
Because in my case i work a lot with plugins for bungee and spigot, sync with mutli proxies/servers and i always need to change code for bungee and spigot
Which can be written in same way
yeha
you can also use a command framework though
for commands
which probably has bungee support
Why Purpur and Paper top?
idk they have the most optimizations
and build on top of spigot and paper
which already have optimjzations
Ok shanks
Also paper comm is really ugly i wouldnt even suggest putting a feet over it
They comm is really toxic, they ban you for everything/whatever and they just critice when you ask for support because they swearing that you must learn paper and shits like that
you haven't given any good advice
Which of us is still a toxic person
paper api and a lot of the discord community sucks ass but the server software is pretty good
Yeah i agree, their server software is okay, but they support and comm completly sucks
Orby stil lalive?
yes
I thinking to try coding something like a multi platform library, which allow you to implements simple modules but like papi extensions
nice
hat you think?
Because its really annoying to having a huge core but coded it in diff plugins
So then i can do something like
public class Module {
abstract ModuleInfo getInfo();
abstract void enable();
abstract void disable();
ModuleManager getManager();
ModuleLoader getLoader();
}
So then i can split bigger plugins easier
But the bigger issue i have is time, time goes really fast
How do I fix this?
I can't figure out how to use an earlier version to compile
and the server host doesn't use the newer version
[21:19:01 ERROR]: Error occurred while enabling Ichest v1.0-SNAPSHOT (Is it up to date?)
This is due to me shading NBTAPI incorrectly, right?
how would i go about checking what half of a block a player is looking at? I currently have the var for what block the player is looking at, i'm just stuck on how to check what half it is (the block i am using to check is a tall grass block)
What version do I use
<relocation>
<pattern>de.tr7zw.nbtapi</pattern>
<shadedPattern>me.tomisanhues2.ichest.nbtapi</shadedPattern>
</relocation>
Error:
[21:19:01 ERROR]: [IChest] Plugin Ichest v1.0-SNAPSHOT has failed to register events for class me.tomisanhues2.ichest.listeners.IChestPlaceListener because me/tomisanhues2/ichest/nbtapi/NBTItem does not exist.
[21:19:01 ERROR]: Error occurred while enabling Ichest v1.0-SNAPSHOT (Is it up to date?)
Indeed I messed up and did provided instead of compile
Thanks for pointing it out
Hmnn
I would suggest reading about maven
Im seeing that this happpen because you havent learnt how maven orks
It was just a mistake because in the wiki there's 2 sections one as provided and another as shaded....
Not that deep
For some reason changing the version still causes it to give the same error
I tried the Amazon Coretto thing for 18, 17, 16 and 15 and all of them did the same thing
You can use the community version for free
What is the standard method for sending multi-line messages to players?
Make one
public void sendMultiLineMessage(Player p, String... lines) {
for (String line : lines) {
p.sendMessage(line);
}
}
Example
What's minecraft 1.19_R2 nbt id
There are plugins for more projects in one view but its honestly nothing i miss from my old eclipse days
eclipse ๐
i cant even think how many people used to suffer without using the adecuate tools for java coding
Smile i cant find the reason of the command not giving any output, its really weirds its like if the execute() method from BukkitCommand wa snever called / executed
Did you add a log message at the very first line of the command method?
yes, but its not displayed
https://paste.md-5.net/yuvesupigo.bash
I need a bit of helping understanding this error
That why im really confused
Then the command is not registered properly
But if wasnt registered properly server will tell you that the command was not found
not wondering to be rude, but you must learnt java before coding
Then it has the wrong command executor
I checked and everything is oaky
maybe will have to open a PR to spigot gitrhub to get areponse
How do you register your command?
Error resolved?
I'm trying to figure it out rn. one moment
I was worried a for loop would allow other messages to interrupt. I guess it happens too fast for that to be a problem?
hee? what you do mean
could still happen
If someone sends a message in chat while the for loop for the plugin's message is running, wouldn't it interrupt the plugin's message?
I want a nice block with no interruptions if that is possible.
till not udnerstand tho
@strong parcel Use what I sent it'll work perfectly
Why are you registering commands like that?
CommandMap >> plugin.yml
I prefer command map over plugin.yml too, but there is def a cleaner impl of command map than that verano
Show me where you register your commands
And i have others cmds in the same plugin registered with the same class and that specific command is not executed
just use a static method to register
static is cringe, sorry
๐ what there are proper uses for static methods
Which of those 3 commands work?
all, except the invites one
That why im really confused because if the others commands works why this dont work
Lets try some heuristics. Change the order and try again.
Alright so the problem has to be within the command class itself
right
the 3 of them extends BukkitCommand, but if 2 of them works correct the 3d must work in the same way
Dont you think its ilogical this issue?
And the Inviter command?
ait
it didnt sent it?
lamo discord is working as trash
there you have smile
Sorry for time, my os got freezed
Why do they have different JavaPlugin variables?
Anyways please add a sysout message right here and tell me the result.
what is the code to refill blocks when it reaches 32
be more specific please
What is "it"
And you cant refill blocks. They arent empty unless you are speaking about a cauldron
Anyone know about the ItemsAdder API and if there any way to parse the emojis in a string? My chat applies gradient colors so IA doesn't pick up on the emoji triggers
when the players block reach 32 (they were originally 64) I need it to refill back to 64. sorry for the bad wording
Till not response on invites command
Erklรคr ausfรผhrlich was genau du vorhast
Even after you added a sysout message at the exact location ive pointed at? Show a screenshot
Yes, till no output
Its really weird what is happening
You would have to dig through their code
Wait but the message is actually showing?
So the command is fired properly
Are trolling me?
What happens if you call the command via console?
Same issue, no response from /invites
Do you have any other plugins installed?
Is the command listed if you type in /?
yes
That why it doesnt even makes sense
Screenshot
right
Yeah all of this makes no sense
Here they are, but im stupid but written wrong descriptiosns, i just realized
instead of sending a message to the sender do the following in the first line:
try {
throw new RuntimeException();
} catch (RuntimeException e) {
e.printStackTrace();
}
Iterate through the fking CommandMap and check if your command is actually in there
But the other commands is exaclty the same and works
ok
the command is there
Because the size of the List commands is 3
Ok no idea then. You must have done something really weird to break this or not shown all the infos needed...
Cant help you with that
I have literally never ever seen this problem
its really extrange i will open a spigot PR, maybe its a 3rd party bug
This is 99.9% not a spigot problem
yeah i know but we have seen all posbiilties
Not really. There is a ton we can do to investigate more.
For example identitiy checks for each element in the CommandMap.
Or manually calling the command
Im thinking something is bugged between proejct build or while compiling
What would happen if this was executed?
byte[][] x = {{1},{2,3,4}};
Nothing? This just creates a byte matrix and does nothing functional
lets say we looped through it and printed it though
Then we would have looped through it and printed it
wait would that be considered a reference of 2 arrays?
Well, yes you can phrase it that way. Its an array containing two arrays.
looping could either look like this
1
2
3
4
Or like this
[1]
[2, 3, 4]
Depending on how you loop/print
You are sitting in class, arent you...
Smile, finally fixed the issue with just invalidating cache and re compiling the project
๐ช๐ฝ
trying to set a block to a tall grass block, but it only sets it as the bottom half of the tall grass. how am i able to set a block to the 2 high tall grass?
Why dont you get the block lcoation and do it as a new location with the same values but reokacubg with y + 2 ?
Smth like:
Location grass = new Location(100, 20, -100);
Location location = new Location(grass.getX(), grass.getY() + 2, grass.getZ());
@frail gazelle
if i am setting that as tall grass, it will still only set it as the 1 tall version, not the two tall
is it that what you mean?
Hmn yeah
Im really confused
Please if you can make a paint draw or smth like that
so I want to set a certain block to a tall grass block, not a regular grass block. the tall grass block is the two high version of the grass. when i try to set a block to tall grass, it only sets it to the bottom half of it.
block.setType(Material.TALL_GRASS)
Hmn i dont have any idea, i never heard about that
anyone else?
mainly will have to wait patinetlly until smth else answer
anyone know what this means for the ItemsAdder api?
java.lang.NullPointerException: Cannot invoke "ia.m.aK.k()" because "this.internal" is null
by chance is that in 1.19.3
yes
probably isnt updated for 1.19.3 changes ig
package entities;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
@DatabaseTable(tableName = "users")
public class User {
@DatabaseField(generatedId = true)
private int id;
@DatabaseField()
private String uniqueId;
@DatabaseField()
private String username;
public User() {}
public int getId() {
return this.id;
}
public String getUniqueId() {
return this.uniqueId;
}
public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.setJoinMessage("");;
Player player = event.getPlayer();
String uniqueId = player.getUniqueId().toString();
String username = player.getDisplayName();
QueryBuilder<User, Integer> queryBuilder = this.userDao.queryBuilder();
try {
queryBuilder.where().eq("uniqueId", uniqueId);
PreparedQuery<User> preparedQuery = queryBuilder.prepare();
User user = this.userDao.queryForFirst(preparedQuery);
if(user != null) {
Bukkit.broadcastMessage("Hey " + username + ", back again eh?");
} else {
Bukkit.broadcastMessage("Hey " + username + ", youve never joined before, hello");
User newUser = new User();
newUser.setUsername(username);
newUser.setUniqueId(uniqueId);
System.out.println(username);
System.out.println(uniqueId);
this.userDao.create(newUser);
}
} catch (SQLException ex) {
System.out.println(ex.getCause());
}
}```
uhhh what
[03:52:08] [Server thread/INFO]: executed create table statement changed 0 rows: CREATE TABLE IF NOT EXISTS `users` (`id` INTEGER AUTO_INCREMENT , `uniqueId` VARCHAR(255) , `username` VARCHAR(255) , PRIMARY KEY (`id`) ) ENGINE=InnoDB [03:52:15] [Server thread/INFO]: Unable to run insert stmt on obje ct entities.User@737650d8: INSERT INTO `users` (`uniqueId` ,`usern ame` ) VALUES (?,?) [03:55:54] [Server thread/INFO]: java.sql.SQLSyntaxErrorException: Unknown column 'username' in 'field list'
why does that happen
[03:55:54] [Server thread/INFO]: java.sql.SQLSyntaxErrorException: Unknown column 'username' in 'field list'
java.sql.SQLSyntaxErrorException
If you're uncertain on how to use SQL correctly I recommend putting your commands through a SQL Syntax Checker or use a tool like DataGrip to test out queries and others @twin nimbus
@frail gazelle Still need help?
Using Bisected right?
yeah i used bisecting then setting the block data
Perfect, good job figuring that out
google is a blessing when it comes to that stuff
Indeed it can be
...
did you read the code
Of course I did
And I can tell you the syntax is wrong
Which is why i said what I said
Because I even went ahead and used datagrip. Like I suggested, to try it out
oh.
I don't think you did? I'm not using raw sql queries I'm using an orm... I sent the code in the message above the error message
ormlite 6.1
I'll check again and show you. But the error message speaks for itself
Unknown column 'username' in 'field list'
Do you have console sql access to the database?
yes
unknown table
Make sure you selected the database prior
Send a SS of the following commands as you run them
i already did
SHOW DATABASES;
That's why
?
alright
oh wtf
there wasnt anything in the users table
why would deleting it and recreating it do anything
So what I think happened
Is you created the table first, without the data
Like the column data
And since IF NOT EXISTS doesn't check if it's identical just checks if it exists
oh.
It didn't overwrite the tables
bruhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Did it work?
If you go to college you can probably get it for free
Almost anywhere in the world. If so. Get IntelliJ premium and Datagrip. You can run queries and check data straight from your java code
huh. yeah unfortunately I'm not going to college rn, don't have the money for that yet, but I'll keep that in mind for when I do, thanks
Best of luck. If you need anything just post it here again
why need premium version ?
Community is still great enough
If you have premium you can attach datagrip directly to IntelliJ
also remote code editing
:l example?
Do you know what datagrip is?
Oh DataGrip
huh
Wrong reply*
Not that needed but may try someday
If you can get Jetbrains premium for free since it's super simple why not
It's really handy
I mean i do have it :d
Education plan is great but still good with community version
What am I doing wrong?
Wait...
I am an idiot
it says for new projects
I've been changing that over and over literally doing nothing
is there an easier way to write this?
File -> Project Structure
also be sure to change it in your pom
like, is there no |= operator lol
what the heck is this supposed to mean lmao
I guess "PluginManager"
huh
all of my projects now show "Lua" as maven dependency
why
maven wants u to add lua scripting to angelchest
yes ?
@orchid gazelle Still need help?

somehow I thought it doesnt exist
is there a deque-like collection that works like a set? lol
guess I could just use a SortedSet
write ur own 
I'll just use a LinkedHashSet
i hate components so much haha
there is
it's ridiculous how annoying they are
changed |= whatever
for real, using components is so extremely annoying, like wtf
it's no wonder that everyone keeps using &ccolor codes
like how would I create a message that says "Bla bla whatever [TP]" and the [TP] is gold and bold and has a command attached to it?
no clue
ComponentBuilder wholeMessage = new ComponentBuilder("Processing chunk " + i++ + " out of " + size + " at " + coord.x() + ", " + coord.z() + "... ");
BaseComponent[] teleportButton = new ComponentBuilder("[Teleport]").color(ChatColor.GOLD).bold(true).event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "minecraft:tp %s %d %d".formatted(sender.getName(), coord.x(), coord.z()))).create();
wholeMessage.append(teleportButton);
sender.spigot().sendMessage(wholeMessage.create());
this does send a message, but nothing's clickable
anyone?
I just want to have sth like "This is white text [Gold button]" where the button runs a command
there is literally no docs about this at all
lmao
wtf
I am async changig blocks, no problem. but "PlayerTeleportEvent must only be triggered synchronously" wtf lol
async changing blocks shoudl also error
nope, it works fine
Youre not using Spigot then
I know, I'm running paper
spit
well it works quite well
Can someone help with getting maven setup properly for some project(s), I have a bunch of repos for plugins that seem to rely on each other but idk how to get them recognized with maven
for spigot plugins?
oh wait, I havent read the full message
what do you mean with "repos that rely on each other"?
?paste your pom and the errors you are getting pls
This causes particles to fly out from the centre, is there a way to make them just puff out in a small spot, like decreasing the speed?
Guys how i can convert the normal font to another one ?
A E D
ร ร ฤ
Like this
manually create a map that maps the original chars to the chars you wanna replace them with
then go through your string and replace all chars with their other variant
Oh ok
Why use bungee
I will try
for example, using a string builder:
public class Test {
private static final Map<Character, Character> CHARACTER_REPLACEMENTS = Map.of(
'A', 'ร',
'E', 'ร',
'D', 'ร'
);
public static String replaceCharacters(String input) {
StringBuilder sb = new StringBuilder();
for (char c : input.toCharArray()) {
if (CHARACTER_REPLACEMENTS.containsKey(c)) {
sb.append(CHARACTER_REPLACEMENTS.get(c));
} else {
sb.append(c);
}
}
return sb.toString();
}
or you could just use the array directly
Thanks
what else would I use for click events?
Oh you are working against spigot API mb mb
?whereami
the components suck so hard
It's bungee chat /shrug
I mean, I could use minimessage, however I actually wanna know how it works with onrmal components
Expected
this is more a "curiosity" question than a "I just wanna get it to work" question ๐
I mean adventure components have a lot nicer usage imo
On spigot Ehm
No idea tbh
Adventure platform:)
well no idea about adventure, I only used it through minimessage
but I wonder, it MUST be possible to properly do it with bungee components, yet it's explained like nowhere lol
directly using the char array is probably easier:
public static String replaceCharacters(String input) {
char[] chars = input.toCharArray();
for (int i = 0; i < chars.length; i++) {
Character replacement = CHARACTER_REPLACEMENTS.get(chars[i]);
if (replacement != null) {
chars[i] = replacement;
}
}
return new String(chars);
}
(unless your replacement may be more than one char, in that case, go for a Map<String,String> or Map<Character,String> and use a StringBuilder)
np
<dependencies>
<dependency>
<groupId>com.pepzii</groupId>
<artifactId>WineSpigot</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
I have this right now, and I have the WineSpigot jar, how can I get it to recognize without changing the pom
Yes
Hi guys, I need to check all the blocks of a chunk. Any suggestions on how to do the work? I was thinking of dividing the job into many small tasks that are executed on the main server thread whenever there is free time, do you have another solution or do you think this one is ok?
Uh, just saw that it exist getChunkSnapshot
lol
grab a chunksnapshot and iterate async over it
why tf does buildtools for 1.8 only work in git bash
works fine here at cmd
This is the script I use to run BT http://haste.palmergames.com/uhadolagor.bat
seems you are correct. 1.8 is nto building for me anymore
its not building source or documentation either
I'm just checkign with no switches
What's the error?
iirc i tested both and neither worked
I just ran with just remapped (although it does nothing on 1.8) and it works
in cmd
Starting download of https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
Uhm, ouch
Oh, you guys use javadoc in your IDEs, lol
yep its failing generating the javadocs
it used to work
I have the javadocs from an earlier build
I don;t have them in my .m2 I have the generated docs
html
I think I can now build 1.8, after starting in a new folder with the latest BuildTools version. Still waiting for it to finish. Seems like yet another cache issue.
--generate-source works
coulda sworn it didnt for me
--generate-docs dies
Where are these docs supposed to be stored at? It completed execution for me but I cannot find the corresponding jar. I read that it only builds javadocs for bukkit, but I can also not find any javadoc jars in the local bukkit repo.
It fails on Material and BlockFace
Building 1.8.8 ?
/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/bin/java -jar BuildTools.jar --rev 1.8 --generate-source --generate-docs
Ignore the absolute java path, is this correct otherwise?
Oh, I thought we were talking about 1.8
1.8.8 is the server version
I was just going off of this list, xD
i just cannot not do this: https://howoldisminecraft188.today/
This is not so much about an old version as to why maven is failing to build javadocs
well javadoc is failing
interesting javadoc.exe works fine for 1.8 but fails on Material and BlockFace on 1.8.8
do u know by chance if one can use the 1.8 javadoc for 1.8.8?
yes there should be no difference in API
ill just build 1.8 then
um
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30.864 s
[INFO] Finished at: 2023-02-16T13:54:46+01:00
[INFO] ------------------------------------------------------------------------
Rebuilding Forked projects....
From file:///D:\Creation\Minecraft\Bukkit
+ 01d18206...1d2509b9 master -> origin/master (forced update)
+ 01d18206...1d2509b9 spigot -> origin/spigot (forced update)
HEAD is now at 1d2509b9 Revert finite checks in locations. Fixes SPIGOT-628 and others
Resetting Spigot-API to Bukkit...
HEAD is now at 1d2509b9 Revert finite checks in locations. Fixes SPIGOT-628 and others
Applying patches to Spigot-API...
fatal: Resolve operation not in progress, we are not resuming.
whats that last line meaning
ignore it
https://paste.md-5.net/epihanutek.coffeescript
It's funny how only Door.java seems to cause trouble, and it's the only place referencing a enum member using @see with member dot notation, instead of the usual javadoc way of using pounds (Enum#CONSTANT). Maybe that's tripping up the javadoc generator. Just a random thought tho.
also fails on BlockFace but I've not looked at the reference
It's not about not finding the enum itself, as that's imported, the import is fine and the corresponding .java file is available. I've checked all of those. It's only about the javadoc itself.
yep
But how would that have worked until now... weird.
Cannot change the file either, as BuildTools overwrites my changes. No idea where I'd have to put those patches to see if it's actually about the dots. Maybe it even pulls freshly, then I'm pretty much out of luck anyways.
yes it pulls fresh from git each time
PR time, lol
you can manually build
I was searching for the maven command it invoked
I forget how though. there is a tutorial
Never used javadoc sadly
that creates a html page right?
yep
Right, thanks for pointing that out! Gonna try it real quick
1.8.3 javadocs are fine too
Still, what a stupid error, that needs to be fixed
it should be really
This is the error we are seeing https://stackoverflow.com/questions/40023408/javadoc-shows-error-reference-not-found-although-reference-cleary-exists
Yeah, it ran
so remove () from comment ?
It was about the darn dots
ah
you sure? I got errors on BlockFace too
The dot's used with the BlockFace constant references as well
oh yep, in Door.java
so it's purely using . instead of # in teh @see comments
Yep, which makes javadocs fail at parsing the doc-string
very wierd
