#help-development
1 messages Β· Page 478 of 1
but the files are right
Send the jar here
The jar on your server does NOT contain the plugin.yml you are showing us
Use String instead of Object and String.equal()
thanks
the jar has plugin.yml
wdym
it might not be able to do that while the server is running
showing this for the record
it might take like 30 seconds
don't switch off
I hate how it worked
ok problem solved
somehow
thank u
and thanks for being patient
** dies **
is not worked
Show your updated code
Yo, quick question. I have a plugin with generators. Basically, it saves their generators to a file, loads on join, and unloads on leave. The problem is if a player spam joins the server the file bugs, and ends up deleting all their stuff. How would i fix this?
Im making a tabCompleter how would i make it so that there are multiple different things for each of the different spaces
check args.length()
your code doesn't work. The design does.
The magic 8-ball says "you messed up"
We all gods here
but my String[] keeps something from one before
?
you shoudl be returning a List
and args[] will contain what you have typed
eg```java
List<String> result = new ArrayList<>();
/*
* Return a TabComplete for users.
*/
switch (args.length) {
case 0:
break;
case 1:
result = tabCompleteUsers(args[0]);
break;
default:
result = getPermissionNodes(args[args.length - 1]);
break;
}
return result;```
Is
Smile around
I'm having a bit of an issue with this GUI implementation
If I have a clickable item that's supposed to open a new gui
Kind of
But I also want to be able to use escape to go back
There's a conflict
And it takes you back every time
@Override
public void onClose(InventoryCloseEvent event) {
super.onClose(event);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
plugin.guiManager.openGUI(new MainMenuInventory(ultraChest), (Player) event.getPlayer());
}, 1L);
}
Inside InventoryButton
Bukkit.getScheduler().runTaskLater(plugin, () -> {
plugin.guiManager.openGUI(new MembersUpgradeInventory(ultraChest), player);
}, 1L);
I want the inventoryButton to refresh the current inventory
I guess I could call decorate again instead of opening the same GUI again, right?
Yeah both should work. But clear the inv before decorating again.
Oh ok
Also... uhhh
Caused by: java.lang.IllegalArgumentException: Specified class does not exist ('me.tomisanhues2.ultrastorage.utils.UpgradeType')
ConfigurationSerialization.registerClass(UpgradeType.class);
But it is registered
Ah... hehehe. Code is obviously executed top to bottom
public void OnEvent(PlayerDropItemEvent event){
Player thePlayer;
thePlayer = (Player) event.getPlayer();
String salam = thePlayer.getDisplayName();
String mrdxo = "mrdxo";
if(salam == mrdxo){
thePlayer.sendMessage("Salam Owner");
}else{
thePlayer.sendMessage("Salam"+salam);
}
}
}```
== won't work for strings
You are still comparing Strings with ==
Dont do that
you never know bro they could somehow end up at the exact same memory location
any of you has a good youtuber that teaches spigot basics?
not that I know of
if you have a good foundation of java though it shouldn't be too hard
I'd argue spigot is the easiest of the Minecraft api's out there
My friend taught me java and spigot
mostly used google though
combination of using forums + google got me to where I am
mostly
Y2K_ one question
you see how in forge 1.17 stuff wont work in 1.18 because they keep changing class names and shit? is that the same with spigot?
no
or would 1.17 spigot scripts work in 1.18?
spigot is braindead easy to maintain
nice
unless you use a shit ton of NMS
there might be breaking changes every great once and a while
but more often than not its 0 effort to get to the next version
I'll pay you 2 dolars if you teach me all the basic stuff
not more than 2 'cuz I'm broke
- a thank u
does any one know why it tps me always to the surface?
like not actually underground
I hate compiling everything in a .jar every time I wanna test the plugin. Is there a way to open minecraft dev mode or something like in forge?
sorry so how to type equals in the if ? without == ?
if (string1.equals(string2)) {}
sorry thanks
Kody Simpson
can some one help me?
well it doesn't work
redissonClient.getTopic("status").addListener(String.class, (channel, msg) -> {
System.out.println(channel);
System.out.println(msg);
String[] args = msg.split(" ");
if (!args[0].startsWith("minigame-")) return;
MinigameServer server = getServer(Integer.parseInt(args[0].replace("minigame-", "")));
if (server == null) return;
MinigameState state = MinigameState.valueOf(args[1]);
System.out.println("Server " + args[0] + " sent state data: " + state + ".");
server.setState(state);
if (state == MinigameState.CLOSING) {
MinigameServerManager.get().removeServer(server);
}
});```
it establishes the connection with redis fine
redissonClient.getTopic("status").publish(minigameId + " " + state.toString());```
this is on the other server's end
it established connection fine too
this does nothing though (not channel nor msg prints)
hello??
cuz chunk loading
can I code a pseudo-random number generator with a seed that would always return a fixed value when I input two values?
a seeded random will always produce the same sequence of numbers.
is there an implementation in java or do I have to create one myself?
There is
just java random will do
All of them except thread local random
Hence why thread local random is bad due to lack of reproducability
fast
i know that if i input the same seed in two different Random objects i'll always get the same output, but i don't know in what order will the nextSomething methods be called, and also some could be called twice and yield the same result
i basically need a method that does something like boolean shouldSpawn(int x, int y, double chance)
joking
And has reproducability
now that i'm putting it this way, this is similar to what perlin noise does
but i don't need it to be gradual
i just need random values to be always the same with the same x and the same y
could I make an hash of the two values and evaluate a pseudo random number from that?
explain better what you need to do
i have a chunk generation system and i want a method to reliably check if at said x and z something should spawn
for generation, to ensure it always generates teh same you use a seeded random. You access that random in teh exact same order every time
i am aware of that, but i need to check if a certain structure would spawn/has spawned not necessarily when the chunk generates
meh
I'm not understanding yoru issue
chunk spawns exactly the same every time
if there should be a structure there, it will be there every time
i need to generate structures using such a formula so i can then tell if a structure spawned at that location
or i can tell before the structure itself is generated
what EXACTLY are you trying to do? as it doesn;t sound like you actually want chunk generation
really nuker?
i've made a chunk generator that randomly generates structures using the provided random from the generateNoise method, but chunks close to that chunk also generate structures depending on what generated in the first chunk, so i need nearby chunks to be able to tell if the original chunk will spawn a structure
Player#getEyeLocation().getDirection()
Location eye = player.getEyeLocation();
for (Entity entity : player.getNearbyEntities(64, 64, 64)) {
Vector toEntity = entity.getEyeLocation().clone().toVector().subtract(eye.toVector());
double dot = toEntity.normalize().dot(eye.getDirection());
if (dot < 1) return entity;
}```
i thought that's the velocity thing
OOOOOH
shit
there is a getVelocity
im dumb
there is
has the same vector but different magnitude
I don;t believe you need to do that, you just set whether the generator can spawn structures
also if you go using the random from noise you will alter how the chunk spawns
unless you use it identically every time
Entity result = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getLocation().getDirection(), 8).getHitEntity();```
this thing don't return player in creative mode in front of me
use teh raytrace that accepts a predicate
oh
(e) -> e != player
yes it's an instance check
shouldnt i compare UUID's or smth for safety
polymorphism and freaking Player object both go brrt
no, there will only ever be one instance of the player during a raytrace
when was this rayTrace added
i used the Vector#dot() since like i started coding for mc
yes for no hit
then why is getHitEntity nullable heh
1.14
no clue π
oh it would be null if you were tracing blocks
single RayTraceResult for both entity and blocks
oh shit rt result is for both
var rtr = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getEyeLocation().getDirection(), 8, e -> e != player);```
this still can't find player in creative mode right in front of me
spamming everywhere possible
it returns null everytime
not surprising if the target player is in creative. Creative is a nightmare
I see no reason it wouldn't find them, but when it comes to creative.
are you sure you are looking the right direction and are within 8 blocks?
Thats an actual player and not an NPC?
?
did you mess up your predicate?
player not Player
it is
yep looks ok
if (event.getAction() != Action.LEFT_CLICK_AIR) return;
Player player = event.getPlayer();
var rtr = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getEyeLocation().getDirection(), 8, e -> e != player);
if (rtr == null) return;
if (!(rtr.getHitEntity() instanceof Player target)) return;
UUID damagerId = player.getUniqueId(), targetId = target.getUniqueId();```
probably also need to add filter for only searching players
instead of if in the end
i just made sysout before checking if rtr == null
and it always says null
no clue, makes no sense
var rtr = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getEyeLocation().getDirection(), 8, e -> e != player && e instanceof Player);
if (rtr == null) return;
Player target = (Player) rtr.getHitEntity();
still
fucked up
it's on playerinteractevent and the action is left click air
lol
it actually worked for some reason
var rtr = player.getWorld().rayTraceEntities(player.getLocation(), player.getLocation().getDirection(), 8, e -> e != player && e instanceof Player);```
but it only works if i click above players head now
not on the player body or head
and player is in creative
due to using player location it's using teh vector of yoru body, not the direction you are facing
Pls make a variable of that. New Location instances are created each time
player interact event is not called when you hit random player in the way
PlayerInteractEntityEvent should be though
Gotcha
i need creative player left click
If you want a right click, it's a damage event ;p
damageevent is not working on creative
Unsure if that's called for a "damaged" player in creative though
listen to the https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerAnimationEvent.html for swing arm
Craft event
while loop?
cringe bukkit
oh you mean
you just have chest
umm, you just listen to inv clicks
while(true) on main thread
sleep()
why does the server keep crashing, I'm pausing the loop
while(true) {
sleep(1000);
System.out.println("test");
}
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
NO clue, code looks fine to me π
Dang it. Better create a jira ticket, surely a bug in spigot
Probably md5 messign up again
Last time I saw md5 blaming Choco that he broke something π€
probably chocos fault then
Dw Choco you our sweet chocolate no matter what :3
Server crashing due to while(true) is a bug. Just like I'm from america, right Choco?
Only because I used "mile" once in my life D:
Is there any easyish way to make a custom crafting table that only crafts certain recipes? My friend had me make a plugin where similar to hypixel the ender dragon has special drops and he wants a special crafting station to craft stuff with the material it drops (which is really just gonna be something like iron but with a custom model id that retextures it and a display name)
I know I can make menus but idk if there's an easy way π₯²
There is sorta
I mean u can use the crafting stuff nms uses
Or write ur own matrix logic
Fr lol
Write code and say I did better than Mojang ever could
Can I someonehow get instace of class? I just want some simplest way π Want to make pl for editing and disabling/enabling recipes. Ofc first I need to save them some how.
for(Iterator<Recipe> iterator = Bukkit.recipeIterator(); iterator.hasNext();) {
Recipe rec = iterator.next();
if (rec instanceof BlastingRecipe) {
}
else if (rec instanceof CampfireRecipe) {
}
}
what java version
if your on java 20 or above you can use pattern matching
JaveSE-17 rip π
rip yeah I wish 17 had some nice 20+ features
unfortunately you will have to just write the else if statements
you could also use a switch statement if you use rec.getClass() you could match like that
Just looking for some ezy way to save recipes. Saving in YAML file trowing errors π
org.yaml.snakeyaml.constructor.ConstructorException: could not determine a constructor for the tag tag:yaml.org,2002:org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe
in 'reader', line 2, column 3:
- !!org.bukkit.craftbukkit.v1_19_R ...
^
at
...```
Looks like you should avoid the "!"
Time to PR :O
or is there just no packet
Why would there need to be a packet
Dispensers fire on the server, events are called on the server
oh truee
code was like this just simple xD
for(Iterator<Recipe> iterator = Bukkit.recipeIterator(); iterator.hasNext();) {
Recipe rec = iterator.next();
listRecp.add(rec);
}
recipes.getConfig().set("recipes", listRecp);
recipes.saveConfig();
Yeah sadly recipes are not ConfigurationSerializable
I just noticed the get "server jar" website has a discord
Hmm Im probably gona do yml like this (or idk in what else I can save it, new in java π¦ )
rectype:
name:
atributs:
Is there some better way? π€
recipes:
<recipe-name>:
type: <type>
attributes:
#type specific stuff
thanks a lot
cheers
Someone go make recipes ConfigurationSerializable :p
Iβll add it to my list I suppose
Honestly probably not a horrible addition
and its literally intellij idea but on c++
In my TabCompleter i want to just have all the playters online be displayed how would i do that
make it return the online players
Bukkit.getOnlinePlayers() returns a collection not a List
iterate through it and make your own list then
Or get fancy with streams
You can also just return null
Word of warning on that though, Paper has an option to disable that functionality (for some reason?)
well
- it doesn't support vanished players
im not on paper
Then you're good to go lol
yea
You can also just return null I believe
Should be the standsrd behavior
I am not the first
Nvm
Don't be surprised, they're really into with trashing their software with things nobody has really asked for
And they're decision making is more depandant on the position of the sun than whether it really makes sense and whether it would potentially damage existing servers, plugins or compatibility
Wrong place
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Keep track of where the inventory was opened?
I also don't think that you need to actually clone the items as spigot does that for you when it converts it to nms
.clone() is not needed in that line
π
I donβt understand how that plugin causes issues for people
Sounds like it should be a pretty simple plugin
what plugin
if ur talking about crafting plugins I think i'd struggle with an effective way to chex matrixes without looping a god awful amount
that might actual require some decent though
Oh nvm
I miss reading lol
Intellij moment π just join vscode gang
If you are placing an item into an inventory slot itβs basically always the click event
Unless you are dragging it over multiple slots, then itβs the drag event
Hello iβm not sure if this is dev related but when I try running a command or chatting, I get an error βChat disabled in client modeβ
Anyone know how I can fix this?
Iβm pretty sure itβs plug-in related
Cause when I restart the server, I can chat again
Then when a function runs from my plugin (essentially turns my gamemode to spectator), I canβt chat again
And I can certainly chat in other servers
@EventHandler
public void onRespawn(PlayerRespawnEvent e){
Player player = e.getPlayer();
if(not_yet_respawned.contains(player)){
not_yet_respawned.remove(player);
player.setGameMode(GameMode.SPECTATOR);
String msg = mainClass.getConfig().getString("messages.end_event_leave");
player.sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
}
}
this is the event handler
the if condition is what triggers this effect I think. That's my hypothesis
Fixed it⦠nvm
Is there any way to change the players name on bungeecord?
You know like how there is the .setUniqueId(); method is there a .setUsername(); ? or similar?
iirc #setDisplayName should work on bungee
no but i dont want a display name lol, like changing the actual players name
you cant force change a someone's username in a game
you can only put a false username instead of it for show
yes, even if you modify source
This apparently does what im trying to do
https://github.com/BlockyTheDev/bungee-spoofer
yeah, thats called setting a display name π
the plugin just sets your display name to the target's username
it doesnt actually change your base username
Yeah of course not but like the forwarded username gets changed right?
"forwarded username"?
Well yeah its gonna be offline since its a backend lol
https://offlinemo.de moment
no like
this guys brain is all over the place
Username -> Bungee (Changes to NotUsername) -> SMP
Well the username is changed after the client logins so auth?
my brother in god, for the sake of ours and your own sanity
just make use of #setDisplayName and set it to the target name
and do pretty much the same for the skin
offline stuff = spigot is not the place
where is the place
?whereami
nobody knows
most likely you would also have to spoof the name the client knows, so it still gets told the right thing
oh lmfao
Well i just searched change name on bungee its the only thing i could find
only thing i could find != works
ok at this point theres 2 possibilities
you mean you want something like hypixel's /nick system?
- this guy is trolling hard
- this guy is genuinely dumb but is at the wrong place because spigot is not the right place for offline stuff
i already know the exact issue why it cant compile and exactly how to fix it
Kindaaaaaaa
whats the issue
ik
bro its literally #setDisplayName just give up
im not going to say, i dont support piracy
nah hypixel is using packets for this
thy must only useth resources why thine be bound by
bruh its for testing
highly doubt that
packets is only for skin i believe
if anything hypixel works like libs disguise
^^^
its kinda not a disguise
π bro just look at proper copy of hypixel nick system like advancednick or smth
its a plugin, it works similar to it
setdisplayname is not enough
for something like that
the advancednick plugin is opensource
do hypixel use advanced nick?
ok @tepid acorn , "kinda" isnt accurate enough for us to help you
tell us what it IS and then maybe we could help
advancednick was coded as a copy for hypixel's nick system
okay? its not a copy
if you think for a second you will understand setdisplayname is not enough bruuh
it might be similar but it isnt the exact hypixel code
cant be a copy if you dont have the og source
oh no how sad
its schrodinger's cat thing
Okay
so
basically i have a bungeecord hub
so you can do /name (username)
they set display name , modify chat formatting, use npcs for the skin and an armor stand for the name
and then /join (ip) to join a server with that username
your pretty much describing offline mode
You can start yelling abt piracy now ig...
this is literally hypixel's nicking system
gimme a sec
Yes but i have a proxy on top that handles the name changes cuz yea
i will send you the srcs
GPT4 doesnt know anything about minecraft either so i cant use that π’
this is most likely how any plugin like hypixel nick's work
it knows java and most likely knows bungee
from (ip) do you mean like, any server at all?
or just servers on your network
No but i need the player to join a bungeecord proxy
Then set a command to change its name and then set a command to connect to a server and play under that name
so you need a plugin on that proxy
Idk in theory you could put hypixel.net and it would work
ok yeah
except for the fact that its online mode
this is not happening sir
Yes
thats the impossible part
you cant auth with mojang
so i can change UUID but not name
BECAUSE
you cant even connect to the servers
but its gonna be offline who cares
you cant change UUID either bro π
only connect to offline servers
you still need something on that server to spoof your info, there is no way to do it without
yes that
if you want only want offline only, there is no point of this
just join with offline
You can tho that already works
yes there is a point
cuz the bungeecord modifies packets
an extra step in the process
whatever point there is, you arent going to get the answer here
if its oflfine the server doesnt care what your name or uuid is
so why do you need bungee
Just gonna bump this
may need to wait for 7smile
tbh this is funny how the whole minecraft coding community that injected their api beforehand decompiled minecraft srcs caring about piracy
Cuz it modifies packets
I mean itβs not just for him
isn't it piracy π€
Surely more than one person knows how to use redisson
so you want to modify the inital join packet the server no longer cares about if its offline mode
e.getConnection().setUniqueId(Plugin.getUUID());
nono
The player joins the proxy
selects a name
and joins a server
then on the server i can modify the player's packets since its connected through a proxy
Yeah it would have probably been easier to make my own reverse proxy but imma figure out the packet modification part later
@tepid acorn what part of "spigot is not the right place for piracy" do you not understand
and also what part of "that is not possible" do you not understand
so we can help you understand that part
you pretty much have to rewrite the entire bungee passing system to work on servers that arent even expecting "bungee" packets or info
okay shit
it may be possible and this is a heavy maybe, if you had full access to the backend servers and could constantly modify that data if anything you have to modify the entire bungee passing and even at a minimum modify the server jar before spigot or anything gets to it
bruh
so it would be easier to make a custom reverse proxy right?
so i have full access to the packets
idk why you are "bruhi"ing minecraft isnt built for this
i mean like 2 ppl have done what im trying to do already
Anyone has made a project in eclipse? I cannot get a working 1.19.3 spigot plugin, stuck using older versions like 1.17 or 1.16
just that their stuff is private
you most likely need to find bugs in the way bungeecord connects to spigot if you even want an attempt at it
use maven or gradle and the reason you cant use later versions is because of
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
it wouldnt use like ipforwarding or anything
okay?
Do you mind I talk to you via PM, I tried everything possible?
i dont use eclipse or an ide build system so i prob wont be much help
I guess I have to downgrade my server and throw viaversion onto it
you can make a plugin for 1.17 and it work on 1.19
I just seen that, thanks
@lost matrix issue
What do you need a reverse proxy for?
@remote swallow Does 1.17 plugins work on 1.19.x? My plugin works but look at #help-server
I dont do dms. There is nothing about it that would warrant such things
if it uses nms it most likely wont, if it just uses api it should work
he wants to spoof a name and uuid on a server he doesnt have backend access to
Sounds like illegal things
^
no ilegal
Well, I don't know. it allows me to use /fly and /god like I said there, I just don't know
its allowed on minecraft ToS
I don't know about that one chief.
No it isnt
You right @wet breach , who said anything about this?
well its just like an alt manager on your usual utility client
except it isnt
check your using latest dev build from https://essentialsx.net
The essential plugin for Spigot servers.
Occasionally you might enocunter some bugs with multiple versions even if using the api due to implementation occasionally slightly changes. Only usually encounter this minor issue if you rely like on certain order of events firing for example so best to test your plugin on all versions you intend to support
If you dont have backend access to something to use a custom plugin. Then spoofing your account to an online mode network will not work at all as the auth would never be correct
Its offline mode network
Then just send the packet with whatever name you want. We dont support offline mode here nor support doing shady things that have nothing to do with spigot
but i cant send that packet with bungee right?
Offline mode/Cracked accounts. These don't work on paid servers such as Hypixel but I recommend stop talking about it as hacking into servers is illegal. No, I not talking about Wurst. These are 2 different things. Now to my programming
Bungee does not alter packets and offline mode there is no auth therefore no verifying player details
But again go somewhere else with your shady stuff. Mc tos does not allow you to use offline mode for the purposes you have described, you not having backend access network to said network also points to you wanting to do shady things that is basically illegal or borderline as such. In all, this is not the place for such support and goes against the spigot rules and what spigot supports.
Hello, does anyone knows reason of why ProtocolLibrary.getProtocolManager() is null?
Caused by: java.lang.NullPointerException: Cannot invoke "com.comphenix.protocol.ProtocolManager.createPacket(com.comphenix.protocol.PacketType)" because "pm" is null
google says In maven, I have to add <scope>provided</scope> but im using gradle
Then use the appropriate scope for gradle. compileOnly
Then i get this: java.lang.NoClassDefFoundError: com/comphenix/protocol/ProtocolLibrary
On runtime?
Well... did you install ProtocolLib?
7smile idk if u saw but i kinda need your help with redisson
Hm? Whats the problem
^^
So this a runtime exception, right?
the publish + subscribe
I don't need help at the moment, I just wanted to say that you're awesome @lost matrix β€οΈ

You're here helping people every time I check the discord haha
@lost matrix You used maven before?
Did you add a debug message right before calling .publish()?
ig yes error on console
no, but the method 100% runs
Yes, both maven and gradle
otherwise the entire thing would not work
I tried to write a plugin using maven and it was not compling so I just downgraded to 1.17 plugin structure
Use /pl and check that Plib is properly installed.
Let me get a minimal setup working, one moment
Use the minecraft dev plugin from Intellij to generate you a clean spigot project.
How do you compile your plugin?
Eclipe
Ok and how do you compile there?
What you mean how?
What steps to you take in order to kick off the compiling and packaging of your plugin
Do you click buttons? Do you type something into console?
sigh
Do you build artifacts? Thats what interests me.
In that case you can as well delete your pom.xml
because you dont use maven at all.
use imgur or verify to upload stuff
yes
?paste
I did but I first ran into this Java 18 error which I fixed but this one error showing the directory is not in the project folder, I just gave up and downgraded to 1.17 structure so I can just program without errors
All of this doesnt matter. You are not using maven so we cant help you with a supposed maven problem.
Here i wrote a minimal working example.
https://paste.md-5.net/umagejimos.java
Before I switched to 1.17, @remote swallow said he does not program using mevan and I cannot find anyone to help me with it. If you the one that can, allow me to switch back. Otherwise, I running out of options
mine looks the same though
or well similar
do i have to create a new RedissonClient every time
or should I keep one instance defined in my class body
Stay with LTS versions. Java 17 is perfectly fine.
Java 18 has mostly garbage features. Nothing that would justify any hustle.
Just a heads up:
- If you use maven, then you never manually add jars or other artifacts to your project (breaks maven)
- You also dont compile by building artifacts. You compile by running a maven lifecycle (install or package)
What do you mean by that?
You should only need one client per server.
Also, this is considered IO:
RTopic topic = client.getTopic(TOPIC_NAME);
As well as this:
topic.publish("Message [" + i + "]");
So not on the main thread pls
Let me double check
oh
well i'm not too sure how to not do it on the main thread
futures or scheduler, futures are prob better
okay
Your code looks fine. Make sure that both connect to the same redis instance.
Also: Add a debug message right before your subscribe and right before you send a message
My main plugin has 3 Manager variables.
public final ItemManager ITEM_MANAGER = new ItemManager(this);
public final GroupManager GROUP_MANAGER = new GroupManager(this);
public final PlayerManager PLAYER_MANAGER = new PlayerManager(this);```Is there any way my API could reference these variables? I can't think of a way for the life of me but it would make my life so much easier
This is what I was seeing at first```Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. MG-Staging Build path JRE System Library Problem
First of all: All fields have to be private.
Only exception are constants (public static and final)
Your naming should be
- itemManager
- groupManager
- playerManager
For referencing:
Really depends on how your API and plugin are structured.
The easiest way would be to create a static getter in your
JavaPlugin class. Then API methods should look like this:
public static PlayerData getPlayerData(UUID playerId) {
YourPlugin plugin = YourPlugin.getInstance();
PlayerManager playerManager = plugin.getPlayerManager();
return playerManager.getPlayerData(playerId);
}
You need a JDK to build ofc. If you want to build for java 18 then you need a java 18 JDK
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
</properties>
Add this to your pom as well
problem solved thanks 7smile
What was it?
protocollib problem
Not version 5.0.0 i suppose
What was it?
oh well it turns out
i called the setState() method before i initialized redis
so i made it call again after the server was ready
its a bit hacky since its setting itself to PRE_GAME twice but it shouldn't affect anything
@lost matrix I missed a config tag, that might be why I was seeing errors. Lets see
I got it to work, plugin shows on my server
also is there a way to write to a database?
redis is a database right
how would i use that? i'd like to keep track of all live minigames
An in memory db
Get a RMap and use it like a map
does it use SQL
No
what would be the best way to track the following:
minigame-id | port | state | player-count
all in one
RMap<Integer, MinigameData>
Or whatever your minigames id is
You can think about RMap like a HashMap.
But its on redis, so all connected servers can use it
You can just use the Map built on Java. I forgot what function it is but it does work if you don't care about SQL
how do i write?
map.put(id, minigame);
Hello, I hope you're doing well. in 1.19.4, how do you spawn a fake armorstand with custom name?
It prints "SEND FAKE ENTITY2.9",
This is my code and when I run this, server says "An internal error occurd..." Without Any coonsole errors.
ProtocolManager pm = ProtocolLibrary.getProtocolManager();
PacketContainer packet = pm.createPacket(PacketType.Play.Server.SPAWN_ENTITY);
packet.getModifier().writeDefaults();
packet.getEntityTypeModifier().write(0, EntityType.ARMOR_STAND);
packet.getUUIDs().write(0, UUID.randomUUID());
packet.getIntegers().write(1, 1);
packet.getDoubles().write(0, location.getX());
packet.getDoubles().write(1, location.getY());
packet.getDoubles().write(2, location.getZ());
WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
WrappedDataWatcher.Serializer chatSerializer = WrappedDataWatcher.Registry.getChatComponentSerializer(true);
WrappedDataWatcher.Serializer boolSerializer = WrappedDataWatcher.Registry.get(Boolean.class);
List<WrappedDataValue> dataValues = new ArrayList<>();
Byte flags = 0x20;
dataValues.add(new WrappedDataValue(0, byteSerializer, flags));
Optional<?> optChat = Optional.of(WrappedChatComponent.fromChatMessage(name.replace("&", "Β§"))[0].getHandle());
dataValues.add(new WrappedDataValue(2, chatSerializer, optChat));
Bukkit.broadcastMessage("SEND FAKE ENTITY2.5");
Boolean nameVisible = true;
Bukkit.broadcastMessage("SEND FAKE ENTITY2.6");
dataValues.add(new WrappedDataValue(3, boolSerializer, nameVisible));
Bukkit.broadcastMessage("SEND FAKE ENTITY2.7");
Byte armorStandTypeFlags = 0x10;
Bukkit.broadcastMessage("SEND FAKE ENTITY2.8");
dataValues.add(new WrappedDataValue(15, byteSerializer, armorStandTypeFlags));
Bukkit.broadcastMessage("SEND FAKE ENTITY2.9");
packet.getDataValueCollectionModifier().write(0, dataValues);
Bukkit.broadcastMessage("SEND FAKE ENTITY3");
pm.sendServerPacket(player, packet);
So i stacktraced, stacktrace says that packet.getDataValueCollectionModifier().write(0, dataValues); is the problem
[20:18:56 WARN]: FieldAccessException: Field index 0 is out of bounds for length 0
oh i see
redissonClient.getMap("name").doSomething
right?
Get the map once
anyone know if its possible to somehow use rcon and gradle to execute reload confirm on said rcon
Spawning an entity and applying metadata has to be done in two separate packets.
You can write metadata into a spawn packet.
What's stopping you from just adding a rcon library to your build source?
And writing the small kotlin yourself
bc ill prob only be using it for testing stuff
You can.
Like
Just smack a rcon lib in there
Have a buildAndReload task somewhere that depends on build/jar/shadowJar that copies the jar over into the plugins folder and then shoots a rcon command
kekw i cant find any working gradle rcon libs
ive tried them too
I mean, either all tried open source java rcon libs are broken or you messed up somewhere XD
hm what do you mean?
Source RCON Protocol Java library. Contribute to Pequla/RconCore development by creating an account on GitHub.
What are you doing
Did you read the gradle docs I linked
You don't add that dependency as a dependency for your plugin, it's a dependency of your build script
still the same
You reloaded the gradle project properly I presume ?
yep
Version 1+ is a funny one ,
doesnt work if i add the dot
They're now private, properly named, and I added getters for all of the managers. Thank you!
Are you sure this would be best to do though? java public static PlayerData getPlayerData(UUID playerId) { YourPlugin plugin = YourPlugin.getInstance(); PlayerManager playerManager = plugin.getPlayerManager(); return playerManager.getPlayerData(playerId); }
I've been doing my absolute best to avoid static methods
since the data inside the PlayerManager is a HashMap (and I was told exposing that is not a good idea)
Also in the API how would I be able to run plugin.getPlayerManager() when the API doesn't know what Realms extends JavaPlugin is, only knows what JavaPlugin is?
yea dunno what you are doing
buildscript {
repositories {
maven("https://jitpack.io")
}
dependencies {
classpath("com.github.Pequla:RconCore:1.+")
}
}
tasks.register("example") {
Rcon("localhost", 42, "password".toByteArray())
}
works for me
obviously a import net.kronos.rkon.core.Rcon at the top
but beyond that
Β―_(γ)_/Β―
without the dot
huh
it does work with the dot
it never did that like 2 weeks ago

You API needs to know your plugin ofc.
And you can design this non-static if you want to
Ahhh, I wasn't sure if I should add my main plugin as a dependency to the API or not
I mean that you need to send 2 packets.
One for spawning
One for setting the metadata
Otherwise your API would have no idea what to do. lul
Yeah and that's why I was so confused XD
For some reason I thought it'd be bad if they depended on each other
π€·ββοΈ
That makes this so much easier! gaaaaah thank you
Well, your plugin should not depend on your API
What exactly do you mean by that?
My main use for the API at the moment is to have a way for multiple servers to be able to understand the same thing. Like, what a custom item is. I have all custom items loaded into memory on each server so they can be quickly accessed right away.
Your main should not use your API
Are you suggesting the way I'm using it at the moment is bad design? If so I would love to hear your thoughts on how I can improve.
You plugin should not use an API to basically communicate with itself.
It should work as a standalone application. The API should be written
after you are done with your plugin. If you follow the basic design principles
then your plugin should easily be accessible through the means of an API.
"The API should be written after you are done with your plugin" I find that statement tough, I believe that you should try to design your code with the API in mind as you are otherwise left with a bunch of Impl classes that implement the interfaces you created for the API
But a separation between API and business code is definetly important
It's similar to tests, you should have them in mind when you are writing your code. If you don't write modular enough you'll have a tough time creating them
At the moment my plugin is depending heavily on the API. I will do my best to take both of your advice and revert that
This is like calling someone over a phone that stands right next to you.
Why not just talk with him instead? If others want to speak with him they
need a phone and his number. But you dont.
i cant tell if your text is being forcefully wrapped across lines or you're doing
XD this is actually just me adding newlines at the end. Its because i have DC on
my second monitor and i dont want to turn my head all the way to the right when
writing something.
ahhh
bruh moment
just... create some distance between you and the monitors
no need to have your eyes glued
No need for physical monitors 
Lmao
I've considered VR for dev work but I'm reluctant to buy
I recommend it
crappy lenses make it hard to pick a system
beat saber
Shapeless should be pretty easy, right?
But shaped recipes are really complicated to get right here.
How does VR contribute to your work as a developer? I've never considered that before.
I can have as many monitors as i want or use no monitors and just have floating windows i can move freely. Since i dont need physical stuff i am free to have a laying down chair. I use a physical keyboard and mouse but with vr this isnt even required either. The headset i have also allows me to see my physical environment at will so i dont have to really remove my headset
How would you program in VR without a physical mouse or keyboard?
You learn to type and grab stuff in the air
My headset can see and track my hands and arm movements
The hard part will be to actually detect which recipe is inside the matrix.
Checking when to update should be easy. Every time the matrix changes you need to
recalculate the output.
Think of the second matrix movie where they have people in that control station
Its like that
But highly customizable to your liking lol
I can watch movies in vr too. Headset i have lets me create virtual rooms
So i can a movie going in vr and be doing stuff on my virtual computer. Virtual computer is linked to real computer but lets you do some neat stuff
Yes but no
I would use a 2d array. Map the slot id to the array indexes
This makes it easier to check the slots without needing to do a loop
I recommend trying it out. I love vr
I will probably eventually get into vr programming
Then i could just wear my headset out in public and it provide me all kinds of info in regards to the physical environment. Like telling me how fast vehicles are travelling for example
What's your WPM with a physical keyboard compared to a VR keyboard? Is it a huge difference?
You dont program in VR when programming for VR
When first learning it your wpm will suffer
You can. But depends what you are doing
Thats like saying you cant use a java ide to program in java lol
anyone know how i can relocate + exclude stuff from a minimize task in gradle, ive tried excluding in the minimize with / and . but it still removes the classes
I have never seen anyone program in VR.
Its more like saying: You wouldnt program a game by starting another game and sitting on a virtual computer.
Makes little sense
My wpm for physical is about 130wpm. Virtual its faster sometimes. Because you dont have to press keys just only make the motion
Virtual computer still needs linked to a real one. But you definitely can program in vr for vr. Testing would be the only nuisance in doing so sometimes but it depends what is you are making. If you are making an app to runin vr then i can just uninstall and install the app from within the vr itself since its menus are accessible from within the headset
Applications for vr are separate from the vr os system. Its no different the reloading an app on your computer. You dont need to reboot your entire computer to do it unless it involved the os itself
saw you talking about wpm and decided to test myself
last time i checked it was about 80-90
what site is that btw
if we are talkign no typos I can do about 10
ty
surprising
u
Not bad
wait until you find out i only do 7 second tests
yeah i thought it was lower lmao
fair enough
let me try that
you get a lot higher speed on 7 second tests if you get lucky
7sec
Most employers in the us that require typing typically have a minimum of 90 lol
All my time is spent correcting mistakes
A proper test measures in 5 minute intervals
Then again I havn't typed in MANY years
fair
Its not super important to have 100% accuracy.
fr? shouldn't 2 be enough
is this good lol
Its not the worst. You should strive to have 85% or 90 minimum
At 90% you should easily have over 100wpm
Its faster to correct typos later and therefore you shouldnt worry about correcting a lot of them while typing.
You need to make your own matrix
This is a matrix
How is this helpful?
I suppose you could keep it 1d array
But 2d is just super quick in terms of looping if its needed.
alf will do
god im not good at typing for long periods of time
this shit was hard
the matrix is the 3x3 grid
I ask one question about WPM and the chat really just took it and went with it lol
lmao
i find it funny that you beat me
tbh i didn't except this high score
This is really good
would i have chances to be hired for a writing-esque job with this
Definitely
oh damn
when i was like 10 my school tried to teach us home row, left hand on f, right on j but i was way quicker just typing with two fingers but i just slowly after that started picking up where i could put other fingers to make it quciker to type
ngl every hand-related part of my body hurts now though
now i just use all fingers and mis spell a lot
yeah
my hands dont hurt, my elbows do
oh same yeah
posture be like
i don't use my pinkies for some reason
probably should rethink my ways of typing
my left pinky is shift and control my right just kinda sits there
or presses enter
You took a test 5 minutes long and got 100wpm. That means you could write 4 paragraphs or a small essay in 5 minutes as that is 500 words in that 5 minutes
ha
If your elbows hut you need to adjust your sitting position. You will suffer carpal tunnel syndrome VERY quickly. It will start with numbness in your pinkie finger
it'd probably be 6 minutes seeing as my speed would decrease over time but that's a good point yeah
good to know, thanks
i'll keep my posture in mind
how do i adjust my posture
Also the reason for 5 minutes being the minimum for proper tests is it prevents copy and pasting
And makes such things more obvious
im just too quick
daamn
you'd type a 500 word essay in 0 minutes
nah
impressive
do the words test then just pre-emtively get read
frostalf
what's your wpm
you probably said it already but i forgot
rusting slowly π
In regards to this recommend a rest pad for your wrists for when typing prolong periods. This helps your hands not get tired, and provides some comfort without losing posture
but its my elbow that hurts
its only my left elbow that hurts, because it rests off my desk
as a person who used to jitterclick a shit ton, your elbow and fingers are somehow related
why should developers be fast a typing
all we do is copy and paste
Indeed because you have 2 nerves that run from your shoulder to your hands that go through your elbow on either side
i changed that so i can shift right click lol
also good
zbll
hm?
do a punctionation + numbers minute test
Yes
or just punctuation
time?
60
kk
Numbers is easy as long as you have a numpad
It can be 1d, but it should be a 2d array
why would i have a numpad
that's quite eh
i already know thats better than me
Most keyboards have numbads unless its a small keyboard
numpad is too far away though
numbers are hard
im a fuckin speedy bitch
it was The quick brown fox jumps over the lazy dog
I just had the quote from all star
thicc
Numpad you use your right hand and keep it placed in the center. Index on 4 middle on 5 and ring finger on 6. In this fashion you dont have to move your fingers very far to hit any of the numbers and your thumb is used for the 0 and bottom keys
Well, the years start coming and they don't stop coming Fed to the rules and I hit the ground running Didn't make sense not to live for fun Your brain gets smart but your head gets dumb So much to do, so much to see So what's wrong with taking the back streets?
this shit
but i restarted it
π
yeah but i still have to write words
moving the hand from here to there is a hassle and a bit
Thats when you learn a different style of typing. But numpad is only good if you have a lot of numbers to type
Not just a few lol
punctuation is hard
im great at all lower case no punctuation
try english 450k
as soon as i need to add capitals, full stops or quotes in im dead
π
Yeah sometimes punctuation tests can be hard. Most of my accuracy misses on tests is mainly me forgoing punctuation because its faster for me to leave those out and then go back after i am done to add them in
i'll add commas randomly if i think what im saying is too long but thats it
and i wont be typing at max speed
I usually have my word processor setup to auto capitalize after using a space after the period
this is general
fair
Lol
for some reason its only my left elbow
if you dont you arent a real dev
i have a membrane keyboard
get out
because i can't afford time to buy a mechanical π
i've wanted one for like 1.5 years to get it
also when you do get one, whatever you do
but yeah first of all shit's expensive
dont get blue switchesd
haha
blue switches are so loud
Costs like $50 for one
yeah if i buy one i want to get a good one
you only get blue if you live alone
expensive for me, haha
Lol
You live in the US?
170$ approx
Nvm then cant buy you one
dayum
which is a steal ngl
I wish I lived in US, everything is cheaper
i've increased my prices approximately 3 times after this commission lmao
i can, but it's harder to find one
what's that?
