Jump to content

[1.8] Updating Mods from 1.7.10 to 1.8


Adityagupta

Recommended Posts

Hi everybody,

 

I am updating my mods to 1.8, and I have a few questions as to how I can do so:

 

  • What are the blockstate, block model, and item model files you need for textures/names of blocks/items?
  • The "setBlock(x, y, z, block)" method in the "World" class doesn't exist, what is the alternative?
  • I noticed that stairs use "IBlockState"s in the superconstructor, but there is no way to set the name, so do I need a blockstate file or something for that?

 

 

Link to comment
Share on other sites

1.BlockState is just a wrapped block with meta, there is not much to say here.

Everything you should know about rendering and json: http://www.minecraftforge.net/forum/index.php/topic,26267.0.html

 

2. World#setBlockState(...)

 

3. I don't quite get you, IBlockState is something that holds wrapped info about block (meta and stuff):

Have look at vanilla:

Block block1 = (new BlockPlanks()).setHardness(2.0F).setResistance(5.0F).setStepSound(soundTypeWood).setUnlocalizedName("wood");

registerBlock(53, "oak_stairs", (new BlockStairs(block1.getDefaultState().withProperty(BlockPlanks.VARIANT, BlockPlanks.EnumType.OAK))).setUnlocalizedName("stairsWood"));

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

The "setBlockState()" method worked really well, thanks for that tip.

 

The link you gave me on the first bullet looks interesting, but I don't see how it makes a block model/texture. Do I just make a file with that code or something similar, or do I need to make a class like that one to get the block to render?

 

Also, for the last one, my question is how do I change the in-game name of my stairs, do I need to do it in the IBlockState implemented by its superconstructor's parameter, or do I have to do it somewhere else?

Link to comment
Share on other sites

I REALLY don't want to rewrite whole page here. :)

 

http://greyminecraftcoder.blogspot.co.at/p/list-of-topics.html

 

Have a look at "Block" topic-list. It contains probably best explanation on this stuff you will ever find.

 

As to my comment - every block MUST have:

blockstates/blockname.json

This file contains link to model and variants for it.

Then there are models:

models/block/some_model.json

Here you can define how model looks like.

And finally, since Block is block only in world, and if not it is ItemBlock, you need to add renderer for block as item (totorial on github in previous post's link explains how).

That happens in models/items/blockname.json - hre you define how ItemBlock will render as item.

 

My additional note: models/items/blockname.json MUST HAVE SAME FILENAME as blockstates/blockname.json (unless you do something tricky in code).

 

-----

 

 

In-game names are not defined by code. They are all in lang files.

I sadly have no knowledge about variant-block lang names.

It will probably look like:

tile.stairsWood.name=Oak Wood Stairs
tile.stairsWoodSpruce.name=Spruce Wood Stairs
tile.stairsWoodBirch.name=Birch Wood Stairs
tile.stairsWoodJungle.name=Jungle Wood Stairs
tile.stairsWoodAcacia.name=Acacia Wood Stairs
tile.stairsWoodDarkOak.name=Dark Oak Wood Stairs

 

Again - look at vanilla stairs and naming :)

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Thanks! It all worked except for the ItemBlock texture. I got the placed block texture and model to work, but the ItemBlock doesn't work.

 

Blockstate file:

{
    "variants": {
        "normal": { "model": "mymods:enderBlock" }
    }
}

 

Block model file:

