Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/01/18 in all areas

  1. @JimiIT92 All of your spoilers are empty.
    1 point
  2. Well, there isn't an event for detecting any chat message but there is a ClientChatEvent that is fired every time most messages get added to the client's chat. It may not work for something like command messages though. For stuff like that you will need to manually check for changes in the client's chat. You can use GuiNewChat.chatLines to get all the chat lines(private, needs reflection) or GuiNewChat#getSentMessages(only works for the messages the client sent at any point, not the received ones) and check for changes in those lists, then modify them if you need it. You can get an instance of GuiNewChat with GuiIngame#getChatGUI and you can get an instance of GuiIngame with Minecraft.ingameGUI
    1 point
  3. GuiScreen#onGuiClosed() is probably what you want here. It's actually called whenever the current GUI object (if already non-null) changes, which is generally by Minecraft#displayGuiScreen() - note that a change from non-null to null also counts here. So when you create your sub-GUI, store a reference to Minecraft.currentScreen in your sub-GUI constructor, and in your sub-GUI's onGuiClosed() override, call Minecraft#displayGuiScreen(parentGuiReference) to redisplay the parent GUI. Note that you're not actually reusing the GuiScreen object - the sub-GUI is a separate object which exists at the same time as the parent GUI. If you need to pass data from the sub-GUI back to the parent GUI, store a reference to the sub-GUI in the parent when you create it (most likely in actionPerformed() when the player clicks a button). The parent's initGui() method should check for a non-null sub-GUI field and use that to extract any data that was entered by the player. The important point being that the parent GUI object still exists while the sub-GUI is being shown (because the sub-GUI holds a reference to it), so you're redisplaying an existing GUI object, not a new one. And the sub-GUI object still exists after it's closed (at least until the parent closes), because the parent GUI holds a reference to it.
    1 point
  4. Common proxy makes no sense, proxies exist to separate sided-only code. If your code is common then it goes anywhere else but your proxy. This makes even less sense. A server proxy either contains noop implementation for client only stuff or references to server-only classes that would crash the client in a similar way how model registration crashes the server. A common proxy can't be your server proxy. Don't use static initializers ever. Instantinate your stuff directly in the appropriate registry event. Don't use this outdated method of registering your TEs. Use the overload that takes a ResourceLocation instead. Why are your blocks and items declared in two separate places(ObjectHandler and ModBlocks/ModItems)? This makes no sense because they are different objects/instances of the same class where only one is registered. IHasModel is stupid. All Items need models, no exceptions and nothing about model registration requires access to private/protected things. Register your models in the ModelRegistryEvent directly. You are registering your items/blocks twice. Once in the RegistryHandler, once in the ObjectHandler. You also have your Item/Block classes copied in two packages, the projecteplus one and the gameObjs one. Please structure your mod/repository correctly. Maybe I am blind here but I can't see any class in your repository that would implement IGuiHandler. The GUI/Container pair won't magically open itself just becaue you've invoked EntityPlayer#openGui. You need a registered IGuiHandler implementation.
    1 point
  5. Well obviously this won't work. An Event can't be equal to a Block, this is basic OOP. The event has a getter that will get you the IBlockState of the block being broken and you can then get the block with IBlockState#getBlock and compare that. The drop chance applies to all the items at the same time, not to the one you've added. If you want a chance for your item to drop then only add the item to the list if the random check succeeds.
    1 point
  6. Well you obviously need to call it from some kind of event that gets called every frame. RenderWorldLast or RenderTickEvent for example. As for the arguments passed see what Render#renderLivingLabel does.
    1 point
  7. Hello! Playing with mods will only be possible if you have the Java version of Minecraft. If you have the Windows 10 version, mods are not compatible. If you DO have the Java version, then I would suggest getting the twitch launcher, found at https://app.twitch.tv/download This will prevent you from downloading mods from Bad Sites that contain broken/outdated/virused mods, and put everything in a nice package for you. After installing the launcher, just run it, and click where it says "Mods" near the top, then select Minecraft. From here, you will be able to browse packs made by other people, or create your own modpack by choosing the mods you want. Keep in mind when adding a bunch of mods, this can make the game run slower, and/or mixing mods sometimes they do not "play well" together. If you want a lot of mods, try adding a couple at a time, and trying the game to make sure it doesn't crash and is still playable. If you add a mod that breaks it, just go back and remove it. I am not sure what you mean by "I want to change my person", but I would guess that it means you would like a new "skin" for your player. There are instructions on changing your skin in the Java edition here: https://help.mojang.com/customer/en/portal/articles/979200-minecraft-skins?b_id=5408 Instructions for changing your skin on the Windows 10 edition here: https://support.xbox.com/en-US/games/game-titles/custom-skins-minecraft-windows-10-edition Hope this helps! Good luck, and most of all have fun!
    1 point
  8. Is this your mod? If it isn't complain to the author. If it is you need to read this:
    1 point
  9. One of the things my mod does is add player names to the filenames of screenshots containing their edits. Currently I'm modifying the Minecraft ScreenshotHelper class to customise the name of the file to save. It would be helpful if there was an event hook in ScreenshotHelper.func_74292_a() just before ImageIO.write(bufferedimage, "png", file3) to customise the File to write. The current screenshot code in Minecraft is a bit of black box. It's currently hardwired to check the F2 key with a call to Minecraft.screenshotListener() in Minecraft.runGameLoop(). Someone pointed out, in another API request I had that it is possible to use the ASM library to modify core code. I have spent a few hours googling around for help and examples, but frankly, I'm struggling with it and it doesn't seem that the mechanisms for doing this in Forge are well explained. I'd appreciate any efforts made by the Forge developers to add an event hook for screenshots, or even a well-documented method of swapping a core Minecraft method for a method nominated by a mod at runtime.
    1 point
×
×
  • Create New...

Important Information

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