• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I don't know how this is so hard to understand. The registration of your network channel must happen in FMLCommonSetupEvent. You are still not doing that. Now you are calling newSimpleChannel from the constructor of PacketHandler, which you call from the constructor of Arknights. This is not in FMLCommonSetupEvent.
    • yea... but can I register custom BiomeProvider with this method? Only settings
    • Maybe I need an example... The former code reference ProjectE, and it use the static initializer. And the documentation is static too. I try to register it in a not static initializer (maybe in a wrong way), and it doesn't work. When I left click, nothing has happened.   By the way, the thrown error appears when I join the world, and when I delete the packet registry, it still appears.  Here is the code: PacketHandler.java package arknights.network; import arknights.network.packets.LeftClickPacket; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.network.NetworkRegistry; import net.minecraftforge.fml.network.simple.SimpleChannel; public final class PacketHandler { private static final String PROTOCOL_VERSION = Integer.toString(1); public SimpleChannel HANDLER = NetworkRegistry.newSimpleChannel( new ResourceLocation("corruption","main") ,() -> PROTOCOL_VERSION , PROTOCOL_VERSION::equals , PROTOCOL_VERSION::equals); int id = 0; public void register(){ HANDLER.registerMessage(id++, LeftClickPacket.class, LeftClickPacket::encode, LeftClickPacket::decode, LeftClickPacket.Handler::handle); } }   Arknights.java Here is the whole class. I think there is something not so relevant, so I provide a simple one. public class Arknights { //something //code I add public static final PacketHandler PACKETHANDLER = new PacketHandler(); public Arknights() { // Register methods for modloading //code I add PACKETHANDLER.register(); // Register ourselves for server and other game events we are interested in }   BaseItem.java package arknights.item; import arknights.Arknights; import arknights.network.PacketHandler; import arknights.network.packets.LeftClickPacket; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; public class BaseItem extends Item { public BaseItem(Properties p_i48487_1_) { super(p_i48487_1_); MinecraftForge.EVENT_BUS.addListener(this::emptyLeftClick); } public void emptyLeftClick(PlayerInteractEvent.LeftClickEmpty event){ Arknights.PACKETHANDLER.HANDLER.sendToServer(new LeftClickPacket()); } public void leftClick(LivingEntity livingEntity, World worldIn, ItemStack stack){ } }  
    • Okay, that is definitely a misbehaving ad. Again: Please show the address bar. Yours is not showing.
    • I have attached a short screen capture. Bildschirmvideo aufnehmen 2020-01-22 um 11.13.20.mp4
  • Topics

  • Who's Online (See full list)