
Jimmeh
Members-
Posts
131 -
Joined
-
Last visited
Everything posted by Jimmeh
-
-
Okay, that all makes sense. I'll just provide all the json files. Here's the blockstate one: { "forge_marker": 1, "defaults": { "textures": { "all": "test:blocks/BlockWeaponRack" } }, "variants": { "normal": { "model": "test:BlockWeaponRack" }, "inventory": { "model": "cube_all" } } } Here's the models/block one: { "parent": "block/cube_all", "textures": { "all": "test:blocks/BlockWeaponRack" } } And here's the models/item one: { "parent": "builtin/generated", "textures": { "layer0": "test:blocks/BlockWeaponRack" } } Thanks
-
Alrighty, so I have a very generic custom block, BlockWeaponRack. All I really have at this point is a custom texture, so my custom block should have the model of a normal cube. There's really 2 questions I have here. 1) How do I make it take on the shape of a full cube? In my JSON file for the model, I have the parent as "block/cube_all", so shouldn't it take on a full 3D appearance? I've tried overriding isFullCube() and returning true, yet it still looks like this: https://gyazo.com/60d9f15f0d47a9b2dde5e24cb7eef111 2) How do I make it look like a 3D cube in the inventory? In the blockstates JSON file, I have it specified to do just that, but it's not happening. Here's my BlockWeaponRack.json blockstates file: { "forge_marker": 1, "defaults": { "textures": { "all": "test:blocks/BlockWeaponRack" } }, "variants": { "normal": { "model": "test:BlockWeaponRack" }, "inventory": { "model": "cube_all" } } } And thinking more into this, the hitbox is still the normal cube shape, but the texture just did 1 3D strip in the center, as you saw above. So maybe there's some method in the BlockWeaponRack class that I need to override and tell it to texture all 6 faces... I don't know .-. Thanks!
-
Update. I actually managed to find another tutorial that's updated for 1.10 I found the ItemBlock part and everything is working now. Thanks for the insight, both of ya!
-
Ah okay. Could you provide an example of this or point me in the right direction? Is it something as simple as like: this.setItemBlock(new ItemBlock()) in my custom block's constructor?
-
And following up on this, do you have any resources you'd recommend that have stood out to you for beginners?
-
Hmmm, perhaps not. I don't remember seeing that in the YouTube tutorial I'm watching. haha. My class extends 'Block' and I am doing GameRegistry.register(blockWeaponRack); Is that what you mean?
-
So I've just created a custom block, and for some reason, I'm running into a NullPointerException when trying to register it. Here's the full code: private static void registerBlockModels(){ ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(BlockHandler.blockWeaponRack), 0, new ModelResourceLocation(BlockHandler.blockWeaponRack.getRegistryName(), "normal")); } And for some reason, this part is returning null: Item.getItemFromBlock(BlockHandler.blockWeaponRack) I've already tested the block itself, and it isn't null. Just the return value of that ^. I'm not sure why that would be null if the block itself isn't. Any help is appreciated!
-
That makes complete sense to me now. Thanks for all your help bud!
-
Literally just did. haha. Have fun .-. https://github.com/Jimmeh94/TestMod 2 things, #1 i have created a pull request check out what i changed, #2 you made a very silly mistake with your resource folders, https://gyazo.com/7b4c4f63e490ad6b307c72dd448a090a it isnt supposed to be assets.test, its supposed to be a folder named assets, and another folder in that named test. I appreciate it! We just figured it out too. haha. I was reading the folder structure like java packages, thinking assets.test = assets/test. I appreciate all the time you gave me this evening. I know this wasn't too riveting of a problem to solve
-
Okay, awesome. I'm glad to know that the problem I've been beating my head on my wall over for the past day have just been folder structures. haha. I appreciate all the help. I'm sure I'll be back on here in the next couple days when I hit the next speed bump in the YouTube tutorials.
-
Wait wait wait. That worked... I don't understand how assets.test.etc is different from assets/test/etc, especially if IntelliJ auto-formats it so. But with a bit of janky work, I get it to the latter setup. Now I just need to fix the lang file and we're good to go. Wow that was so much harder than it had to be
-
But from what I've experienced with IntelliJ, it'll combine packages unless there's a file there. So for instance, unless there's a file in assets (assets.File), the structure won't be assets/test/etc, it'll be "compressed" into assets.test. Let me mess around with it and see if I can figure it out
-
Literally just did. haha. Have fun .-. https://github.com/Jimmeh94/TestMod
-
Okay, now that's realllly strange .-. The item I've created is ItemTrainingStaff, which extends (another custom class) ItemBase, which extends Item. Why would it be considering itself a block? O_o
-
Yeah, I removed that. Followed your example to a T. Usually error reports are my best friend, but this one doesn't seem to help since the path it's specifying is literally the same structure I have in my resources folder. Here's the error report: http://hastebin.com/muxeborinu.rb And my folder structure: https://gyazo.com/ccb0bda2a43365ceff4e0beada180e98
-
I just arranged it your way and for some reason it's still not working. I have no idea what I've done wrong. My resources path is correct, so I still have no clue why it can't find the JSON file. But I do like the way you have your mod set up!
-
True. I might scrap this and start fresh. If I do, then I'll use Github.
-
Ah, okay. So I'm trying to go through and pick out what could help me here. haha. I see in your ModItems class, you use GameRegistry.register(item) But you aren't setting the model or anything. Could you explain to me in what order you do what? I'm trying to use the (apparently) new events for registering things. RegistryEvent.Register<Item> to register all my items and ModelRegisteryEvent to set all the ModelResourceLocations. Apparently those fire before FMLPreInitializationEvent does
-
Here's the folder structure for my resources: https://gyazo.com/96fc9e00ac32f9d6d926d9dbee54b4c8
-
I just set my unlocalized name = registry name as well. It made sense to me. haha. I notice you have "normal" in your ModelResourceLocation. All tutorials have "inventory" there. If you don't mind, could you explain what that's actually for, because none of them seem to do that
-
Alrighty, a lot of code inbound. Main: @Mod(modid = Test.MODID, name = Test.MOD_NAME, version = Test.VERSION) public class Test { public static final String VERSION = "1.0.0"; public static final String MODID = "test"; public static final String MOD_NAME = "Test Mod"; @SidedProxy(serverSide = "com.github.jimmeh.server.ServerProxy", clientSide = "com.github.jimmeh.client.ClientProxy") public static ServerProxy PROXY; @Mod.Instance("test") public static Test INSTACE; @Mod.EventHandler public void onPreInit(FMLPreInitializationEvent event){ Test.PROXY.onPreInit(); } @Mod.EventHandler public void onInit(FMLInitializationEvent event){ Test.PROXY.onInit(); } @Mod.EventHandler public void onPostInit(FMLPostInitializationEvent event){ Test.PROXY.onPostInit(); } } ClientProxy: public class ClientProxy extends ServerProxy { public static final Minecraft MINECRAFT = Minecraft.getMinecraft(); @Override public void onPreInit(){ super.onPreInit(); MinecraftForge.EVENT_BUS.register(ClientEventHandler.INSTANCE); } @Override public void onInit(){super.onInit();} @Override public void onPostInit(){ super.onPostInit(); } } Server Proxy: public class ServerProxy { public void onPreInit(){ MinecraftForge.EVENT_BUS.register(ServerEventHandler.INSTANCE); } public void onInit(){ //Items and blocks here ItemHandler.INSTANCE.onInit(); } public void onPostInit(){ } } ItemHandler: public enum ItemHandler { INSTANCE; public List<Item> itemList = new ArrayList<Item>(); public static ItemTrainingStaff staffTraining; public void onInit(){ //this.register your items staffTraining = new ItemTrainingStaff(); this.registerItem(staffTraining); } private void registerItem(ItemBase item){ //GameRegistry.register(item, new ResourceLocation(Test.MODID, item.getItemReference().getRegistryName())); GameRegistry.register(item); this.itemList.add(item); } } ItemBase: public class ItemBase extends Item { private ItemReferences itemReference; public ItemBase(ItemReferences i){ this.itemReference = i; setUnlocalizedName(i.getUnlocalizedName()); setRegistryName(i.getRegistryName()); } public ItemReferences getItemReference() { return itemReference; } } ItemReferences: public enum ItemReferences { /* * For json models, the file name needs to match the registry name * For the lang, use the unlocalized name */ ItemTrainingStaff("ItemTrainingStaff"); private String unlocalizedName; private String registryName; ItemReferences(String u){unlocalizedName = this.registryName = u;} public String getUnlocalizedName() { return unlocalizedName; } public String getRegistryName() { return registryName; } } ItemTrainingStaff: public class ItemTrainingStaff extends ItemBase { public ItemTrainingStaff(){ super(ItemReferences.ItemTrainingStaff); } } ItemTrainingStaff.json: { "parent": "builtin/generated", "textures": { "layer0": "test:items/ItemTrainingStaff" } } I know this is a lot, but thanks for, at the very least, taking a shot at this!
-
Okay, thank you! I've moved everything into the Register<Item> event now. I think this is my last question (until I reach the next road bump in the YouTube tutorial series I'm following). I put it in another thread even though I do think it's somewhat related to this. If you could offer a bit of insight there, that'd be great. But either way, I appreciate your time. The other thread (having to do with 'missing' JSON files): http://www.minecraftforge.net/forum/index.php?topic=43043.0
-
I tried that too and it still didn't work .-. I have no idea what I'm doing wrong. I tried working with forge earlier this year and creating an item was a breeze. Now I can't figure it out. haha
-
I appreciate the suggestion! I'll try that if I can't figure it out with 'ModelLoader.setCustomModelResourceLocation(...)'. In a previous thread earlier today, I was told to use that rather than getItemModelMesher(). I don't know if this is the "new" way or what, but if it continues to not work, I'll definitely be going back to that. haha