Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

DragonFerocity

Members
  • Joined

  • Last visited

Everything posted by DragonFerocity

  1. Oh! That fixed it! Thanks! When looking around online, I found this, which is for MC 1.8, and he references ItemBlockWithMetadata. So I guess that class got renamed and slightly remade into ItemMultiTexture? EDIT: Also, I know how to fix the item's not having textures by doing what I described above This doesn't work: But this does: Which just means I need a different blockstate json file for each which isn't a problem, it's just strange to me.
  2. Duh. That fixes it not having a model. But it has no textures. And it still only places the oak variant no matter which type I use. There's also nothing in the log now about campfire errors.
  3. Okay, thanks! I found a way to make the individual campfire items have models: I just have to pass a custom resource location when I call ModelLoader.SetCustomModelResourceLocation instead of passing the registry name of the item. ie, instead of using this (which doesn't work): ModelLoader.setCustomModelResourceLocation(ibCampfire, 4, new ModelResourceLocation(ibCampfire.getRegistryName().toString(), "acacia")); I can do this (which does work) ModelLoader.setCustomModelResourceLocation(ibCampfire, 4, new ModelResourceLocation("expanded:acacia_campfire")); Is there something wrong with this json (This corresponds to the first setCustomModelResourceLocation)? (Also, the items still place the wrong variant when used in a world... I'm investigating that still) EDIT: Here's the error output: Which, I realize what it's saying, I just don't understand why it's saying it. Why can't it load the model? I believe my blockstate json is correct, yet it seems it can't find it. Why?
  4. What are you trying to tell me? If I move @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { BlockHandler.registerModels(); } to ClientProxy.java, none of my items have item models anymore.
  5. That's because this code is now in my RegistryHandler.java file: See above You're right in that I can find a better way to do things. It's on my list of things to do but for now it works and I'm not really going to change this until I get my currently problem resolved. See above I was told that this has to happen during the ModelRegistryEvent event, thus I have put it during that event, in which it actually works. Again see above Yes, that import is left over from 1.11.2 Sorry that my code is a mess right now. I haven't gone through to clean it up yet. It's what I plan on doing next as soon as I figure this problem out (unless I can't, in which I'll just scrap it)
  6. I believe I am really close to the solution: Now the itemblocks when held in hand have no textures, which I'm actually not sure how to fix but I'm looking into it (I'm thinking this is because I don't have any textures defined in the campfire.json model file), and then whenever I try to place an acacia campfire, it places an oak one and the onscreen debugger shows that it's type is oak not acacia. I have updated my code on GitHub to the latest as well. I also found this post which helps a little and let's me know i'm doing things fine, but it's for v1.10.2, and so some of the things aren't correct anymore. According to this post, I have everything I need in my code to get it working.
  7. Okay, thanks for letting me know all of this. It's been helpful. One last question, how do I get all of the other variants in the game? I made a crafting recipe for one of the acacia variants, and the item produced was just a black/purple square with no model (but it had the same name as the default campfire "campfire.name"), and when I placed it, it placed a normal version of the campfire with the normal model rather than using the acacia version. Do I need to go through and register all of the different models like I am with the default version? campfire = createBlock(new ModCampfire(false, "campfire", CreativeTabs.DECORATIONS, 1F, 1F, "pickaxe", 0), event); ibCampfire = createItemBlockWithoutAddingToList(new ItemBlock(campfire), campfire); litCampfire = createBlock(new ModCampfire(true, "lit_campfire", CreativeTabs.DECORATIONS, 1F, 1F, "pickaxe", 0), event); ibLitCampfire = createItemBlockWithoutAddingToList(new ItemBlock(litCampfire), litCampfire); I thought that using Metadata would make it so I wouldn't have to, but I might be wrong. The reason I wanted to use metadata is because of this function in ModCampfire.java public static void setState(boolean active, World worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); TileEntity tileentity = worldIn.getTileEntity(pos); keepInventory = true; if (active) { worldIn.setBlockState(pos, BlockHandler.litCampfire.getDefaultState().withProperty(TYPE, iblockstate.getValue(TYPE)), 3); worldIn.setBlockState(pos, BlockHandler.litCampfire.getDefaultState().withProperty(TYPE, iblockstate.getValue(TYPE)), 3); } else { worldIn.setBlockState(pos, BlockHandler.campfire.getDefaultState().withProperty(TYPE, iblockstate.getValue(TYPE)), 3); worldIn.setBlockState(pos, BlockHandler.campfire.getDefaultState().withProperty(TYPE, iblockstate.getValue(TYPE)), 3); } keepInventory = false; if (tileentity != null) { tileentity.validate(); worldIn.setTileEntity(pos, tileentity); } } If I have to register each variant separately, I'm either going to have to find another way to change the blockstate of each variant from the same file, or just create a new file for each variant. Is there a way around this?
  8. Here's a link to the root of my git repo There's a link to specific files in my first post by the way.
  9. I upgraded my version of Forge, and the FML has stayed the same. EDIT: I should probably also point out that my register renders function is what registers Items and ItemBlocks. Isn't that supposed to be called in the Init of the ClientProxy? EDIT: Also, if models must be registered in the ModelRegistryEvent, why does RegistryEvent.Register<Item> and RegistryEvent.Register<Block> exist?
  10. I'm very confused right now because I don't really know what you're talking about. I added this to my client proxy and it just made things worse: (The item doesn't show a model in my hand, or inventory, and the block still doesn't show a model. Both are the purple/black cube) @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { BlockHandler.registerRenders(); } I don't know what I'm supposed to do here. The way I currently register renders/models works for everything except for my campfire, and I'm 99% sure it's because I'm trying to use Metadata to make it easier.
  11. Thanks for being more specific that time: BlockHandler::InitItems creates all the items BlockHandler::InitBlocks creates all the blocks Snippet from BlockHandler::initItems() Here's one of the register functions called from registerRenders (there's multiple, one for each different type): BlockHandler::registerRenders() is called from the ClientProxy() Did I forget anything this time?
  12. BlockHandler::createItemBlock() BlockHandler::registerRenders() snippet This code is located in BlockHandler, which is called from RegistryHandler.java
  13. I'm only registering one of the variants, here's it's code: BlockHandler::initBlocks //Campfire //Oak campfire = createBlock(new ModCampfire(false, "campfire", CreativeTabs.DECORATIONS, 1F, 1F, "pickaxe", 0), event); ibCampfire = createItemBlock(new ItemBlock(campfire), campfire); litCampfire = createBlock(new ModCampfire(true, "lit_campfire", CreativeTabs.DECORATIONS, 1F, 1F, "pickaxe", 0), event); ibLitCampfire = createItemBlock(new ItemBlock(litCampfire), litCampfire); GameRegistry.registerTileEntity(ModTileEntityCampfire.class, "campfire_tile_entity"); Here's ModCampfire.java
  14. I don't see anything useful in the FML, but here you go.
  15. Okay, made those changes to the whole file, but the block itself is still the black and purple cube instead of having a model.
  16. Is that a global statement? Because extending BlockContainer for one of my other objects that doesn't have metadata works just fine. Or is this statement specific to things with metadata? EDIT: Also, I can't seem to find getTileEntity in the Block.java file from Forge. I did find createTileEntity though. Is that what I should use? (Just checking even though it might just be a semantics difference.)
  17. Hey guys, So, I'm working on adding a new block, a campfire, and I want there to be a campfire for each of the different wood types. I believe I've setup the metadata correctly (I basically just copied from BlockPlanks.java). Basically, in game, the ItemBlock has a model and shows textures properly in the inventory and hand, but the block itself doesn't even show a model and instead is the black/purple block instead. Here is my campfire code Here is my Blockstates.Json file I'm also a little confused as in the vanilla minecraft code I didn't see anywhere where each of the different types of planks are registered programmatically. In the Block.java file, it just registers the base type of planks. However, there is a separate json file for each of the different types rather than a single planks.json that specifies the different EnumType variants. I'm pretty sure there's more I need, but I'm not sure what else I need to do.
  18. Where exactly did you put that snippet of code? Preinit or init or elsewhere?
  19. Hey guys, So how do I override a vanilla recipe in 1.12? I tried overriding the recipe json file in a resource pack but it didn't work. Sorry if this is a basic question, but there doesn't seem to be anything out there for 1.12 yet that I can find.
  20. Seems to be showing my gui now...
  21. Yes. I know it's strange. The reason being I played Guild Wars 1 a lot when I was younger, and I found that using 1-4 and Q W E R for my spells worked a lot better than using 1-8, so I just shifted wasd to asdx so that I could move and cast spells all with my left hand.
  22. I'm sorry that anything I've tried seems to not work. Oh, I'm also sorry for trying to get help on a minecraft forge forum. I'm also sorry that forge isn't throwing any errors. I'm also sorry that I don't code the same way you do. I'm also sorry that my breakpoints aren't being hit. I'm also sorry that I followed a, as you put it, stupid beginning forge tutorial.... I'm also sorry that I'm not as experienced. I'm also sorry that I'm trying to get help... Oh wait I already stated that and it doesn't seem like I'm actually getting anywhere. Edit: Btw, I removed all the unnecessary files/folders from the repo.
  23. Try again. (P.S. does that really relate to my problem? Or are you trying to run it?) I just never pushed the new version to the repo.
  24. https://github.com/DragonFerocity/expandedaesthetics

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.