Jump to content

ricosw

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by ricosw

  1. #push Version: 1.12.2 Mouse Cursor is invisible I'm opening the gui at the ClientCustomPacketEvent any ideas? public class ClientPacketHandler extends ServerPacketHandler { private TestMod testMod; public ClientPacketHandler(TestMod testMod) { this.testMod = testMod; } @SubscribeEvent public void onClientPacket(ClientCustomPacketEvent event) throws IOException { channelName = event.getPacket().channel(); System.out.println("Message on channel " + channelName); if(channelName.equals("TESTMOD")) { System.out.println("target: " + event.getPacket().getTarget().name()); // TARGET IS CLIENT System.out.println("Client recived packet from server"); ProcessPacketClientSide.processPacketOnClient(testMod, event.getPacket().payload(), event.getPacket().getTarget()); } } } public class ProcessPacketClientSide { public ProcessPacketClientSide() { } @SideOnly(Side.CLIENT) public static void processPacketOnClient(TestMod testMod, ByteBuf parBB, Side parSide) { try { if (parSide != Side.CLIENT) { System.out.println("ERROR! ProcessPacketClientSide"); return; } System.out.println("Received ProcessPacketClientSide on Client Side"); ByteBufInputStream bbis = new ByteBufInputStream(parBB); String data = bbis.readLine(); /* DOING HERE MY GUI STUFF */ Minecraft.getMinecraft().player.openGui(testMod, gui.getGuiId(), Minecraft.getMinecraft().player.world, 0, 0, 0); // ON GUI OPEN THE MOUSE CURSOR IS NOT VISIBLE BUT I CAN HOVER BUTTONS AND CLICK THEM /*Minecraft.getMinecraft().setIngameNotInFocus(); Minecraft.getMinecraft().inGameHasFocus = false; Minecraft.getMinecraft().displayGuiScreen(guiBuilder); Minecraft.getMinecraft().currentScreen.allowUserInput = true;*/ //Mouse.setGrabbed(false); //Minecraft.getMinecraft().mouseHelper.ungrabMouseCursor(); //Mouse.setGrabbed(false); } catch (IOException ex) { Logger.getLogger(ProcessPacketClientSide.class.getName()).log(Level.SEVERE, null, ex); } } }
  2. I fixed it by myself from initGui() to drawScreen() my fault
  3. Hello, I want to bind an texture from my selected Resourcepack how can I get the Resource? I am using: this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/book.png")); this.drawTexturedModalRect(50, 50, 20, 1, 200, 200); And my error is: [FML]: Exception caught during firing event net.minecraftforge.fml.common.network.FMLNetworkEvent$ClientCustomPacketEvent@4b8d2f5: net.minecraft.util.ReportedException: Registering texture at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) ~[TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:42) ~[TextureManager.class:?] at de.ricosw.hhmod.guitools.GuiBuilder.initGui(GuiBuilder.java:64) ~[GuiBuilder.class:?] at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:543) ~[GuiScreen.class:?] at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:1019) ~[Minecraft.class:?] at de.ricosw.hhmod.networking.ProcessPacketClientSide.processPacketOnClient(ProcessPacketClientSide.java:91) ~[ProcessPacketClientSide.class:?] at de.ricosw.hhmod.networking.ClientPacketHandler.onClientPacket(ClientPacketHandler.java:33) ~[ClientPacketHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_ClientPacketHandler_onClientPacket_ClientCustomPacketEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) [EventBus.class:?] at net.minecraftforge.fml.common.network.FMLEventChannel.fireRead(FMLEventChannel.java:129) [FMLEventChannel.class:?] at net.minecraftforge.fml.common.network.NetworkEventFiringHandler.channelRead0(NetworkEventFiringHandler.java:51) [NetworkEventFiringHandler.class:?] at net.minecraftforge.fml.common.network.NetworkEventFiringHandler.channelRead0(NetworkEventFiringHandler.java:39) [NetworkEventFiringHandler.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:111) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:413) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:278) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [SimpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [ByteToMessageDecoder.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [ByteToMessageDecoder.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [ByteToMessageDecoder.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:150) [ReadTimeoutHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [NioEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [SingleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
  4. Update: I have changed the Cursor I mean the image and it shows me it. But If I set an windows cursor on mac and linux will it be the windows cursor any ideas?
  5. Hello I have an Problem with my GUI when I open them with Minecraft.getMinecraft().displayGuiScreen(guiBuilder); //OR player.openGui(...) The Mouse Cursor is not visible if I hover over my buttons it works clicking it works too but the Cursor is still invisible if I go out of Minecraft and go back the Cursor works fine. My Gui: import com.google.gson.Gson; import de.ricosw.data.GuiButtonClick; import de.ricosw.hhmod.HHMod; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import java.io.IOException; import java.util.HashMap; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.network.PacketBuffer; import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; /** * * @author Rico */ public class GuiBuilder extends GuiScreen { private HHMod mod; private HashMap<GuiButton, Integer> guiButtons; private int guiId = -1; public GuiBuilder(HHMod mod, int guiId, HashMap<GuiButton, Integer> guiButtons) { this.mod = mod; this.guiId = guiId; this.guiButtons = guiButtons; } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); super.drawScreen(mouseX, mouseY, partialTicks); } @Override public void initGui() { for (GuiButton buttons : guiButtons.keySet()) { System.out.println(buttons); this.buttonList.add(buttons); } super.initGui(); } @Override protected void actionPerformed(GuiButton button) throws IOException { if (guiButtons.containsKey(button)) { //... } } @Override public void updateScreen() { super.updateScreen(); } } Edit: I opening the Gui in ClientCustomPacketEvent
×
×
  • Create New...

Important Information

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