Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.9] Ore Dictionary


Bektor
 Share

Recommended Posts

Hi,

 

I've got a few question about the Ore Dictionary.

 

  • I want to compare if the given IBlockState equals wood, so if it is wood (logs). How can I do this the best way? (should work with all other mods, so Ore Dictionary)
  • Should I register my custom dirt, grass, logs, stone and leaves with the Ore Dictionary or not? (they do not work like normal vanilla blocks of these kinds, which is the reason why I made them custom | they should only spawn in my own dimension | they have stuff like gravity)

 

Thx in advance.

Bektor

Developer of Primeval Forest.

Link to comment
Share on other sites

I want to compare if the given IBlockState equals wood, so if it is wood (logs). How can I do this the best way? (should work with all other mods, so Ore Dictionary)

Do you want to check if the block drops wood or is itself wood?

For the first use

getDrops

to obtain it's drops, for the 2nd use

getPickBlock

to obtain the picked ItemStack.

 

In postInit obtain the list of wood stacks using

OreDictionary.getOres("logWood")

. To check if a given ItemStack is wood check if any of the stacks in the list matches using

OreDictionary.itemMatches

.

Should I register my custom dirt, grass, logs, stone and leaves with the Ore Dictionary or not?
Probably yes. It depends if you want them to be usable in recipes (e.g. sticks).
Link to comment
Share on other sites

To 1: So basically I've got a tree and the leaves are checking if they are connected to other leaves and/or the tree itself.

So when the scanState matches wood the method should return true.

 

To 2: Well, I've got no idea if I want that my wood and stuff can be used in normal recipes. That's the problem. What would you suggest when my dimension should be harder then the one from vanilla. So harder crafting recipes and all of that stuff in my custom dimension (and it should be able to get the items into the normal dimension back for fun ^^)

Developer of Primeval Forest.

Link to comment
Share on other sites

To 1: So basically I've got a tree and the leaves are checking if they are connected to other leaves and/or the tree itself.

So when the scanState matches wood the method should return true.

Why would you use the OreDict here? Leaves should only check for their type of wood, not any.

To 2: Well, I've got no idea if I want that my wood and stuff can be used in normal recipes. That's the problem. What would you suggest when my dimension should be harder then the one from vanilla. So harder crafting recipes and all of that stuff in my custom dimension (and it should be able to get the items into the normal dimension back for fun ^^)

I would add them regardless. Just because you can do the easier stuff with your wood as well, doesn't mean that you can do the harder recipes with any type of wood.

So it's up to the player to not "waste" the precious wood on things like sticks.

Link to comment
Share on other sites

To 1: So basically I've got a tree and the leaves are checking if they are connected to other leaves and/or the tree itself.

So when the scanState matches wood the method should return true.

Why would you use the OreDict here? Leaves should only check for their type of wood, not any.

Well, I want them to check for any time of wood. Allows me some nice stuff. ;)

 

So I think I have to save them here in a list (this is in ServerProxy) and then call itemMatches in my own method in the Block class?

    @Override
    public void postInit() { 
        OreDictionary.getOres("logWood");
    }

 

And what have I to put in here: OreDictionary.itemMatches(target, input, strict)

?

Developer of Primeval Forest.

Link to comment
Share on other sites

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
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.

 Share



×
×
  • Create New...

Important Information

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