{
    "ambientocclusion": false,
    "textures": {
        "particle": "blocks/stone",
        "base": "blocks/stone",
        "pole": "blocks/emerald_block"
    },

    "elements": [
        {   "from": [ 2, 0, 0 ],
            "to": [ 14, 1, 16 ],
            "shade": false,
            "faces": {
                "down": {
                    "uv": [
                        2,
                        0,
                        14,
                        16
                    ],
                    "texture": "#base"
                },
                "up": {
                    "uv": [
                        2,
                        0,
                        14,
                        16
                    ],
                    "texture": "#base"
                },
                "east": {
                    "uv": [
                        16,
                        0,
                        0,
                        1
                    ],
                    "texture": "#base"
                },
                "west": {
                    "uv": [
                        0,
                        0,
                        16,
                        1
                    ],
                    "texture": "#base"
                },
                "north": {
                    "uv": [
                        14,
                        0,
                        2,
                        1
                    ],
                    "texture": "#base"
                },
                "south": {
                    "uv": [
                        2,
                        0,
                        14,
                        1
                    ],
                    "texture": "#base"
                }
            }
        },
        {   "from": [ 7, 1, 6 ],
            "to": [ 9, 8, 10 ],
            "shade": false,
            "faces": {
                "up": {
                    "uv": [
                        7,
                        6,
                        9,
                        10
                    ],
                    "texture": "#pole"
                },
                "east": {
                    "uv": [
                        6,
                        1,
                        10,
                        8
                    ],
                    "texture": "#pole"
                },
                "west": {
                    "uv": [
                        6,
                        1,
                        10,
                        8
                    ],
                    "texture": "#pole"
                },
                "north": {
                    "uv": [
                        7,
                        1,
                        9,
                        8
                    ],
                    "texture": "#pole"
                },
                "south": {
                    "uv": [
                        7,
                        1,
                        9,
                        8
                    ],
                    "texture": "#pole"
                }
            }
        }
    ]
}

 

The block model file is long because I wanted it to have a cool shape.

 

Item model file:

{
  "parent": "mymods:block/enderBlock",
  "display": {
    "thirdperson": {
      "rotation": [ 10, -45, 170 ],
      "translation": [ 0, 1.5, -2.75 ],
      "scale": [ 0.375, 0.375, 0.375 ]
    }
  }
}

 

Can you tell me what I am doing wrong?

Link to comment
Share on other sites

That's probably what I missed. What is the inventory block renderer and how do I register it? I'm guessing it renders the blocks in the inventory, but I don't know if that's right. I also don't know how to register it. Can you tell me what it is and how to register it?

Link to comment
Share on other sites

From McByExample:

// This is currently necessary in order to make your block render properly when it is an item (i.e. in the inventory
// or in your hand or thrown on the ground).
// Minecraft knows to look for the item model based on the GameRegistry.registerBlock. However the registration of
// the model for each item is normally done by RenderItem.registerItems(), and this is not currently aware
// of any extra items you have created. Hence you have to do it manually. This will probably change in future.
// It must be done in the init phase, not preinit, and must be done on client only.
Item itemBlockSimple = GameRegistry.findItem("minecraftbyexample", "mbe01_block_simple");
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation("minecraftbyexample:mbe01_block_simple", "inventory");
final int DEFAULT_ITEM_SUBTYPE = 0;
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(itemBlockSimple, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation);

 

This happens ofc in client-proxy (registerRendering), MUST be in in init() (load). // Lol I noticed now that the posted code alredy said this xD

 

Now note (as I said before):

