
Heltrato
Members-
Content Count
259 -
Joined
-
Last visited
Posts posted by Heltrato
-
-
Update: it seems i debug using eclipse all of the java that are include with this issue but all seems fine..
I try removing all items but still aint working....
-
So yeah, i was making a 3d other all of my weapons and have them with the same code in render (only differs in Item class and Model class)
The bad thing is when i test it out all of my weapons renders in inventory.. but when it comes to Entity, 3D person and first person .. Some renders fine but others dont..
This one bugs but looks fine in inventory
Others looks fine
Here is the render code of one of my weapons and the other weapon
RenderWeapon A
package mhfc.net.client.render.weapon.huntinghorn; import mhfc.net.client.model.weapon.huntinghorn.ModelHHEliteBagpipe; import mhfc.net.common.util.lib.MHFCReference; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; public class RenderHHEliteBagpipe implements IItemRenderer { private ModelHHEliteBagpipe weapon; public RenderHHEliteBagpipe() { weapon = new ModelHHEliteBagpipe(); } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED : // render in third person float scale = 1.7f; GL11.glScalef(scale, scale, scale); GL11.glPushMatrix(); // start gl rendering for this section Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_elitebagpipe_tex)); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); // rotate 0 � on X axis GL11.glRotatef(-5F, 0.0f, 1.0f, 0.0f); // rotate -5 � on Y axis GL11.glRotatef(-120F, 0.0f, 0.0f, 1.0f); // rotate -150 � on Z // axis GL11.glTranslatef(-0.35F, -0.5F, -0.05F); // translate model to // fit in the hand of // the player // the entity argument can/could be passed to as null. weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case EQUIPPED_FIRST_PERSON : // rince and repeat the rendering. adjust axis' and translation // as needed GL11.glPushMatrix(); scale = 1.4f; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_elitebagpipe_tex)); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-5F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(-150F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(-0.4F, -0.4F, -0.1F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case ENTITY : GL11.glPushMatrix(); scale = 3F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_elitebagpipe_tex)); GL11.glRotatef(90F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(0F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(-0.2F, -0.3F, 0F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case INVENTORY : GL11.glPushMatrix(); scale = 1.0F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_elitebagpipe_tex)); GL11.glRotatef(200F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f); GL11.glTranslatef(0F, -0.1F, -0.0F); // this is a method made by me in my model class to render only // the modelparts, without an entity argument, because in your // inventory, //the entity is always null. weapon.render(0.0625F); GL11.glPopMatrix(); break; default : break; } } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { switch (type) { case INVENTORY : return true; default : break; } return false; } }
RenderWeapon B
package mhfc.net.client.render.weapon.huntinghorn; import org.lwjgl.opengl.GL11; import mhfc.net.client.model.weapon.huntinghorn.ModelHHBlackCasket; import mhfc.net.common.util.lib.MHFCReference; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; public class RenderHHBlackCasket implements IItemRenderer { private ModelHHBlackCasket weapon; public RenderHHBlackCasket() { weapon = new ModelHHBlackCasket(); } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED : // render in third person float scale = 1.7f; GL11.glScalef(scale, scale, scale); GL11.glPushMatrix(); // start gl rendering for this section Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_blackcasket_tex)); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); // rotate 0 � on X axis GL11.glRotatef(-5F, 0.0f, 1.0f, 0.0f); // rotate -5 � on Y axis GL11.glRotatef(-120F, 0.0f, 0.0f, 1.0f); // rotate -150 � on Z // axis GL11.glTranslatef(-0.35F, -0.5F, -0.05F); // translate model to // fit in the hand of // the player // the entity argument can/could be passed to as null. weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case EQUIPPED_FIRST_PERSON : // rince and repeat the rendering. adjust axis' and translation // as needed GL11.glPushMatrix(); scale = 1.4f; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_blackcasket_tex)); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-5F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(-150F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(-0.4F, -0.4F, -0.1F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case ENTITY : GL11.glPushMatrix(); scale = 3F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_blackcasket_tex)); GL11.glRotatef(90F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(0F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(-0.2F, -0.3F, 0F); weapon.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; case INVENTORY : GL11.glPushMatrix(); scale = 1.0F; GL11.glScalef(scale, scale, scale); Minecraft.getMinecraft().renderEngine .bindTexture(new ResourceLocation(MHFCReference.weapon_hh_blackcasket_tex)); GL11.glRotatef(200F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f); GL11.glTranslatef(0F, -0.1F, -0.0F); // this is a method made by me in my model class to render only // the modelparts, without an entity argument, because in your // inventory, //the entity is always null. weapon.render(0.0625F); GL11.glPopMatrix(); break; default : break; } } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { switch (type) { case INVENTORY : return true; default : break; } return false; } }
-
Hello everyone i need help i know this sound basic but ive stop doing java for almst a year. Anyways
im trying to make armor work on picked players only and by doing it it must be have its name to be wore
here is my code anyways
@Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { for(int i = 0; i < Name.dragoonHelm.length; i++) if(entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)entity; if (stack.getItem() == MHFCRegItem.mhfcitemdragoonhelm || stack.getItem() == MHFCRegItem.mhfcitemdragoonchest || stack.getItem() == MHFCRegItem.mhfcitemdragoonboots) { if(player.getDisplayName() == Name.dragoonHelm[i]) return MHFCReference.armor_dragoon_tex1; }else return "mhfc:textures/armor/null.png"; if (stack.getItem() == MHFCRegItem.mhfcitemdragoonlegs) { if(player.getDisplayName() == Name.dragoonHelm[i]) return MHFCReference.armor_dragoon_tex2; }else return "mhfc:textures/armor/null.png"; } return null; }
-
Ok i think i got it work but during my test it suddenly crashes
Jul 13, 2014 1:05:14 AM io.netty.channel.embedded.EmbeddedChannel recordException WARNING: More than one exception was raised. Will report only the first one and log others. java.lang.RuntimeException: Timeout waiting for client thread to catch up! at cpw.mods.fml.client.FMLClientHandler.waitForPlayClient(FMLClientHandler.java:843) at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:852) at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:589) at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28) at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:257) at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:185) at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:43) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:313) at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:43) at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:299) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) at java.lang.Thread.run(Unknown Source) [01:05:15] [server thread/INFO]: XxHeltratoxX lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}} [01:05:15] [server thread/INFO]: XxHeltratoxX left the game [01:05:15] [server thread/INFO]: Stopping singleplayer server as player logged out [01:05:15] [server thread/INFO]: Stopping server [01:05:15] [server thread/INFO]: Saving players [01:05:15] [server thread/INFO]: Saving worlds [01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/Nether [01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/The End [01:05:17] [server thread/INFO]: Unloading dimension 0 [01:05:17] [server thread/INFO]: Unloading dimension -1 [01:05:17] [server thread/INFO]: Unloading dimension 1 [01:05:17] [server thread/INFO]: Applying holder lookups [01:05:17] [server thread/INFO]: Holder lookups applied [01:05:18] [server thread/INFO]: Starting integrated minecraft server version 1.7.2 [01:05:18] [server thread/INFO]: Generating keypair [01:05:19] [server thread/INFO]: Injecting existing block and item data into this server instance [01:05:19] [server thread/INFO]: Applying holder lookups [01:05:19] [server thread/INFO]: Holder lookups applied [01:05:19] [server thread/INFO]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9) [01:05:19] [server thread/INFO]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9) [01:05:19] [server thread/INFO]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9) [01:05:19] [server thread/INFO]: Preparing start region for level 0 [01:05:20] [Netty Client IO #1/INFO]: Server protocol version 1 [01:05:20] [Netty IO #3/INFO]: Client protocol version 1 [01:05:20] [Netty IO #3/INFO]: Client attempting to join with 4 mods : FML@7.2.211.1121,Forge@10.12.2.1121,mcp@9.03,mhfc@1.7.2 [01:05:20] [Netty IO #3/INFO]: Attempting connection with missing mods [] at CLIENT [01:05:20] [Netty Client IO #1/INFO]: Attempting connection with missing mods [] at SERVER [01:05:20] [server thread/INFO]: [server thread] Server side modded connection established [01:05:20] [server thread/INFO]: XxHeltratoxX[local:E:091b44fb] logged in with entity id 91 at (364.5, 4.0, 13.5) [01:05:20] [server thread/INFO]: XxHeltratoxX joined the game [01:05:20] [Client thread/INFO]: [Client thread] Client side modded connection established [01:05:20] [server thread/INFO]: Saving and pausing game... [01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/Nether [01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/The End [01:05:31] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2781ms behind, skipping 55 tick(s) [01:05:31] [server thread/INFO]: Saving and pausing game... [01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/Nether [01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/The End ERROR MESSAGE: SoundSystem did not load after 30 seconds. Starting up SoundSystem... Switching to No Sound (Silent Mode) [01:05:46] [sound Library Loader/INFO]: Sound engine started [01:05:46] [server thread/INFO]: Stopping server [01:05:46] [server thread/INFO]: Saving players [01:05:46] [server thread/INFO]: Saving worlds [01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/Overworld [01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/Nether [01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/The End [01:05:47] [server thread/INFO]: Unloading dimension 0 [01:05:47] [server thread/INFO]: Unloading dimension -1 [01:05:47] [server thread/INFO]: Unloading dimension 1 [01:05:47] [server thread/INFO]: Applying holder lookups [01:05:47] [server thread/INFO]: Holder lookups applied [01:05:47] [Client thread/FATAL]: Unreported exception thrown! java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalGetSourcei(II)I at org.lwjgl.openal.AL10.nalGetSourcei(Native Method) ~[lwjgl-2.9.0.jar:?] at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853) ~[lwjgl-2.9.0.jar:?] at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651) ~[ChannelLWJGLOpenAL.class:?] at paulscode.sound.Source.playing(Source.java:1213) ~[source.class:?] at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556) ~[soundManager$SoundSystemStarterThread.class:?] at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253) ~[soundManager.class:?] at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222) ~[soundHandler.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:2071) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] ---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear! Time: 7/13/14 1:05 AM Description: Unexpected error java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalGetSourcei(II)I at org.lwjgl.openal.AL10.nalGetSourcei(Native Method) at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853) at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651) at paulscode.sound.Source.playing(Source.java:1213) at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556) at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253) at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2071) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) at net.minecraft.client.Minecraft.run(Minecraft.java:912) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at org.lwjgl.openal.AL10.nalGetSourcei(Native Method) at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853) at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651) at paulscode.sound.Source.playing(Source.java:1213) at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556) at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253) at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['XxHeltratoxX'/91, l='MpServer', x=357.71, y=8.11, z=11.37]] Chunk stats: MultiplayerChunkCache: 225, 225 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: World: (366,4,12), Chunk: (at 14,0,12 in 22,0; contains blocks 352,0,0 to 367,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 1572 game time, 1572 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 74 total; [EntitySlime['Slime'/88195, l='MpServer', x=385.31, y=4.00, z=-63.41], EntitySlime['Slime'/20867, l='MpServer', x=354.21, y=4.81, z=30.53], EntitySlime['Slime'/46340, l='MpServer', x=296.28, y=4.00, z=36.69], EntitySlime['Slime'/20869, l='MpServer', x=369.68, y=4.84, z=40.29], EntitySmallFireball['Small Fireball'/142469, l='MpServer', x=366.35, y=8.65, z=18.47], EntitySmallFireball['Small Fireball'/143493, l='MpServer', x=364.32, y=12.75, z=20.58], EntitySmallFireball['Small Fireball'/142865, l='MpServer', x=364.79, y=10.91, z=19.52], EntitySlime['Slime'/101782, l='MpServer', x=395.11, y=4.00, z=-66.59], EntityClientPlayerMP['XxHeltratoxX'/91, l='MpServer', x=357.71, y=8.11, z=11.37], EntityCow['Cow'/12080, l='MpServer', x=310.22, y=4.00, z=-13.78], EntityCow['Cow'/12081, l='MpServer', x=300.22, y=4.00, z=-5.81], EntityCow['Cow'/12082, l='MpServer', x=309.50, y=4.00, z=-11.78], EntityCow['Cow'/12083, l='MpServer', x=311.78, y=4.00, z=-12.22], EntityHorse['Donkey'/12084, l='MpServer', x=312.41, y=4.00, z=-18.53], EntityHorse['Donkey'/12085, l='MpServer', x=313.41, y=4.00, z=-20.19], EntityHorse['Donkey'/12087, l='MpServer', x=310.81, y=4.00, z=-16.25], EntitySheep['Sheep'/12089, l='MpServer', x=312.50, y=4.00, z=-15.50], EntitySheep['Sheep'/12090, l='MpServer', x=316.50, y=4.00, z=-17.50], EntitySheep['Sheep'/12091, l='MpServer', x=323.88, y=4.00, z=-22.25], EntitySlime['Slime'/61, l='MpServer', x=281.21, y=4.00, z=-4.31], EntitySlime['Slime'/63, l='MpServer', x=279.71, y=4.00, z=78.71], EntitySlime['Slime'/66, l='MpServer', x=352.28, y=4.00, z=81.13], EntityRathalos['Rathalos'/68, l='MpServer', x=363.75, y=11.52, z=21.28], EntityHorse['Horse'/11972, l='MpServer', x=339.16, y=4.00, z=-11.19], EntitySmallFireball['Small Fireball'/69, l='MpServer', x=366.19, y=6.38, z=21.91], EntitySmallFireball['Small Fireball'/70, l='MpServer', x=366.47, y=6.41, z=21.91], EntitySmallFireball['Small Fireball'/71, l='MpServer', x=367.63, y=6.47, z=19.78], EntityHorse['Horse'/11975, l='MpServer', x=338.50, y=4.00, z=-5.50], EntitySmallFireball['Small Fireball'/142149, l='MpServer', x=366.20, y=7.96, z=18.21], EntityHorse['Horse'/12104, l='MpServer', x=313.47, y=4.00, z=-39.50], EntitySheep['Sheep'/11977, l='MpServer', x=341.50, y=4.00, z=-9.50], EntityHorse['Horse'/12105, l='MpServer', x=314.75, y=4.00, z=-37.88], EntitySheep['Sheep'/11978, l='MpServer', x=337.50, y=4.00, z=-11.50], EntityHorse['Horse'/12106, l='MpServer', x=319.56, y=4.00, z=-39.16], EntitySheep['Sheep'/11979, l='MpServer', x=338.50, y=4.00, z=-15.50], EntityHorse['Horse'/12107, l='MpServer', x=319.84, y=4.00, z=-40.91], EntitySheep['Sheep'/11980, l='MpServer', x=333.82, y=4.00, z=-15.10], EntityPig['Pig'/12108, l='MpServer', x=318.84, y=4.00, z=-37.50], EntityPig['Pig'/12109, l='MpServer', x=305.06, y=4.00, z=-45.22], EntitySlime['Slime'/107852, l='MpServer', x=297.18, y=4.00, z=56.01], EntitySmallFireball['Small Fireball'/78, l='MpServer', x=366.97, y=6.19, z=18.94], EntitySheep['Sheep'/11982, l='MpServer', x=347.13, y=4.00, z=-12.94], EntityPig['Pig'/12110, l='MpServer', x=310.53, y=4.00, z=-41.84], EntitySmallFireball['Small Fireball'/143180, l='MpServer', x=364.32, y=12.38, z=20.52], EntitySlime['Slime'/79, l='MpServer', x=345.41, y=4.00, z=22.28], EntityPig['Pig'/12111, l='MpServer', x=311.09, y=4.00, z=-44.63], EntitySheep['Sheep'/12112, l='MpServer', x=305.97, y=4.00, z=-39.06], EntityTigrex['Tigrex'/81, l='MpServer', x=368.38, y=4.00, z=15.84], EntitySheep['Sheep'/12113, l='MpServer', x=307.53, y=4.00, z=-45.69], EntitySheep['Sheep'/12114, l='MpServer', x=310.50, y=4.00, z=-47.50], EntitySlime['Slime'/83, l='MpServer', x=402.66, y=4.00, z=17.69], EntitySheep['Sheep'/12115, l='MpServer', x=305.25, y=4.00, z=-49.66], EntitySlime['Slime'/46804, l='MpServer', x=288.78, y=4.00, z=41.63], EntitySlime['Slime'/85, l='MpServer', x=410.75, y=4.00, z=-59.51], EntitySlime['Slime'/86, l='MpServer', x=390.37, y=4.00, z=-13.81], EntitySlime['Slime'/87, l='MpServer', x=405.91, y=4.00, z=4.97], EntitySlime['Slime'/88, l='MpServer', x=401.84, y=4.17, z=-4.77], EntitySmallFireball['Small Fireball'/144218, l='MpServer', x=364.30, y=13.37, z=20.57], EntitySlime['Slime'/90, l='MpServer', x=415.94, y=4.00, z=-32.37], EntitySlime['Slime'/106088, l='MpServer', x=386.00, y=4.00, z=60.28], EntityPig['Pig'/12010, l='MpServer', x=282.50, y=4.00, z=-14.50], EntityPig['Pig'/12011, l='MpServer', x=282.50, y=4.00, z=-17.50], EntitySlime['Slime'/4332, l='MpServer', x=320.09, y=4.66, z=12.37], EntityCow['Cow'/12020, l='MpServer', x=347.16, y=4.00, z=75.19], EntityCow['Cow'/12021, l='MpServer', x=342.44, y=4.00, z=71.13], EntityCow['Cow'/12022, l='MpServer', x=343.50, y=4.00, z=68.50], EntityCow['Cow'/12023, l='MpServer', x=342.72, y=4.00, z=69.84], EntityHorse['Horse'/12024, l='MpServer', x=346.50, y=4.00, z=73.50], EntitySmallFireball['Small Fireball'/143866, l='MpServer', x=364.22, y=13.09, z=20.55], EntityHorse['Horse'/12027, l='MpServer', x=344.50, y=4.00, z=71.50], EntitySlime['Slime'/28539, l='MpServer', x=399.68, y=4.00, z=68.07], EntityChicken['Chicken'/12028, l='MpServer', x=352.50, y=4.00, z=71.50], EntityChicken['Chicken'/12029, l='MpServer', x=351.50, y=4.00, z=73.50], EntityChicken['Chicken'/12030, l='MpServer', x=353.50, y=4.00, z=75.50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523) at net.minecraft.client.Minecraft.run(Minecraft.java:941) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
So what i did is instead of in my main mod class Side.CLIENT . i make it into Side.SERVER
then this is what i did in my packet and handler
public static void handleTheClient(EntityPlayerMP player) { EntityRathalos entity = (EntityRathalos)player.worldObj.getEntityByID(entityID); if(entity != null && animID != -1){ entity.setAnimID(animID); if(animID == 0) entity.setAnimTick(0); } } public static class PacketAIRathalosHandler implements IMessageHandler<PacketAIMessageTest, IMessage> { public IMessage onMessage(PacketAIMessageTest message,MessageContext ctx) { handleTheClient(ctx.getServerHandler().playerEntity); return null; }
-
ok i think i only have a few problem how do i make an instances for EntityPlayer
well it always says i cant instantiate entityplayer
it sends java.lang.nullpointexception
crash
[00:37:51] [Client thread/ERROR]: There was a critical exception handling a packet on channel mhfcs java.lang.NullPointerException at mhfc.heltrato.common.network.message.PacketAIMessageTest.handleTheClient(PacketAIMessageTest.java:37) ~[PacketAIMessageTest.class:?] at mhfc.heltrato.common.network.message.PacketAIMessageTest$PacketAIRathalosHandler.onMessage(PacketAIMessageTest.java:48) ~[PacketAIMessageTest$PacketAIRathalosHandler.class:?] at mhfc.heltrato.common.network.message.PacketAIMessageTest$PacketAIRathalosHandler.onMessage(PacketAIMessageTest.java:1) ~[PacketAIMessageTest$PacketAIRathalosHandler.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:34) ~[simpleChannelHandlerWrapper.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:14) ~[simpleChannelHandlerWrapper.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?] at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1649) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
I register it here btw
here my main mod
@Mod.EventHandler public void load(FMLInitializationEvent event){ network = NetworkRegistry.INSTANCE.newSimpleChannel("mhfcs"); network.registerMessage(PacketAIMessageTest.PacketAIRathalosHandler.class, PacketAIMessageTest.class, 0, Side.CLIENT); }
-
Hello i was having issues with that Netty packet handler it leaks and it shows like "mhfc:100" which is one reason why i tried diesieben's tutorial on SimpleMessage but i dont see any handleClientSide in there which probably will be an issue for my PacketAI's
Heres my progress so far
Packet
package mhfc.heltrato.common.network.message; import io.netty.buffer.ByteBuf; import mhfc.heltrato.common.entity.mob.EntityRathalos; import net.minecraft.entity.player.EntityPlayer; 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 PacketAIMessageTest implements IMessage { private static byte animID; private static int entityID; public PacketAIMessageTest() { } public PacketAIMessageTest(byte anim, EntityRathalos e){ animID = anim; entityID = e.getEntityId(); } @Override public void fromBytes(ByteBuf buf) { animID = buf.readByte(); entityID = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeByte(animID); buf.writeInt(entityID); } public static void handleTheClient(EntityPlayer player) { EntityRathalos entity = (EntityRathalos)player.worldObj.getEntityByID(entityID); if(entity != null && animID != -1){ entity.setAnimID(animID); if(animID == 0) entity.setAnimTick(0); } } public static class PacketAIRathalosHandler implements IMessageHandler<PacketAIMessageTest, IMessage> { private EntityPlayer player; public IMessage onMessage(PacketAIMessageTest message,MessageContext ctx) { handleTheClient(player); return null; } } }
My entity packet sender
public void sendAttackPacket(int id) { if(MHFCMain.isEffectiveClient()) return; currentAttackID = id; // MHFCMain.packetPipeline.sendToAll(new PacketAIRathalos((byte)id, this)); MHFCMain.network.sendToAll(new PacketAIMessageTest((byte)id, this)); } public boolean attackEntityAsMob(Entity entity){ if(!worldObj.isRemote) { if(currentAttackID == 0){ sendAttackPacket(1); } if(currentAttackID == 0 && rand.nextInt(4) == 0){ sendAttackPacket(2); } } return true; }
-
-
@Elyon - Chill man chill, what i mean by ID's doesnt mean int and such stuff . im pointing on like GameRegistry.register ok so chill and i know now how it works
@diesieben07 - thanks thanks bro now i think i kinda gonna handle this now
@MultiMote - thanks for the guide bro
-
Well is it possible for me to create a custom damage source? aside from looking from the class file . Do i need still to make a registry stuff like that ? ID's and such?
ill thank you if you reply thou
-
Yup i think i got it i created another class that extends ItemFood , override some stuff and the duration is set if the armor is check . Thanks for helping me out guys i think this is solve
Ill post a github soon so i can show you
-
Yes the crash is gone but i dont know if the consume time make it shorter this is what i did.
if(food != null &&food.getItem() instanceof ItemFood){ int i = food.getItem().getMaxItemUseDuration(food); int j = 16; i = i - j; }
I removed the ItemFood foods variable since i think the food which is the current itemstack on players hand is checking if its ItemFood. and i make 2 ints and subract them both . Well it works but i dont know if it reduced the duration
-
-
Hey im back sorry i overslept.
Im really dont know how to set this Item Food because if i set it into contructor it adds argumets
private ItemFoods FOODS = new ItemFoods(int, boolean);
And here is i really dont know what will i do
private ItemFoods FOODS = FOODS. //<----- i dont know what to set
-
-
Here
@Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack) { ItemStack food = player.getCurrentEquippedItem(); if(food != null &&food.getItem() instanceof ItemFood){ int i = foods.getMaxItemUseDuration(itemstack) - 16; // <--- StrackTrace } }
-
Heres the crash
net.minecraft.util.ReportedException: Ticking entity at net.minecraft.world.World.updateEntities(World.java:2079) ~[World.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:2064) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] Caused by: java.lang.NullPointerException at mhfc.net.common.item.armor.TigrexArmor.onArmorTick(TigrexArmor.java:109) ~[TigrexArmor.class:?] at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357) ~[inventoryPlayer.class:?] at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625) ~[EntityPlayer.class:?] at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299) ~[EntityPlayerSP.class:?] at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) ~[EntityLivingBase.class:?] at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342) ~[EntityPlayer.class:?] at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100) ~[EntityClientPlayerMP.class:?] at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) ~[World.class:?] at net.minecraft.world.World.updateEntity(World.java:2214) ~[World.class:?] at net.minecraft.world.World.updateEntities(World.java:2064) ~[World.class:?] ... 10 more ---- Minecraft Crash Report ---- // Would you like a cupcake? Time: 7/4/14 11:01 PM Description: Ticking entity java.lang.NullPointerException: Ticking entity at mhfc.net.common.item.armor.TigrexArmor.onArmorTick(TigrexArmor.java:109) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625) at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342) at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) at net.minecraft.world.World.updateEntity(World.java:2214) at net.minecraft.world.World.updateEntities(World.java:2064) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2064) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) at net.minecraft.client.Minecraft.run(Minecraft.java:912) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at mhfc.net.common.item.armor.TigrexArmor.onArmorTick(TigrexArmor.java:109) at net.minecraft.entity.player.InventoryPlayer.decrementAnimations(InventoryPlayer.java:357) at net.minecraft.entity.player.EntityPlayer.onLivingUpdate(EntityPlayer.java:625) at net.minecraft.client.entity.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:299) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1820) at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:342) at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:100) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2254) at net.minecraft.world.World.updateEntity(World.java:2214) -- Entity being ticked -- Details: Entity Type: null (net.minecraft.client.entity.EntityClientPlayerMP) Entity ID: 459 Entity Name: XxHeltratoxX Entity's Exact location: 118.86, 5.62, -888.44 Entity's Block location: World: (118,5,-889), Chunk: (at 6,0,7 in 7,-56; contains blocks 112,0,-896 to 127,255,-881), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513) Entity's Momentum: 0.00, 0.00, 0.00 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2064) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['XxHeltratoxX'/459, l='MpServer', x=118.86, y=5.62, z=-888.44]] Chunk stats: MultiplayerChunkCache: 20, 20 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: World: (119,4,-896), Chunk: (at 7,0,0 in 7,-56; contains blocks 112,0,-896 to 127,255,-881), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513) Level time: 2884 game time, 2884 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 20 total; [EntityCow['Cow'/352, l='MpServer', x=117.25, y=4.00, z=-855.47], EntityCow['Cow'/353, l='MpServer', x=121.34, y=4.00, z=-848.69], EntitySheep['Sheep'/354, l='MpServer', x=123.09, y=4.00, z=-863.06], EntitySlime['Slime'/355, l='MpServer', x=112.94, y=4.00, z=-854.03], EntityClientPlayerMP['XxHeltratoxX'/459, l='MpServer', x=118.86, y=5.62, z=-888.44], EntitySlime['Slime'/389, l='MpServer', x=151.34, y=4.00, z=-899.27], EntityChicken['Chicken'/390, l='MpServer', x=157.53, y=4.00, z=-882.56], EntityPig['Pig'/391, l='MpServer', x=155.41, y=4.00, z=-873.41], EntityChicken['Chicken'/392, l='MpServer', x=156.56, y=4.00, z=-877.47], EntityChicken['Chicken'/393, l='MpServer', x=149.63, y=4.00, z=-862.41], EntitySlime['Slime'/334, l='MpServer', x=97.52, y=4.00, z=-880.38], EntitySlime['Slime'/335, l='MpServer', x=109.88, y=4.00, z=-875.19], EntitySlime['Slime'/367, l='MpServer', x=139.78, y=4.00, z=-900.84], EntitySheep['Sheep'/368, l='MpServer', x=131.81, y=4.00, z=-848.63], EntitySlime['Slime'/336, l='MpServer', x=104.50, y=4.00, z=-860.28], EntitySlime['Slime'/337, l='MpServer', x=99.13, y=4.00, z=-863.66], EntitySheep['Sheep'/313, l='MpServer', x=82.09, y=4.00, z=-852.06], EntitySheep['Sheep'/314, l='MpServer', x=80.09, y=4.00, z=-848.97], EntitySlime['Slime'/350, l='MpServer', x=123.41, y=4.77, z=-902.63], EntitySlime['Slime'/351, l='MpServer', x=114.26, y=4.00, z=-888.39]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523) at net.minecraft.client.Minecraft.run(Minecraft.java:934) at net.minecraft.client.main.Main.main(Main.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Whats bad about making the item max duration into 16 . Dint it got reduced?
-
Thanks so much bro now last question please . how do i make the item duration on use shorter i mean the item that is on right click will iniate shorter
I did this and it crash once again
int i = foods.getMaxItemUseDuration(itemstack); i = 16;
-
Hello
how do i make the itemstack make instanceof ItemFood it seems i crash and i dont knowwhats exactly making it wrong heres my code anyway
ItemStack food = player.getCurrentEquippedItem(); if(food.getItem() instanceof ItemFood){ int i = foods.getMaxItemUseDuration(food); i = 16; }
By the way im making the food duration short if my armor set is worn in short it makes the player eat fast
-
So if hopefully if im not mistaken i should to this ?
ItemStack armor = player.getCurrentArmor(armorType // <---- to get all the sets);
-
Uhm , am i right
the one that runs 4 times is the cause of this variables ?
ItemStack boots = player.getCurrentArmor(0); ItemStack legs = player.getCurrentArmor(1); ItemStack chest = player.getCurrentArmor(2); ItemStack helmet = player.getCurrentArmor(3);
Also how do player detect the item duration on itemuse ? im probably putting all things now and gonna test it if im not mistaking of the codes above
-
-
-
Did i made right? i got an idea at your tip and this is what i made
@Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemstack) { ItemStack food = player.getCurrentEquippedItem(); if(this != null && this == MHFCRegItem.mhfcitemtigrexhelm && this == MHFCRegItem.mhfcitemtigrexboots && this == MHFCRegItem.mhfcitemtigrexchest && this == MHFCRegItem.mhfcitemtigrexlegs){ if(food.getItem() instanceof ItemFood){ } } }
If it is one last Question how do i detect the itemfood maxduration because this armor makes u eat faster >.<
-
instanceof yeah im trying that now , yeah sorry about that im trying to figure out myself but ill fix it myself
1.7.10 - 3D Item Bug (Some renders other gone Invisible only at inventory)
in Modder Support
Posted
Bump anyone please?
is this a forge bug anyway?