Jump to content

Recommended Posts

Posted

Hi.

 

I hope I'm not asking something obvious, but I haven't been able to find the answer anywhere.

 

Is it possible to get a block object and/or ID by the block's text name, for mod-generated blocks?  It seems to me that, from a programming point of view, this would be the best way of allowing mods to interact with each other, without worrying about internal IDs.

 

I'd like to write a mod that makes use of custom blocks that exist in another mod, but that mod uses undocumented ID/meta values.  (Specifically, I want to use some of the blocks from the Condensed Blocks mod in recipes.)

 

I've tried using the ID Resolver mod to find out more info about the blocks in question, but it just hangs my Minecraft during loading.

 

The mod does use a config file for the base IDs of the blocks, but the few blocks I'm looking for, specifically, don't have any mention in the config.

 

Anyone have any ideas?

 

Thanks.

 

Posted

Hi.

 

I hope I'm not asking something obvious, but I haven't been able to find the answer anywhere.

 

Is it possible to get a block object and/or ID by the block's text name, for mod-generated blocks?  It seems to me that, from a programming point of view, this would be the best way of allowing mods to interact with each other, without worrying about internal IDs.

 

I'd like to write a mod that makes use of custom blocks that exist in another mod, but that mod uses undocumented ID/meta values.  (Specifically, I want to use some of the blocks from the Condensed Blocks mod in recipes.)

 

I've tried using the ID Resolver mod to find out more info about the blocks in question, but it just hangs my Minecraft during loading.

 

The mod does use a config file for the base IDs of the blocks, but the few blocks I'm looking for, specifically, don't have any mention in the config.

 

Anyone have any ideas?

 

Thanks.

 

Posted

Or... maybe not.  Looks like that function was added in the last couple of revisions.  I need to wait for all my favorite mods to update to 1.5.1 first. :-(  I'm still on 1.4.7, and that function doesn't exist yet.  Oh, well.  Patience...

Posted

Or... maybe not.  Looks like that function was added in the last couple of revisions.  I need to wait for all my favorite mods to update to 1.5.1 first. :-(  I'm still on 1.4.7, and that function doesn't exist yet.  Oh, well.  Patience...

Posted

it should be in the mod owners mcmod info file, or in the main mod class under modid = "MODID", alternatively if you do not have access to either of these you would have to ask thr mod creator.

Use examples, i have aspergers.

Examples make sense to me.

Posted

it should be in the mod owners mcmod info file, or in the main mod class under modid = "MODID", alternatively if you do not have access to either of these you would have to ask thr mod creator.

Use examples, i have aspergers.

Examples make sense to me.

Posted

foreach Block block inn BlockList

if (block.name == name)

return block

minecraft is coded in java not in c#

c#

foreach(Block b in Block.blocksList){

if(b.name.Equals(name))

return block;

}

java

for(Block b : Block.blocksList){

if(b.name.equals(name)

return block;

}

Posted

foreach Block block inn BlockList

if (block.name == name)

return block

minecraft is coded in java not in c#

c#

foreach(Block b in Block.blocksList){

if(b.name.Equals(name))

return block;

}

java

for(Block b : Block.blocksList){

if(b.name.equals(name)

return block;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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