Everything posted by Bugzoo
-
[1.7.10] Packets Not Working?
Where am I registering it on both sides?
-
[1.7.10] Packets Not Working?
Oh, right
-
[1.7.10] Packets Not Working?
It is. It was in my logs folder. It was called latest.log
-
[1.7.10] Packets Not Working?
- [1.7.10] Packets Not Working?
Ok, so now when I press it, it says "a fatal error has occured, this connection is terminated"- [1.7.10] Packets Not Working?
How do I get it from the MessageContext?- [1.7.10] Setup IntelliJ IDEA with Forge?
Oh right- [1.7.10] Setup IntelliJ IDEA with Forge?
I dont know how to get IntelliJ IDEA working with forge.- [1.7.10] Packets Not Working?
Ok, this may potentially be the most nooby question you will ever see, and it might make you want to shoot yourself. Please dont. So, I want to give the player an item when I click a button, but this isn't working Button: public void actionPerformed(GuiButton guibutton){ if(guibutton.id == 24){ // Sending packet to server IMessage msg = new SimplePacket.SimpleMessage(500, true); PacketHandler.net.sendToServer(msg); } } PacketHandler: package com.bugzoo.FinancialMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; public class PacketHandler { public static SimpleNetworkWrapper net; public static void initPackets() { net = NetworkRegistry.INSTANCE.newSimpleChannel("YourModId".toUpperCase()); registerMessage(SimplePacket.class, SimplePacket.SimpleMessage.class); } private static int nextPacketId = 0; private static void registerMessage(Class packet, Class message) { net.registerMessage(packet, message, nextPacketId, Side.CLIENT); net.registerMessage(packet, message, nextPacketId, Side.SERVER); nextPacketId++; } } SimplePacket: package com.bugzoo.FinancialMod; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import com.bugzoo.FinancialMod.SimplePacket.SimpleMessage; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class SimplePacket implements IMessageHandler<SimpleMessage, IMessage> { Minecraft mc; @Override public IMessage onMessage(SimpleMessage message, MessageContext ctx) { // just to make sure that the side is correct if (ctx.side.isClient()) { mc.thePlayer.inventory.addItemStackToInventory(new ItemStack(FinancialMod.Wallet)); int integer = message.simpleInt; boolean bool = message.simpleBool; } return message; } public static class SimpleMessage implements IMessage { private int simpleInt; private boolean simpleBool; // this constructor is required otherwise you'll get errors (used somewhere in fml through reflection) public SimpleMessage() {} public SimpleMessage(int simpleInt, boolean simpleBool) { this.simpleInt = simpleInt; this.simpleBool = simpleBool; } @Override public void fromBytes(ByteBuf buf) { // the order is important this.simpleInt = buf.readInt(); this.simpleBool = buf.readBoolean(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(simpleInt); buf.writeBoolean(simpleBool); } } }- [1.7.10] Render Item/Block In GUI?
omg, that is so freakin cool! I always wondered what that method was for!- [1.7.10] Render Item/Block In GUI?
But what about rendering blocks?- [1.7.10] Render Item/Block In GUI?
Cool, it works thanks- [1.7.10] Render Item/Block In GUI?
I have a GUI and I want it to render Blocks and Items on it. It doesn't matter if the render 3D or 2D- [1.7.10] Make Balance NBT?
They are saving NBT to Items and Blocks. I need to know how to save a number to the player- [1.7.10] Make Balance NBT?
I can only find 2...- [1.7.10] Make Balance NBT?
Yea, I mean the player. Do you have any examples on how to do this?- [1.7.10] Make Balance NBT?
I want to make a balance variable that stores the balance you have and you get add and subtract to it. How would I do this?- [1.7.10] Change size of GUI String?
I'm drawing a string on my GUI and i'm using the fontRendererObj, how would I change the size of the string?- [1.7.10] Multiple GUIs in One Class?
Thanks, great example- [1.7.10] Multiple GUIs in One Class?
I have a gui which you can flick through the pages. How would I automatically make a new page gui without making an entire new class for every page?- [1.7.10] Send Packets From GUI
I cant open a gui from with the actionPerformed() method because it doesn't have the right perameters- [1.7.10] Send Packets From GUI
I want it to send a packet when I press a button and the packet opens a gui- [1.7.10] Send Packets From GUI
I don't know how I would get that working on my gui- [Solved][1.7.10] Custom Rendering
Try using this private static final ResourceLocation texture = new ResourceLocation(MODID + ":" + "textures/model/modelalchemycauldron.png");- [1.7.10] Send Packets From GUI
How do I send packets from a gui. I don't know how Netty works, so a link to a tutorial would be good aswell - [1.7.10] Packets Not Working?
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.