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.

Featured Replies

Posted

Hello there,

I have trouble with understanding how the GameRegistry works in regards of blockID's etc.

I'm currently trying to extract the id and metadata of a given location. I stumbled upon the metadatasplitting of wood logs or leaves for example:

 

public int damageDropped(int par1)
{
  return par1 & 3;
}

 

This uses the first 2 bits for subblock identification of the BlockLeaves, which has 4 different types. In order to work with all (unknown) types of blocks, I would need a method to resolve the block class by the blockId. I couldn't find such a method by now. This led me to the GameRegistry. I'm aiming for working with vanilla blocks aswell as foreign modded blocks.

 

In the GameRegistry you can resolve a block by its modid and name (which is ok). How would I get the name of a given id?

 

In addition to this I used BiomesOPlenty as a reference and found this (https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.7.10-2.1.x/src/main/java/biomesoplenty/common/blocks/BOPBlock.java):

 

public abstract class BOPBlock extends Block
{
protected BOPBlock(Material material)
{
	super(material);

	this.setCreativeTab(BiomesOPlenty.tabBiomesOPlenty);
}
}

 

which obviously differs from my mc block implementation in a critical way:

 

public Block(int blockID, Material par2Material) {
...
}

 

So BOP seems to use another Block implementation, which does not require an id to be set. I don't even know what to ask here. I just can't understand how the blockID is determined. So i dont know blockID->Block, blockID->blockName, in mods i don't even know Block->blockID.

 

Im working with forge-1.6.4-9.11.1.964. BOP seems to use 1.6.2. The questions are a bit vague. But feel free to elaborate how the id management is supposed to work or point to sth, i couldn't find.

 

 

 

 

Im working with forge-1.6.4-9.11.1.964

In addition to this I used BiomesOPlenty as a reference and found this (https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.7.10-2.1.x/src/main/java/biomesoplenty/common/blocks/BOPBlock.java)

 

And also, why are you working on 1.6.4?

  • Author

Compatibility reasons.

 

I'd like to add:

 

Block b = Block.blocksList[id]

 

Is this a reliable way to resolve modded blocks?

Guest
This topic is now closed to further replies.

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.