Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

TheASTRO

Members
  • Joined

  • Last visited

  1. File f = new File("."); DedicatedServer d = new DedicatedServer(f); String serverName = d.getStringProperty("", "server-name"); Complete disaster?
  2. Its in server.properties in “server-name” line.
  3. So there is no way? :c
  4. 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?
  5. 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?
  6. Sooo many information. Thanks for tour help A LOT!
  7. And it has to be on Bukkit or Forge side?
  8. If you still have a little patience, then explain it how to make that... Thanks for your patience and support!
  9. 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.
  10. 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..
  11. 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
  12. Okey, I will do my best. The last test - is Forge code alright? Thanks
  13. 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...
  14. 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!!!

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.