models/items/blockname.json MUST HAVE SAME FILENAME as blockstates/blockname.json.

 

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Does it work without natures_spirit and/or spectrum / adventurez?
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system
    • (i originally submitted this report to CurseForge but since we localized the issue to the modloader they pointed us here)  I am the partner of the user, GalaxyReach, assisting them as they are not as tech savvy. We have spent days troubleshooting a very weird issue that none of our other friends have with a certain modloader.  On a curse-forge launched instance of the Minecraft Launcher, clicking "play" throws an error code 1: crash log says EXCEPTION_ACCESS_VIOLATION. This exception happens in a blank, no-mods test pack as well as manually installing Forge. This issue also happens on NeoForge. We tried All of the steps withing this guide: https://support.curseforge.com/en/support/solutions/articles/9000218027-issues-related-to-the-forge-modloader namely: reinstalling the modpack reinstalling minecraft & curseforge deleting curseforge appdata updating the drivers updating the firewall the computer has been restarted several times we have tried running it on different networks manually installing & selecting java manually installing forge I don't think it is a specs/hardware issue, its a pretty good laptop (HP Omen), 16GB RAM & a 3060. It runs windows 11. Further, launching minecraft like normal through the Microsoft Store runs the game just fine. It is solely with trying to use a modded launch with Forge & NeoForge. I also tried different versions of Forge, though the specific instance I am trying to get running is 47.3.0 Is there anything else we can do here or does Forge just truly not work on this laptop?   Thank you MINECRAFT LAUNCHER GAME OUTPUT LOG 10:07:33.755 launcher main Version does not support log configuration, will assume one plaintext entry per line 10:07:36.419 game 2024-08-31 10:07:36,408 main WARN Advanced terminal features are not available in this environment 10:07:36.586 game [10:07:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, GalaxyReach, --version, forge-47.3.0, --gameDir, C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server, --assetsDir, C:\Users\Micha\curseforge\minecraft\Install\assets, --assetIndex, 5, --uuid, 7f099235327e4206afdfbc22c7712328, --accessToken, ????????, --clientId, OWEyZTE3Y2MtOTZiOC00MWMwLWFkZjYtNmY2MDU2NmIxNDAz, --xuid, 2535442900827884, --userType, msa, --versionType, release, --width, 854, --height, 480, --quickPlayPath, C:\Users\Micha\curseforge\minecraft\Install\quickPlay\java\1725124053749.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] 10:07:36.593 game [10:07:36] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Oracle Corporation; OS Windows 11 arch amd64 version 10.0 10:07:37.363 game [10:07:37] [main/INFO] [ne.mi.fm.lo.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow 10:07:37.452 game [10:07:37] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 10:07:37.503 game # 10:07:37.503 game # A fatal error has been detected by the Java Runtime Environment: 10:07:37.503 game # 10:07:37.503 game # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff8a76f59f0, pid=13980, tid=12732 10:07:37.503 game # 10:07:37.503 game # JRE version: Java(TM) SE Runtime Environment (17.0.11+7) (build 17.0.11+7-LTS-207) 10:07:37.503 game # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.11+7-LTS-207, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) 10:07:37.503 game # Problematic frame: 10:07:37.506 game # C [atio6axx.dll+0x1759f0] 10:07:37.507 game # 10:07:37.507 game # No core dump will be written. Minidumps are not enabled by default on client versions of Windows 10:07:37.507 game #   Debug txt:  [31Aug2024 10:07:36.584] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, GalaxyReach, --version, forge-47.3.0, --gameDir, C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server, --assetsDir, C:\Users\Micha\curseforge\minecraft\Install\assets, --assetIndex, 5, --uuid, 7f099235327e4206afdfbc22c7712328, --accessToken, ????????, --clientId, OWEyZTE3Y2MtOTZiOC00MWMwLWFkZjYtNmY2MDU2NmIxNDAz, --xuid, 2535442900827884, --userType, msa, --versionType, release, --width, 854, --height, 480, --quickPlayPath, C:\Users\Micha\curseforge\minecraft\Install\quickPlay\java\1725124053749.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.3.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [31Aug2024 10:07:36.592] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.11 by Oracle Corporation; OS Windows 11 arch amd64 version 10.0 [31Aug2024 10:07:36.640] [main/DEBUG] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Found launch services [fmlclientdev,forgeclient,minecraft,forgegametestserverdev,fmlserveruserdev,fmlclient,fmldatauserdev,forgeserverdev,forgeserveruserdev,forgeclientdev,forgeclientuserdev,forgeserver,forgedatadev,fmlserver,fmlclientuserdev,fmlserverdev,forgedatauserdev,testharness,forgegametestserveruserdev] [31Aug2024 10:07:36.648] [main/DEBUG] [cpw.mods.modlauncher.NameMappingServiceHandler/MODLAUNCHER]: Found naming services : [srgtomcp] [31Aug2024 10:07:36.664] [main/DEBUG] [cpw.mods.modlauncher.LaunchPluginHandler/MODLAUNCHER]: Found launch plugins: [mixin,eventbus,slf4jfixer,object_holder_definalize,runtime_enum_extender,capability_token_subclass,accesstransformer,runtimedistcleaner] [31Aug2024 10:07:36.672] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Discovering transformation services [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path GAMEDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path MODSDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\mods [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path CONFIGDIR is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\config [31Aug2024 10:07:36.680] [main/DEBUG] [net.minecraftforge.fml.loading.FMLPaths/CORE]: Path FMLCONFIG is C:\Users\Micha\curseforge\minecraft\Instances\Liminal Server\config\fml.toml [31Aug2024 10:07:37.354] [main/DEBUG] [cpw.mods.modlauncher.TransformationServicesHandler/MODLAUNCHER]: Found additional transformation services from discovery services: [31Aug2024 10:07:37.362] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [31Aug2024 10:07:37.450] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6  
  • Topics

×
×
  • Create New...

Important Information

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