deadrecon98 Posted May 12, 2013 Posted May 12, 2013 Hello. I am having trouble on a custom furnace that I made. Here is the error report. http://gw.minecraftforge.net/CVuQ There is also a texture glitch... The main error i see on right click is the one about network mod. Please help soon. Quote
keynah Posted May 12, 2013 Posted May 12, 2013 Hey I Just myself recently made a Custom Furnace, for the Textures did you copy the code straight from the BlockFurnace.class. Example of my code and what was from the BlockFurnace Class. (May help with texture glitch) @SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); } @SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "NetherCraft:activeFurnace" : "NetherCraft:inactiveFurnace"); this.furnaceIconTop = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); } Quote
deadrecon98 Posted May 12, 2013 Author Posted May 12, 2013 Would you mind posting the main mod file? http://gw.minecraftforge.net/Q2js Quote
deadrecon98 Posted May 12, 2013 Author Posted May 12, 2013 Hey I Just myself recently made a Custom Furnace, for the Textures did you copy the code straight from the BlockFurnace.class. Example of my code and what was from the BlockFurnace Class. (May help with texture glitch) @SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); } @SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "NetherCraft:activeFurnace" : "NetherCraft:inactiveFurnace"); this.furnaceIconTop = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); } Thats the same as mine... Wonder whats going on there. Quote
larsgerrits Posted May 12, 2013 Posted May 12, 2013 A) The @Mod annotation has to be above the @NetworkMod annotation. B) You need to have a client packet handler and a server packet handler. Replace you @NetworkMod annotation with this: @NetworkMod(clientSideRequired = true, serverSideRequired = false, clientPacketHandlerSpec = @SidedPacketHandler(channels = UCReferences.CHANNEL_NAME, packetHandler = ClientPacketHandler.class), serverPacketHandlerSpec = @SidedPacketHandler(channels = UCReferences.CHANNEL_NAME, packetHandler = ServerPacketHandler.class)) and change the ClientPacketHandler.class with your client packet handler class and the ServerPacketHandler.class with your server packet handler class Also, put this in your client packet handler class: package com.larsg310.uc.core.handlers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class ClientPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload payload, Player player) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(payload.data)); } } And put this in your server packet handler class: package com.larsg310.uc.core.handlers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class ServerPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload payload, Player player) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(payload.data)); EntityPlayer sender = (EntityPlayer) player; } } This code is from my mod and it works for me. Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
deadrecon98 Posted May 12, 2013 Author Posted May 12, 2013 A) The @Mod annotation has to be above the @NetworkMod annotation. B) You need to have a client packet handler and a server packet handler. Replace you @NetworkMod annotation with this: @NetworkMod(clientSideRequired = true, serverSideRequired = false, clientPacketHandlerSpec = @SidedPacketHandler(channels = UCReferences.CHANNEL_NAME, packetHandler = ClientPacketHandler.class), serverPacketHandlerSpec = @SidedPacketHandler(channels = UCReferences.CHANNEL_NAME, packetHandler = ServerPacketHandler.class)) and change the ClientPacketHandler.class with your client packet handler class and the ServerPacketHandler.class with your server packet handler class Also, put this in your client packet handler class: package com.larsg310.uc.core.handlers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class ClientPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload payload, Player player) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(payload.data)); } } And put this in your server packet handler class: package com.larsg310.uc.core.handlers; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; public class ServerPacketHandler implements IPacketHandler { @Override public void onPacketData(INetworkManager manager, Packet250CustomPayload payload, Player player) { DataInputStream data = new DataInputStream(new ByteArrayInputStream(payload.data)); EntityPlayer sender = (EntityPlayer) player; } } This code is from my mod and it works for me. Thank you it seems that the tutorial I followed was wrong. Quote
larsgerrits Posted May 12, 2013 Posted May 12, 2013 Does it actually work now? Cause i've made a new furnace and mine can't smelt the items. Do you mind taking a look at my code? It's on this thread: http://www.minecraftforge.net/forum/index.php/topic,8381.0.html Quote Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
deadrecon98 Posted May 12, 2013 Author Posted May 12, 2013 Does it actually work now? Cause i've made a new furnace and mine can't smelt the items. Do you mind taking a look at my code? It's on this thread: http://www.minecraftforge.net/forum/index.php/topic,8381.0.html Oh i am getting that error But then again i was just working on the gui Quote
EarthGuardian Posted July 22, 2013 Posted July 22, 2013 Hey I Just myself recently made a Custom Furnace, for the Textures did you copy the code straight from the BlockFurnace.class. Example of my code and what was from the BlockFurnace Class. (May help with texture glitch) @SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); } @SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "NetherCraft:activeFurnace" : "NetherCraft:inactiveFurnace"); this.furnaceIconTop = par1IconRegister.registerIcon("NetherCraft:sideFurnace"); } this actual worked so i can get my own furnace texture. but why does the block show in your hand only with top textures and side texture .. and not like the funace texture it shows the front also ?? how so i fix this?? also in creative tabs it shows with top and side textures only ... meanwhile when you place it it does have the front texture i put in and the active front texture when its burning.. so only when your holding it or seeing it in creative tab .. it dusnt show like the furnace. it was the same btw with the vanilla textures and skin ... (with custom furnace) greets Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.