#help-archived
1 messages Β· Page 117 of 1
I have 876 commits on a private gitlab repo for a project where I'm the only developer
Yeah?
I'm rewriting some old repository branch
So this will be a public resource?
yes it will
and three years down the line you'll stop supporting this project I assume?
Even if it becomes a public resource, those who choose to rely on the project for whatever they intend shouldn't be the problem of the creator especially if they don't intend on creating an API for it.
what.
I mean I don't know if i'll stop supporting
Trust me you will
yes you will
If I always worried about what others are going to do with my projects I would never get anything done XD
you're making a mindset for yourself and you'll do this automatically forward
I will remove it when I know i won't update it ever again
you're training to do less mistakes but you need to start somewhere
yeah my mindset is to not worry about what everyone else will do with my projects since the majority of them are open source anyways if they want to change it, they can π
Your mindset will get you calls late at night in the corporate world asking for how code you wrote works.
Because nobody in the team can understand why you made a specific choice
Β―_(γ)_/Β―
@steady cedar doesn't happen to me mainly because I ensure it is documented as to why something is the way it is.
Yeah I like documenting as well
if someone can't understand its purpose beyond that, they shouldn't have any business touching it then
I think every single method i have is documented
Do you declare why you use a specific Map implementation?
I'm saving that comment lmfao
Retaining a type like that is a really dumb idea unless you have a REALLY good reason to do it.
except everyone's argument for not doing it is also weak though....so I mean if they want to use a specific type let them lol
What's your strong argument for doing it?
You've never maintained software that isn't your own have you
I have
[x] doubt
Facts?
My opinion is rooted in multiple years of corporate experience and almost a decade of experience in software development
yo boys id like to ask a question, but your discussion is crowding up this channel
@weary harness ask away
So I'd say my opinion about this topic has a bit more weight than the average person here
I have an issue where /help [plugin] doesnt write the whole line out, so it ends it like this...
https://i.gyazo.com/thumb/1200/bf25a648b10a884fc45d6af8e3b4f78e-png.jpg
anyone know how to help me?
it does work in command line tho
https://gyazo.com/30a0db7ed43ade55d19e4a5a73718f5d
except this isn't corporate software being created
scroll up @weary harness
no
i mean the line isnt finished
He's asking about the ...
its like this...........
I think you have to use a custom help plugin or a custom help command to fix that
That's the standard behavior
i changed chat width, didnt help
cmi help did work
but thats not handled through bukkit
that is normal behavior, if one does /help (Specific command) that is listed they should get the full output of that command
instead of a condensed version
now the reason it works just fine in the console is because the console and server are one in the same, that is the console is not bound by the chat restrictions
yes
it is normal behavior not sure how what I said was confused
they should get the full output of that command
the reason it is normal is to prevent multi-lines breaking up trying to see all the commands
That's what I call over-documentation
looks good to me
yeah
i mean youre not really answering my question @keen compass
is there a way to change any of that
No
@weary harness Do you want the description to split into the next line?
yes
I don't think you can do it tbh
Not without using reflection
Use a custom plugin Mondo
You're going to have to modify the help command in spigot.
or taking over the help command in a custom plugin
i could find where idriz, saw nowhere a setting or anything like this
/help <command>
@keen compass reflection?
and you will get full text I think
iknow fendi
@weary harness You'd have to modify the help command's code.
oh
i want it for a particular thing
the base help command isn't really to list what each command is for though, its main purpose is to list the commands that are available. The small amount of text that comes with it is just a plus.
i wanna fix some documentation for my server
I think you should rely on something else than Bukkit help messages
and those help things are nice so i dont have to figure out who has which permission
any tips?
i thought this was quite easy, and if it would print out the whole line i could do it easily
If you really want to change how it is outputted you are only left with two options both of which require a custom plugin. Well there is a third option and you could just modify the server code directly to change its behavior.
"its main purpose is to list the commands that are available. The small amount of text that comes with it is just a plus." thats enough for me
yeah i cant modify server code, so what are the other 2?
Custom plugin. Either take over the help command and catch when someone runs /help and output what you want
or use reflection to change the servers behavior
he's not a programmer i think
whats reflection?
There might be plugins that exist already that do this
im not @sturdy oar
okay
so ill go find a plugin that can help me then, anyone familiar with any help plugins?
i think it does, but i use CMI already
oh
thanks for the help boys, ill have a look into help plugins
mondo its not official to have official in ur name π
lol
lol ur pfp
some people have og in their name, like bruh thats even less og
og is worse
so ur good
LOL
@sturdy oar Essentials doesn't allow the ability to control it though
og mondoofficial is my next nickname
)= big sad
But I posted a link to a plugin that allows custom help pages though
can you bring useless discussions to #general @frigid ember
mondoytofficialogsubscribetotseries
ty
i saw that frostalf, ill have a look
yes retro
my name precedes the game π
π¦
Dark age of Camelot is the game most people think my name comes from @frigid ember
how to make day/night in MOTD
(
wdym @open mantle
Anyways my name is derived from Norse language
ah i see you want good day or good night zelen?
-_-
are you making a plugin or are you asking if a plugin does it? o.O
-_-
@open mantle ??
mhh I think one day I'll want to rewrite my entire plugin with Kotlin
Lol
it would be much shorter and better
eventually at some point programs have to be re-written
be more clear in your questions @open mantle
well I'm already rewriting the old one
it was kinda trash
I now only depend on high quality Libraries
while others disagree on my view point of planning for the future. I do agree with them, just really depends on the purpose my project is all π
yo im gonna have dinner, thanks boys
bye
So which kids were insisting that lineaer time lookups were a good idea?
Not entirely sure o.O
I never said it was a good idea
Only thing I did earlier was just correct that HashMap is not guaranteed to be O(1) is all. But to make that the case, you really need a very large data set to make that happen lol.
I think if someone has a lot of rows
i could implement
cleanup features
so old data gets purged
While what you said is technically true, that piece of information really is not relevant at this level
how do i get hostile mobs
Use a google cache lol
wut
Wdym ?
And @sturdy oar You should be cleaning up your map whenever players leave
It was relevant earlier because it isn't accurate to say that HashMap is guaranteed to be that.
If you don't clear out entries when players leave you're going to be leaking entries all over the place
I think u don't know the structure of my plugin so its kinda confusing
going to be leaking player objects which means you will be holding up resources that need to be GC'ed from being GC'ed
Nope. A hashmap is guaranteed to be O(1). A treemap, which is what hashmap converts into after some time, is O(logn)
@gleaming helm only accurate if the data set isn't super large. Even if it doesn't get converted hashmaps eventually become O(n)
if hash recurrence
On startup, i cache the database into the ConcurrentHashMap,
every 5 min i save the data from JVM to database (to avoid server crash and data loss)
and I save another time when onDisable is called
Well yeah because it runs out of buckets
wait so you save the ENTIRE DATABASE into a map?
I hope you aren't expecting a lot of data in your database
What does your database store?
sure
if you want some resilience for when the server crashes I recommend using Memory Mapped files as the middle for holding data
Yea so you could really end up with a lot of data
wdym @open mantle
@weary harness
how to make a title it can switch (day;night) it depend of time in serv
flags are only 3 at the moment
yeah , technically a huge ass server
could have a lot of rows
but I'm planning to implement data purging so databases don't get insanely big with time
boys can anyone help @open mantle. He is trying to make the MOTD change according to local time zone day/night cycle
hes not very good at asking questions apperently
Well then you're just deleting player data. That's a band aid, not a fix
so im typing this out
))
??
))
@open mantle lol this guy
I think it might be possible with using PlaceHolderAPI
I mean i could also work directly from the database, but I think caching it makes things more easy
thats a good call yea @keen compass
You should only get data that you know you need and not get all the data if its not needed
its not really a big performance hit to query the DB for extra data
well I don't need any data, until it's requested
for example when one player says a "bad" word
i increment his flags
but, googles Gson stuff has a few nice caching stuff you can actually use though
which is shaded into the server already
what does GSON have to do?
What
im not using json at the moment
GSON is just json parsing and serializing
yes I know, but in that library is caching methods
I think you're talking about google's collection apis
If I recall its part of guava
I think the best way is to try just finishing it the way I have planned
and make a benchmark
but the caching mechanism you could use is an expiring cache method
I think he wants the maps for the online players always loaded in memory
That's what I'd do
it gets cached, but only for a period of time, and then it expires and removed but it can auto get the data for you if the data you want expired already
Load it from the file database when the player joins in asyncprelogin
Is it possible to make a Cache expiration but execute a save when it expire?
And then save it periodically and when they leave
nono its a lot different, i will explain
@undone narwhal yes
@keen compass awesome
I cache all data, if a player does a thing, my plugin will search into the map for the player UUID, and if it is found it will increment a flag integer, otherwise it will just add him
if i didn't cache the data i'd have to execute a sql statement each time i think
Wait your data is already in sql?
Why are you caching at all
Just execute the sql statements
sql queries can be done on their own thread
and the odds you will have slow queries is very low as well
That's the proper use of a completable future
so I shouldn't cache anything at all
I don't think I would
It only makes sense to cache if you absolutely need the data now
cool, I guess i will take a lot of time and rewrite everything π’
no many of the data actually may end up not being used
so it's waste of space
y'all right
only times where I find it where cache is needed is say like a minigame where a slow query can be deterimental
in which case you would just cache the data you know that is needed and in most cases its already known before hand which data that is
Thank you. i will fix this
It will take some guud time because I'm not that good with SQL
Just make sure in your queries right
Well here's the thing about sql
You never need more than 1 query to fetch all the data you need
HikariCP or BoneCP which is deprecated but still works are good for implementing SQL connection pooling
If you use more than 1 query, combine them by nesting or use a join
can even go as far as to implementing functions too if you really want to
i mean, i don't think it's necessary
For his schema he doesn't need that though
I agree
i basically need to either get a row
or increment a value
that's all
it's pretty easy
UPDATE tableSET value = value+1 WHEREname = '?';
yeye don't worry, I will figure out SQL for myself
SELECT value FROM table WHERE name = ?;
don't like spoonfeed
Those are your two queries lol
your use case for SQL is actually easy though fortunately
you don't need anything complex
are you making an anticheat?
???
PlayerData
even if you were to execute multiple queries for you it won't be detrimental lol
u have Integer and flag
Oh my god
or whatever
you had flag and integer
i mean, it is a security plugin
He skids anticheats and sees PlayerData all the time in anticheat code
So he assumes you're skidding too
I've never bothered making anticheats
I think it might be possible with using PlaceHolderAPI
@keen compass thanks
don't follow it
?
I don't recommend putting a parallelstream inside of a completablefuture
That's how you end up using all the threads up in your threadpool
well that's prob going away
lol
what kind of security will you have?
that best kind
And yeah when you have the option to just use a foreach loop just use the foreach loop
What do you do?
A feature to ban everyone named Retrooper
It sounds like its just a chat filter
where it monitors when someone uses a banned word or something
I'll delete playerData
My chat filter the best
wy
i don't actually even need it anymore
I use a fancy recursive algorithm to generate mangled words
Really similar to password cracking tools
I have no idea what skidded means, is that the new word everyone uses for saying stealing?
I did not even skid
Nope mine's way way better than regex then
Apparently to some people here forking open source projects isn't allowed.
Β―_(γ)_/Β―
Forking open source projects and calling them your own, you're right, in most cases that's not allowed.
u can skid that regex
Nah I have way better than a regex
big sad
just have to be careful with re-cursive methods though. You can deadlock threads that way if you don't know what you are doing XD
just have to be careful with re-cursive methods though. You can deadlock threads that way if you don't know what you are doing XD
lmao
Yeah you think I'm the type to not know what I'm doign?
Yes
col
@gleaming helm lol obviously the comment wasn't for you
I can add them in game and it synchronizes it to all nodes in the sharded cluster
Using redis
I just have a cool config.yml
I just have a cool list in both redis and mongodb
just stating for others if they get the idea to use recursive methods to just be careful in doing so. As you can cause some bad things to happen if you are not aware of the repercussions of it.
^
My Swear Filter is Me.
I never used recursion
Don't do recursion unless you like know what you're doing
I only know the recursion for factorial xd
imgur is easier
No you can't
lol
only if you are registered
Oh I can't lol
yeah you have to link your account
I'm not linked
Imagine caring about a blue name
Oh no, now you are going to awaken the purple gang
Well i know my code is far from perfect, but at least i put all my efforts into it and have never skidded
o.o
wait oop-
lmao
What's Coding
stackoverflow
I have 226k mangled words in my chat filter dictionary LOL
its the 1 and 0
226763 words
With random character combinations?
@frigid ember what
So lookups on the mangled set are very very fast
whats funny @sturdy oar
L3375P34K
of letter -> substitution
if you write 'dick'
i dont get it
you get 'trick'
oh
into the chat
if you can read L3375P34K
ur cool
but if you write dickens, its fine
It blocks "7it7y" for example
trickens
no
Dickens is allowed, it's a common name after all
mine >> regex
you can also use character comparisons too for checking substitutions
yea
Or any substituting algorithm thing
I don't think regex is slow , at least with the length of minecraft messages
the character one is a bit more difficult though to create from scratch
No but my checks run on hashsets
Kevin's way is probably easier and just as efficient
or be a mega cool kid and make a table with every permutation
Yeah regex is prob. much easier
well I guess depends who you ask π
otherwise i wouldn't have used it
the character method is actually comparing the character itself since characters are just images
I generate all of the possible mutilated words using a fancy algorithm that I can't disclose, then I store them in a hashset and checking contains is O(1) time (with the same caveat we talked about with hashmaps)
oh
For some reason I've made a game though for some reason it saves, I've turned off both Bukkit's Auto saving and our hosts autosaving though it still saves, can anyone help?
I could use a bloom filter as a preliminary check but really... that's overkill
lol
It was implemented through a Vanilla world
i do it the dumb way, I remove all whitelisted words from string, then check if it has any match with the blacklist regex
a WHITELIST
wut
Oh, I roll it back each time the game is done
oh man oh man you're going to really piss off some players
lol
Though for some reason it will save randomly
wdym ?
Best Chat Filter is a Human Person.
whitelisted words???
nonono
@wheat summit server saves upon shutdown
tf
I pay MC-Market Developer $0.50/hr To Check Chat.
If you're whitelisting words that means there are going to be words you've not thought of
whitelisted addresses, and domains Ahahahaha
Oh oh I see
Yes though the game world was always unloaded before shutdown @keen compass
like 127.0.0.1
whitelist block types too
turning off saving just means the server won't save periodically while it is running, but it will save all the data once you shutdown @wheat summit
So unloading the world while auto save is off still makes it save>
You know you're baller when you disable playerdata saving in spigot.yml
Yes that is correct @wheat summit
well, it has to unload all the data before the world can unload and the server defaults to saving that data first
Flex incoming
yes use a custom plugin to stop it
nice
Actually there's another collection with a few more fields
for each player so
Total is probably in the ballpark of 30-35 fields
I do like the sound of your method, but I probably won't bother with it unless it really becomes necessary lmao
This is what I used to reset the arena:
I mean as in creating it myself
Only do this if you're sharding
public ArenaReseter(Main plugin) {
this.plugin = plugin;
}
public void unloadMap(String mapname){
Bukkit.getServer().unloadWorld(Bukkit.getServer().getWorld(mapname), false);
}
public void loadMap(String mapname){
World world = Bukkit.getServer().createWorld(new WorldCreator(mapname));
world.setAutoSave(false);
}
public void rollback(String mapname){
unloadMap(mapname);
loadMap(mapname);
}
Don't fucking do this if you don't have a good reason to do it lol
lol
Sometimes it worked and other times it didn't
I figured that would be the case with it
That's what confuses me
It's a lot easier to not serialize inventories and health and hunger and all that
@wheat summit is the world for a minigame?
Yes
then just delete the world after its use
I did try that though it never seemed to work
keep a master of the world and copy the master everytime you need a new world. Delete the world when done
Cloning world folders is a beautiful thing
That's what I originally did
@sturdy oar make sure you're tokenizing
Though for some reason when I tried copying the new folder or deleting it I would get errors related to stuff like the file having a /level.dat
i don't know if that would actually pass or not
@wheat summit probably had to do with in how you were doing the cloning.
SlimeWorldManager was designed for exactly what you're trying to do
This is how I would clone and delete it:
public void copyFolders(File sourceFolder, File destinationFolder) throws IOException {
if(sourceFolder.isDirectory()) {
if(!destinationFolder.exists()) {
destinationFolder.mkdir();
}
for(String files : Objects.requireNonNull(sourceFolder.list())) {
File srcFile = new File(sourceFolder, files);
File destFile = new File(destinationFolder, files);
copyFolders(srcFile, destFile);
}
} else {
Files.copy(sourceFolder, destinationFolder);
}
}
public void deleteFolder(File fileToDelete) throws IOException {
FileUtils.deleteDirectory(fileToDelete);
}
Call delete and then copy
FileUtils is from org.apache
see you later
Lol
if you want to know my way of how I would do it, is I would just execute a bash script to uncompress the world from an archive. This way only thing you really need to code is just unloading/loading of the world. Bash script handles removing and cloning the world files. Makes no sense to have the JVM handle it when the OS does just fine to do so π
FYI, you can execute commands from Java as well as get the output of the command as well.
Ok thanks
The only thing is when executing commands from Java, is that the Java applications has the same permissions as the user that executed the Java Application
also don't you have to stop any writing when you clone a word?
Reason why you shouldn't run MC servers as root π
@sturdy oar yes, but you can let the server handle the loading/unloading for the world though
i remember I had a discussion about cloning worlds while running the servers on Paper discord
as for the actual cloning you can let the OS handle it
I'd use the right tool for the job and use SlimeWorldManager which was designed to solve the exact problem you're having
I haven't used such things, but if a plugin exists to handle it you can use that too
You can clone worlds into memory (even from a database if you want)
I have heard of it, just haven't used it is all so I am not entirely sure what exactly it all does
Yea it's a pretty neat bit of software
but, me I prefer to let the OS handle stuff if its able to handle it π
not like you are going to beat the OS doing its job in most cases lol
if coming from the Database I could see that
Even from a filesystem
It doesn't call copy
In fact it loads the world on boot and then just copies all the data it needs in memory
is he also compressing?^
(When I say load the world I just mean loads the world data from the file system, it doesn't like add it to the world list)
Yeah the compression is pretty darn good
only bad thing bout swm insanely high ram usage
I always use 7Zip for compressing my worlds
A map in a schematic takes about 3mb for my use case. The same map in the slime format is 30kb
so you have to keep worlds unloaded till they're used and loading then is a little lag
Yeah
I actually have a bit of a patch in my version to make that async. The patch isn't too difficult but it requires some knowledge about the world loading system
Not the reason for the 99% size reduction from a schematic
there is quite a bit of data that isn't necessary most of the time to be saved everywhere
@gleaming helm could share? I'd like to test
I can't unfortunately
but the other thing it does is re-organizes the data
NDA
for more optimal saving
how much does compression take advantage of having more cores?
like a ryzen 2600 for example
depends on algorithm
depends on the algo and how its implemented
The data you're compressing is really small anyways with SWM so it's really not a huge concern, and it all happens off the main thread.
7Zip
you can use an appropriate algo, but not implement it in a way to take advantage of multiple cores lol. But I am going to assume SWM has it implemented properly π
SWM uses a lib that implements properly
Nobody implements a compression algo themselves
They're complicated beasts that most people here don't have a chance at understanding
Yeah unless you've gone to school for cryptography, don't. Please for the love of god don't. write your own crypto alg
lol
Even in my discrete math class
I have been to school for crypto and I still have a hard time with it XD
The professor had us implement RSA in completely wrong way
Hey guys - I have a resource pack in which we change Lime_Dye to be this big structure. However, Lime_Dye does not change on the server. The Lime_Dye DOES change in our single player world, but again, not in on our server.
Yes, I know we have the right link and it is being downloaded properly, that is not the issue. The other textures we manipulated change successfully, just not the lime dye texture.
Even implementing crypto libs
probably using the wrong name for the server @frigid ember
People still fucking use ECB mode
@frigid ember Custom model data?
COUGH FUCKING ZOOM
@keen compass What do you mean?
@gleaming helm Do you mean you want to see the custom model data?
Well, when we changed hoes to spears, that worked just fine
well Lime_Dye is a material in the server. It isn't a block, but the material can be used as part of block data.
I didn't have to set anything in NBT
Understood
Paste it on https://hasteb.in/
@gleaming helm @keen compass https://hasteb.in/elupepix.json
Which file?
The one at /assets/minecraft/items
ok
It's named lime_dye.json
Yeah thats the contents of it @gleaming helm
What I just posted is the contents of that file
Oh so your resource pack guy literally overrode it
Yeah
That's kinda dumb but ok
I forgot how you make a plugin reload command anny one that can help ?
For me it was easier to unload the whole plugin (internally, not actually on Spigot) then load it again (coz there was sooo much that would have to be reloaded individually).
@frigid ember could be viaversion related, I had same issue
I have now running 41 plugins so restarting see will cause in waiting 2 min
Oh, reload other plugins.
Never mind fount ou that it is not possible
Anny Idea how to get a date and time in the scoreboard?
Does anyone have some tips for creating a world at runtime? I'm trying to copy a world by first copying the world files and then creating the world but it occupies the main thread so the server will stop responding. I tried to create the world async but I got an error because Bukkit API and async don't go together well.
That link is a screenshot of the method
why are you copying it for?
@zenith siren Look at this thread: https://www.spigotmc.org/threads/world-copy.37932/
That thread is where I got my method from
@frigid ember I am not an expert at resource packs, but the only thing I can say is that lime_dye is an item and isn't a block. So as far as structures goes, you will need to use something that is a block. You can re-skin items all you want, just doesn't mean the server will treat it differently because it has a different texture.
Any one an idea> Anny Idea how to get a date and time in the scoreboard?
@south shoal
did you ping yourself , smh.
SimpleDateFormat might do the work
LocalDateTime.now() tho
How do you listen for if a fish is being caught? PlayerFishEvent has event.getCaught() but it returns an Entity rather than an ItemStakc
if (event.getCaught().getType().name().endsWith("FISH") || event.getCaught().getType().name().equalsIgnoreCase("SALMON") || event.getCaught().getType().name().equalsIgnoreCase("COD")){} doesn't seem to work though
you can also catch an entity so it's not always an item
i'm not entirely sure because I've never actually used this event
i dont get this
where do i put plugins, either on the spigot plugin folder or the bungee plugin folder to make the plugin work?
can someone tell me pls
I'm using a RayTraceResult from World#rayTraceBlocks, but is there a way to make it ignore the block that is at the starting position?
using block.getLocation will work, but only when the player is northwest from the block
Anyone can help me? im was trying to start a server with Hamachi, but a Appeared " FAILED TO BIND PORT " I've tried everything and I couldn't solve it.
If you know how to help me, send me a message in private.
i...
j..
So I'm trying to increase the apple drop rate of leaves
I'm not sure how to check if a leaf has dropped an apple by decaying naturally
you already have something on that port
or you don't own that ip
Does anyone have some tips for creating a world at runtime? I'm trying to copy a world by first copying the world files and then creating the world but it occupies the main thread so the server will stop responding. I tried to create the world async but I got an error because Bukkit API and async don't go together well.
okay hamachi
i don't know how that worked
but you had to use like the hamachi ip or something
yah
I use it daily, really cool thing
Other person can into the server?
yup
it generates address to give to your users
the address is different every run, unless you pay
Hi, im trying spawn a CustomEntity but this only work if i reload the server. Any help?
Version: 1.15.2
MainClass code:
public class MainClass extends JavaPlugin {
public void onEnable() {
h.spawn(loc);
main = this;
Location loc = new Location(Bukkit.getWorlds().get(0), -45, 66, -11);
h = new ChesterEntity(((CraftWorld)loc.getWorld()).getHandle());
}
}```
CustomEntity code
public class CustomEntity extends EntityWolf {
public CustomEntity(World world) {
super(EntityTypes.WOLF, world);
}
public void spawn(Location loc) {
this.world.addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
this.setPositionRotation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
}
}```
the address is different every run, unless you pay
@frigid ember ok
how ?
don't know, google it or something
but I know that plugins can be loaded after world load
with some plugin.yml change
hi i need help
Im using Cmi holograms but idk how to do things like Players online and that stuff can someone help me?
yea we have that but im still confused
@frigid ember using PlayerJoinEvent to delay spawning I also have to connect 2 times to make it appear.
hmm
why is your h.spawn above loc generation?
it seems to be wrong order of code
you new to programming?
bad copy
h = new ChesterEntity(((CraftWorld)loc.getWorld()).getHandle());
Bukkit.getPluginManager().registerEvents(new Listener() {
@EventHandler
private void join(PlayerJoinEvent e) {
h.spawn(loc);
}
}, this);
I have my debug messages ```java
for (int i = 1; i <= craftingSlots.length; i++) {
view.setItem(i, inv.getItem(craftingSlots[i - 1]));
}
ItemStack stack = view.getItem(0);
if (stack == null) {
msg(p, "&cItem result is null");
}
int i = 0;
for (ItemStack item : view.getContents()) {
if (item == null || item.getType() == Material.AIR)
continue;
i++;
}
msg(p, "&aFound: " + String.valueOf(i) + " &items in the crafting inventory.");
if (view.getItem(0) != null && view.getItem(0).getType() != Material.AIR) {
msg(p, "&aAnd the resulting item is type " + view.getItem(0).getType().toString());
} else {
msg(p, "&cAnd the resulting item is null");
}
inv.setItem(23, stack);
Where view is a crafting inventory
please someone help me here
i'm using multiple NMS versions via interfacing with several modules
and i'm using maven
my plugin is letting me import com.willfp.ecoenchants.API
but then it won't let me compile: Error:(3,34) java: package com.willfp.ecoenchants.API does not exist
when clearly it does exist
i'm just totally lost
looking through compile logs it says [WARNING] The POM for com.willfp.ecoenchants:API:jar:1.2.0 is missing, no dependency information available
but the pom does exist
i created a bungee server, do i have to port foward my other servers when you change the server port?
any one a idea how to set a time in a scoreboard
is there a way i can enchant a sword with sharpness 1000 with a command. when ever i put it in it says "error: unknown item name"
look for a plugin that has that that is not a future of a normal spigot server
????
As a person who has figured out how to properly do custom crafting (including multiple items in the recipe, and custom items in the recipe) using nothing but the vanilla crafting UI... I can confirm that you do not need a custom crafting UI for custom crafting. Way worse experience, possible dupes.
^
I'm not trying to make custom crafting recipes, just to have a workbench in a gui
again
there may be glitches and or dupes you didn't account for
I'm trying to do this
yes
that is hypixel
they have a big team of devs
yep
But why is the result always null?
It works when I do p.openWorkbench instead, but then the item in slot 0 is set to the result
let me look up
what code are you referencing exactly
do they really have a big team of devs?
π im still angry they left crypt on his own
Is it better to use (System.nanoTime() / 1000000) or System.currentTimeMillis()
currentTimeMillis but it depends on much accuracy you need since it uses OS time, which can be off by a few millis
nanoTime() is more accurate but is a more costly call as well
apparently currentTimeMillis doesnt work on some OSes
which OS's would that not work on o.O
dont ask me anything but everything but windows apparently
and if its off, well then the next time you call it, it would still be off by same amount right?
the only thing I know of is that Windows implements millis differently then linux and therefore isn't as accurate on windows
but it still works
Depends how fast you are making the call
every packet, as a timestamp
Well, still kind of broad. Do you really need the timestamp to be super accurate? not sure what you are using it for
is there a way i can enchant a sword with sharpness 1000 with a command. when ever i put it in it says "error: unknown item name"
need a custom plugin to allow unsafe enchants
literally just use essentials
If you are using TCP @frigid ember then you can just use the protocols timestamp function to put timestamps on outgoing packets
normally that is the standard for timestamps in packets, and since java edition minecraft uses TCP more then likely it uses the Timestamp method from the protocol so the answer would be yes.
well they broke the plugin anyway, i dont see any other anticheat have problems using millis so Β―_(γ)_/Β―
doesn't System.getCurrentMillis() and System.nanoTime() call native stuff
yes
but one is more relaxed then the other though
currentTimeMillis doesn't care about accuracy as much as well as there is a possibility of getting the same time depending how fast you are using that method
where as nanoTime is more accurate but its a more costly call because of that
Isn't nanosecond a system call on some jvms?
@frigid ember You can do all of that with the vanilla crafting GUI
I have literally done all of that myself with the vanilla crafting GUI on my current project
Also I don't recommend copying hypixel, you'll get laughed at for... copying hypixel.
How could I make the sound follow the player? Because if the player moves the sound he's only on one side of the phone...
pl.playSound(p.getLocation(), "minecraft:music_disc.13", Float.MAX_VALUE, 1f);
increase volume
How much?
Isn't there a Player#playMusic method?
nope
Damn
hello, i got a question, i want to create a "generic" thing, like, i need to create a KillerMoney, when mob is killed, the player got money.
Or, i don't want to make a condition for ALL mobs, someone got an idea ?
Thanks! (ping me)
why are many java developers saying what lwjgl says about currentTimeMillis and nanoTime is false when i tell them i learned it from their wiki?
Are they wrong?
@gleaming helm I don't think I'm being clear, I want the crafting table in the gui, I'm not adding custom recipes
@tired condor I checked the jd, seems that there is no method to play a durable sound based on the player location...
lol
I want it in the gui because I'm making a fakepixel server
Hello, I need help in the creation of my plugin, I do not know what is happening (photos):
I am Spanish, it is in case you do not understand something of what is in the photo
The only viable idea I thought of was to create several positions to put the sound and it would be like "speakers"
wrong way of doing it imo
Hey guys can someone explain how the f java calculates 132/6.6 to be 22?
yeah I think it is @hoary parcel
@tired condor play your sound with Float.MAX_VALUE volume
i playing
The accuracy of those depends on the OS as a whole
Some OSes also optimize the heck out of calls like getting the monotonic time
Linux >>>>>>>>
I know that tux was testing on freebsd, and the cost of a nanoTime call was literally fricking crazy
i used freeBSD
@proud furnace In the image that my problem sends sale, it would be very helpful to help me
@balmy sorrel you put a } line 40
I wanna say that in part it was more down to the fact that he was running it in a VM
But, god knows
cat
i could test it legitimately
i have GhostBSD as my desktop
without virtualization
LWJGL basically has its own thing which pulls the nanotime in a more efficent manner than having to ask the OS
I can see it being costly in the VM if time isn't passed through from the host to the VM
as well as it being not so accurate as well
XD
Nice
@balmy sorrel Btw your String texto isn't actually getting the string from the config
do you think i should return a Void CompletableFuture when a query has been finished?
or just not return anything at all
depends if you need the result
if you feel that you may have a reason to wanna pull a response from it, it's worth just giving it a response type
The text should be like this, but a friend told me to change it, what do I do?
I told my friend since it gave me an error if I put it like this
yey spanish variables
?
idk is that spanish or mexican
I don't really see the issue other then path might be the issue. What are you trying to do or what is the problem @balmy sorrel ?
config.getString("Config.mensaje-bienvenida-texto")
Instead of just the "Config...."
more optimal that way as it removes an unnecessary String object. But i am not entirely sure though what is being asked lol
π€·ββοΈ me neither
Guys he's beginning let's try not to lose him ^^
I am fine with that, Fendi is learning too π but without a proper question or clarification I can't really help
He's passing the path, not the value
uhm not really related to spigot but when you get the head of another player, does it auto update or no
like if i change my skin does the head update on the map?
i think the answer equals to no
dangit
Someone know a daily rewards plugin for 1.8 please ? (I tested Reward Pro but there are some lags)
Try getConfig().getString("Config.espanol-here") in the translateAlternateColorCodes call, @balmy sorrel
It won't update until the cache expires and re-updates or a plugin forces it to update @wind dock
Is it actually possible to put a transparent intelliJ background tho
uhhhh I dont get it
Until it decides to forget them, Geometry
Isn't it like 1 month
shorter time then that
nvm that's offlinePlayer
Thank you all very much, they have solved it for me, thank you seriouslyβ€οΈ
Well glad it was resolved even though I wasn't much help for that
@balmy sorrel do you want a very pro tip
Either Fendi will be complimented on this tip of theirs or everyone is going to smite Fendi for the tip XD
upgrade to IntelliJ whenever you have time
π
It doesn't really matter what IDE you use
Well... it just makes your life easier
I know lol, just like to always throw out there for the other ide's whenever one is recommended π
Sorry for bothering you, but what do I do now?
until theyve got the basics and intermediates well versed, there is no need for intellij
after that you can use plugin in your class, slayer
https://bukkit.gamepedia.com/Event_API_Reference#.40EventHandler
This is written very well
maybe they are referring to the import with the yellow triangle? In which case I think it is indicating the import is no longer being used o.O
to make a new instance of the class, you have to give it one of your main class. if you do that inside your main class, do new Entrar(this)
Also what Frostalf said; you can hover over and use the recommended fix (applies to most yellow lines, here it is delete the line)
eclipse isn't the only one that does it. It separates the imports that come from different places
Its easier to see where the imports are
intellij does the same but without an empty line :)
^ yeah
Yep
so, all the bukkit ones will be grouped together, the java ones will be grouped together, if there was another lib those will have their own group
I think you can change most of that stuff anyways in eclipse preferences
why are many java developers saying what lwjgl says about currentTimeMillis and nanoTime is false when i tell them i learned it from their wiki?
Are they wrong?
@frigid ember > http://wiki.lwjgl.org/wiki/LWJGL_Basics_4_(Timing).html
@frigid ember
you can enable empty line in IJ tho i believe
i automatically set to this
Which is why it doesn't really matter which ide you use
What are they telling you @frigid ember ? not sure who these other Java Developers are lol
I am pretty sure though I and few others have responded though in relation to your comment
@frigid ember What it's saying about currentTimeMillis is true
It clearly states that some implementations differ
Yep, that was covered earlier lol
it really indirectly refers to windows though, since windows is the one that implements currentTimeMillis differently XD
what would you recommend me to use in an async task for example
depends on how much accuracy you really need
i guess having a lot wonβt hurt as much
can someone explain what they mean by 1-50ms off
literally 1-50mS???
that much
nanoTime is already thread safe, currentTimeMillis() can get you the time in the past depending on what exactly you are doing since not all threads run at the same time or same order
like thats terrible ofc i want accuracy
Because Windows doesn't update currentTimeMillis every millisecond
depending on os ofc
yea
linux is about 1ms off
but if you are supporting multiple platforms(im not only talking games also spigot servers hosted on diff platforms)
some osβ being 50ms off
is terrible
Most of the case you're not 1ms accurated if you're talking about spigot plugins
imagine having an anticheat for example and it being 50ms off
depends if you care about being 50ms off or not
1 tick = 50ms
ik
In the better case
you can always use a delta
And it's 1-50ms, it's less than, or a tick
So you can't skip it, only if you decrease your TPS and base your check sync
assuming you are using the tick loop or not
create your own new thread, and the code in that new thread can run faster then the tick loop of the server
no
but again depends if you are using the tick loop or not. If you use the tick loop then yes it will run slower if there is TPS loss
otherwise if the thread isn't bound to the server loop then no
Yep that's what I was thinking
m8 you don't write checks you copy them from janitor, and janitor checks false themselves lmfao
Any good anticheat will have almost no dependency on System.currentTimeMillis() whatsoever
@gleaming helm can u just stfu and stop dude, you are annoying and just do something w your life, youβre so annoying dude
like stfu
every single day just sayin random sht
nocheatplus back in my day was amazing
mmm
it barely used any resources
Loool
NCP is garbage
lets go ton #general
its not a bad ac to learn from as a beginner, to learn the basics
Hey guys, if I get a name change can I opt in to remove previously known as?
I'm using a listener to make players drop their heads on death, but i think it's triggering twice and dropping two heads
thanks for contributing
Try debugging, make sure it's actually being fired first.
There is a Spigot for 1.8.8, but it's unsupported (no patches). I personally just use Paper though https://papermc.io/
softdepend is supposed to make your plugin load after the ones in the list right? Because it's not for me.
do i need to do that in my plugins folder or in my filemanager?