Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/27/17 in all areas

  1. If you just copy/paste, then what's the point of you making the mod?
    2 points
  2. No. This forum is for helping people with their own code. Giving out copy-paste-code is not helpful, neither to you, who won't learn what the actual code does, nor us, who'd have to write detailed tutorials on where, how, why and when the code does whatever it does. I've told you how to gain access to a block that the player is looking at, and how to get the specific side as well (Item::rayTrace). Now try and use it. We can help you along the way. We will not send you off with a free ticket.
    1 point
  3. You could also try moving your model registration to the ModelRegistryEvent instead of preInit
    1 point
  4. If you look at where GUIs are opened in the Minecraft#displayGuiScreen() method, you'll see that as soon as the current GUI is set to a new GUI (i.e. just opened the GUI) the following code is run: ScaledResolution scaledresolution = new ScaledResolution(this); int i = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledHeight(); guiScreenIn.setWorldAndResolution(this, i, j); Since that code is running in the Minecraft class, the "this" refers to the entire game window. So you can see that the idea is that the GuiScreen "resolution" is set to be the entire game window. In other words, the GuiScreen always covers the whole window, but it is up to you where you draw your Gui within the game window. If you look at the GuiScreen#setWorldAndResolution() method you'll see that it sets the height and width fields of the GuiScreen. So with all that background you should be able to understand how to scale your Gui. You should leave the height and width fields, but do drawing locations based on them. So if you wanted to draw in the middle of the game window you'd use height/2 and width/2. This will ensure they scale along with the minecraft game window. Hope that makes sense. Also, just look at other GuiScreen-based classes to understand how they position things.
    1 point
  5. the JSON system is considered the proper modern way to do it. One advantage is that it will be able to be replaced in resource packs rather than "hard coded" into your mod. Unless you're doing something very unusual with recipes (in which case you might implement your own IRecipe class) you should use the JSON along with the registry event system.
    1 point
  6. Do you have a pack.mcmeta file in src/main/resources with pack_format set to 3? If you don't, Forge will load your mod's resources using the LegacyV2Adapter IResourcePack wrapper. This means that your lang files will be loaded with the old mixed-case names (e.g. en_US.lang) rather than the new lower-case names (e.g. en_us.lang). If you do, your lang files should be loaded with lower-case names. Try refreshing your IDE project (i.e. click the "Refresh all Gradle projects" button in IDEA's Gradle window or re-run the eclipse Gradle task) and/or rebuilding it.
    1 point
×
×
  • Create New...

Important Information

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