Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

WOTBLITZ

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by WOTBLITZ

  1. Forge has its own config syntax. But I don't like to use it, I like to use the json syntax.
  2. Use a SimpleChannel. Forge docs: https://mcforge.readthedocs.io/en/1.13.x/networking/simpleimpl/
  3. Can you copy the installer log content to pastebin?
  4. No, the slot is handled in the server. Are you making a client-side only mod? If not create a keybinding and check if it is pressed on the client and then send a packet to tell the server that, that the key has been pressed and don't forget which player pressed the key. On the server get the inventory from the player and move the items around there.
  5. You should post your problem on minecraftforum next time. How did you install forge? Remember to change your mc version on your launcher profile.
  6. How did do your setup of the mdk?
  7. You can't. The server says to the client to move items around in an inventory. What exactly do you want to do?
  8. Have you installed Minecraft 1.14.3? Forge installer requires the corresponding mc version to be installed.
  9. Somehow my post doesn't display properly. Here is a redo: ^Why (I Almost think you're stupid. No offense) 1. From what I understand, it keeps from returning null without the dev knowing. 2. LazyOptional.of((NonNullSupplier<T>) Optional.fromNullable("Your capability instance here")); 3. Use .orElse in LazyOptional and set null as the argument. If you get null and not a capability instance then the LazyOptional is empty. Took me literally weeks to find the answer for 2. And take a look at my mod source for guidance: https://github.com/WotblitzMC/FEUniversial
  10. ^Why? (Almost think you're stupid. No offense) 1. From what I understand, it keeps from returning null without the dev knowing. 2. LazyOptional.of((NonNullSupplier<T>) Optional.fromNullable("your capability instance here")); 3. Use .orElse in LazyOptional and set null as the argument. If you get null and not a capability then the LazyOptional is empty. Took me literally weeks to find the answer for 2. And take at me mod source for guidance: Github
  11. Hmm..., You really must learn how to read. First I said my main mod class then I mentioned a getter which means that I am created it on when my mod object gets init! However, I tried to change register the channel st FMLCommonSetupEvent, no difference. Also tried changing how I registered my channel from: NetworkRegistry.newSimpleChannel(new ResourceLocation("feuniversal", channelName), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); to NetworkRegistry.ChannelBuilder .named(new ResourceLocation("feuniversal", channelName)) .clientAcceptedVersions(PROTOCOL_VERSION::equals) .serverAcceptedVersions(PROTOCOL_VERSION::equals) .networkProtocolVersion(() -> PROTOCOL_VERSION) .simpleChannel(); and still no difference. And this was taken from two different projects at Github.
  12. I haven't changed my code apart from my GuiHandler. The problem is that this [04jun2019 20:34:56.138] [Client thread/WARN] [net.minecraft.client.network.NetHandlerPlayClient/]: Unknown custom packed identifier: feuniversal:fenet is being printed whenever I try to send a packet.
  13. The SimplChannel is working as the client is being updated.
  14. Should I register my SimplChannel at FMLCommonSetupEvent instead?
  15. The PacketHandler is just created like this: private PacketHandlerFE network = new PacketHandlerFE("fenet"); //The following is using that instance public PacketHandlerFE getNetwork() { return this.network; } //and private void doSetup(final FMLCommonSetupEvent event) { this.network.registerPackets(); } The getNetwork() getter is only being used to send packets. And thank you for informing me, that I had to write additional GUI data. Could find so much information about the new Gui system.
  16. I create the PacketHandlerFE in my main mod class. This where I open it: @Override public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { if(!player.isSneaking()) { if(!worldIn.isRemote) { TileEntityProducerBasicDirt tile = (TileEntityProducerBasicDirt) worldIn.getTileEntity(pos); NetworkHooks.openGui((EntityPlayerMP) player, new IInteractionObject() { @Override public ITextComponent getName() { return new TextComponentString(""); } @Override public boolean hasCustomName() { return false; } @Override public ITextComponent getCustomName() { return new TextComponentString(""); } @Override public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new DirtProducerContainer(playerIn, tile); } @Override public String getGuiID() { return FEUniversal.getInstance().dirtProducerID.toString(); } }); } else { return true; } } return super.onBlockActivated(state, worldIn, pos, player, hand, side, hitX, hitY, hitZ); } I can see that "onBlockActivated" is deprecated but I don't what to use instead.
  17. Yes, but at the moment I have just one registered: Packet registry: public class PacketHandlerFE { private final String PROTOCOL_VERSION = "1"; private int ID = 0; private final SimpleChannel INSTANCE; public PacketHandlerFE(String channelName) { this.INSTANCE = NetworkRegistry.newSimpleChannel(new ResourceLocation("feuniversal", channelName), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); } public SimpleChannel getSimpleChannel() { return this.INSTANCE; } public void registerPackets() { this.INSTANCE.registerMessage(ID++, UpdateTileEntityS.class, UpdateTileEntityS::encode, UpdateTileEntityS::decode, UpdateTileEntityS.Handler::handle); } public <MSG> void sendTo(MSG msg, EntityPlayerMP player) { if (!(player instanceof FakePlayer)) { this.INSTANCE.sendTo(msg, player.connection.netManager, NetworkDirection.PLAY_TO_CLIENT); } } /*public void send(PacketTarget target, Object msg) { this.INSTANCE.send(target, msg); }*/ } and GuiHandler: public GuiScreen openGui(FMLPlayMessages.OpenContainer openCon) { BlockPos pos = openCon.getAdditionalData().readBlockPos(); World world = Minecraft.getInstance().world; EntityPlayer player = Minecraft.getInstance().player; if(guiElement.get(openCon.getId()) != null) { return new guiElement.get(openCon.getId()).openGuiContainer(player, world, pos); } else { player.sendMessage(new TextComponentTranslation("error.opengui.null")); return null; } }
  18. Have at the moment two problems with my mod: 1. When I try to send a packet this message is being printed: [04jun2019 20:34:56.138] [Client thread/WARN] [net.minecraft.client.network.NetHandlerPlayClient/]: Unknown custom packed identifier: feuniversal:fenet 2. The new way to display a GuiContainer get stuck(no errors are being printed) at this line: BlockPos pos = openCon.getAdditionalData().readBlockPos(); I can print to the console before the line but not after and therefore the GuiConatiner isn't returned.
  19. At the moment read files from the installation dir.
  20. I was trying to get the server instance at init but FMLCommonHandler doesn't exist and FMLCommonSetupEvent doesn't give a server instance either. So how do get the instance in 1.13?
  21. Read the title! The same as original but with different mcp version
  22. I'm downloading it by changing the default mappings in the build.gradle file. Usually, it should work fine and update the project.
  23. I tried to update mcp mappings via http://export.mcpbot.bspk.rs/ but I get the same error. Error: Could not download mappings from de.oceanlabs.mcp.
  24. Yeah it's something with LiteLoader, but there is a fix remove the LiteLoader jar and edit the forge version json, add { "name": "com.mumfrey:liteloader:1.6.4", "url": "http://dl.liteloader.com/versions/" }, to libraries and add --tweakClass com.mumfrey.liteloader.launch.LiteLoaderTweaker to minecraftArguments before the forge tweakClass. Basically loading and init LiteLoader before forge
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.