#help-development
1 messages ยท Page 1281 of 1
it wouldn't be particularly hard
there's already fabric layers for it, and there's probably some fabric loader for minestom out there
bukkit api on minestom idea sounds like Wine on linux ๐
i mean it can allow you to execute bukkit plugins on non NMS servers, albeit if plugin doesnt use NMS
HashMap
give me a complete type
with generics
?
is it HashMap<UUID, Consumer<String>> or something else?
private Map<UUID, Conversation> awaitingInput = new HashMap<>();
package com.lewdmc.util;
public class Conversation
{
private final ValueType type;
private Object value;
public Conversation(ValueType type) {
this.type = type;
}
public void setValue(Object value) {
this.value = value;
}
public Object getValue() {
return value;
}
public ValueType getType() {
return type;
}
}
oh
Yeah lmao
so you're passing a lambda function into conversation type value. that obviously doesnt work since <function lambda> != Conversation
do you want to compute value from lambda and then put into map
?
i dont get it
So, where I was going with this Is I want a certain value back. Like String, Int or something else if I need it.
That's what my orginal code was using it for.
I could just remove that since I could use the param function to parse the value when its callback.
oh, I forgot to write out that part since I thought it'd be self-explanatory
you'd have to change the awaitingInput map from <UUID, Conversation> to <UUID, Consumer<String>>
Just did it
but when are we getting Wine on Windows?
what is manager suppose to be defined as?
whatever class your awaitingInput map is in
Just had one more question how could I use a timeout (Bukkit Scheduler) function for this as it seems it keeps waiting for a valid input
i wna join a bot in minecraft server from bothosting website can anyone gimme its codings
https://gist.github.com/JavierFlores09/6122ccb53d745710acb45100225eef88 took me a hot second, but I half-assed a conversation api here
it has a composable version of the conversation method using completable futures which allow you to chain conversation inputs as well as some built in parsers to avoid some boilerplate
why does EssentialsX use separate file for storing locale information if it doesnt allow you to change the locale dynamically in the server
i mean what's even the point of that
I didn't test it so it probably has some issues, but you can base your thing off of it
I also made the examples with AI so they may also be wrong lol
All I'll plop in is the bukkit scheduler like 30 seconds to timeout other then that what you orginally had was good
I don't like addtional clutter as I already have like 30 files lmao mainly GUIs and database classes and already have like 5 dependicies using for advancements, ui, etc.
that is fine too, you can just take it as reference
as you can see, you can infinitely scale this kind of thing lol
my next step would be to make composable parsers as well as introducing context objects
though, you shouldn't really worry about having too many files in Java
Java is very file-based when it comes to organization, so you'll see a lot of projects with classes on the hundreds even if they're relatively simple
on one hand it is Java being verbose enough to need multiple files and the other just being that enterprise standards leak into normal code
public <T> void createConversation(
Player player,
String question,
Function<String, T> parser,
Consumer<T> action
) {
UUID uuid = player.getUniqueId();
if (awaitingInput.containsKey(uuid)) {
awaitingInput.remove(uuid);
player.sendMessage(ChatColor.RED + "You had an unfinished input, it has been cancelled.");
}
player.sendMessage(ChatColor.WHITE + question);
awaitingInput.put(uuid, input -> {
try {
T value = parser.apply(input);
action.accept(value);
} catch (Exception e) {
player.sendMessage(ChatColor.RED + "Invalid input. Please try again.");
} finally {
awaitingInput.remove(uuid);
}
});
Bukkit.getScheduler().runTaskLater(plugin, () -> {
if (awaitingInput.containsKey(uuid)) {
awaitingInput.remove(uuid);
player.sendMessage(ChatColor.RED + "Input timed out.");
}
}, 15 * 20);
}
This should be fine with the scheduler at the end?
looks fine to me
createConversation(
player,
"Enter a number:",
Integer::parseInt,
number -> {
player.sendMessage("You entered: " + number);
}
);
You showed this earlier but I want to set the value to an actual int It seems I can't do that in Consumer
?paste
I am not sure what you mean, the value should already be an integer there
if you mean that you want an int and not the boxed class Integer, just do intValue on it
like setting my values not the callback values
int myValue = 0
number -> {
myValue = number
}
I am still not sure what you mean by that
ah, you mean you want access to the value outside of the lambda
Java doesn't allow to do that directly, but you can do it if you wrap it around a class or an array:
int[] returnedValue = new int[1];
...
number -> {
returnedValue[0] = number;
}
Or is there a better way to returning just the value
like removing the consumer itself?
you could use a Function instead and make the return value of the method the returned value of the action
me trying to avoid having like a 700 line class file rn lol
Wouldn't the code inside of the lambda run after the code outside of it
So grabbing it outside would be pointless?
time to make it blocking IO
realized my issue
i was trying to configure application when i needed to configure tasks.run
@flat lark you're just meant to do everything you have to do in the action inside the Consumer object
but remember that Consumer is just a wrapper around a function, you could pass outside values into it
haha callbacks go brrrrrr
callbacks? seriously? i get anxious enough when my phone rings and you expect me to call back now?
I donโt have a landline
the amount of code gemini can generate mind-boggles me
Stop encouraging them to take our jobs!
https://g.co/gemini/share/94035e42cc28 I was playing around the concept of a conversation API that is declarative, and it generated very convincing code with 2.5 flash
of course, I haven't tried it myself so it is all for naught probably when I would actually put it to production use, however it really serves as a starting point if you don't feel like scaffolding all of this out
really tempts me to get a Cursor setup running
the start was more testing the AI whether it could recognize the reason SimpleFuture was more or less a dumb idea
I tried to nudge it into believing it is good even, but it still went with its guts, which is surprising to me since I am used to these models just going to extreme lengths to satisfy my wack prompting
it would probably make me get more jobs by actually releasing stuff instead of them always being in an infinite loop of being my pet side projects lol
I just can't be bothered to work on something after a few weeks when it comes to projects I start on a whim, but if I can just proompt away my problems with architecturing stuff out, then it might just be possible even if it might not be up to my standards of quality
then again, I would still just break even considering I'd have to spend actual money to use AI for actual production, so any money I'd get from these projects would just be for paying these services lmao
for some reason im impressed it understands minecraft ticks lol
of course it does, ticks is not hard at all
you should stop underestimating LLMs
of course there's still the occasional schizophrenia but they're getting pretty damn good
completely depends
in the aspect of being explicitly solution oriented, they tend to do quite well
I hate gitlab-ci files
Seems to not pickup on response
what does your chat event handler look like
@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event) {
var player = event.getPlayer();
var uuid = player.getUniqueId();
var callback = awaitingInput.get(uuid);
if (callback != null) {
event.setCancelled(true);
Bukkit.getScheduler().runTask(plugin, () -> callback.accept(event.getMessage()));
}
}
doesn't look like anything is wrong there, is the event handler being registered properly? Can you put a println on the top to check?
You know whats that might be the issue
what exactly is "awaitingInput"?
btw maybe you're interested in the bukkit conversation api, that was made for exactly stuff like this https://www.spigotmc.org/threads/spigot-conversation-guide.434956/
Its awaiting for an input from a player.
Its a hashmap <UUID, Consumer<String>
I don't think the async chat event is meant to be blocked like that "forever"
why can't you cancel the event right away?
Look at the conversation API I linked above, it's exactly what you want to do
I mean at least they wna revoke the mapping on callback- id guess at least?
I don't like its design
but ye it can be abstracted into a way better design
no if it isn't async
does someone have all nms existing packets ? (http://wiki.vg/Protocol is down for now)
The lambda is stored and ran in the next chat event
ah as a callback, then yeah
?protocol
ok thx i'll check that
I dislike pirate software with a passion
I cluster them based on common functionality or target. So starting with events, anything that has to do with the player and actions of the player is put into a single package
Hello, i want to animate a block display entity from scale of 0 to 1 block size in 5 seconds
idk why this isn't working
BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);
Transformation transform = blockDisplay.getTransformation();
transform.getScale().set(1, 1, 1);
transform.getTranslation().set(-0.5, -0.5, -0.5);
blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
blockDisplay.setInterpolationDuration(20 * 5);
blockDisplay.setTransformation(transform);
paper btw
sometimes, I have stuff that just doesn't fit anywhere and I generally just toss those into either a util package or misc package
You can't interpolate right when it spawns
Because idk that game just works like that
Wait a tick
Also use the spawn method that takes a consumer
what is the most efficient way to wait 1 tick
so you spawn it with the right data
Bucket scheduler thing?
instead of spawning then modifying
yes
?scheduling
BukkitRunnable
oh it's a command i thought you were asking me
ty btw
BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);
Transformation transform = blockDisplay.getTransformation();
transform.getScale().set(0, 0, 0);
transform.getTranslation().set(-0.5, -0.5, -0.5);
blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
blockDisplay.setInterpolationDuration(20 * 5);
blockDisplay.setTransformation(transform);
new BukkitRunnable() {
@Override
public void run() {
Transformation transf = blockDisplay.getTransformation();
transf.getScale().set(1, 1, 1);
blockDisplay.setTransformation(transf);
}
};
so something like this would work?
it didn't work, and i tried doing this:
BlockDisplay blockDisplay = (BlockDisplay) getWorld().spawnEntity(location, EntityType.BLOCK_DISPLAY);
Transformation transform = new Transformation();
transform.getScale().set(1, 1, 1);
transform.getTranslation().set(-0.5, -0.5, -0.5);
blockDisplay.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
blockDisplay.setTransformation(transform);
new BukkitRunnable() {
@Override
public void run() {
Transformation transform = blockDisplay.getTransformation();
transform.getScale().set(1, 1, 1);
transform.getTranslation().set(-0.5, -0.5, -0.5);
blockDisplay.setInterpolationDuration(20 * 5);
blockDisplay.setTransformation(transform);
}
}.runTaskLater(plugin, 1L);
it's still just instantly going from 0 to 1, i need a smooth interpolation
Use the consumer method bukkit provides so you create and modify the display before itโs spawned, then it should be smooth
ItemDisplay itemDisplay = world.spawn(throwLoc, ItemDisplay.class, display -> {
display.setItemStack(new ItemStack(Material.POPPED_CHORUS_FRUIT));
ItemMeta displayMeta = display.getItemStack().getItemMeta();
displayMeta.setCustomModelData(1);
display.getItemStack().setItemMeta(displayMeta);
display.setBillboard(Display.Billboard.CENTER);
display.setCustomName(ChatColor.translateAlternateColorCodes('&', this.getName()));
display.setCustomNameVisible(true);
});```
Also, you don't have to write the transformation bit twice, just once inside the loop and I believe that will work
@lethal kindle
Try 2 ticks
Or make the transformation smaller and allow more max ticks
5 seconds is plenty of time
Well itโd make it smoother
Let's worry about having it work first
Psh if it doesnโt then skill issue
Iโm no expert on the display api but Iโm pretty sure what he sent should work technically
Can someone help me make a smp server with mod or plugin? I want to play a private smp with my friend but donโt know how to make a good one
For free :>
Sure I'll do it fo fee. It will cost you $1000 per day
yep fee
Bro I said free not fee
yep I saw fee
Da hail
๐
๐ฆ
unlikely anyone will actually do it for free though. Youd best setup a pre-built modded (using a launcher, or setup a basic spigot server if its close friends you can trust
There are free server set ups?
for modded yes
Where can I find it
I haven't done it in years but I remember the moded launcher had a download for server files
FTB launcher
has a download server button
literally pick the pack you want and download the server files, then run it
I think that screenshot might be older than them
My PC might be. I just took the screen shot
maybe?!
Curseforge launcher also has a download server button
Idk about the modern FTB launcher but it doesn't have that many packs last I checked
FTB moved their packs to curseforge, but they didn't like curseforge so they remade their launcher
But then I guess they weren't getting any downloads because now they are on curseforge again
ironic considering that is where the mods came from for the majority of these packs
yeah I stopped using curse when they decided to insert adverts but no profit share
YES it works now
ty guys โค๏ธ
btw here is the code that worked:
BlockDisplay blockDisplay = getWorld().spawn(location, BlockDisplay.class, entity -> {
entity.setBlock(Material.LIGHT_GRAY_WOOL.createBlockData());
entity.setInterpolationDuration(20 * 5);
entity.setInterpolationDelay(-1);
Transformation transform = entity.getTransformation();
transform.getScale().set(0, 0, 0);
transform.getTranslation().set(-0.5, -0.5, -0.5);
entity.setTransformation(transform);
});
new BukkitRunnable() {
@Override
public void run() {
Transformation transform = blockDisplay.getTransformation();
transform.getScale().set(1, 1, 1);
blockDisplay.setTransformation(transform);
}
}.runTaskLater(plugin, 1L);
ik i made two variables for transformation but just for testing
i know that there is a better way but couldn't think of it rn
Hello, I noticed that ItemStack#getItemMeta is annotated as nullable, I never saw it being null, when could that be the case except by setting it to null manually maybe?
Air
Ok, thanks!
on paper it is annotated as UndefinedNullability because of that lmao
Do you know how to do it, like for example I log in for the first time and I stay in survival and I log out and then instead of taking me to the lobby it takes me to survival, do you know how to fix it?
It is with the JPREMIUM plugin
You should contact JPremium support
we only help people who make their own plugins
That's the problem I'm looking for on discord, the owner's discord, but nothing
capitalism
Probably have something to do with how your bungeecord/velocity setup. If I remember correctly there's an option for "force-server" or something, basically an option to force player to join specified server upon joining.
That's for all players
He wants the persons server to save
That's not what I read on his statement. He wants player to be forced into the lobby on join.
he wants session based server switching, a.k.a when player joins a specific server, the server selection gets persisted somewhere and when he rejoins it puts him back to the same server instead of lobby
good idea actually i might steal that for my own limbo server dedicated for authenticating people lol
im wondering.. does gradle shadow plugin does some kind of treeshaking in order to remove unused class dependencies from uber jar?
i think u need to relearn to read
๐
not by default
that's what minification is for
however people don't usually do minification since it is annoying to configure in some cases where your dependencies are reflectively depending on some classes
you can try adding minimize() to your shadowJar task configuration right now and see if anything breaks, if it doesn't then good, if it does then you got to check which classes error out and include them manually
https://gradleup.com/shadow/configuration/minimizing/ documentation about it
Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries
this comes back to runtime dependency resolution and why it is bad, it doesn't allow safely excluding "unncessary" dependencies
Done some learning to read and you were right
this should work for utility functions and classes tho just fine, the problem is with jdbc drivers and such which use native java methods through JNI
jdbc drivers are easy because most people who are using them and are trying to minify their jars probably already have a minification configuration out there you can take
just gotta look for the right terms on github
or if you're too lazy to figure it out then just exclude the whole jbdc driver from minification and you're good
usually a good idea anyway, some jbdc drivers like the sqlite one do wacky shit
most jdbc drivers I've used don't make use of natives
sqlite is the only one that comes to mind
most type 1 and 2 jdbc drivers are like this, but sqlite is probably the only one that actually is used out of all of them lol
I say all of them as if there were many, I think there is an db2 driver that is still type 2 but other than that, I don't believe there are many anymore
and people discourage type 1 drivers nowadays
A JDBC driver is a software component enabling a Java application to interact with a database. JDBC drivers are analogous to ODBC drivers, ADO.NET data providers, and OLE DB providers.
To connect with individual databases, JDBC (the Java Database Connectivity API) requires drivers for each database. The JDBC driver gives out the connection to th...
the only place that still has some documentation on what type 1, 2, 3 and 4 drivers were is now Wikipedia, the oracle page about it vanished with time lol
its been two months and i still dont seem find a way to implement rich domain models which do not use ORM's which bloat sql queries with useless update data
lets say i have
class User {
private final Email email;
...
public void changeEmail(Email email) { .. }
}
how would you persist only the change of email without trying to persist the whole entity (User), that would require to track changes somehow, or use some kind of service class which orchestrates persistence
is there a way to make it not run clean every time i package craftbukkit so i can test faster
also getting this error when I try to run the built craftbukkit
Error: Unable to initialize main class org.bukkit.craftbukkit.Main
Caused by: java.lang.NoClassDefFoundError: joptsimple/OptionException
do i need to run the bootstrap jar instead?
yes i do
i am doing a taser plugin, but i found an incompatibility that if i taser the player, it will no take damage if essential plugin is enabled, some of u know why? if i create a listener that listen EntityDamageByEntityEvent and send the damage direct to the player with player#damage it work. how i can fix this? I don't understand the connection between my plugin and the essential one
((the event is not cancelled))
Are you teleporting the player
yes, but i removed all listener of it but it is doing it always
makes me think he doesn't like the item or something
The essentials plugin will apply damage protection for players that you teleport
i retry removing all listener
You can just disable the teleport invulnerability in the essentials config
i use packet and i have to teleport for cancel the packet
I'm giving it to the public and they wouldn't put it on
Forcibly removing all listeners is a much worse idea
i try removing all packet listener etc.. for see if that is the bug
no is not the teleport, the blindless effect?
it can be?
ah yes, it is the bug but idk why, because i dont teleport the player xd
U just said u did tho
Hi,
this is of course for the legacy versions, but behind the scenes this maybe still applies. Does CraftItemStack#asBukkitCopy also copy user-defined NBTCompound data already applied on the nms stack? Some forum posts say no, some yes...
try it and see
So I am using a datapack to create my enchantments and wanted to do the coding in spigot. How could I detect the enchantment data on the item when interacting with a datapack?
Well up until now it seems to have worked. Weird stuff.
you can get the Enchantment from the Registry.ENCHANTMENT by its key, then get the level with ItemMeta#getEnchantLevel(Enchantment)
so like my datapack is name is ce and the id of the enchant is flare
I do something like?
Registry.ENCHANTMENT.get(NamespacedKey.fromString("ce:flare"))
Yes
They asked me, not you
Yes
You wanna fight >:(
Where can I find the source code of spigot?
?stash
if you wanna have it in a nicer readable format you can just run buildtools
please help
aSofian@H3R MINGW64 ~/Desktop/SPIGOTYARDIMI/spigot (version/1.8.8) $ ./applyPatches.sh Rebuilding Forked projects.... ./applyPatches.sh: line 40: cd: ../Bukkit: No such file or directory ./applyPatches.sh: line 11: cd: /c/Users/aSofian/Desktop/SPIGOTYARDIMI/spigot/Bukkit: No such file or directory fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the w orking tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' fatal: repository 'Bukkit' does not exist ./applyPatches.sh: line 20: cd: /c/Users/aSofian/Desktop/SPIGOTYARDIMI/spigot/Spigot-API: No such file or directory Resetting Spigot-API to Bukkit... error: No such remote: 'upstream' fatal: ambiguous argument 'upstream/upstream': unknown revision or path not in t he working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' Applying patches to Spigot-API... fatal: Resolve operation not in progress, we are not resuming. Applying: POM Changes error: sha1 information is lacking or useless (checkstyle.xml). error: could not build fake ancestor Patch failed at 0001 POM Changes hint: Use 'git am --show-current-patch=diff' to see the failed patch hint: When you have resolved this problem, run "git am --continue". hint: If you prefer to skip this patch, run "git am --skip" instead. hint: To restore the original branch and stop patching, run "git am --abort". hint: Disable this message with "git config advice.mergeConflict false" Something did not apply cleanly to Spigot-API. Please review above details and finish the apply then save the changes with rebuildPatches.sh
Rerun BuildTools in an empty folder
aSofian@H3R MINGW64 ~/Desktop/qwdqwdwqdwqdwq/Spigot (master)
$ cd Spigot-Server
bash: cd: Spigot-Server: No such file or directory
aSofian@H3R MINGW64 ~/Desktop/qwdqwdwqdwqdwq/Spigot (master)
$ ^C
aSofian@H3R MINGW64 ~/Desktop/qwdqwdwqdwqdwq/Spigot (master)
$ ls
LICENCE.txt README.md pom.xml src/
aSofian@H3R
yeah what about it
Why Spigot-Server folder is not created
probably because BuildTools didn't finish running
How can I edit the HandshakeListener.java file and turn it into a spigot again?
?xy
What are you trying to do and why
Exception in thread "main" java.lang.RuntimeException: Error patching Block.java
at org.spigotmc.builder.Builder.lambda$startBuilder$2(Builder.java:617)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Iterator.forEachRemaining(Unknown Source)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.forEach(Unknown Source)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:568)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)
Caused by: difflib.PatchFailedException: Incorrect Chunk: the chunk content doesn't match the target
at difflib.Chunk.verify(Chunk.java:86)
at difflib.ChangeDelta.verify(ChangeDelta.java:78)
I added authkey protection to my client and added it to my server. It works on bungeecord but the spigot server disconnects because of the extra package.
example bungeecord comamnd:
package net.md_5.bungee.protocol.packet;
import io.netty.buffer.ByteBuf;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class Handshake extends DefinedPacket
{
private int protocolVersion;
private String host;
private int port;
private int requestedProtocol;
private String authKey;
@Override
public void read(ByteBuf buf)
{
protocolVersion = readVarInt( buf );
host = readString( buf, 255 );
port = buf.readUnsignedShort();
requestedProtocol = readVarInt( buf );
if (buf.isReadable()) {
authKey = readString(buf);
} else {
authKey = null;
}
}
@Override
public void write(ByteBuf buf)
{
writeVarInt( protocolVersion, buf );
writeString( host, buf );
buf.writeShort( port );
writeVarInt( requestedProtocol, buf );
if (authKey != null) {
writeString(authKey, buf);
}
}
@Override
public void handle(AbstractPacketHandler handler) throws Exception
{
handler.handle( this );
}
public String getAuthKey() {
return authKey;
}
}
Why are you sending a custom packet vs a CustomPayload packet
^^
(Which is what plugin messaging is)
The problem is that when entering spigot from bungeecord, I think it disconnects because the authkey value is an extra package.
how is it done
Since I couldn't find any resources, this is what chatgpt suggested :(
..
inetaddress = InetAddress.getByName(ip);
GuiConnecting.this.networkManager = NetworkManager.func_181124_a(inetaddress, port, GuiConnecting.this.mc.gameSettings.func_181148_f());
GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen));
GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN, "PASSWORD"));
GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile()));
What should I write here?
Hello, I'm trying to send a message to my spigot server, the channel should be fine, this is the code (im fairly new to bungee, sorry if the code is trash ๐);
Bungee side:
```getProxy().registerChannel("staff:vanish");
getLogger().log(Level.INFO, "Staff ยงaEnabled");
}
@Override
public void onDisable() {
getProxy().unregisterChannel("staff:vanish");
getLogger().info("Staff Disabled");
}```
Spigot Side:
public void onPluginMessageReceived(String channel, Player receiver, byte[] message) {
try {
DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
String subchannel = in.readUTF();
if (subchannel.equals("VANISH")) {
String action = in.readUTF();
String playerName = in.readUTF();
Player player = Bukkit.getPlayerExact(playerName);
if (player == null) return;
getLogger().info("Received plugin message: " + subchannel + " - " + action + " for " + playerName);
if (action.equalsIgnoreCase("on")) {
plugin.getVanishManager().vanish(player);
} else if (action.equalsIgnoreCase("off")) {
plugin.getVanishManager().unvanish(player);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}```
Could you show us how you send the message
String message = vanish ? "vanish:on" : "vanish:off";
player.sendData("staff:vanish", message.getBytes());
}```
okok, thank you very much! ๐
I tried to even put it in chatgpt, didnt help at all ๐
google search is often more useful than chatgpt
it's a dying skill sadly
i tried to google "messenger spigot not working" ๐ญ
but yeah, i will try to google more from now on
thanks for the help very much
yeah knowing what to search for is a skill worth learning
๐
Hi, I was wondering if anyone here knew whether snowball projectiles (and egg projectiles) get knocked back by tnt explosions or not. I made this little plugin that would shoot a bunch of explosive snowballs with a block display. The issue is, sometimes these snowballs mysteriously bounce back or ricochet and land somewhere else. I have no idea what can be causing this...
I thought it would be the explosions but I can't seem to replicate the issue with normal tnt and snowballs/eggs
Then there's also this, where it's just a single one. All the previous explosives worked but for some reason, in this very specific configuration/scenario it keeps ricocheting. I think it's linked, but the difference is that with the single projectile it ricochets into outer space
Probably
I wasnt able to find anything on disabling projectile knockback
what if I say no?
I get sad
i can do that
? How?
with great prejudice
cancel the entity knockback event
and connections to local kennels
i'm not sure if that applies here but it's worth a shot
plugin channels my beloved
Are there any projectiles that don't have knockback?
just cancel the event
You can also cancel the damage to remove the knockback
Actually the knockback event wonโt work since itโs only called for living entities
snowballs don't trigger on the damaged event
inetaddress = InetAddress.getByName(ip);
GuiConnecting.this.networkManager = NetworkManager.createNetworkManagerAndConnect(inetaddress, port, GuiConnecting.this.mc.gameSettings.isUsingNativeTransport());
GuiConnecting.this.networkManager.setNetHandler(new NetHandlerLoginClient(GuiConnecting.this.networkManager, GuiConnecting.this.mc, GuiConnecting.this.previousGuiScreen));
GuiConnecting.this.networkManager.sendPacket(new C00Handshake(47, ip, port, EnumConnectionState.LOGIN));
GuiConnecting.this.networkManager.sendPacket(new C00PacketLoginStart(GuiConnecting.this.mc.getSession().getProfile()));
PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
buffer.writeString("password");
C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
GuiConnecting.this.networkManager.sendPacket(authPayload);
will my code be like this?
what are you trying to do
What I want to do is to send a packet by the extra client when entering the server and if there is such a packet in bungeecord, it will put it into the game, if not, it will throw it from the server.
so, let me check if I got this right
you want to send a payload for authentication from the client to the server and now you're asking how to receive that packet in the server
yes
how can i do this
I've been trying to do this for 2 days.
all you have to do is register a channel with netty in the bungeecord side
you could do it with plugin messages if you use the Bungeecord channel but seeing as you're doing this right on the login phase, it's probably too early to receive plugin messages
How can I record a channel with netty? Is there a sample code?
may I ask though, what is the point of this? A plain-text password isn't providing a lot of security to a server
to prevent other clients from entering the server
Security is not that important, I think Turks would never think of that :)
well, try with bungeecord's plugin messaging channels first, since I doubt bungee exposes netty by itself
Is there a sample code?
it should, otherwise they'd have to reimplement the whole pipeline for receiving packets lol
like Minestom does for example :p (iirc)
Is client side packet sending correct?
and how do i get it with netty
Is there a sample code?
have you considered just letting people type their password
like most offline mode servers do
They will have entered my server from all kinds of different clients :D
so?
your custom packet thing is super simple to bypass
you will just loose out on players since they need to install your mod
Don't worry, Turks are not that intelligent :)
If it was, they would pass the game servers like Sonoyuncu
I am suspicious of what you're trying to accomplish with this but alas
@waxen anchor do you have a bungeecord plugin already? If not then start there
package luaclient.server;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.LoginEvent;
import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.ProxyPingEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.ServerPing;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.awt.TextComponent;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.nio.charset.StandardCharsets;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
public class Main extends Plugin implements Listener {
private final Set<UUID> allowedPlayers = ConcurrentHashMap.newKeySet();
private final String CHANNEL_NAME = "MyAuthChannel";
private final String EXPECTED_AUTH_KEY = "password";
@Override
public void onEnable() {
getProxy().getPluginManager().registerListener(this, this);
getLogger().info("Waterfall plugin etkin!");
}
@Override
public void onDisable() {
getLogger().info("Waterfall plugin devre dฤฑลฤฑ!");
}
@EventHandler
public void onPing(ProxyPingEvent event) {
ServerPing ping = event.getResponse();
ping.setVersion(new ServerPing.Protocol("LuaClient", -94408)); // 1.20.4 protokol
event.setResponse(ping);
}
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if (!event.getTag().equals(CHANNEL_NAME)) return;
if (!(event.getSender() instanceof ProxiedPlayer)) return;
ProxiedPlayer player = (ProxiedPlayer) event.getSender();
try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
String authKey = in.readUTF();
if (!"password".equals(authKey)) {
// Authkey yanlฤฑลsa oyuncuyu at
player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤrulanamadฤฑ!"));
getLogger().info(player.getName() + " authKey doฤrulanamadฤฑฤฤฑ iรงin atฤฑldฤฑ.");
} else {
getLogger().info(player.getName() + " baลarฤฑyla doฤrulandฤฑ.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
yes i have
Sounds like a worse version of ye olde badlion client
looks alright to me
that's all you need for it to work
whats lunar client up to with badlion now
01:17:05 [SEVERE] at java.base/java.io.DataInputStream.readFully(DataInputStream.java:215)
01:17:05 [SEVERE] at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:597)
01:17:05 [SEVERE] at java.base/java.io.DataInputStream.readUTF(DataInputStream.java:555)
01:17:05 [SEVERE] at luaclient.server.Main.onPluginMessage(Main.java:60)
01:17:05 [SEVERE] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
01:17:05 [SEVERE] at java.base/java.lang.reflect.Method.invoke(Method.java:565)
01:17:05 [SEVERE] at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:19)
01:17:05 [SEVERE] at net.md_5.bungee.event.EventBus.post(EventBus.java:49)
01:17:05 [SEVERE] at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:448)
01:17:05 [SEVERE] at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:337)
01:17:05 [SEVERE] at net.md_5.bungee.protocol.packet.PluginMessage.handle(PluginMessage.java:81)
01:17:05 [SEVERE] at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:151)
01:17:05 [SEVERE] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
01:17:05 [SEVERE] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:293)
01:17:05 [SEVERE] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
01:17:05 [SEVERE] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)
01:17:05 [SEVERE] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
01:17:05 [SEVERE] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:107)
01:17:05 [SEVERE] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
01:17:05 [SEVERE] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
01:17:05 [SEVERE] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
01:17:05 [SEVERE] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:359)
01:17:05 [SEVERE] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)
01:17:05 [SEVERE] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
01:17:05 [SEVERE] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:167)
01:17:05 [SEVERE] at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:445)
01:17:05 [SEVERE] at io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:383)
01:17:05 [SEVERE] at io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:577)
01:17:05 [SEVERE] at io.netty.channel.nio.NioIoHandler.processSelectedKeysPlain(NioIoHandler.java:522)
01:17:05 [SEVERE] at io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:495)
01:17:05 [SEVERE] at io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:470)
01:17:05 [SEVERE] at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:204)
01:17:05 [SEVERE] at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:175)
01:17:05 [SEVERE] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1073)
01:17:05 [SEVERE] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
01:17:05 [SEVERE] at java.base/java.lang.Thread.run(Thread.java:1447)
just making more money by killing competition ig
I got an error
is that from the client or the server?
on the next step thing they announced it they would keep it alive but add similar features to each
luaclient.server.Main.onPluginMessage(Main.java:60)
this is gonna sound really wild, do you actually know java before attempting this?
String authKey = in.readUTF();
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if (!event.getTag().equals(CHANNEL_NAME)) return;
if (!(event.getSender() instanceof ProxiedPlayer)) return;
ProxiedPlayer player = (ProxiedPlayer) event.getSender();
try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
String authKey = in.readUTF();
if (!"password".equals(authKey)) {
// Authkey yanlฤฑลsa oyuncuyu at
player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤrulanamadฤฑ!"));
getLogger().info(player.getName() + " authKey doฤrulanamadฤฑฤฤฑ iรงin atฤฑldฤฑ.");
} else {
getLogger().info(player.getName() + " baลarฤฑyla doฤrulandฤฑ.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
EOFException means it read more than it needed to
since that's the only call made to the reader i'd wager the byte array is empty and it threw that while trying to read the string length prefix
it's probably just the fact that it doesn't have a string length prefix
they didn't use a DOS when sending the packet from the client
What can I do to solve this error?
my client NetHandlerLoginClient.java code:
public void handleLoginSuccess(S02PacketLoginSuccess packetIn) {
this.gameProfile = packetIn.getProfile();
this.networkManager.setConnectionState(EnumConnectionState.PLAY);
this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));
PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
buffer.writeString("password"); // authKey
C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
this.networkManager.sendPacket(authPayload);
}
just use a data output stream to send the string on the client
writeString on a buffer isn't the same as readUTF on a data input stream
you can either change this to use Netty's ByteBufUtil to read the string
or change this to use a DataOutputStream to send the data
public void handleLoginSuccess(S02PacketLoginSuccess packetIn) {
this.gameProfile = packetIn.getProfile();
this.networkManager.setConnectionState(EnumConnectionState.PLAY);
this.networkManager.setNetHandler(new NetHandlerPlayClient(this.mc, this.previousGuiScreen, this.networkManager, this.gameProfile));
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
DataOutputStream dataout = new DataOutputStream(byteStream);
try {
dataout.writeUTF("password");
dataout.flush();
PacketBuffer buffer = new PacketBuffer(Unpooled.wrappedBuffer(byteStream.toByteArray()));
C17PacketCustomPayload authPayload = new C17PacketCustomPayload("MyAuthChannel", buffer);
this.networkManager.sendPacket(authPayload);
} catch (IOException e) {
}
}```
Did it happen?
sure that works, but use a try-with-resources on the DataOutputStream
i don't think it uses any native resources
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if (!event.getTag().equals(CHANNEL_NAME)) return;
if (!(event.getSender() instanceof ProxiedPlayer)) return;
ProxiedPlayer player = (ProxiedPlayer) event.getSender();
try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
String authKey = in.readUTF();
if (!EXPECTED_AUTH_KEY.equals(authKey)) {
// Authkey yanlฤฑลsa oyuncuyu at
player.disconnect(new net.md_5.bungee.api.chat.TextComponent("AuthKey doฤrulanamadฤฑ!"));
getLogger().info(player.getName() + " authKey doฤrulanamadฤฑฤฤฑ iรงin atฤฑldฤฑ.");
} else {
getLogger().info(player.getName() + " baลarฤฑyla doฤrulandฤฑ.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
welp, congrats then
But how do we remove the ones that are not true from the server?
or those who do not send packages
any player without your mod isn't going to send the packet, meaning they're going to get disconnected as per your code
It works when I log in from a different client.
It just doesn't log like the message below
01:35:42 [INFO] [LuaClient] Player792 baลarฤฑyla doฤrulandฤฑ.
well, that's weird, you literally disconnect them if they don't send the packet
But it does not trigger the onPluginMessage event every time someone enters the server.
perhaps it is as I said and it is probably too early in the login process to receive the plugin message
Wonโt the message only be sent if they login with their client
When I log in with my own client, there is no problem, it sends messages, but when I log in with another client, it does not send messages from the server.
Otherwise no message is sent and therefor no player.disconnect gets called
that's what happens anyway
only my client triggers the onPluginMessage event
But since other clients do not send messages, they can bypass this event and log in to the server.
Use the plugin message to mark that the player is allowed to join
Then use a join event or whatnot to prevent any other players from joining
how do i do that
Can we check if the onPluginMessage code is coming in the onLogin event?
oh right that makes sense
or onPostLogin event
how can i do this
since you send the plugin message really early, you probably can get away by adding them to a map in the login event and then removing them from that map in the plugin message event, if they're still on the map on post login then you just kick them
I will put my loop that controls it according to its uuid
If the message arrives before the AsyncPlayerPreLoginEvent you can just stop them joining there
Otherwise you could stop them in the PlayerLoginEvent
What should I do now in short?
add them to a map in the plugin message event, then in either of the events Jish mentioned you just check whether they're there or not, if not you disallow the connection
private final Set<UUID> pendingAuthPlayers = ConcurrentHashMap.newKeySet();
@EventHandler
public void onLogin(LoginEvent event) {
pendingAuthPlayers.add(event.getConnection().getUniqueId());
}
@EventHandler
public void onPluginMessage(PluginMessageEvent event) {
if (!event.getTag().equals(CHANNEL_NAME)) return;
if (!(event.getSender() instanceof ProxiedPlayer)) return;
ProxiedPlayer player = (ProxiedPlayer) event.getSender();
try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(event.getData()))) {
String authKey = in.readUTF();
if (!EXPECTED_AUTH_KEY.equals(authKey)) {
player.disconnect("AuthKey doฤrulanamadฤฑ!");
getLogger().info(player.getName() + " authKey doฤrulanamadฤฑฤฤฑ iรงin atฤฑldฤฑ.");
} else {
pendingAuthPlayers.remove(player.getUniqueId()); // Baลarฤฑyla doฤrulandฤฑ
getLogger().info(player.getName() + " baลarฤฑyla doฤrulandฤฑ.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
@EventHandler
public void onPostLogin(PostLoginEvent event) {
UUID playerId = event.getPlayer().getUniqueId();
if (pendingAuthPlayers.contains(playerId)) {
event.getPlayer().disconnect("AuthKey gรถnderilmedi!");
getLogger().info(event.getPlayer().getName() + " authKey gรถndermediฤi iรงin atฤฑldฤฑ.");
}
}
Does this work?
it could work, though you could probably kick them even earlier
doesn't really matter anyway, try it and if it works then good
This time the plugin didn't send the message so he kicked everyone :(
I need to wait somewhere
But what will someone with bad internet do?
it probably wasn't that it didn't send it but rather that it was sent too late then
yes
the order of the events stay the same regardless of whether one has latency or not
check at which point your payload packet is sent first
what is the order of events in bungeecord for the login phase
what is called first, ServerConnectEvent or the login ones?
I have no idea :(
ClientConnectEvent -> PlayerHandshakeEvent -> PreLoginEvent -> PostLoginEvent -> LoginEvent -> ServerConnectEvent -> ServerConnectedEvent -> ServerSwitchEvent this is the order apparently
you probably want either LoginEvent, ServerConnectEvent or ultimately the ServerConnectedEvent but I doubt you send the packet that late
S02PacketLoginSuccess, you're sending your packet on the handler for this packet, to me that sounds like ServerConnectEvent/ServerConnectedEvent
guys, Im writing a purpur plugin, and I need to add an NMS. What is the best way to do this?
there we go
purpur is a paper fork, and sir this is Spigot
Well, if we put the encryption as AES 256 and a date at the end, would that be ok?
Kind of pointless since the client has the password anyways
Didn't you say they wouldn't take the packages? They could.
you can encrypt the password if you want, but it is pointless because the client mod has the password in plain text
I encrypt by date, for example, I will write the minute somewhere in the text, if it does not match the plugin, it will not be sent to the server.
there is no point
then there is no need :)
even if you encrypt the password, it'll be part of the mod code, which they can just decompile to get, they don't have to decrypt it to use it
Iโm trying to think of what the proper method for this would be
The client gets an auth token from a central server that would only be valid for a few minutes?
And then uses that to auth with the minecraft server
If it is not necessary, there is no need. The idea in my mind was something like I would encrypt a key + minute with AES256 and even if the password was captured, it would be canceled because 1 minute would pass.
the best thing you can do is just update the password regularly by updating the mod so that they can't access even if they decompile older versions of the mod
I think so too
security by obscurity would be the reasonable choice here since you could make a really complex authentication algorithm but there is no way to prevent someone from spoofing it if it is generated on the client
the only way to make it secure would be the same way websites do it, by doing all authentication on the server
but for that you'd have to setup a registration and login process, which I imagine is something you wouldn't want to deal with
I think it's enough for now, I don't think there are people who can find it.
I'm also wondering about something, how do some servers do the HD skin logic? For example, they sell HD skins for money. Even if we assume that we add it to the client, how do they add it to the server, especially to plugins like skinrestorer?
they don't have to do anything on the server to make it work
wtf is an HD skin
though I have no idea what an hd skin is, the skin rendering logic is handled on the client
Minecraft skins have a fixed size
I imagine something popular on turkish servers
For example, there are 512x512 ones
They are what we call HD
Where can I upload a photo here? I want to upload a sample skin photo from a server.
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
beat me to it yet again
if this was the wild west I'd have been shoot by you twice Jish, you won't get me again
this is a thing apparently, never seen it myself though
they probably just remove the client-side limitation for skin resolution
How do they do it server side?
you can't do that server side
How do they define this for plugins like skinsrestorer?
If itโs a custom client they can do whatever they want
Otherwise maybe some core shader magic could do it
all skin restorer does is ask the client to re-render a skin
For example, what should I do to create an HD skin system?
they probably have their own skin services to handle this, though, since I doubt you can upload hd skins to minecraft servers
๐modsโจ
Which
:D
You could in theory use some of the empty space in a normal skin to add more detail
makes sense
Assuming you had a mod that count render it
Idk how much extra space there is though
So how can I download Forge to MCP? (mods file will be closed to the outside)
you mean, hardcoding your mod into the client?
Eh not that much
yes
there's probably resources online about that in the bukkit or forge forums, you'd just have to ask google to show everything before 2014
Can't we do it directly manually? Instead of mod, can we set a certain pixel number to 512?
just copy whatever the mod does into your client and you're good
I didn't want to spoil my mcp now (my 50th spoil)
Do I need to decompile the mod?
the hd skins mod I linked above is open source
so you can just look at it
probably want to look at their earliest branch (the 1.12 one)
but I'm using 1.8.9 :D
doesn't really matter, skin logic hasn't changed at all since then
Well have fun backporting
We tolerate it because our Turkish youth like 1.8.9 pvp more.
that's every community except the english one for whatever reason
here in the latin community everyone plays on 1.8.9 too
It is loved very much :D
unfortunate
Can I say the line
Okay, I'll ask a very good question. How do I set this up? It seemed very complicated to my client. :(
?howold 1.8
Minecraft 1.8 is 10 years, 9 months old.
:D
oh no 1.8 modding...
it is very complicated, no way around it
mostly because you have to backport, otherwise it'd be easy
g'old times
had you made your authentication mod with legacy-fabric instead of hardcoding it into the client, it'd probably have been easier but no way around it now
I'm watching a 12-year-old video right now and the guy is installing forge on MC 1.2.5 :))) he's a crazy guy
But then people could inject other mods!!!!11112
I remember trying to make a mod with mccreator
and failing at it since I didn't understand the concept of having to make 3d models by myself
I just thought people calculated those in code or something, the idea of there being baked models didn't sit right with my mind
it still doesn't to this day, I use python to generate graphs
What time is it there? I'm about to die of insomnia. :D
Unreal Engine 6โข๏ธ: Generate 3D models programmatically
I remember trying to write a minecraft plugin in Windows Notepad because my dad didn't allow me to install random software when I was like 6
turns out that it does not work really well when you don't build your plugins
weird right?
Wait until you hear about skript!
oh no
I know more than one person that started off with Skript, honestly amazed it is still a thing today
Technically you could do this with my jshell plugin
:p
great Coll but I am not 6 anymore :p
it is good as an introduction to programming, if that were their focus then it'd probably be a lot more sucessful of a project
I've been able to use maven since I was 9 years old
lmao
what jshell plugin
did you make a repl for spigot
Pretty much
that's cool, it's one of the things I was working on
I was actually working on a plugin called scratchpad which would let you load single-file java "scripts"
but it somehow diverged into a repl as well
Itโs actually pretty easy to get JShell to work with spigot
Just need a little bit of classloader suffering
oh I thought you had made one from scratch, didn't even think of hacking away jshell
since it is open source I guess you could just scrap the entrypoint and make it a plugin
huh
gta 5 is older than minecraft 1.8
than 1.7.2 too apparently
gta 5 came out around 1.7.2 though, no?
it was definitely in 2013
yeah, September vs October 2013
https://dev.bukkit.org/projects/hdskinner
What is this? Will it work for me?
one month difference, crazy
god damn
SQLibrary
today is the feel older by the minute day
I always wondered why every single plugin back in the day used that library
were we just all kids back then and nobody but that one guy understood how to use SQL, who knows
Hot damn thatโs a 1.5.2 plugin
INSERT INTO :D
Now weโre going back
Jish, it is a spout plugin
Off, is there any updated plugin? Up to 1.8 as I said.
?howold 1.5.2
Minecraft 1.5.2 is 12 years, 1 month old.
hm, I thought it would have a title
lame
that doesn't sound right, 1.5 is 15 years old to me
that is the version I started playing on
Minecraft 1.0 is 13 years, 6 months old.
Fuckin hell
grandpa
not a big difference, how many versions did minecraft release that year
Minecraft 1.7.10 is 10 years, 11 months old.
Hmm
I remember trying out 1.3.2 first, but I couldn't figure out how to break wood
I definitely remember starting to make plugins in 1.7.10
Off HD skin why is it so hard
But I swear it was longer than 11 years ago
i was too young to realize you could hold to break blocks, so I just didn't play until a friend actually taught me how to break wood
my first experience with Minecraft was in 1.4.2 with a friend who had TMI
same lol
and then 1.8 happened n it was like how the hell do i download craftbukkit
when I got home I go ahead and get 500 viruses before I get a successful Minecraft install, launch the game, inventory menu looked nothing alike
much confusion
TMI was a necessity, the old creative menu was.. uh
uh
I remember there was a cursed plugin that let your server have 1.8 features and allow 1.8 clients
TMI and Rei's minimap were THE mods back then
I remember when they added waypoints that were beacons in 1.8, it was amazing
oh yeah reis
you mean 1.7.10 protocolhack version
then the redstone update came and ohmygod HOPPERS LOOK THERE'S HOPPERS AND A REDSTONE BLOCK, everyone bully coal for not having a coal block!!
what the fuck is this
then they added horses and donkeys and coal blocks in 1.6 and I stopped playing
There was a big downtime between spigot 1.7 and 1.8
Due to the dramaโข๏ธ
So that plugin happened
it makes me think that I must have stopped playing minecraft way too many times yet I come back to it even now lol
I still hold my belief that whenever hypixel closes bedwars 1.8, it's when I finially leave the minecraft community but still
I also have way too much knowledge about minecraft, I get FOMO every time a new update comes and I don't know how it works
oh don't ask me anything about new versions, name any thing that's been added in the past 5 major updates and I'm as good as dead
I miss playing the adventure maps on the server
Creaking
?????
isn't that a uh
fetish, what's it called
diapers
I wish I didn't know that
Iโฆ
Yeah
when I grow old, I wanna be just like him
Heโs happy because you saved him
You found his dried corpse in the nether, brought it home and moistened it
I am still wrapping my head around datapacks and how they handle worldgen
Now he lets you ride him around and stand on his head to build
that's epic
Iโve been wanting to ask around in the mc worldgen discord about that for a while, seems all them over there know a good bit about it
guy-ass lookin dood
lookin like the kinda guy who'd invite you to a bbq and then grill some paddies
Why do I feel like I saw a dude with similar glasses somewhere else...?
Claggor from Arcane?
Carl from up but as a kid?
idk its just a typical aviator cap
this dude is quite similar lol
I made this plugin that spawns an airstrike where snowballs (invisible) with a block display mounted on it are pushed towards a destination and explodes on impact.
Issue is, the snowballs get knocked back by the explosions and fly in all sorts of directions. Spent 8 hours now trying to fix this bs.
I've tried:
Listening to the knockback event, but it does not check for snowballs being knocked back. (it does check for snowballs knocking something else back, besides snowballs)
Scanning for more snowballs in the radius of an explosion, then prematurely exploding those, but it's very unstable and unreliable.
Tried multiple projectiles, but they all have the same issue.
Listening to the entity damaged event, but snowballs apparently do not get damaged...
I don't know anymore
probably tried more things that I forgot about too
ok
what the f
I thought of just disabling the explosions to recreate my own with no knockback, but they still fly all over the place....
please help I'm going insane
?jd-s
That looks like those fireworks causing explosions
bunch of particles
but I found the issue
idk how to solve it yet but I'll find something. It's not knockback fixed it, finally
is this a simulation of iraq or something?
(don't ban me please)
LOL
๐ซ
Any suggestions to make it look better?
atm I'm using the following particles:
flash, explosion_emitter, large_smoke, lava, warped_spore, white_ash
some of them you can't see bcs I'm too far away
crazy
without resource packs and easily? just a few flashes ig
you could also look into adding like simulated rubble or smoldering projectiles that carry particle effects with them
there are some very cool things you can do with block entities like demonstrated here, but they're also rather difficult and probably not very performant with how many entities they use. can be quite laggy on clients https://www.youtube.com/watch?v=OKXTGbp6AMk&t=6s
with resource packs i reckon some impact flash frames could be cool, or some shockwave particles
Space lasers using block display entities.
Source Code:
https://github.com/TheCymaera/minecraft-sky-torch
Forest Map:
https://www.planetminecraft.com/project/ambertry-forest/
Garden Map:
https://www.planetminecraft.com/project/spider-garden/
All my links:
https://heledron.com/links/
Tools used:
Complementary Shaders (Reimagined):
https://mo...
this video also shows a lot in how you can use subtle effects to create a much more impactful feeling explosion
Ive been wondering if I could do beacon beams and point it at things but what he did is great, I'll use that
yeah its really cool isnt it
yeah, but very complicated and performance heavy too haha
I'll use the beam idea though, I'll add that as an option to my airstrike. And I'll add some camerashake
It wouldn't be that performance heavy
and I'll see if I can do the magma blocks but idk
at most its a few hundred block displays
and all the block updates (removing them, replacing with other blocks or air) etc. takes some time to render too
for the server its no big deal but clients can at times start lagging with hundreds of entities
that guy
any idea how he made the beam bright?
If I just use block displays they'll be kinda dark if there's no light shining on them
He has the source in the descriptionm
yeah I just found that, but it had a weird input. Fixed that now
Hello, I'm trying to make a Vanish with Bungeecord (to learn), bungee instance sends the message, but the paper doesnt recieve it, someone knows why?
Spigot side:
plugin.getLogger().info("onPluginMessageReceived() triggered! Channel: " + channel);
try {
DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
String subchannel = in.readUTF();
switch (subchannel) {
case "blabla": {
//
}
case "VANISH": {
String action = in.readUTF();
String playerName = in.readUTF();
Player player = Bukkit.getPlayerExact(playerName);
if (player == null) return;
getLogger().info("Received plugin message: " + subchannel + " - " + action + " for " + playerName);
if (action.equalsIgnoreCase("on")) {
vanishManager.vanish(player);
} else if (action.equalsIgnoreCase("off")) {
vanishManager.unvanish(player);
}
break;
}
}
} catch (Exception e) {
e.printStackTrace();
}
}```
Spigot main:
```getServer().getMessenger().registerIncomingPluginChannel(this, "staff:vanish", handler);
getServer().getMessenger().registerOutgoingPluginChannel(this, "staff:vanish");```
Bungee side:
```private void sendVanishPluginMessage(ProxiedPlayer player, boolean vanish) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("VANISH");
out.writeUTF(vanish ? "on" : "off");
out.writeUTF(player.getName());
System.out.println("Sending VANISH message for " + player.getName());
player.sendData("staff:vanish", out.toByteArray());
}```
I read the whole docs, yet I still can't figure it out, I'm probably just super dumb ๐
wait let me see
it looks fine on a first glance
i'm not sure if this is the correct way to send custom plugin messages tho
wait i found this
you must register on proxy channel too
@graceful patrol
oops, my bad, I didnt send it here, but yeah, I do have it registered
getProxy().registerChannel("staff:vanish");
on plugin message side replace it with
ByteArrayDataInput in = ByteStreams.newDataInput(message);
so it's consistent
tho it should work nonetheless
nope, still nothing
paper didnt recieve anything
the whole "event" is not firing for some reason
plugin.getLogger().info("triggered, channel: " + channel);
^
didnt fire at all, its on the start of onPluginMessageRecieved(), nothing should prevent it
wouldn't it be better if you instead just made a proxy command?
wonder if you could just do the whole vanishing from the proxy ๐ค
it actually is a proxy command, but I'm sending a message to the paper plugin to hide the player
- i "delete" the join message for the staff member
declaration: package: org.bukkit.event.player, class: PlayerJoinEvent
seems maybe you really don't need the proxy for this
unless you are going to handle all the stuff on the proxy and not on the server at all, which you technically could
but it wouldn't make sense to do all that work though lol
i am making it as a proxy command, which will vanish the staff member even after he switched servers (using /server <name> etc.), that is why i need proxy, tbh you can do it through a database and not with proxy, but eh
you could technically do it through the permissions
since most people have a DB for permissions
all you would do is enable the permission, then its a matter of checking that regardless of which server they go to
now, you don't have to deal with multiple DB tables and making use of what you already have ๐
this is probably the better method because you can't interact with a server that has no players using plugin messaging
and if the only player is the one who is joining, it can cause issues before the player fully joined if they are the only one
as for the join message, I would recommend you modify the plugin to still log that they joined, just not send the join message
this way when looking through logs you can still see your staff members joining in case something happens etc
if its free why don't you make it yourself?
Itโs country restrictions
then use something that isn't restricting countries
or use a vpn
or the country you are from anyways
Itโs patched
wouldn't make sense to have somone make you a server you can't even connect to though
Wait what
well if you dont need the server for anything special, you can just use localhost
Then how can I connect to Germany server like aternos
Itโs for my friend and I
use the essential mod, that way you can just connect to eachother
Oh my friend is in bedrock
or use ngrok ๐คทโโ๏ธ
And other from Java
you said the host was country restricted hence you need someone who is from a country not restricted by the host right? if that is the case then only they could connect to the server and actually test anything, you might still have access to the web panel but that is it lol.
well, use ngrok and just install geyser on it
What is Ngrok
๐ญ
Sry autocorrect
thats wild
lol
in case you were curious, Negroni is a cocktail
๐ฅธ
better than ngrok i can tell you that
What server hosting you recommend then
none you can afford
Stop๐ญ๐ญ๐ญ
all the free ones are crap
Oracle free tier
Fr
Except I guess oracle
you can atleast do something with it
but its a pain to use so I have heard
Hey skull it all you want it can run ATM10
ive been waiting over a month for them to restock their servers
90% of the time, you cant create the vps
lol
Yeah getting it is the hard part
you can register, but they dont restock ๐
yeah lol
But once you get one it's not too bad
restocking == users deleting their servers
idk which country you are in, I would look into getting a hetzner vps or ovh server from like kimsufi (their cheapest)
recommending oracle is like recommending contabo bru
I couldn't say since I never used an oracle free tier vps
Ok
lol
What is a vps
they give you like a micro server at first and then you wait a few years and you get their arm server
its a virtual private server. Means your server is not the only one on the box
My professional server is production ready for any scale applications https://media.discordapp.net/attachments/1377794974782980196/1377997680349020220/IMG_20220917_173134.png?ex=68478618&is=68463498&hm=9f598015308bc67d7830b3fa177c6a149aa7cace80a4edc7c7c663b79cdff389&=&format=webp&quality=lossless&width=720&height=960
OVH specializes in renting entire boxes
we got ads in spigotmc help-dev now
๐ญ
Anton is a good option for everyone
Ima try to make oracle server then
to be fair, google doesn't have a case for their servers either
you need a debit card that has at least 1โฌ on it
or a credit card
Oh I donโt have a card
probably should have specified that in the beginning ๐
maybe ๐ญ
lol
no negroni for you
So what should I use then
Wow, this is rude to say something like that in front of a person promoting their data center. I am hosting provider ANTON can supply you with the newest server components if you got a need of them
you should try it, its a sweet drink not all that terrible
๐ญ๐ญ๐ญ
Anton obviously
thats good
the newest i5 4670k and 16 gigs of ddr3
i actually love sweet drinks ngl
You gonna sent it for free?
dang bro
moscow mules are probably one of my favourite cocktails since they tend to be so sweet
for 20$ a month i will provide a vps with 4 vcpus and 8gb of ram
but how much space?
160gb
a bit over priced but within market prices though
i have to make some money on buying a hetzner vps
for 20$ a month i will provide one bar of chocolate sent to your mailbox once a year
Negroni๐ฅธ
no hetzner
true we all need to make money
i also barely use my oracle vps i have an actual hetzner one now
Are you paying for it with alpacas
no, great british pounds actually
Iโve search it it is available to play on a server that restricted your country
then what is the point of the restriction?
why couldn't you set it up if the restriction doesn't apply to you
Well I donโt really know
Maybe to restrict number of people using it
For it to be exclusive and sell their paid plans
in either case sounds like you shouldn't have an issue setting it up yourself then
It restrict to make a free server in my country
someone knows why my onPluginMessageRecieved "event" does not fire at all?
it is registered in proxy:
getProxy().registerChannel("staff:vanish");
even in main class (in paper plugin):
getServer().getMessenger().registerIncomingPluginChannel(this, "staff:vanish", handler);
getServer().getMessenger().registerOutgoingPluginChannel(this, "staff:vanish");
the code:
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
try (ByteArrayInputStream byteIn = new ByteArrayInputStream(message);
DataInputStream in = new DataInputStream(byteIn)) {
String subChannel = in.readUTF();
if (subChannel.equals("VANISH")) {
String action = in.readUTF();
String targetName = in.readUTF();
Player target = Bukkit.getPlayerExact(targetName);
if (target != null) {
boolean vanish = action.equalsIgnoreCase("on");
for (Player p : Bukkit.getOnlinePlayers()) {
if (vanish) {
p.hidePlayer(plugin, target);
} else {
p.showPlayer(plugin, target);
}
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}```
(added a debugger to the top, didnt fire)
is a player on the paper server?
no players no data communication
@graceful patrol
it's the reason why i went with sockets in one of my plugins
i would like to see the bungee plugin code
^ seeing how you're sending the data would be helpful, since just the part that registers the channel doesn't tell us much
i think that is the code you asking about
redis is also a good option for that
redis too
well, it does look like they're doing everything properly, so the only question left is whether there's is in fact a player in the receiving server
yeah no, they're sending the data to the player client, not the player's server
ah, that makes sense
@graceful patrol you need to get the server from the player, and call sendData on the server instead, not the player, that will send the payload to the client
classic deathtrap
?jd-s
When making custom items, like a pickaxe that mines a 3x3 area, what's the best way of detecting if the item is custom or not? Using the name would be unsafe, surely?
?pdc
perfect, thank you :)
---- Minecraft Crash Report ----
// My bad.
Time: 6/8/25, 7:36PM
Description: Exception in server tick loop
java.lang.AssertionError: TRAP
at net.minecraft.world.item.ItemStack.updateEmptyCacheFlag(ItemStack.java:247)
at net.minecraft.world.item.ItemStack.setCount(ItemStack.java:1282)
at net.minecraft.world.item.ItemStack.grow(ItemStack.java:1286)
at net.minecraft.world.item.ItemStack.shrink(ItemStack.java:1290)
at net.minecraft.world.item.FireworkRocketItem.useOn(FireworkRocketItem.java:54)
at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:336)
at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:625)
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1868)
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:33)
at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9)
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51)
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:156)
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24)
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128)
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1394)
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1387)
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:139)
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362)
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1243)
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:318)
at java.base/java.lang.Thread.run(Thread.java:1583)
What can cause this error?
What version are you on?
1.18.2
Could you send the output from /version
version 1.18.2-R0.1-SNAPSHOT (Git: 80b5528 on 1.18.2)
/version is blocked
That doesn't look like Spigot
Custom build but i only touched villagers
si
well not me i did some small changes only to overall fork
but lead is on vacations sooo yea
i am fucked
Try with regular Spigot
The server was running for like 3 weeks
And now some player poked that exception
Thats the problem if i knew what caused it i would be able to fix it
But i have no clue, especially in context of fireworks
My guess would be that they used a firework with a stacksize of 0
but I would have to check what the assert is
since you have it setup you could just look at the line the stacktrace is pointing at
hey, i have a plugin made by chatgpt that cancels some player events when they have a tag, but i dont know how to compile it. can someone do it for me or just explain?
dm
how to install citizens to maven ??
it's hosted on their own maven repo
Citizens has an extensive API for working with NPCs. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.
what is with that exclusions block on their wiki
i don't wanna know lmao
that sounds like they messed up their maven publishing and are working it around by asking people to exclude things
welp, if it works
Did you reload maven
yeah
and did you add their repo
hover over the error and tell us what it says
yes
makes sense
ont really understand these things, where do i find that
you just check the repository to see if it is there
oh
Common mistakes #4
so i thouh that its not snapshot cause it was not written on spigot
pokay thankss
-SNAPSHOT just means "latest artifact available"
in reality if they are using semantic versioning they shouldn't need to -SNAPSHOT it but alas
does it become not snapshot when theres new version
i mean from minceraft, snapshots were test verdsions for players to see and like give feedback before releasing the version
but thats spoilering ;
-SNAPSHOT is used when you want to push updates without updating the version number
ah, I see where the confusion is from
yeah, it isn't quite the same as minecraft snapshots
so does that mean i should remove -LATEST from my plugin?
why are you a new user