Jump to content

_gjkf_

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by _gjkf_

  1. I like the idea, but yeah, as dieseben said, it might not work so well. I really like the idea though
  2. Even doing that it won't write anything on the textfield. It fixes the crash, but it won't work.
  3. Thanks to kenoba10, I have fixed my 1st issue, now I crash trying to open the 2nd GUI, I have the problem at textField.drawtextBox(); and insertField.drawtextBox(); Here's the crash: http://pastebin.com/svQq8jDD Thanks for the help.
  4. Anyone has any ideas?
  5. Hello everyone, I'm trying to make 2 GUIs and both of them have problems: 1) In this GUI I should be able to insert an item in the only slot of my item (headPhones). The problems are: 1) I can't interact with the player inventory, in any way 2) In the container slot there's the item that's in the 2nd slot of the player's hotbar, I don't know why. Here are the classes I used: https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/handler/GuiHandler.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/client/gui/HeadPhonesGui.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/items/HeadPhones.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/items/HeadPhonesContainer.java 2) This GUI should allow the player to manage Links (I'm making a radio mod), I have 2 textFields and some buttons. The problem is that I can't interact with the textFields, in any way, neither clicking them nor using "textfield.setText("Test Text");". I even tried using a variable to get the String that is inserted. Here are the classed used: https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/handler/GuiHandler.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/items/RadioCrystal.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/items/RadioCrystalContainer.java https://github.com/gjkf/HeadPhones-Radio/blob/master/src/main/java/com/gjkf/headPhones/client/gui/RadioCrystalGui.java Any help, clarifications, suggestions would be really appreciated, thanks.
  6. It worked!!! I love you man!!!
  7. U'll try the work-around, thanks.
  8. SourceTree App crashes, no crash report. It crashes when I press the "Create Repository" Button on the "Show Hosted Repositories" view. I have a Mac Book Pro 13'', 5 years old. I'm using 10.7.5 as OS Specs: Processor: 2,53 Ghz Intel Core 2 Duo Ram: 4 GB 1067 MHz DDR3 Software: Mac OS X Lion 10.7.5 (11G63b) Graphic: NVIDIA GeForce 9400M 256 MB I hope this helps
  9. I crash the app when I try to make a new remote repository... I tried many times, I just can't do it.
  10. Thanks, I'll try it tomorrow, thanks
  11. hey guys, I downloaded source tree, how can I use it? I have no idea Sorry if it sounds stupid, I just have no clue about git and anything related to it, exception made for EGit (Eclipse plugin, I can't use it, it won't work...) Thanks in advance
  12. Thanks to everybody for your answers @jabelar @Kwibble I'll try using Source tree, I hope it will help me out @Meastroman I'll build a basic mod, just to try it out on git, I'll tell you if I have any problems. Thanks again.
  13. Hello everyone, I know this is a question that has been asked lots of times, but I couldn't find anything that could help me. I know how to make a Git repository and syncing that with eclipse. If I try that with my mod, instead of copying the files and then pushing them to git, eclipse moves them to the local repo folder, so that I can't access them anymore and I don't see anything in my git repository. I'm on Mac, version 10.7.5 (can't update, my Mac is too old) I would really love to be able to access my mod on git. Thanks. P.S.: I have never used Github before, so I don't really know much about it.
  14. Even with that set as null I still crash @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == References.GUI_ID){ return new HeadPhonesGui(player.inventory, null); } return null; } Is it what you meant or did I misunderstand you again? Sorry, I'm really a noob at this, sorry again
  15. Do you mean like this? public HeadPhonesGui(IInventory inv1, IInventory inv2) { super(new HeadPhonesContainer(inv1, null)); this.headPhones = inv1; } If so, it still crashes at the exact same point. If you mean this public HeadPhonesGui(IInventory inv1, IInventory inv2) { super(new HeadPhonesContainer(inv1, inv2), null); this.headPhones = inv1; } It won't work because GuiContainer accepts only 1 argument I might have not understand you, sorry if that's the case
  16. Thanks for the early reply. Now it kinda is working. I still crash but for another reason. Here's the report ---- Minecraft Crash Report ---- // This doesn't make any sense! Time: 16/07/14 17.58 Description: Rendering screen java.lang.NullPointerException: Rendering screen at com.gjkf.headPhones.client.gui.HeadPhonesGui.drawGuiContainerBackgroundLayer(HeadPhonesGui.java:31) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:97) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1145) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1066) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:56) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.gjkf.headPhones.client.gui.HeadPhonesGui.drawGuiContainerBackgroundLayer(HeadPhonesGui.java:31) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:97) -- Screen render details -- Details: Screen name: com.gjkf.headPhones.client.gui.HeadPhonesGui Mouse location: Scaled: (273, 213). Absolute: (546, 52) Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2 -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/106, l='MpServer', x=708,58, y=5,59, z=1059,00]] Chunk stats: MultiplayerChunkCache: 210, 210 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: World: (720,4,1047), Chunk: (at 0,0,7 in 45,65; contains blocks 720,0,1040 to 735,255,1055), Region: (1,2; contains chunks 32,64 to 63,95, blocks 512,0,1024 to 1023,255,1535) Level time: 1850 game time, 1850 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: 60 total; [EntityChicken['Chicken'/3, l='MpServer', x=632,66, y=4,00, z=989,44], EntityChicken['Chicken'/5, l='MpServer', x=639,66, y=4,00, z=985,56], EntityChicken['Chicken'/6, l='MpServer', x=637,56, y=4,00, z=1069,53], EntityChicken['Chicken'/7, l='MpServer', x=638,50, y=4,00, z=1072,50], EntityChicken['Chicken'/8, l='MpServer', x=638,59, y=4,00, z=1077,44], EntityPig['Pig'/21, l='MpServer', x=644,50, y=4,00, z=985,50], EntityChicken['Chicken'/23, l='MpServer', x=641,50, y=4,00, z=988,50], EntityPig['Pig'/22, l='MpServer', x=640,94, y=4,00, z=984,56], EntityChicken['Chicken'/24, l='MpServer', x=640,50, y=4,00, z=986,50], EntityChicken['Chicken'/27, l='MpServer', x=640,63, y=4,00, z=1067,63], EntityChicken['Chicken'/26, l='MpServer', x=639,81, y=4,00, z=1068,78], EntityChicken['Chicken'/29, l='MpServer', x=651,57, y=4,00, z=1072,44], EntityChicken['Chicken'/28, l='MpServer', x=654,41, y=4,00, z=1067,56], EntitySheep['Sheep'/31, l='MpServer', x=652,16, y=4,00, z=1126,78], EntityChicken['Chicken'/30, l='MpServer', x=640,47, y=4,00, z=1073,47], EntityCow['Cow'/34, l='MpServer', x=659,22, y=4,00, z=1135,22], EntityChicken['Chicken'/33, l='MpServer', x=658,44, y=4,00, z=1059,56], EntityCow['Cow'/38, l='MpServer', x=657,34, y=4,00, z=1139,09], EntityCow['Cow'/42, l='MpServer', x=680,94, y=4,00, z=1015,19], EntityChicken['Chicken'/43, l='MpServer', x=686,53, y=4,00, z=1018,56], EntityCow['Cow'/46, l='MpServer', x=679,51, y=4,00, z=1026,43], EntityCow['Cow'/47, l='MpServer', x=682,13, y=4,00, z=1028,09], EntityChicken['Chicken'/44, l='MpServer', x=676,63, y=4,00, z=1036,44], EntitySheep['Sheep'/45, l='MpServer', x=684,50, y=4,00, z=1031,97], EntityChicken['Chicken'/51, l='MpServer', x=685,38, y=4,00, z=1076,44], EntitySheep['Sheep'/50, l='MpServer', x=678,34, y=4,00, z=1078,50], EntitySheep['Sheep'/49, l='MpServer', x=679,84, y=4,00, z=1079,88], EntitySheep['Sheep'/48, l='MpServer', x=680,72, y=4,00, z=1067,38], EntityChicken['Chicken'/54, l='MpServer', x=684,41, y=4,00, z=1092,44], EntityChicken['Chicken'/53, l='MpServer', x=676,72, y=4,00, z=1074,28], EntityChicken['Chicken'/52, l='MpServer', x=679,81, y=4,00, z=1077,34], EntitySheep['Sheep'/59, l='MpServer', x=696,41, y=4,00, z=1064,19], EntityChicken['Chicken'/58, l='MpServer', x=688,06, y=4,00, z=1028,19], EntitySheep['Sheep'/57, l='MpServer', x=697,19, y=4,00, z=1029,22], EntityClientPlayerMP['ForgeDevName'/106, l='MpServer', x=708,58, y=5,59, z=1059,00], EntitySheep['Sheep'/62, l='MpServer', x=717,25, y=4,00, z=1131,63], EntityCow['Cow'/61, l='MpServer', x=715,88, y=4,00, z=1126,13], EntitySheep['Sheep'/60, l='MpServer', x=708,94, y=4,00, z=1031,94], EntitySheep['Sheep'/68, l='MpServer', x=732,16, y=4,00, z=1125,16], EntitySheep['Sheep'/69, l='MpServer', x=728,50, y=4,00, z=1132,50], EntitySheep['Sheep'/70, l='MpServer', x=732,59, y=4,00, z=1132,72], EntitySheep['Sheep'/71, l='MpServer', x=734,63, y=4,00, z=1135,50], EntityCow['Cow'/76, l='MpServer', x=730,91, y=4,00, z=1128,19], EntityCow['Cow'/77, l='MpServer', x=735,50, y=4,00, z=1132,50], EntitySheep['Sheep'/72, l='MpServer', x=733,78, y=4,00, z=1134,38], EntitySheep['Sheep'/73, l='MpServer', x=733,50, y=4,00, z=1127,50], EntitySheep['Sheep'/74, l='MpServer', x=734,50, y=4,00, z=1129,50], EntityCow['Cow'/75, l='MpServer', x=729,50, y=4,00, z=1126,50], EntitySheep['Sheep'/85, l='MpServer', x=748,25, y=4,00, z=1077,63], EntityPig['Pig'/87, l='MpServer', x=758,47, y=4,00, z=1069,31], EntitySheep['Sheep'/86, l='MpServer', x=762,50, y=4,00, z=1071,50], EntitySheep['Sheep'/93, l='MpServer', x=764,50, y=4,00, z=1072,22], EntitySheep['Sheep'/92, l='MpServer', x=767,91, y=4,00, z=1062,94], EntitySheep['Sheep'/95, l='MpServer', x=759,63, y=4,00, z=1080,81], EntitySheep['Sheep'/94, l='MpServer', x=755,19, y=4,00, z=1083,19], EntityPig['Pig'/89, l='MpServer', x=754,55, y=4,00, z=1063,92], EntityPig['Pig'/88, l='MpServer', x=755,91, y=4,00, z=1064,49], EntitySheep['Sheep'/91, l='MpServer', x=764,81, y=4,00, z=1070,28], EntityPig['Pig'/90, l='MpServer', x=753,19, y=4,00, z=1065,81], EntitySheep['Sheep'/96, l='MpServer', x=770,81, y=4,00, z=1074,34]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2567) at net.minecraft.client.Minecraft.run(Minecraft.java:983) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:56) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Mac OS X (x86_64) version 10.7.5 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 851198632 bytes (811 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available HeadPhonesRadio{0.1} [HeadPhonesRadio] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: NVIDIA GeForce 9400M OpenGL Engine GL version 2.1 NVIDIA-7.32.12, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) Thanks again
  17. Hello everyone!!! I'm making a mod that adds 2 items, an helmet that allows the player to listen to the radio while playing and the radio crystal that should go inside the helmet. My goal is to make a GUI for the helmet with only 1 slot that can contain only the radio crystal. I have no clue with GUIs, I looked at Minecraft code in order to do it (the ChestContainer class, the ChestGui). I have no idea where's my problem. Here's the crash report ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 16/07/14 15.05 Description: Unexpected error java.lang.NullPointerException: Unexpected error at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2514) at com.gjkf.headPhones.items.HeadPhones.onItemRightClick(HeadPhones.java:36) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:166) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:434) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1556) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2043) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:56) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2514) at com.gjkf.headPhones.items.HeadPhones.onItemRightClick(HeadPhones.java:36) at net.minecraft.item.ItemStack.useItemRightClick(ItemStack.java:166) at net.minecraft.client.multiplayer.PlayerControllerMP.sendUseItem(PlayerControllerMP.java:434) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1556) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['ForgeDevName'/168, l='MpServer', x=12,68, y=5,54, z=1,66]] Chunk stats: MultiplayerChunkCache: 360, 360 Level seed: 0 Level generator: ID 01 - flat, ver 0. Features enabled: false Level generator options: Level spawn location: World: (356,4,-283), Chunk: (at 4,0,5 in 22,-18; contains blocks 352,0,-288 to 367,255,-273), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1) Level time: 5568 game time, 2346 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: 1 total; [EntityClientPlayerMP['ForgeDevName'/168, l='MpServer', x=12,68, y=5,54, z=1,66]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:417) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2567) at net.minecraft.client.Minecraft.run(Minecraft.java:990) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at GradleStart.bounce(GradleStart.java:95) at GradleStart.startClient(GradleStart.java:88) at GradleStart.main(GradleStart.java:56) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Mac OS X (x86_64) version 10.7.5 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 842866192 bytes (803 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available HeadPhonesRadio{0.1} [HeadPhonesRadio] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: NVIDIA GeForce 9400M OpenGL Engine GL version 2.1 NVIDIA-7.32.12, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) Here's my Main class package com.gjkf.headPhones; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import com.gjkf.headPhones.creativeTab.HeadPhonesCreativeTab; import com.gjkf.headPhones.handler.ConfigurationHandler; import com.gjkf.headPhones.items.HeadPhones; import com.gjkf.headPhones.items.RadioCrystal; import com.gjkf.headPhones.proxy.CommonProxy; import com.gjkf.headPhones.reference.References; import com.gjkf.headPhones.utility.LogHelper; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = References.MODID, name = References.MOD_NAME,version = References.VERSION, guiFactory = References.GUI_FACTORY_CLASS) public class Main { @Instance(References.MODID) public static Main instance; @SidedProxy(clientSide = References.CLIENT_PROXY_CLASS, serverSide = References.SERVER_PROXY_CLASS) public static CommonProxy proxy; public static int headPhonesId; public static CreativeTabs tab = new HeadPhonesCreativeTab(CreativeTabs.getNextID(), "HeadPhonesTab"); public static ArmorMaterial plastic = new EnumHelper().addArmorMaterial("plastic", 100, new int[]{1,0,0,0}, 0); public static Item headPhones = new HeadPhones(plastic, headPhonesId, 0).setUnlocalizedName("headPhones") .setCreativeTab(tab); public static Item radioCrystal = new RadioCrystal().setUnlocalizedName("radioCrystal").setCreativeTab(tab); @EventHandler public void preinit(FMLPreInitializationEvent event){ ConfigurationHandler.init(event.getSuggestedConfigurationFile()); FMLCommonHandler.instance().bus().register(new ConfigurationHandler()); GameRegistry.registerItem(headPhones, "headPhones"); GameRegistry.registerItem(radioCrystal, "radioCrystal"); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_11); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_13); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_cat); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_chirp); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_far); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_mall); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_mellohi); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_stal); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_strad); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_wait); GameRegistry.addRecipe(new ItemStack(headPhones), "xxx","xax",'x', Blocks.log, 'a', Items.record_ward); LogHelper.info("Pre Initialization Complete!!!"); } @EventHandler public void init(FMLInitializationEvent event){ NetworkRegistry.INSTANCE.registerGuiHandler(this, new CommonProxy()); LogHelper.info("Initialization Complete!!!"); } @EventHandler public void postinit(FMLPostInitializationEvent event){ LogHelper.info("Post Initialization Complete!!!"); } } Here's my Helmet class package com.gjkf.headPhones.items; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import com.gjkf.headPhones.Main; import com.gjkf.headPhones.client.gui.HeadPhonesGui; import com.gjkf.headPhones.reference.References; import com.gjkf.headPhones.utility.LogHelper; public class HeadPhones extends ItemArmor{ public HeadPhonesContainer container; public HeadPhones(ArmorMaterial material, int id, int placement) { super(material, id, placement); if(placement == 0){ this.setTextureName(References.MODID+":headPhones"); } } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){ if(stack.getItem() == Main.headPhones){ return References.MODID+":textures/models/armor/headPhonesArmor_1.png"; }else{ return null; } } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ if (player.isSneaking()){ player.openGui(HeadPhonesGui.class, References.GUI_ID, world, (int)player.serverPosX, (int)player.serverPosY, (int)player.serverPosZ); LogHelper.info("Succesfully opened GUI"); } return stack; } } Here's my Helmet Container class package com.gjkf.headPhones.items; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; public class HeadPhonesContainer extends Container{ private IInventory playerInv; private int numSlots = 1; public HeadPhonesContainer(IInventory inv1, IInventory inv2){ this.playerInv = inv1; for (int j = 0; j < this.numSlots; ++j) { for (int k = 0; k < 1; ++k) { this.addSlotToContainer(new Slot(inv2, k + j * 9, 8 + k * 18, 18 + j * 18)); } } } @Override public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_){ return null; } @Override public boolean canInteractWith(EntityPlayer player){ return this.playerInv.isUseableByPlayer(player); } @Override public void onContainerClosed(EntityPlayer p_75134_1_){ super.onContainerClosed(p_75134_1_); this.playerInv.closeInventory(); } } Here's my Helmet GUI class package com.gjkf.headPhones.client.gui; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.inventory.IInventory; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import com.gjkf.headPhones.items.HeadPhonesContainer; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class HeadPhonesGui extends GuiContainer{ private static final ResourceLocation location = new ResourceLocation("textures/gui/headPhonesGui.png"); public static IInventory headPhones; private IInventory playerInv; private int inventoryRows; public HeadPhonesGui(IInventory inv1, IInventory inv2) { super(new HeadPhonesContainer(inv1, inv2)); this.headPhones = inv1; this.playerInv = inv2; } @Override protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { this.fontRendererObj.drawString(this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName(), new Object[0]), 8, 6, 4210752); this.fontRendererObj.drawString(this.headPhones.hasCustomInventoryName() ? this.headPhones.getInventoryName() : I18n.format(this.headPhones.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); } protected void drawGuiContainerBackgroundLayer1(float p_146976_1_, int p_146976_2_, int p_146976_3_) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(location); int k = (this.width - this.xSize) / 2; int l = (this.height - this.ySize) / 2; this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.inventoryRows * 18 + 17); this.drawTexturedModalRect(k, l + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96); } } Here's my Common Proxy package com.gjkf.headPhones.proxy; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.world.World; import com.gjkf.headPhones.client.gui.HeadPhonesGui; import com.gjkf.headPhones.items.HeadPhonesContainer; import com.gjkf.headPhones.reference.References; import cpw.mods.fml.common.network.IGuiHandler; public class CommonProxy implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if (ID == References.GUI_ID){ return new HeadPhonesGui(player.inventory, HeadPhonesGui.headPhones); } return null; } } Here's my Reference class package com.gjkf.headPhones.reference; public class References { public static final String MODID = "HeadPhonesRadio"; public static final String MOD_NAME = "HeadPhones Radio Mod"; public static final String VERSION = "0.1"; public static final String GUI_FACTORY_CLASS = "com.gjkf.headPhones.client.gui.GuiFactory"; public static final String CLIENT_PROXY_CLASS = "com.gjkf.headPhones.proxy.ClientProxy"; public static final String SERVER_PROXY_CLASS = "com.gjkf.headPhones.proxy.ServerProxy"; public static final String COMMON_PROXY_CLASS = "com.gjkf.headPhones.proxy.CommonProxy"; public static final int GUI_ID = 1000; } Again, I'm really new to GUIs so I could have made incredible mistakes, please don't yell me. Thanks for all the help.
  18. To fix the KeyBind tutorial you need to put in your load or init method in the main class this line: KeyBindingClass.init() It worked for me, I hope it'll work for you.
  19. Thanks for all the infos, I'll start looking for packet handling tutorials and render tutorials, I'll go look into vanilla code and I hope I'll do something cool. Thanks again.
  20. Thanks for the explanation, I have no clue about packets so I'll read that link. I didn't thought about the server thing, that's right though. So basically I have to get when the key is pressed, send a packet to the server so that he knows if the stair should be rotated and only then rotate the block, right? Now my problem is that I want to rotate a block in a way that vanilla Minecraft hasn't conceived, I want my stair to be horizontal on a wall, Minecraft has never thought it was even possible. So, do I have to write a custom render engine to rotate the stair and then store its rotation inside the metadata? Sorry if it seems dumb to you, it's my first serious mod that I've ever released (even the other part is awful (vertical slabs that I had to use 2 different blocks, one for East/West the other for North/South because I couldn't get the direction of the player without crashing)). Thanks for your answers, and again sorry for my very small knowledge.
  21. Here you are. Stairs Class package com.gjkf.blocks; import com.gjkf.main.Main; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; public class HorizontalStair extends BlockStairs{ private final Block block; private final int meta; private boolean field_150152_N; private int field_150153_O; public static boolean field_rotated = false; public HorizontalStair(Block blockSource, int metadata) { super(blockSource, metadata); this.block = blockSource; this.meta = metadata; this.useNeighborBrightness = true; } @Override public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ if (this.field_150152_N){ this.setBlockBounds( 0.5F * (float)(this.field_150153_O % 2), 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F * (float)(this.field_150153_O / 4 % 2), 0.5F + 0.5F * (float)(this.field_150153_O % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 2 % 2), 0.5F + 0.5F * (float)(this.field_150153_O / 4 % 2)); }else{ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } @Override public int getRenderType(){ return 10; } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta){ return this.block.getIcon(side, this.meta); } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister p_149651_1_) {} @Override public boolean isOpaqueCube(){ return false; } @Override public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta){ return side != 0 && (side == 1 || (double)hitY <= 0.5D) ? meta : meta | 4; } @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase ent, ItemStack p_149689_6_){ int l = MathHelper.floor_double((double)(ent.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i1 = world.getBlockMetadata(x, y, z) & 4; if(field_rotated){ this.rotateBlock(world, x, y, z, ForgeDirection.EAST); } if (l == 0){ world.setBlockMetadataWithNotify(x, y, z, 2 | i1, 2); } if (l == 1){ world.setBlockMetadataWithNotify(x, y, z, 1 | i1, 2); } if (l == 2){ world.setBlockMetadataWithNotify(x, y, z, 3 | i1, 2); } if (l == 3){ world.setBlockMetadataWithNotify(x, y, z, 0 | i1, 2); } } @Override public void onBlockClicked(World world, int x, int y, int z, EntityPlayer ent){ this.block.onBlockClicked(world, x, y, z, ent); } } KeyBind Class package com.gjkf.key; import org.lwjgl.input.Keyboard; import cpw.mods.fml.client.registry.ClientRegistry; import net.minecraft.client.settings.KeyBinding; public class KeyBind { public static KeyBinding rotate; public static void init(){ rotate = new KeyBinding("Rotate", Keyboard.KEY_LMENU, "key.categories.gameplay"); ClientRegistry.registerKeyBinding(rotate); } } KeyInputHandlerClass package com.gjkf.key; import net.minecraft.client.settings.KeyBinding; import org.lwjgl.input.Keyboard; import com.gjkf.blocks.HorizontalStair; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent; public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event){ while(KeyBind.rotate.isPressed()){ System.err.println(HorizontalStair.field_rotated); if(HorizontalStair.field_rotated){ HorizontalStair.field_rotated = false; }else if(!HorizontalStair.field_rotated){ HorizontalStair.field_rotated = true; } } } } I wanted so that when you press a key while placing a block it would rotate it. That's why I have the KeyBindings classes.
  22. It doesn't seem to work. Neither for the stairs, nor for any other kind of block. Maybe I'm just doing it wrong.
  23. Thank you very much, now it's working smoothly. Didn't know that you needed to call that method. Thanks again.
  24. Where should I do that? I have in the init() method of my Main Class this "FMLCommonHandler.instance().bus().register(new KeyInputHandler());" otherwise I don't think I never call it anywhere.
  25. I followed the tutorial in the minecraftforge wiki and it crashes my game with a NullPointerException... Crash KeyBind Class KeyInputHandler Class
×
×
  • Create New...

Important Information

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