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.

TheRedMezek

Members
  • Joined

  • Last visited

Everything posted by TheRedMezek

  1. Thank you. The problem now is that I don't know how to get the information of whether it's cooking (stored in the block's blockstate) from within the method, seeing as nothing helpful like it's position is passed in. EDIT: Oh derp, there's two getLightValues. I shall use the more helpful second one.
  2. It would help if we knew what you wanted it to come out as. I'm assuming you want it to be smaller in first person, in which case you need to turn down the firstperson scale in your item .json. If that still isn't to your liking, fiddle around with the item .json until you like it. You'll learn how it works as you go.
  3. I have a furnace-like block which is supposed to change light level depending on whether or not it's in use. So far my attempts to make this work have succeeded in a very broken way; the light level only changes when the block is done cooking, it never goes back to how it was, and it changes for all of the blocks in the world at once. I've been changing it with this.setLightLevel(), if you know of another way to change the light level I would appreciate it. The code it below. My code trying to change the light level is currently in the particle spawning method because I couldn't figure out where to put it. And I thought I was done asking on here for help with this mod...ha ha...
  4. I have a model with a texture that has some pixels filled, others left empty so it can be seen through (like vanilla glass). When the model is applied to the block it's supposed to be used on, the empty pixels get filled with white, but when applied to a different block I discovered that the texture worked just fine. I've fiddled with and looked around both blocks' class and blockstate files, and can't figure it out. Intended block which model doesn't work with Block which the model works fine with, but doesn't belong to The model What the working and non-working models look like: What the blocks look like when using the vanilla glass model:
  5. I changed getStateFromMeta() as you suggested, I don't see any change. The models aren't the actual models I plan to use for this block (since I haven't made those yet), they're just placeholders. raisedbrazier is two or three times as many pixels high as bigbrazier, so when the model changes it will be quite obvious. God help me, TheGreyGhost is stumped.
  6. No relevant errors in the console as far as I can see Blockstate json Block code Tile entity
  7. Both of them are currently being used by other blocks and work just fine there. bigbrazier raisedbrazier
  8. Thank you Jabelar, for my first hint of success! I implemented basically what you showed, and now my particle method is making particles when things are cooking! THE BLOCK STATE HAS CHANGED! HUZZAH! Unfortunately the model is still the same. So why would the model be the same even though I KNOW the blockstate has changed?
  9. I'm not exactly sure how to implement getMetaFromState() correctly, here's what I tried (which didn't work) public int getMetaFromState(IBlockState state) { return ((Boolean)state.getValue(ISBURNING)).booleanValue() ? 1 : 0; } I don't see where the state is being changed. I assume it happens whenever getActualState() is called, or perhaps when other methods are called, and that I would need to update the block after that. I got rid of the private boolean isBurning, but I was only using it for the particle generator function anyways. This is what I'm using now (which still doesn't make particles when things are cooking): @SideOnly(Side.CLIENT) public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { boolean isBurning = ((Boolean)state.getValue(ISBURNING)).booleanValue(); if(isBurning) { double d0 = (double) pos.getX() + 0.5D; double d1 = (double) pos.getY() + 0.4D; double d2 = (double) pos.getZ() + 0.5D; worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D, new int[0]); } } This in particular suggests to me that the block state isn't being changed at all. I need to go to bed, but will look back here in the morning. Thanks again for your help!
  10. Thank you for the resource (I wish I had thought to look up a tutorial earlier), but unfortunately it has not helped. What I see different there is that the blockstate isn't actually set anywhere, but instead there's the getActualState function in the block and the tile entity sets the bock for a forced update instead of setting its state. Current block class Current tile entity EDIT: I've got to go to a class, I won't be back for an hour or so. Any help you guys can provide is appreciated! This problem has been the final obstacle for my first mod for nearly two weeks now.
  11. Is anybody out there? Is nobody replying because the problem is too dumb, or because nobody else can figure it out either?
  12. I have a furnace-like block that is supposed to change its model depending on whether or not it's cooking something. However, even when I explicitly and repeatedly tell the game to put the block state to true, as opposed to the default of false, it only ever shows the model for false. There are no errors, no crashes. I am at my wit's end. Block class Tile entity Blockstates json
  13. Should I make a new thread for the new model-doesn't-change problem?
  14. Oops. public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { return (oldState.getBlock() != newSate.getBlock()); } Also, I noticed an error in the launcher output, although it could be caused by some other mod I have installed: [08:48:04] [Thread-10/ERROR]: Error in class 'LibraryLWJGLOpenAL' [08:48:04] [Thread-10/ERROR]: Source '60ea8f7f-d987-4d46-904b-2690630d242c' not found in method 'play' [08:48:04] [Thread-10/ERROR]: Error in class 'LibraryLWJGLOpenAL' [08:48:04] [Thread-10/ERROR]: Source '60ea8f7f-d987-4d46-904b-2690630d242c' not found in method 'play'
  15. I added this to the tile entity: public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { return false; } And now it cooks things like a furnace, but the block model doesn't change with the state like it's supposed to. Here's the blockstates json in case you need that: { "variants": { "active=false": { "model": "braziermod:raisedbrazier" }, "active=true": { "model": "braziermod:bigbrazier" } } } Both models work just fine, as I have tested by switching the false and true above.
  16. I wish I didn't have to ask about block states and my mod again, but...oh well. I'm making a furnace-like block, which is functional except that whenever it has a fuel item in the fuel slot and a cookable item in the cooking slot, rather than starting to cook it closes the GUI and when I open it again the items have vanished. I assume this means that the tile entity is deleting itself, but it isn't producing any errors so I don't really know. Here's the code: Block (ignore the commented-out parts) Tile entity
  17. Yes, thank you! I added the getRenderType method provided and now I can see the block.
  18. bigbrazier raisedbrazier They are just placeholders and currently being used by two other blocks just fine. I'm afraid I don't know what a registry is... EDIT: A HA! Perhaps you mean this, from the launcher output? [15:25:31] [Client thread/ERROR] [FML]: Model definition for location braziermod:cookingbrazier#active=true not found [15:25:31] [Client thread/ERROR] [FML]: Model definition for location braziermod:cookingbrazier#active=false not found
  19. He means: You can add spoilers with [nobbc] [/nobbc] Yeah, I figured that out eventually. Thanks So can anyone help me with the actual modding problem?
  20. I'm trying to make a furnace-like block, which is currently fully functional except that it's invisible when placed. It's supposed to have two possible states, one for when it's in use and one for when it isn't, and I've tried everything I can think of to make it work. The really odd thing is that when it breaks the correct particles appear. The block class file Blockstates JSON file { "variants": { "active=true": { "model": "braziermod:raisedbrazier" }, "active=false": { "model": "braziermod:bigbrazier" } } }
  21. Challenge accepted. Uh...so...what should it extend instead?
  22. I don't know what reflection is. I'm extending it because the block I'm making is basically a furnace, and I didn't want to copy-paste or recreate its functionality. Why is extending it a bad idea?
  23. I don't want it to be rock, although I haven't decided what I do want it to be yet. Is there any way I can change the material to something else?
  24. "Cannot assign a value to final variable 'blockMaterial'" Is what it says when I mouse over this.blockMaterial, which is underlined red

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.