-
How to get server name on server-side mod?
File f = new File("."); DedicatedServer d = new DedicatedServer(f); String serverName = d.getStringProperty("", "server-name"); Complete disaster?
-
How to get server name on server-side mod?
Its in server.properties in “server-name” line.
-
How to get server name on server-side mod?
So there is no way? :c
-
How to get server name on server-side mod?
Hello. I am trying to create a server-side mod. First what I need is servers name. I tried this: String serverName = FMLServerHandler.instance().getServer().****; And I won't find any serverName() method. How can I get it?
-
Getting mods list and it’s versions.
Hello. I am wondering how to get mods list and there versions? I was thinking about build.gradle and mcmod.info... Is there way to do this?
-
Communication between Forge mod and Bukkit plugin
Sooo many information. Thanks for tour help A LOT!
-
Communication between Forge mod and Bukkit plugin
And it has to be on Bukkit or Forge side?
-
Communication between Forge mod and Bukkit plugin
If you still have a little patience, then explain it how to make that... Thanks for your patience and support!
-
Communication between Forge mod and Bukkit plugin
I am literally crying... Really. I made so many attempts... Made it: String s = "some text here"; byte[] b = s.getBytes(StandardCharsets.UTF_8); And the error is the same: io.netty.handler.codec.DecoderException: java.lang.NullPointerException: Undefined message for discriminator 115 in channel Channel Decoder.. I thought it is about Charset. But now it is UTF-8 and it still doesn`t work.
-
Communication between Forge mod and Bukkit plugin
Searched the Internet, even asked a question on StuckOverFlow, and everyone suggest using getBytes. I have no idea to convert string to UTF-8 and then place to byte array..
-
Communication between Forge mod and Bukkit plugin
Done some work. Here is a plugin: Plugin plugin = this; @EventHandler(priority = EventPriority.NORMAL) public void onPlayerPickupItem(PlayerPickupItemEvent event) { Player player = event.getPlayer(); System.out.println("Sent message"); player.sendPluginMessage(plugin, "Channel", "u there".getBytes()); //player.sendPluginMessage(plugin, "Channel", new byte[]{}); System.out.println("Maybe complete..."); } When I pickup an item, server throws fatal error and terminates connection Minecraft output: Maaaaybe someone will see this post and help me. Thats it
-
Communication between Forge mod and Bukkit plugin
Ok, Thanks!
-
Communication between Forge mod and Bukkit plugin
Okey, I will do my best. The last test - is Forge code alright? Thanks
-
Communication between Forge mod and Bukkit plugin
So Forge code is okay? Wow... May I ask you to write a piece of code for Bukkit part? Cause I don`t really get into how to do that...
-
Communication between Forge mod and Bukkit plugin
Hello AGAIN! (I know that Bukkit is dead ) So I am trying to create a mod and a plugin that could communicate with each other. By the way, I need to send a simple message to Forge mod from the plugin. I found the old thread, which was written for 1.7.10 by one of the forums staff member and a guy :). Here is the code from old 2015: //Forge part: // --- Main class --- @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { SimpleNetworkWrapper network = NetworkRegistry.INSTANCE.newSimpleChannel("Channel"); network.registerMessage(CommunicationMessage.Handler.class, CommunicationMessage.class, 0, Side.CLIENT); System.out.println("Channel registered as CLIENT Side with 0"); } //--- CommunicationMessage class --- public class CommunicationMessage implements IMessage { private String text; public CommunicationMessage() { } public CommunicationMessage(String text) { this.text = text; } @Override public void fromBytes(ByteBuf buf) { text = ByteBufUtils.readUTF8String(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, text); } public static class Handler implements IMessageHandler<CommunicationMessage, IMessage> { @Override public IMessage onMessage(CommunicationMessage message, MessageContext ctx) { System.out.println(String.format("Received %s from %s", message.text, ctx.getServerHandler().playerEntity.getDisplayName())); return null; // no response in this case } } } //Bukkit part: //--- Main plugin class (In onEnable()): --- Bukkit.getMessenger().registerOutgoingPluginChannel(this, "Channel"); I really want to create this mod-plugin connection. I have great ideas, but I need some base. PLEASE, help me with this. Thanks in advance!!!
IPS spam blocked by CleanTalk.