#help-archived
1 messages · Page 115 of 1
@naive goblet what do you mean?
@EventHandler
public void onGrabyPacket(PlayerJoinEvent event) throws InvocationTargetException {
Player player = event.getPlayer();
PlayerInfoData playerInfoData = new PlayerInfoData(WrappedGameProfile.fromPlayer(player), 0, EnumWrappers.NativeGameMode.fromBukkit(player.getGameMode()), WrappedChatComponent.fromText(player.getDisplayName() + "AAAAAA"));
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
PacketContainer packetContainer = protocolManager.createPacket(PacketType.Play.Server.PLAYER_INFO);
packetContainer.getModifier().writeDefaults();
packetContainer.getPlayerInfoDataLists().write(0, Collections.singletonList(playerInfoData));
for(Player players : plugin.getServer().getOnlinePlayers()) {
Error on this line protocolManager.sendServerPacket(players, packetContainer);
}
}
at me.slashthewarrior.project.events.PacketActions.onGrabyPacket(PacketActions.java:37) [SlashSkyknock-1.0-SNAPSHOT.jar:?]
Nonnull ItemMeta#getDisplayName
@naive goblet ah I was not aware of that. probably throws an exception if the displayname isn't set. Check with hasDisplayName()
Hmm iirc ItemStack#getItemMeta would return a new ItemMeta if its not air right?
@wheat summit which line is 37?
@naive goblet I haven't worked much with that api but it would make sense to me
I just need to know if air makes some rude exceptions because then it might be more worth throwing an ISE instead
protocolManager.sendServerPacket(players, packetContainer);
Player player = event.getPlayer();
PlayerInfoData playerInfoData = new PlayerInfoData(WrappedGameProfile.fromPlayer(player), 0, EnumWrappers.NativeGameMode.fromBukkit(player.getGameMode()), WrappedChatComponent.fromText(player.getDisplayName() + "AAAAAA"));
ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
PacketContainer packetContainer = protocolManager.createPacket(PacketType.Play.Server.PLAYER_INFO);
packetContainer.getModifier().writeDefaults();
packetContainer.getPlayerInfoDataLists().write(0, Collections.singletonList(playerInfoData));
for(Player players : plugin.getServer().getOnlinePlayers()) {
protocolManager.sendServerPacket(players, packetContainer);
}
@wheat summit makes sense that it's in the stacktrace since the packet is probably fired in sync
no, just that the stacktrace can be thought of as everything leading up to the problem. so because you sent the packet, the listener is called instantly so it's part of the stacktrace
not a problem
I'm guessing you need to change onPacketReceiving to onPacketSending but I'm not sure
@opal marsh Do you know where to get the yaw values for north/south/east/west?
I honestly cannot find anything on this online
you mean the unit circle?
@frigid ember 0 is south, 90 is west, 180 is north, -90 is east
Ok I'm getting the message packetsent now though I can't see my alt on either window but do commands like/tp
And skins reset to steves
@frigid ember or it could be 0-360 with 0 being south and 90 being west. I'm not sure. Pitch and yaw are funky
@wheat summit I don't understand what you're saying
So
No errors appeared
When I ran it in the onenable
It sent the message to console instead of an error
@opal marsh Thanks
Though also made other players invisible
skins resetting to steves would make sense because you're changing the player names
Oh, I thought it was just the display name we were changing
idk about invisibility though, that's some funky business
Yeah
are you setting the packet field "action" to 0 and "Number of players" to 1?
What?
if you don't set the "Number Of Players" integer, I suspect it could be defaulting to 0
in that case, it might be setting it automatically? double check by trying to write the int
the packet doesnt have an int field
Ok I'll do it in a few minutes
you guys need to be careful when looking at wiki.vg
it describes the wire format
not the format of the packet class mojang uses
which is what you want for protocollib
what seems missing is the action enum
what's the recommended way to get the packet class format? server mappings?
just look at the packet class
you dont care about the names, do you?
you care about the datatype
the names you get via wiki.vg
or you can just look at my mapping viewer
ah, I suppose
https://minidigger.github.io/MiniMappingViewer/#/mojang/server/1.15.2 -> searhc for PacketPlayOutPlayerInfo
ooh, nice
there you can see that the packet class only has two fields, the entries and the action
vue but not vuetify ;-;
its quasar
and yes, its super ugleh, the code is even worse, I was hella drunk
but it works
pretty cool stuff though
wait till I tell you that I have a spigot/paper fork where I use mojang mappings, so I can send packets directly, just by setting fields with nice names 😄
ooh, looks pretty but why not use a wrapper instead of a fork?
because this is sooooo much easier
I remapped everything to mojang names
dealing with "nms" (it isnt nms for me anymore, I have actual packages!) is so much nicer
Hey im using: https://api.spigotmc.org/legacy/update.php?resource=70157 to check for updates and this is returning 1 version behind what I posted today. Does it take a while to update? I posed the update 3hrs ago
See the cache headers
can i get a Player from a UUID?
Yes @frigid ember
how so?
Bukkit.getServer().getPlayer(Player'sUUID)
ah ok.
how do i create a thread on spigotmc?
@opal marsh So I'm trying to figure out how to orient which way an armorstand is actually looking
You said to teleport the armorstand with the pitch/yaw that you want
However, I don't see a teleport method that passes those arguments
This is the closest thing I found:
armStand.setRotation(arg0, arg1);
Is this what I'm looking for?
@opal marsh 270 would be west right?
Uhmm how to disable chat and tab between worlds by coding
Just guessing but I think you set rotation in the Location Object
@frigid ember the teleport method takes a Location as an argument. That Location object contains pitch and yaw data
how do you load a class in from another plugin
im looping through classes in each plugin in the server but java cant find the class becuz its not in my plugin
What are you trying to do @honest sun
You probably need to include the Plugin in your classpath or your dependencies for your build tool
i cant im looping through all plugins in the server and then looping their classes
try {
Class<?> clazz = // issue
if(!clazz.isAnnotationPresent(CommandCreation.class))
continue;
CommandCreation command = (CommandCreation) clazz.getAnnotation(CommandCreation.class);
System.out.println("HOLY FUCKING SHIT DUDE YOU FOUND A FUCKING COMMANDLOL LMAO NICE JOB MAN: " + command.name());
CommandImplementer.loadCommands(command, plugin);
} catch (Exception e) {
e.printStackTrace();
}
}```
this is what i have right now
well maybe change getClasses to return a list of classes
instead of just their names
well that just spits out an error in that method the issue is the classes cant load because they're from a different project
Have you already tried Class.forName
ya i said the issue is java cant load in a class thats not in their project
thats the problem
I'm only checking if the class exists in my plugin but I compile against the spigot API and when I run on Paper this Class.forName("com.destroystokyo.paper.VersionHistoryManager$VersionData") gives me the class not null
im checking for other plugins
Should work the same as long as you load after
Ok sorry for not being helpful
all good gamer
https://gyazo.com/e5278f01295be735771edd0d63da71f9 why is this only thing coming up from the enum?
can u show us your enum class
https://gyazo.com/78a1c309f7fab2091065eb0eea59e1c0 its obf because i am using an API from my own Plugin.
The private access modifiers means you can only access the method from within the class.
@frigid ember
Is there any obf that doesn't do that?
any multi-worlds plugin for 1.15?
multiverse works fine
oh wait there's a dev one?
if it doesn't work idk. Mv works fine for me
For younger people, is Minecraft a good place to start coding?
It will get them interested but IDK how well they will learn Java
the potions in world 1 stay in world 2
I think thats default behaviour
hmm
when you go to the nether you keep effects for example
can i change that?
Not sure, I would look through the multiverse configs and then look for another plugin if there is no option
I think you may need to use Multiverse-Inventories to do that
can i get the latest build
appreciate it
np
Does anyone know how to link players in different worlds
I have multiverse-core and I want to link the players in nether and the end for factions.
Wdym?
I want to make a placeholder (%server_online_<world>)
and I want to keep the nether, factions, and the end in one number
like 3 Players
for my scoreboard
u could use ''/mvtp ''ur world name'' ''
No, that’s not the issue.
Is there a way so I can invite you to my server
Can I share the IP for my server?
You want linked world player count
doesn't it count by default ?
No. I want to link the player count for all three worlds
Just get the server player count?
when it shows the amount of players, it will show the players in the factions world, nether world, and the end world because they are all considered factions.
hello! could someone please answer this?
is there anyway to use the same domain for your minecraft server and website?
like, if i want to connect it to my webhosting. i have to change the nameservers. and the nameservers are one cloudflare
where i have my minecraft connections etc
is there anyway i can make it the same domain for both?
yes u can. just add a sub domain to your server. for example “play.example.com”
the “play.” is the su domain
subdomain*
oh, so i can't like have "haflpace.net" on the server?
no i don’t think so
and how do i add the subdomain if the domain is connected to the webhost?
what website are u using for ur domain??
You can use MC and a site on the same domain? Just set up an A record
@quartz trench i know how to setup a record.
oh they are different machines
yeah
did you already try an SRV record to your mc server
oh right. i forgot i’m sorry
@quartz trench not the problem.
i can connect to the server, but idk how to connect the domain to the website, while also being availbe at the cloudflare
so the srv's can work
Hmm I haven't used cloudflare so I'm no use there
should i just buy another domain?, because i actually have no idea.
I don't see why a subdomain wouldn't work also tbh
I don't think you need to buy another domain
@quartz trench, sav.com for some reason doesn't have srv. and that's for the most part why i use cloudflare. lol.
idek why i bought a domain there, it was cheap.
yeah, i should try that.
to cloudflare or namecheap or something
i mean, i can transfer it to my hosting service?
if they have good DNS I don't see why not
where both the webhost and minecraft servers are hosted at.
just make sure they support whatever records you need to use
can someone also help with my problem lol
@arctic parcel, what's the problem?
@quartz trench, i work there.
so i'm pretty sure they have good support 😉
when it shows the amount of players, it will show the players in the factions world, nether world, and the end world because they are all considered factions.
@arctic parcel that's because they're in the same server. i think you can use per-world player-count or something
2 seconds
but i want to link all of the players
for example, if there is one player in factions world, one player in nether, and two in end
i want it to say 4 players
but keep in mind, i also have a creative world, skyblock world, and kitpvp world
@arctic parcel, why do you have everything in one server?
cuz bungeecord is too expensive
your server won't handle the players each and one will have.
@arctic parcel how much are you paying for your server right now?
yes it will. i have about 6 gigs of ram on it
about $12.00
yikes.
LOL
12$ for 6gb?
yeah i think
check dm's i don't wanna advertise here.
ok
so i tried the mv-inventories and changed the configs
but it still keeping the effects
Is there a way to hide timestamps from server configs? I use git to sync all my configs and those timestamps mess everything up
you mean logs?
need help pliz, my plugin works on my test server but not on my actual server
Server config with time stamps???
?
Not talking to you
If your talking about the file timestamps git should ignore those unless you have line endings that are different ie CRLF vs LF
if one machine is windows and one is linux
Bukkit.yml etc change all the time
It's kinda annoying
Server properties too, since it's backed by a hashmap
I gitignore and force add when I changed something
uh no
bukkit.yml definitely does not change
and server.properties will not change on recent java versions or where the java version is the same
I'm not saying anyone is wrong but on my server the last modified date for all those files changes each server restart
java 8
git does not track last modified date
yeah I know
then whats the issue?
nothing, I just thought you said the files don't change
well the file is still bit for bit identical
Maybe that changed recently, I haven't touched that recently
But that's what I remember
Good to hear that that seems to be changed
Ive never seen a config with timestamps tbh
I mean server.properties for example. spigot.yml is another example. There are commented timestamps in the beginning of that files
I have paper 1.12, not the latest
pinging md while using paper
It was automatic reply, sry
spigot.yml is a part of spigot as I can tell from the name
Woah
I need help !
pliz
with my plugin. It only works on my test server and not on my official server
that gives literally no information about what's going on. Are they running the same version? do they all have the same plugins? what about configuration?
have you checked logs to see exactly what's happening on your main server?
this works on my test server but not on my main server
and there are no errors
just the gui doesn't open
so if it works on your test server, then it's probably not your code.
start looking at what's different on your main server, and see if you're missing something important
not your code
server config, plugins, etc
also with your code, dont use nested if loops my man
//dont do this
if(a) {
if(b) {
thing();
}
}
//do this
if(a && b) {
thing();
}
correction: if is a not a loop
?
so how can i fix that ?
thats not whats causing your issue, just a programming tip to make your code cleaner
does ur test server has another api?
it's the same plugins i think
hm
yeah, no errors
does it successfully enable?
can you even do Eager operation on Java boolean?
i check @knotty karma
i dont think so... not sure tho
no, they aren't any errors
you still havent checked your environment
99% chance this isnt your code, its your environment
how do i check it ?
figure out what is different between your test server and main server. try loading it on a new server, see if that works
ok
if it works in one place, but not elsewhere, figure out what's different. then, remove the differences until you figure out what was causing it not to work
ikr
the problem is that i have other gui's which open without any troubles
apply DRY principles and you may figure out the issue
anyways, i would like some multithreading advice
so i have a custom generator, inside of which i need to change biomes. The biome change is calculated independently of everything else in the generator, and nothing is dependent upon its result
fail to bind to port...
you already have a server running on whatever port you assigned
i know...
anyways, i profiled my plugin and the biome change takes a lot of CPU time. Should i put it in its own thread so it runs asynchronously? I'm worried about the amount of threads that would be spawned, since it'd be one per chunk generated
well, it would be nice if you provide profiling data
wait.... so which part take time?
so in my chunk generator, getting/setting biomes takes 80% of the time, and actually generating the chunk takes 20%
yea, but what does it do in that 80%?
how much time it took to calculate noise / to set chunk itself
the 80% isnt even the noise/setting the biome, it's NMS retrieving biomes. 1 sec ima screencap my flame graph
so, if i stuck it in a thread, would that method even be run asynchronously?
Don't quote me on that, but I think nms loading stuff aren't thread safe
if I remembered correctly, it also do IO operations if those area aren't loaded etc
I think I remember a patch for that
well it works just fine on another server
so then find out what's causing it to stop working on your main server
how ?
bruh
were opening the main in 2 hours
look at what is different between your test server, the one you just set up, and main
figure out the differences, remove them one at a time, test, repeat
ok
this is like troubleshooting basics here
i don't know how to do it
another method that might work better depending on your situation, is if you have time, build a new main server, by adding things to the one you just set up until it breaks
copy/paste the world folders
How do you even run a server?...
Rsync > sftp
how can i download mcmmo
from their website
woah
Is it possible to add more / less hearts with Spigot api ?
im looking for a plugin that control potions/effects
@hoary parcel why rsync?
Hello all, I am using Message Announcer.
I was wondering how to I create a clickable link inside of a message?
Because rsync is superior for syncing worlds
Sync worlds?! O_O
Can anyone help me?
If there is no indication on the page of the plugin, then you can't do it
boolean generateDecorations = true;
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
//generate stuff
//calculate some conditions
generateDecorations = areConditionsMet;
}
@Override
public boolean shouldGenerateDecorations() {
return generateDecorations;
}```
how terrible of an idea is this
i have a hunch that it's pretty terrible and not something that I should do
would it even work?
i'd assume those are all fetched and stored on enable and not per-chunk
(by "those" i mean shouldGenerateDecorations() etc)
That will not likely not work
I don't think they are stored, but I don't think you can rely on order
Since chunk gen goes thru stages
yeah that was another concern
ugh i wish that the chunk coords were passed into that method
Hey guys, to save the cache from my server to my database I do this :
public void updateBdd() {
try {
int size = Main.playerPoints.size();
if(size == 0)
return;
this.query.createStatement().execute("DELETE FROM players");
StringBuilder sb = new StringBuilder();
int i = 0;
for(String keySet : Main.playerPoints.keySet()) {
Integer points = Main.playerPoints.get(keySet);
if(i == size - 1) {
sb.append("("+keySet+",'"+points+"')");
break;
}
sb.append("("+keySet+","+points+"),");
i++;
}
String sql = sb.toString();
System.out.println(sql);
this.query.createStatement().execute("INSERT IGNORE INTO players(uuid, vip_points) VALUES " + sql + ";");
} catch (SQLException e) {
e.printStackTrace();
}
}
is there something better?
I'm not very convinced that doing a : this.query.createStatement().execute("DELETE FROM players"); is a good idea
how can i fix it?
if (args[1].equalsIgnoreCase("SetCrateParticlesMod")) {
if (args[2]=="true") {
plugin.getConfig().set("hubParticlesEnabled", "true");
sender.sendMessage(toColor("&aThe particles been enabled"));
} else if (args[2]=="false") {
plugin.getConfig().set("hubParticlesEnabled", "false");
sender.sendMessage(toColor("&cThe particles been disabled"));
} else sender.sendMessage("non option");
}
allways it type non option
Is your 3rd argument null?
Never use == with Strings but equals() or related methods
are there a plugin for item display on chat but bungee version?
Didn't know any sorry
wdym Rolyn?
Someone knows if Faction has an event fired when the player switch faction when he moves?
@limber summit Call this method "Async" so it won't freeze the server
You can use Bukkit#runTaskAsync or something similar
well databases shouldn't always been used async
in some cases i've needed to use them on the main thread
Yeah for sure, but if you only need to save a cache it could be better using parallel
When a player connects to a seperate server through bungeecord, is it then the server that maintains the connection or bungeecord?
the bungee gets your connection and route it to the server
Bungee is a reverse proxy
how do u move to another server host provider?
should i just copy and paste all the fyp files
yeah, that's how it goes
teleport
elaborate on why it doesn't work
oh so on playermoveevent
well
edit from or to
pretty sure those mutable as well
edit the internals?
lastloc
and loc
the nms code
( Attention , informations non sur à 100 %) Mauvaise nouvelle pour aujourd'hui, en effet un événement de cyberattaque va avoir lieu sur toutes les plateformes de réseaux sociaux , y compris Discord . Certaines personnes vont essayer de vous envoyer des images extrêmement gores , des insultes racistes/pornographiques et il y aura bien évidemment des gens qui en auront après votre IP . Je vous conseille à tous de n'accepter personne en ami ( sauf si c'est une personne que vous connaissez ) . Merci de passer ce message sur tous les serveurs que vous administrez . Je vous souhaite à tous de la sécurité . Pensez à vous mettre en invisible/déconnecté aujourd'hui , ce qui vous fera réduire la chance de vous faire harceler par ces gens . Même si les informations ici ne sont pas 100% sures , merci de rester prudent pour le bien de tous .
now im not french but let me guess
some random mf pasted that in a discord; saying YOUR going to be hacked!"!!!111!!1!1
ah the DISCORD attack
I'm sorry, but if you add someone you don't know and willingly click on a dodgy link, it's survival of the fittest xD
oh no they got my ip
and there is no group at all
with the abilities to target all social media platforms
if you mean scraping well tracr.co is a nice site
well
clicking a site can get your ip
it doesn't matter which platform it will be
just don't click them
cyberattack
not phising or whatever its called
what if you take the vector calculations on your own to prevent them mendling with it? 🤔
Hello, I have essentials, CrazyAuctions. But isn't the same money, how can I make an good economy and the same on all the plugin?
I already have vault :/
hi
Henlo
i'm having an issue with a plugin of mine that was made for bungeecord
is there a way to force my plugin to load after a certain one
i have depend: [LuckPerms] in my yml file
but i get this issue from an image i can't send: https://pic.wtf/u/PMUbLwDiq8.png
there is : load-before
hello, what are the forums where you can post an update of your plugin
for example if I want to tel people I updated where could that be
on the forums
hello, what are the forums where you can post an update of your plugin
for example if I want to tel people I updated where could that be
on the forums
@fair musk You can click on "Post Resource Update" when you are viewing your own plugin
And then everyone following it will receive a notification
Alright thanks!
Someone has a good message announcer plugin please (don't tell me Message Announcer plugin because it deletes my config)
I am about to begin developing my first plugin and whilst following the tutorial, am i right in thinking I am required to download this .jar?
no
if you downloading stuff and importing manually you already doing something wrong
you should import dependency from maven\gradle
don't follow that
In the past I had been using maven but that was many years ago
NetBeans has full support for maven \ gradle so I don't see why you wouldn't use them
was just looking for an up to date tutorial
well you're not going to find many "up to date" tutorials with NetBeans IDE
although the process is very similar on IntelliJ as well
so you could just kinda follow those
Does IntelliJ follow the maven route?
IntelliJ can use maven and gradle as well
and has super cool plugins
that automatically setup your plugin maven config for you
would you recommend intellij over eclipse?
yes
i mean you could just try them all
but im pretty sure you would like IntelliJ the most after having tried them all
Thanks, I'll give it a go with IntelliJ. I've not developed in java in quite a while
oh god
Nice code dkl
He must be
DKLMapper your trying to set items in a non existing slot
the stacktrace is pretty clear
Dkl I’d highly recommend something like mfs when making guis or so
It can be a relief to work with
🤦 .
Saw that too
@frigid ember
https://mf.mattstudios.me/ this might help but there is plenty of other options as well
one
and make a for loop
so its less repetitive
as there is no pattern in these numbers ofc
oh boy lol
he wrote it 50 times
oh boy
this mans be doing a yanderedev
So i'm writing a command that'll put a potion into an inventory, and getting this error; Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_15_R1.inventory.CraftMetaItem cannot be cast to org.bukkit.inventory.meta.PotionMeta
I'm casting the item's ItemMeta to PotionMeta, editing that, and then doing setItemMeta(potionmeta); how am I supposed to do it?
well the item meta clearly isn't an instanceof PotionMeta
so check your item before doing the cast i guess
Oh I should probably make a new ItemMeta for that since its using one from a previous item
I think it copies by default?
@acoustic temple check what CraftMetaItem inherits bro
getItemMeta() stupidly makes a copy of the meta
You have to set it again with setItemMeta() if you want it to update
mhm, thats what ive been doing
Spodo what are you specifically trying to accomplish
i think what i'm doing wrong is
im making a GUI with a bunch of items, one item object specifically
the item object started as something other than a potion, so the meta object wasnt an instanceof potionmeta
How to make a sound code in config with boolean?
Example:
Had-Sound:
Enable: true - if true it will make a sound, if false, it will not make a sound!
Sound: 'ENTITY_EXPERIENCE_ORB_PICKUP'
How can I do it?
Make a potionbuilder
que?
@vestal jewel java if (boolean) { //do stuff }
Spoda yeah ?
I can send some pseudo code if you’d like
that'd be a big help
i'm new to spigot so i'm kinda just figuring stuff out as i go
can send?
Deived you can get a bool value by FileConfiguration#getBoolean(path)
@naive goblet how ?, '-' i am still learning java
Does anyone know if it is possible to show stuff from GitHub in minecraft using spigot?
I want to create a GUI that shows all commits, and would know how to make a GUI but I dont know how I would get those commits
Yep obvisouly
Use GitHub's RESTful API.
It's pretty well documented. I'm not sure if it contains commits
Worth looking into it though
Thanks, Ill look into it!
@acoustic temple
class PotionCreator implements Supplier<ItemStack> {
List<Consumer<PotionMeta>> list;
public PotionCreator() {
list = new LinkedList<>();
}
private void withMeta(Consumer<PotionMeta> meta) {
list.add(meta);
}
public PotionBuilder setType(PotionEffectType type) {
withMeta(meta -> meta.setMainEffect(type));
return this;
}
@Override public ItemStack get() {
ItemStack item = new ItemStack(Material.POTION);
PotionMeta meta = (PotionMeta) item.getItemMeta();
list.forEach(consumer -> consumer.accept(meta));
item.setItemMeta(meta);
return item;
}
}``` might miss some stuff but it was on phone
oh, thank you so much!
@vestal jewel FileConfiguration#getBoolean() and
FileConfiguration#getString() then Sound#valueOf(String#toUpperCase)
'='
Type#method
Since I don’t know where you get your types I can’t write something in your case
Why can't I post on instagram?
can he not
lol
Hey
if he knows no other community
is ok
So i have a few questions
ok
How important is a dedicated gpu for a modded server
to run a modded server
0
okay
also this isn't sponge support
you should ask them if you plan to run server with mods
spigot doesn't do forge mods )=
is there a difference when using ecc memory
okay
whats more important
clocks or cores
and is setting java params important
OpenJ9 vs HotSpot vm
single-core performance is very important for minecraft
I use OpenJ9 and I've heard it's more efficient on memory and slightly better for cpu
Hey, does any of you fine folks know what I'm doing wrong here?
https://paste.helpch.at/ofamehipuz
I'm trying to hide players from the tab list without hiding the actual player entity :)
Hello,
I got to a bit of a problem today. I will need an offline player database that will store name : uuid i will handle that with mongo, but then i have problems of multiple uuids having the same name since there is some illegals account that have different uuid but same name does anyone have idea how it would be best to handle this kind of accounts? I will be updating the name to the latest one on every join. But i am unsure how to handle another thing where if i change name on my main account to something else and then i don't login to server so the name wont update, and on my alt account i change it to MrWolfeh and join the server it will most likely generate an error?
Well use the UUID as primary key
and unique
simply don't base your code/db on the player usernames
tell me morw about openj9
It has been developed by eclipse team and it's still 🤷♂️
is it better on performance or not
I need an offline player database so i cant use the uuid
what are pros and cons
@brave gulch pretty sure you can?
Last I checked I don’t think UUIDs changed when the name changed, even for offline
Uuids are unique
Since i have servers that start by themselves and they always regenerate to template i don't have the user cache available and im not sure the OfflinePlayer works without that or i am wrong?
OfflinePlayer works with uuids
OfflinePlayer simply contacts mojang API
i don't see why you'd need a player cache honestly
If cache isn't found
NoSQL ☹️
😦
mongo is nice
Can't find it anyone know what people use for bungeecord to add commands like /survival /creative /hub /kitpvp ect to take you to that server?
Aliases plugin
Anyone know a good free plugin for money vouchers? for 1.15.2
@ionic hound can you look up “Money vouchers 1.15” for me and tell me what you see
Don't use mongo for a cache. If you want a cache, use redis
The reason you'd want a cache is because the mojang API is rate limited to 600 requests per 10 minutes
i made a thread, if u wanna help, go to this link: https://www.spigotmc.org/threads/how-do-i-link-my-player-count-with-different-worlds.443614
Maybe just don’t have an offline server
Almost as if mojang solved this problem for you
I have an online mode server and still need a cache for UUID lookups
There are perfectly valid reasons to want to look up a UUID or player name
How would i make a variable uniqe to every player?
Learn java.
ok
@gleaming helm are you looking up players that have already join?
I’m pretty sure they’re auto cached
Both players who have joined and have not joined.
Using the filesystem cache does not work for my use case for two reasons
Yeah redis is smart thanks 😄
- I'm sharding, so not all the servers share the same filesystem.
- If a player changes their name, I want it to update immediately.
That’s one a second are you really going to need to lookup a player a second
Not the next time they join
@torpid field you want to keep track of every player online?
I'm caching for a period of a few minutes
So if they change their name it'll change on the network in less than 10 minutes guaranteed.
@naive goblet no more like a variable like a players money or kills
Well if you want a unique player variable you may use their uuid
explain more my buddy
You can use a map to map player uuids to your variable
I think that's what you're asking
Depends
If you want to save it I believe bukkit has a serializer for saving a map collection to yaml but I'm not really sure (I refuse to store any data in yaml files)
lerdyr if I am right you want to store custom stats for each player ?
yes
store each player with a file named after their uuid
to explain more i want to add another currency
ah
so like normal money and coins
But whouldnt having many files of players uuid and an int coins be a waste of space?
Certainly
You could store it with a database if you want but it requires knowledge about some basic java
right now i am just making plugins on a local server so getting a database would require money to be spend on a host right?
or i could just make one file with all the players uuid and coins right?
I mean not neccesarily
1 file is kind of oof
But I mean if you want sure
Wouldn't recommend it though
what do you mean by oof
First of all maintaining the file with all player uuids
All I can tell is that after a while that file will be pretty nasty
Is a hashmap a good idea?
hmm
sure
Obviously a database is better but choosing between single flatfile for storage per player vs per player flatfile then per player flatfile is better
ok so ill just need to make a folder and make the player data inside that folder right?
yeah it's smart to make a directory for it
there is a player.uuid method right?
Player#getUniqueId()
ok ty for taking the time to answer my probably pretty stupid questions :)
np just ask more if needed
Does spigot provide builds before the official release?
Does SQLITE have a number cap?
I get "Couldn't execute MySQL statement:
java.sql.SQLException: ResultSet closed"
By number cap do you mean a limit on the number of records it can retrieve in one query?
I mean it looks like it's an overflow error
But it seems far too small of a number for that
So you mean the number of bytes that can be allocated to a numeric field?
Perhaps
what version are you using?
Of?
sqlite
how can i check
well that does look like an over flow; it does appear that sqlite is limited to 8 bytes, but I would expect a larger number in that case.
"Eight bytes contain 64 bits of information, so you can store 2^64 ~ 10^20 unique items using those bits."
wait
Yes the number is definitely too small
#general
@frigid ember we already told you
something's wrong here
It's just a message, it's a mistake
I'm learnt it online
and they must have copied the messages from another of their projects
...
2 people literally told you
read the whole conversation
@remote socket it's kinda too small for humans to read
Why aren't you using maven to include your dependencies?
I am
not to mention Spigot already provides SQLIte drivers
learn how to use maven for god's sake
@sturdy oar Dont be so rude, I know how to use maven
then why the hell you're using system dependencies
for something that is already present at runtime
Can't remember
then why do you have those jars in a dependencies folder?
What does that have to do with sqlite?
I don't remember why its there
best domain for dependency
But there was a reason
Songoda does have repos, on Gitlab
Hrm, pretty sure I was able to do something with their SkyBlock plugin when I was trying to trouble shoot my Scoreboard plugin.
Been a while though since I did that.
songoda jesus dude
high quality software
I'm new to plugin development, why's everyone hate them
it's a long story, i don't want to explain it again
there's not bot command to explain it? 😛
long story short their code is kinda scammy for what you're paying for
I've never heard of this 👀
just the fact that the user is banned should be enough
oh damn
long story short their code is kinda scammy for what you're paying for
It's all open source, so you can just compile it free 🤷♂️
I think I looked at their plugins a while ago and they had nice artwork but I had no idea they were banned
just the fact that the user is banned should be enough
"The User"? Isn't it several people
I don't want to bring this story up again, however with 'the user' i refer to the creator of the website.
Ah okay
you can just look up all conspiracies and not funny things she had done yourself
sports
rotanosrepmi
So they breadcrumb charges for their plugins?
idnef
DLC in DLC?
So you're a repoorter?
isnt that like ksi but glasses
?
pls help anyone know why my server crashes with this [Netty Epoll Server IO #2/WARN]: io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer
Would anyone happen to know how I would hide players only from the tablist, without completely preventing clients from rendering them? This is my code
this.protocolManager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Server.PLAYER_INFO) {
@Override
public void onPacketSending(PacketEvent event) {
if(event.getPacket().getPlayerInfoAction().read(0) == PlayerInfoAction.ADD_PLAYER) {
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
List<PlayerInfoData> playerInfoDataList = new ArrayList<PlayerInfoData>();
for(PlayerInfoData data : event.getPacket().getPlayerInfoDataLists().read(0)) {
if(data == null || data.getProfile() == null) {
playerInfoDataList.add(data);
continue;
}
WrappedGameProfile profile = data.getProfile();
playerInfoDataList.add(new PlayerInfoData(profile, data.getPing(), data.getGameMode(), data.getDisplayName()));
}
packet.getPlayerInfoAction().write(0, PlayerInfoAction.REMOVE_PLAYER);
packet.getPlayerInfoDataLists().write(0, playerInfoDataList);
for(Player p : Bukkit.getServer().getOnlinePlayers()) {
try {
ProtocolLibrary.getProtocolManager().sendServerPacket(p, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
});
Hi One question is there a good way to access a file from one plugin in another plugin?
So like you have Plugin a which creates a file and plugin b should be able to access it
Just get the datafolder, go one folder up, get the other plugins datafolder, get file
I did that but if Plugin a changes a value in the file plugin b still outputs the old value ...
You need to refetch the values, or watch the files for changes
How
But why would you need that
Cause I want a modular system
Eh, that doesnt make much sense
Why
Its better to just broadcast the new values in code
Just hook into your “other plugin”
Let that other plugin call update methods
How would you do that?
pls help anyone know why my server crashes with this [Netty Epoll Server IO #2/WARN]: io.netty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer
Does it show you that error in console or when you try to log on?
Or I could do it differently
I have the problem that my plugin stops all tasks that are being run by it when a certain action happens cause I dont know how to do that otherwise
Who
How much time are you in java?
Okay I think you are able to make it
Nice
Maybe it's time to do so?
What do you need?
@pastel arrow maybe ping green person (staff) but k don't recommend it, you can try
hey is there a way to make items not stackable, someone said making them unbreakable but that didnt work
I think you could give them a weird enchantment which could make them apart from the rest, and then hide flags
But i dont think you can prevent stacking of exactly the same types
Can you somehow set the id of a repeating task?
Why would you need the id?
Can someone help me how to play the block shuffle like where to put the files so on?
Is it possible to have a crafting table without opening it for a player?
InventoryView inv = p.openWorkbench(p.getLocation(), true);
I have this, but I don't want it to open
Alright guys, so I have this now But the item in slot 0 should be set to a diamond block
@tiny dagger oops sorry I forgot to post the code
private HashMap<Player, InventoryView> crafting = new HashMap<>();
@Override
public void onCommand(Player p, String[] args) {
Inventory in = Bukkit.createInventory(p, 54);
InventoryView inv = p.openWorkbench(p.getLocation(), true);
p.openInventory(in);
//inv.setItem(0, new ItemBuilder(Material.DIRT).setName("HI").build());
new BukkitRunnable() {
@Override
public void run() {
in.setItem(0, inv.getItem(0));
}
}.runTaskTimer(main, 20L, 20L);
crafting.put(p, inv);
}
@Override
public List<String> onTabComplete(Player p, String[] args) {
return null;
}
@EventHandler
public void onClick(InventoryClickEvent e) {
Player p = (Player) e.getWhoClicked();
p.sendMessage("CLICKED");
if (crafting.get(p) == null) {
p.sendMessage("null craft view");
return;
}
InventoryView view = crafting.get(p);
if (e.getSlot() <= 9) {
view.setItem(e.getSlot(), e.getCurrentItem());
e.setCancelled(true);
}
}
I'm trying to get the result from the workbench
are any spigot devs on this server?
ok, in that case
I think there is a bug in spigot, but I don't know enough about it to file it on JIRA
so, here's as much info as I can provide, https://github.com/Multiverse/Multiverse-Core/issues/2276
hopefully one of them sees
Could you make a summary of it here
he meant for md5
👌
Is there an event to detect when farmland degrades into dirt?
Neither MoistureChangeEvent nor BlockFadeEvent are triggered for this
Oops I had a mistake in my code, BlockFadeEvent is called for farmland degrading into dirt and the moisture event is triggered for all degredations before then.
Hm?
hey is there a way to check in which inventory the player put the item? i want to prevent players from putting items with lore in craftable inventories which includes the player 2x2 interface, so i cant just check which inventory is currently open because that would disallow the player from moving the item in their normal inventory
iirc that 2x2 is a part of the players default inventory
Maybe you could check what slot they moved it to? Idk if the 2x2 registers as a specific slot number, but I bet it probably does
You could probably debug which slot with the drag event or click event
but like the inventory click event only gives of the slot the item was originally clicked in
so it could be dragged into the crafting inventory but not taken out
e.getSlotType() would be the slot where the item initially was clicked wouldnt it
hm.. lemme think about it for a minute
it doesnt say in the docs
What about trying a CraftItemEvent? (Not sure if a different event would be more appropriate) but check the recipe items for lore? And cancel the crafting if so
Or does that not really fulfill what you're trying to do
could i technically use getInventorySlots() from drag event and look if it contains the slots of the craft interface
I have no idea homie, I haven't really worked on anything with the crafting items in a hot minute
Worth a shot maybe? lol
ill try it
If there is anyone good with the citizens plugin please contact me ASAP! Thanks in advance.
How do i download mc mmo
ok so this is kinda strange, getinventoryslots outputs 1, 2, 3,4 if i put the item in the craft interface but also if i put it in the usual 1, 2, 3, 4 slots
@hard crane it must be a different inventory owner or type then. something has to be differentiating those two.
Somebody can help me?, I need change my resource to premium.
Yeah, you do it just like that
So like for UUID:
That would be 2 spaces out further on the next line, than hello: is
@uneven dove You gotta delete the resource and reupload it. Needs to be approved by Resource staff
How delete the resource?
I don't think you can delete it by completely by yourself. I think you need to use the report button on the bottom of your plugin's page and ask for it to be deleted
You could upload an empty jar file though, and delete the previous version, under the "version history" tab
Yes, report your resource with "please delete".
Where is the option to report?
bottom left of the description
done
❤️
thats some super speed Weaves 😮
lol
web is down ? or is my connection?
same with me
It happens once in a while
Its happened to me a handful of times in the past couple months
ok so i did it with the drag event and i check if the inv is crafting and the raw slots are 1 2 3 or 4
and sometimes it works but sometimes it just doesnt
no errors nothing
event just doesnt trigger for some reason or smth
Thats weird
Good on you for check rawSlots though, I forgot about that for a minute lol
tbh no
Is there any difference? Between when it works and doesnt work?
Different item stack, size, etc?
no exact same item
Different slot that its moving to?
@golden vault i added my resource 🤭
if i try putting it in the same crafting slot again after its been cancelled i can do it
and then i can move it everywhere
and then it doesnt work at all for some time
but resumes afterwards
if it helps heres the code
@EventHandler
public void onDrag(InventoryDragEvent e){
Player player = (Player) e.getWhoClicked();
if(e.getInventory().getType().equals(InventoryType.CRAFTING)) {
Set<Integer> slots = e.getRawSlots();
System.out.println(slots);
if(slots.contains(1) || slots.contains(2) || slots.contains(3) || slots.contains(4)){
e.setCancelled(true);
player.sendMessage(Lang.CANT_PUT_IN_INV.get(player));
}
}
}```
try with InventoryClickEvent
inventory click event only gives the original slot of the item not where it was moved to
so if i cancel it in inventorytype crafting the player wouldnt be able to move the item anywhere
I have this, but for some reason it tdoesnt work if I place the item down
@EventHandler
public void onClick(InventoryClickEvent e) {
Player p = (Player) e.getWhoClicked();
Inventory inv = e.getInventory();
Inventory clicked = e.getClickedInventory();
if (clicked == null) return;
InventoryView view = crafting.get(p);
if (view == null) {
return;
}
for (int i = 1; i <= craftingSlots.length; i++) {
view.setItem(i, inv.getItem(craftingSlots[i - 1]));
}
inv.setItem(23, view.getItem(0));
}
And for some reason the slot 0 is being set to air
use InventoryAction to check if you are taking an item from those slots
what do the villagers-work-immunity-after/for options mean
@hard crane Why are you checking InventoryType.CRAFTING
Wouldnt it make more sense to check InventoryType.PLAYER
If youre looking for the 2x2
Is there a more efficient way to affect loot tables/drop rates than just listeners?
Not that I know of
I would imagine that you could do it with NMS, but personally I wouldn't go down that route there is substantial benefit. which idk if there is
What's NMS?
acronym for net.minecraft.server
ahh
Downside of using NMS is plugins break when a new MC version comes out.
Is there a more efficient way to affect loot tables/drop rates than just listeners?
@acoustic temple ?xy
?xy
Asking about your attempted solution rather than your actual problem
Oh, sorry
What I'm going for is I want to slightly bump the drop rate of apples & flint, and make it so that apples drop from any type of leaves
BlockBreakEvent --> random --> drop
Aight, that's what I thought
Just wanted to check if there was any special way of messing with that stuff
Thank you though!
Best way to create nms entity in versions (1.12 - 1.15) ?
I was able to spawn her but I can't edit her pathfinder
or, is there any way to get the path that would use an entity from point X to point Y?
md5, did you see my messages above?
Does anyone know how to add acceleration to vectors?
For example, I want an entities speed when given a vector to speed up slower, not just "explode" forward as it currently does.
I've thought of making very small increases to the velocity at the start, something like
stand.setVelocity(stand.getVelocity().multiply(1.5));
//etc
yo
y'all know how to fix this?
Hey guys, for some reason It sets the 0 slot to the result
Player p = (Player) e.getWhoClicked();
Inventory inv = e.getInventory();
Inventory clicked = e.getClickedInventory();
if (clicked == null || inv == null) return;
if (clicked.equals(inv)) {
p.sendMessage("clicked inventory");
if (!Util.contains(craftingSlots, e.getSlot())) {
e.setCancelled(true);
p.sendMessage("contains slot");
}
else {
e.setCancelled(false);
}
}
InventoryView view = crafting.get(p);
if (view == null) {
p.sendMessage("null view");
return;
}
//For some reason it's messed up if I set it right away
new BukkitRunnable() {
@Override
public void run() {
for (int i = 1; i <= craftingSlots.length; i++) {
view.setItem(i, inv.getItem(craftingSlots[i - 1]));
}
inv.setItem(23, view.getItem(0));
new BukkitRunnable() {
@Override
public void run() {
inv.setItem(0, new ItemBuilder(Material.STAINED_GLASS_PANE, 15).setName(" ").build());
}
}.runTaskLater(main, 2L);
}
}.runTaskLater(main, 2L);
}
@frigid ember inv.setItem(0, new ItemBuilder(Material.STAINED_GLASS_PANE, 15).setName(" ").build());
try put a debug
what would I debug exactly?
I have open a workbench at the same time so I think when i set the items in the workbench its setting slot 0 to the result, but I don't know how to fix that
put a message to see if that line is executed
Yeah it executes
uhm
I see it flicker black then turn back into diamons
I don't know, the only thing I see in your code that can be changed is
This:
for (int i = 1; i <= craftingSlots.length; i++) {
view.setItem(i, inv.getItem(craftingSlots[i - 1]));
}
To:
for (int i = 0; i < craftingSlots.length; i++) {
view.setItem(i+1, inv.getItem(craftingSlots[i]));
}
2 times are diamonds generated?
wdym
Guys
I need help with world guard.
I enabled warp signs in Essentials and when I make them in worldguard regions, nothing happens when you right click them.
I enabled flags use and interact and it still doesn't work.
I'm also OP'ed and have the * perm, so I have no idea why it doesn't work.
Is the problem only occurring in the worldguard region? Did you check to see if the same sign works outside the wg region?
The sign works outside of the worldguard region
I've tried every single thread online
Long thread but the guy having the same issue it seems found his answer
Nothing works
idrk what to tell you then. if you went through every thread you could find from google, enabled the right wg flags, and gave yourself the right permission
no idea :/ sorry
@uneven dove its executing
Anyone good with multi-dimensional hashmaps? lol
is there any way i can get a knockback 1000 stick?
^ that would crash your server
/give <playername> minecraft:stick 1 0 {ench:[{id:19,lvl:1000}]}
For 1.8 at least, not sure what it is in 1.9+
Is this also where I can ask development questions?
Well I'll ask anyways ;p
If a Minecart is not being pushed by Water due to a modification of a Minecart, how would I fix that? Do I need to make the water realize that it's an Entity and should be pushed or make the modified Minecart get pushed by the water?
Alright better question. Where is the Water Physic Logic for Minecarts?
Can I force update a chest inventory?
@pastel arrow I mean a custom inventory using Bukkit.createInventory, but however I have this issue now
java.lang.ClassCastException: org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCustom cannot be cast to org.bukkit.inventory.CraftingInventory
Inventory inv = Bukkit.createInventory(null, InventoryType.WORKBENCH);
crafting.put(p, inv);
CraftingInventory inventory = (CraftingInventory) view; //error here, where view is crafting.get(p)
Hey guys, does anybody know how to change player's block collision to one block height?
To make him crawl?
yup
@frigid ember that's fixed in later versions
should I just file my issue on JIRA anyways? even though I don't know much about it?
md_5 fork minecraft dungeons code LOL, learn cpp and fork it, idk what lang they used for netcode but probs cpp as ue4 is the game engine
yes you can make an issue on jira if there are steps to reproduce it
can you make the issue happen repeatedly?