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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. That's because the player doesn't exist yet, that event fires before the connection is finalized and the server creates the player in the world and sends the world information to the client.
  2. Don't make custom launchers
  3. They do, automatically. I forget what the default logging level is (things below it don't show), but I'm pretty sure Level.INFO works (I'm using it currently) but if it doesn't, you can use Level.WARN
  4. Yes, because it includes information like what mod the message is coming from and where in the code it was called from.
  5. You're doing everything wrong. Keyboard events only happen on the client. Game state is stored on the server. You must use packets
  6. Your Container is broken. Also, you didn't post any code.
  7. I'm sure vanilla manages this somewhere. I'm sure you could look at it. Even if that fails, I'm sure an IBlockState decomposes into a collection of values that can be contained within a packet.
  8. public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); }
  9. You already have a thread about this:
  10. What do you mean, you can't call it because of one of the parameters? What about that parameter? Which one? What are you doing? From where?
  11. Random question: Why are you printing to standard error? You know every mod had a mod specific logger, right? (Also... System.out is a Thing...)
  12. You can't create an ItemStack out of an IBlockState. You have to ask the block to give you an item stack for the given state (getDrop or getPickBlock)
  13. Not really. But I do know you'll be interested in ISimpleBlockRenderingHandler
  14. Sorry, I missed the version number you're on. 1.7.10 isn't supported here any more.
  15. Use multiple layers. For example, all of my ores use this model: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderores/models/block/hardore.json Note there are twelve faces specified: each face of the block (up, down, north, etc) is specified twice with different textures each time. You can use blockstates to indicate which texture-file (cross.png) gets drawn in each texture-reference (#overlay, #base, #foo).
  16. Change the size of the item stack.
  17. When would you like to do this?
  18. Second time this exact problem this week. The Block + Meta problem probably needs to go into the common issues thread.
  19. No worries! We all have days like that. Heck, there have been times when writing up a post to as a question or figure out a bug, I'll arrive at the solution. It's called rubber duck debugging.
  20. You can't remove the blocks from being in existence, but you can remove them from the world. There's an OreGen event, you would just need to subscribe to it, then cancel it. (I'm blanking on the exact name atm)
  21. AH HA, that debug output solves it: String str = b.getPropertyString(state.getProperties()); ModelResourceLocation mrl = new ModelResourceLocation(state.getBlock().getRegistryName(), str); // HERE Log.info("Registering variant : " + str + " -- Meta : " + this.getMetaFromState(state) + " @ " + mrl.toString()); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(state.getBlock()), this.getMetaFromState(state), mrl);
  22. You don't use "inventory" for metadata blocks. Well, you can, but you need to then supply a JSON item model file to specify which texture to use (this is how vanilla does it). It's way easier to reuse the blockstate json for item models when possible (all hail Forge). This is why there's all that StateMapper#getPropertyString() stuff: we need to know what the state mapper says the variant string is so we can tell the Model Loader what variant model to go locate data for from the blockstate json.
  23. You're not using the inventory variant, you're using the other variants: String str = b.getPropertyString(state.getProperties());
  24. Oh, and then it redirects back into the block class. :V You're making things unnecessarily complicated and duplicate code. All of this: public void initModel() { StateMapperBase b = new DefaultStateMapper(); BlockStateContainer bsc = this.getBlockState(); ImmutableList<IBlockState> values = bsc.getValidStates(); ResourceLocation mrla[] = new ResourceLocation[values.size()]; for(IBlockState state : values) { String str = b.getPropertyString(state.getProperties()); ModelResourceLocation mrl = new ModelResourceLocation(state.getBlock().getRegistryName(), "inventory"); Log.info("Registering variant : " + str + " -- Meta : " + this.getMetaFromState(state) + " @ " + mrl.toString()); Item.getItemFromBlock(state.getBlock()).getMetadata(0); ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(state.getBlock()), this.getMetaFromState(state), mrl); } } Can easily be inside a library class and you pass in the relevant block/item instead of using "this." Like this. Now then... This is unused: ResourceLocation mrla[] = new ResourceLocation[values.size()]; This does nothing: Item.getItemFromBlock(state.getBlock()).getMetadata(0); Beyond that...it looks exactly like my own code, so I can't see the error.

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.