Config files would only work for the simple cases. I may allow that but it would add a ton of complexity.
In other news hurricane irene took out power for much of southeastern PA (oh my god this forum sucks on a phone) so no more updates until that gets fixed; probably won't be able to get back up until tomorrow afternoon.
I would love to use the extensibility API, but I am no programmer, however if it could be done with some sort of configuration file, then I could fix any mods I decide to use to work with harvesters and planters.
There is a much easier way with buildcraft, now that harvesters put items into chests.
DDD
DDD
DDD
_HC
that is how it would look above ground, and if you use Eloraams redpower logic mod youcan set a timer on the other side of the harvester to keep it powered.
then under ground have a wooden pipe coming out of the chest with a diamond pipe atached sending sapplings to the planter which sits under the center dirt block, and wood to wherever you need it to go.
Ok now that I'm not typing on a phone keypad that's somehow randomly losing focus every five characters (seriously curse an iphone 4 should be one of the most powerful phones available, how does your forum bring it to its knees) I want to reply properly.
First off, would that layout even work? Harvesters only access chests "behind" them. Though harvester-chest-harvester is still smaller than my layout (I did say I wasn't good at this).
Now as for config files. The issue is that while it would be possible to set up "default" blocks through one, any block that required custom logic - like wheat - would be impossible to support that way. I could add hardcoded support for tilling fields, but then what about nethercraft that has tilled netherdirt? Then I'd need to have a general purpose way to change the ground underneath, and have a way to specify when it's legal to do that, and..
It's possible. But it's a lot of work for not much gain. If you want truly comprehensive support outside of using java, you wind up with what happened to itemcraft where you have your own custom programming language instead of just using the one that was meant to do this in the first place. So basically I'm not trying to "lock out" people with no modding experience, it's just that "just add a config file" is actually an extremely complicated request :smile.gif:
First off, would that layout even work? Harvesters only access chests "behind" them. Though harvester-chest-harvester is still smaller than my layout (I did say I wasn't good at this).
Oh, you are absolutely right you cannot place the chest beside the harvester, but that brings up an interesting idea, would it be possible to add that functionality? that the harvester will fill any chest placed adjacent to it?
Now as for config files. The issue is that while it would be possible to set up "default" blocks through one, any block that required custom logic - like wheat - would be impossible to support that way. I could add hardcoded support for tilling fields, but then what about nethercraft that has tilled netherdirt? Then I'd need to have a general purpose way to change the ground underneath, and have a way to specify when it's legal to do that, and..
It's possible. But it's a lot of work for not much gain. If you want truly comprehensive support outside of using java, you wind up with what happened to itemcraft where you have your own custom programming language instead of just using the one that was meant to do this in the first place. So basically I'm not trying to "lock out" people with no modding experience, it's just that "just add a config file" is actually an extremely complicated request :smile.gif:
I understand completely, I am happy with what I have so far, anything additional is just icing on the cake. :smile.gif:
Oh, you are absolutely right you cannot place the chest beside the harvester, but that brings up an interesting idea, would it be possible to add that functionality? that the harvester will fill any chest placed adjacent to it?
When I first looked at adding the drop in chests thing I thought this would be very hard to do but... I have no idea why I thought that. Sometimes I am wrong in very stupid ways. It should be fairly easy; I'll see if I can't get it in for 1.1.
Fertilizer is now also extensible, though it's slightly more complicated. I also found a crashing bug with the fertilizer that I THINK is also present in 1.0.5 but is pretty hard to trigger; since nobody has found it yet I think I'm fine waiting for 1.1 to put the patch for that in.
Still have to port all the changes to the server half (actually not that hard) and then test it (pain in the butt).
Ok! Assuming I don't lose power AGAIN today 1.1 should be out this evening. I was planning on getting it out last night but apparently the power company had different plans.
Also, one thing I wanted to add about harvesters dropping in chests - they will drop in anything that has an inventory; this includes things like furnaces. They are not aware of slots having "special" meanings in these things, so beware if for some reason you put a furnace next to your harvester.
Ever since i put up my automatic tree farm video i have had a number of people ask me how to make it, i thought the video was pretty self explanatory but i guess it wasn't so for those that are interested i made another video using the same mods including and mainly Minefactory Reloaded as a tutorial on how to make the automatic tree farm.
Is there any way through a config file or something, to get planters to plant a 3X3 square in one tick, the fertilizer to fertilize that square, and a harvester to harvest it, like they used to, because at the moment, they're going around one by one, and I don't want to have to rebuild half a house to change it =/
Edit: grammar fix :tongue.gif:
I actually removed that along the way of making everything standardized because... well because I personally didn't like it, basically. I thought it made the setup a little too good. What is it doing differently that's screwing up your build though? I'm honestly curious; I couldn't think of anything that disabling that would break.
I have other things I'm considering for the harvest pattern but that's definitely not for 1.1. Probably whatever the next major version winds up being, 1.2 I guess.
Ever since i put up my automatic tree farm video i have had a number of people ask me how to make it, i thought the video was pretty self explanatory but i guess it wasn't so for those that are interested i made another video using the same mods including and mainly Minefactory Reloaded as a tutorial on how to make the automatic tree farm.
I don't use wireless redstone; what's the purpose of one of them being channel 11? And I lol'ed at the tree spawning.
Sort of related to the first guy's comment - does anyone actually USE the downward facing fertilizer? I kind of want to deprecate it so I have more space in the metadata (since it goes 0-4 that uses 3 bits, leaving me only 1, and I want 2), but I don't want to break something that a lot of people rely on.
it's mainly the way i have the fertiliser set up, and stupid planning :tongue.gif:
the fertiliser points down, on a tower made with redpower coverplates, and because it poits down, it won't fertilize now. that's not really a big deal, because i can cut down on complicated wiring by bringing it level with the crops, but the planter and harvester only work in the top left of the 3X3 grid, as they do it one at a time, only two blocks out of nine are being used, so the farm looks wierd, it's mainly the speed of the thing that i was worried about, and i agree it mad the farm a bit too efficient.
it's not that much of a big deal to move the farm a bit, but an anti-grief system I placed in there makes changes 9001X harder to make, in the style of "you break any block or touch any redstone, the house and a large area around it dissapears"
oh, the only reason i was using it facing down was at the time, I didn't know that placing it at the side could do all 9 blocks :dry.gif:
Ah, ok, that makes sense. And I agree about it looking weird - if I could, I'd make it so the fertilizer/harvester/planter couldn't all affect the same block in one tick, but I can't think of a way to do that that wouldn't murder performance, so that's probably as good as it's gonna get unless I have a major epiphany. Sadly, I can't fix everything :smile.gif:
Couldn't the planter and fertilizer be combined into one unit and just have it dispense both? Or is that something that's too hard to do?
Yeah I could do that, but I personally like them being 3 separate machines. Plus a lot of people (including everybody amongst my friends that use this mod) don't even bother with fertilizers. Hell I could combine all 3 into a single harvestfertiplanter without too much effort but again, I just happen to like them being separate :tongue.gif:
Ah, ok, that makes sense. And I agree about it looking weird - if I could, I'd make it so the fertilizer/harvester/planter couldn't all affect the same block in one tick, but I can't think of a way to do that that wouldn't murder performance, so that's probably as good as it's gonna get unless I have a major epiphany. Sadly, I can't fix everything :smile.gif:
Thanks for the feedback though, it's appreciated.
I actually like that I can set up a single timer for the whole setup, requiring multiple timers, one for each machine would take way to much space.
Yeah I could do that, but I personally like them being 3 separate machines. Plus a lot of people (including everybody amongst my friends that use this mod) don't even bother with fertilizers. Hell I could combine all 3 into a single harvestfertiplanter without too much effort but again, I just happen to like them being separate :tongue.gif:
I also like them being separate machines, it makes for a nicer looking setup.
1.1.0 released! Downward conveyors, harvesters can harvest mushrooms/flowers/tall grass, and.. aside from all the work I did on the extensibility API that's about it. I will have an example compatibility mod at some point. I'll also write a post on how to use the API at some point in the near future too.
I kinda forgot to do the thing where harvesters will check other sides for chests until I'd uploaded the files :tongue.gif: I didn't feel like doing another recompile/testing pass as those take a while, but it will be in the next update for sure, and sorry about that.
edit: also 1.0.5 passed 500 downloads recently, awesome
I actually like that I can set up a single timer for the whole setup, requiring multiple timers, one for each machine would take way to much space.
The way I envisioned it they'd all still run on one clock but only one would be allowed to work on a block each tick. But again I have no idea how to do that without crippling the performance anyway, so it's all just conjecture.
Making MineFactory Reloaded aware of other mods
Since 1.1, MineFactory Reloaded has an extensibility API. Here's my explanation of how to use it.
This information is current for MFR version 1.3.x.
There's four interfaces you need: IFactoryPlantable, IFactoryHarvestable, IFactoryFertilizable, and IFactoryRanchable, which are located in net.minecraft.src.powercrystals.minefactoryreloaded.api (so is the HarvestType enum below). These are NOT implemented by your blocks/items; you need a new instance of them for each block or item you want to make MineFactory Reloaded aware of. There are default implementations of IFactoryPlantable, IFactoryHarvestable, and IFactoryRanchable provided.
Let's start with IFactoryPlantable. The planter needs to be aware of what thing it is going to plant, and what block it will become when it is planted. The interface is defined as:
public interface IFactoryPlantable
{
public int getSourceId();
public int getPlantedBlockId(World world, int x, int y, int z, ItemStack stack);
public int getPlantedBlockMetadata(World world, int x, int y, int z, ItemStack stack);
public boolean canBePlantedHere(World world, int x, int y, int z, ItemStack stack);
public void prePlant(World world, int x, int y, int z, ItemStack stack);
public void postPlant(World world, int x, int y, int z);
}
The methods mean the following:
getSourceId: The ID of the "thing" inside the planter. For example, the sapling block ID or the wheat seeds item ID.
getPlantedBlockId: The block ID to place on the ground.
getPlantedBlockMetadata: The metadata value of the block that will be planted.
canBePlantedHere: Return true if it is legal for the thing being planted to go here, and false if it should not be planted here. The XYZ coordinates are where the block will be placed.
prePlant: If the planter should take additional steps prior to planting, do it here. For example, tilling fields for wheat.
postPlant: If the planter should take additional steps after planting, do it here. No stock plants use this, but it is included for completeness.
The standard implementation is called "PlantableStandard". Its constructor takes a source ID and a block-to-be-placed ID; the metadata is copied straight from the source stack. It does nothing for prePlant or postPlant and uses the planted block's canPlaceBlockAt method (as well as making sure the destination block is air) for canBePlantedHere. If your block requires nothing special to be planted, you can just create a new instance of this class.
Next, IFactoryHarvestable. The harvester needs to know what block to look for, and what additional drops if any to produce when the block is harvested. In addition, it needs to know what "kind" of harvestable thing it is. The interface is defined as:
public interface IFactoryHarvestable
{
public int getSourceId();
public HarvestType getHarvestType();
public boolean canBeHarvested(World world, int x, int y, int z);
public boolean hasDifferentDrops();
public List<ItemStack> getDifferentDrops(World world, int x, int y, int z);
public void preHarvest(World world, int x, int y, int z);
public void postHarvest(World world, int x, int y, int z);
}
The methods mean the following:
getSourceId: The block ID that is being harvested.
getHarvestType: The "type" of harvestable block this is. See next section.
canBeHarvested: For plants that should not be harvested until they have grown to a sufficient size, like wheat. Return true if the plant can be harvested and false if it should not be.
hasDifferentDrops: True if this block will drop something that is different from Block.getBlockDropped()'s return value.
getAdditionalDrops: A list of different items to drop. Will only be called if hasDifferentDrops returned true.
preHarvest: If the harvester should take additional steps prior to harvesting, do it here. No stock plants use this, but it is included for completeness.
postHarvest: If the harvester should take additional steps afterharvesting , do it here. "Stem" plants (pumpkin and melon) uses this to re-till the ground after they are harvested.
There are four types of harvestable items. This is defined in the HarvestType enum:
public enum HarvestType
{
Normal,
LeaveBottom,
Tree,
TreeLeaf
}
Normal blocks are directly broken and harvested, with no special considerations. Wheat is a Normal harvest.
LeaveBottom blocks grow upwards, and are replanted directly. As such, the bottommost block is left in place, and the harvester searches directly upwards for blocks to harvest. Cactus and sugarcane are LeaveBottom harvests.
Tree blocks signal that a tree is attached to this point. If the harvester finds one of these on the ground, it will begin a tree search for something to harvest. Upper blocks will be harvested before lower blocks. Logs are a Tree harvest.
TreeLeaf blocks are part of a tree, but are harvested before normal Tree blocks. When the harvester finds a tree, it will search upwards for all TreeLeaf blocks and then back downward for all Tree blocks. Use this if your block is a leaf, or something that hangs from leaves (like vines). Leaves and vines are a TreeLeaf harvest.
The standard implementation is HarvestableStandard. Its constructor requires the ID of the block being harvested, and the harvest type. It always returns true for canBeHarvested and always returns false for hasDifferentDrops, and does nothing in preHarvest/postHarvest. If your block requires nothing special to be harvested, you can just create a new instance of this class.
In 1.3, the default drop system is no longer idDropped/damageDropped/quantityDropped, but rather Forge's new Block.getBlockDropped method. If your block being harvested implements this correctly, then your work here will be greatly decreased.
Third, the fertilizer just needs to know what can be fertilized, what can be used as fertilizer, and how fertilizing actually works. The IFactoryFertilizable interface is defined as:
public interface IFactoryFertilizable
{
public int getFertilizableBlockId();
public boolean canFertilizeBlock(World world, int x, int y, int z, ItemStack fertilizer);
public boolean fertilize(World world, int x, int y, int z, ItemStack fertilizer);
}
The methods mean the following:
getFertilizableBlockId: The block ID that will be fertilized.
canFertilizeBlock: Return false if this block should not be fertilized (ie, wheat that is already fully grown, or the stack provided can't be used as a fertilizer for this plant).
fertilize: Called to actually perform the fertilizing. The XYZ coordinates are of the block being fertilized.
There is no standard implementation for the fertilizer, because there is no standard way to fertilize things.
Finally, we have IFactoryRanchable, for the rancher. It needs to know what is being ranched, what to drop, and if the entity should be injured (and if so, by how much). It is defined as:
public interface IFactoryRanchable
{
public Class<?> getRanchableEntity();
public List<ItemStack> ranch(World world, EntityLiving entity, TileEntityRancher rancher);
public boolean getDamageRanchedEntity(World world, EntityLiving entity, List<ItemStack> drops);
public int getDamageAmount(World world, EntityLiving entity, List<ItemStack> drops);
}
The methods mean the following:
getRanchableEntity: The class of your entity that will be ranched by this instance (the <?> is to deal with compiler warnings about generics). For example, to ranch a chicken, you'd use "return EntityChicken.class".
ranch: This is where the magic happens. Return a list of drops from this ranching. The rancher instance is provided so that you can use its inventory (ie, for milking cows).
getDamageRanchedEntity: True if the entity being ranched should be damaged. Based on a random number on all stock implementations. The drops returned by ranch above are provided here if you want it to depend on that instead.
getDamageAmount: How much damage to do to the entity if the above function returns true. Again, the drops returned by ranch above are provided here if you want it to depend on that instead.
The standard implementation is called "Ranchabletandard". Its constructor takes, in order, the class to ranch, the stack to drop, the percent chance to injure the entity, the amount of damage to do, and the percent chance of dropping the item provided in the ItemStack earlier. This only supports a single drop from a ranch, so it is suggested that you create your own implementation for more complex entities. It uses the provided arguments to decide if it should drop the .. drop, and if it should damage the entity and by how much.
Note that the Rancher will ignore entities that are not a subclass of EntityLiving. If this is a problem for your mod, please contact me directly so we can discuss this.
Once you have created your instances, you need to call the following functions, located in mod_MineFactory:
public static void registerPlantable(IFactoryPlantable plantable)
public static void registerHarvestable(IFactoryHarvestable harvestable)
public static void registerFertilizable(IFactoryFertilizable fertilizable)
public static void registerFertilizerItem(int itemId)
public static void registerRanchable(IFactoryRanchable ranchable)
You simply pass your instance to the appropriate function and you are done. The registerFertilizerItem method takes an item ID and registers it as a valid ID that can be used to fertilize things; if this is not called, the fertilizer will ignore that item in its inventory. Only bonemeal ("itemDye") is registered by default.
Note that if more than one instance is provided for the same "source" ID, the latter instance will overwrite the former. Only one instance is supported per source ID.
If you are a modder and want a technical change or general help with this API, please feel free to post here. This specification was done from what I needed to make all the stock plants work and what I knew I needed for what mods I was aware of, but that can hardly be everything.
so since i can throw fertilizer on the ground and it will grow grass and flowers normally then the fertilizer should be able to do the same thing correct? and if so then we just need to make the harvester capable of harvesting the flowers for use in dye for the wool factories.
so since i can throw fertilizer on the ground and it will grow grass and flowers normally then the fertilizer should be able to do the same thing correct? and if so then we just need to make the harvester capable of harvesting the flowers for use in dye for the wool factories.
As of 1.1 it'll harvest flowers (and tall grass, and mushrooms), so that part's set. But fertilizing is actually fairly difficult. The fertilizer is built to look for blocks level with it, but the grass would be below it; and if it triggered whenever it found grass it could burn fertilizer really fast.
Thinking about it, I guess you could actually place grass level with it and just put the fertilizer lower than the harvester, hm. This is an interesting idea. Since any legit farms would be flatted out this should be safe. I'll think about this.
Thinking about it, I guess you could actually place grass level with it and just put the fertilizer lower than the harvester, hm. This is an interesting idea. Since any legit farms would be flatted out this should be safe. I'll think about this.
To continue my fine tradition of doubleposting the crap out of this thread, I've posted two compatibility mods! One enables the fertilizer to do the above. The other makes MineFactory aware of Better Than Wolves' hemp plant.
The latter would have been out sooner, but... I set out to test it, asked my friend "hey how long does hemp take to grow?" "oh 4-6 days" ":huh.gif:"
And then like an ingame week passed and I finally had enough hemp to actually test the thing. Anyway I don't actually play BTW, it had just been requested, so I'm only pretty sure I got the mechanics to match the mod correctly. Somebody please tell me if I screwed it up.
Quick question, i just upgrade to 1.1 and i noticed that the fertilizer is only doing 1 out of the 9 squares that it had been doing on 1.0.5 it used to plant one fertilize it plant one fertilize it and so on now it plants one and fertilizes it then plants all the rest without fertilizing them, am i missing something?
Quick question, i just upgrade to 1.1 and i noticed that the fertilizer is only doing 1 out of the 9 squares that it had been doing on 1.0.5 it used to plant one fertilize it plant one fertilize it and so on now it plants one and fertilizes it then plants all the rest without fertilizing them, am i missing something?
I'm not entirely sure I understand what you're asking. You mean it now only ever fertilizes the same square but before used to rotate around them? I'm not sure how the hell I changed that but the only thing I can think of that could have changed that was the bugfix I added to prevent the fertilizer from entering an infinite loop in certain cases; for obvious reasons I don't really want to undo that.
Is this actually a functional problem or does it just look bad?
I'm not entirely sure I understand what you're asking. You mean it now only ever fertilizes the same square but before used to rotate around them? I'm not sure how the hell I changed that but the only thing I can think of that could have changed that was the bugfix I added to prevent the fertilizer from entering an infinite loop in certain cases; for obvious reasons I don't really want to undo that.
Is this actually a functional problem or does it just look bad?
Well when doing a 3X3 section of wheat the planter plants each block one at a time, same as it did in the last version, but the fertilizer now only fertilizes one of those blocks where before it used to fertilize each block that got planted by the planter. I am using a timer to pulse a signal to the fertilizer and the planter so it can plant each of the 9 block but alas the fertilizer just wont go more than 1 block so instead of getting a maximum wheat count of 9 bundles each harvest i am only getting one bundle. It's not a game stopper or anything that causes a crash.
Well when doing a 3X3 section of wheat the planter plants each block one at a time, same as it did in the last version, but the fertilizer now only fertilizes one of those blocks where before it used to fertilize each block that got planted by the planter. I am using a timer to pulse a signal to the fertilizer and the planter so it can plant each of the 9 block but alas the fertilizer just wont go more than 1 block so instead of getting a maximum wheat count of 9 bundles each harvest i am only getting one bundle. It's not a game stopper or anything that causes a crash.
Oh hell I see what I did wrong. I didn't notice because I always ran the fertilizer and harvester at the same time. I'll get a fix out for that later today.
edit: for what it's worth this shouldn't affect sapling fertilizing.
In other news hurricane irene took out power for much of southeastern PA (oh my god this forum sucks on a phone) so no more updates until that gets fixed; probably won't be able to get back up until tomorrow afternoon.
INFORMATION WANTS TO BE WRONG
Ok now that I'm not typing on a phone keypad that's somehow randomly losing focus every five characters (seriously curse an iphone 4 should be one of the most powerful phones available, how does your forum bring it to its knees) I want to reply properly.
First off, would that layout even work? Harvesters only access chests "behind" them. Though harvester-chest-harvester is still smaller than my layout (I did say I wasn't good at this).
Now as for config files. The issue is that while it would be possible to set up "default" blocks through one, any block that required custom logic - like wheat - would be impossible to support that way. I could add hardcoded support for tilling fields, but then what about nethercraft that has tilled netherdirt? Then I'd need to have a general purpose way to change the ground underneath, and have a way to specify when it's legal to do that, and..
It's possible. But it's a lot of work for not much gain. If you want truly comprehensive support outside of using java, you wind up with what happened to itemcraft where you have your own custom programming language instead of just using the one that was meant to do this in the first place. So basically I'm not trying to "lock out" people with no modding experience, it's just that "just add a config file" is actually an extremely complicated request :smile.gif:
INFORMATION WANTS TO BE WRONG
Oh, you are absolutely right you cannot place the chest beside the harvester, but that brings up an interesting idea, would it be possible to add that functionality? that the harvester will fill any chest placed adjacent to it?
I understand completely, I am happy with what I have so far, anything additional is just icing on the cake. :smile.gif:
When I first looked at adding the drop in chests thing I thought this would be very hard to do but... I have no idea why I thought that. Sometimes I am wrong in very stupid ways. It should be fairly easy; I'll see if I can't get it in for 1.1.
Fertilizer is now also extensible, though it's slightly more complicated. I also found a crashing bug with the fertilizer that I THINK is also present in 1.0.5 but is pretty hard to trigger; since nobody has found it yet I think I'm fine waiting for 1.1 to put the patch for that in.
Still have to port all the changes to the server half (actually not that hard) and then test it (pain in the butt).
INFORMATION WANTS TO BE WRONG
Also, one thing I wanted to add about harvesters dropping in chests - they will drop in anything that has an inventory; this includes things like furnaces. They are not aware of slots having "special" meanings in these things, so beware if for some reason you put a furnace next to your harvester.
INFORMATION WANTS TO BE WRONG
I actually removed that along the way of making everything standardized because... well because I personally didn't like it, basically. I thought it made the setup a little too good. What is it doing differently that's screwing up your build though? I'm honestly curious; I couldn't think of anything that disabling that would break.
I have other things I'm considering for the harvest pattern but that's definitely not for 1.1. Probably whatever the next major version winds up being, 1.2 I guess.
I don't use wireless redstone; what's the purpose of one of them being channel 11? And I lol'ed at the tree spawning.
Sort of related to the first guy's comment - does anyone actually USE the downward facing fertilizer? I kind of want to deprecate it so I have more space in the metadata (since it goes 0-4 that uses 3 bits, leaving me only 1, and I want 2), but I don't want to break something that a lot of people rely on.
INFORMATION WANTS TO BE WRONG
Ah, ok, that makes sense. And I agree about it looking weird - if I could, I'd make it so the fertilizer/harvester/planter couldn't all affect the same block in one tick, but I can't think of a way to do that that wouldn't murder performance, so that's probably as good as it's gonna get unless I have a major epiphany. Sadly, I can't fix everything :smile.gif:
Thanks for the feedback though, it's appreciated.
INFORMATION WANTS TO BE WRONG
I set a different channel to the planter then the harvester so one can be shut off with out shutting off the other. just personal preference really.
Yeah I could do that, but I personally like them being 3 separate machines. Plus a lot of people (including everybody amongst my friends that use this mod) don't even bother with fertilizers. Hell I could combine all 3 into a single harvestfertiplanter without too much effort but again, I just happen to like them being separate :tongue.gif:
INFORMATION WANTS TO BE WRONG
I actually like that I can set up a single timer for the whole setup, requiring multiple timers, one for each machine would take way to much space.
I also like them being separate machines, it makes for a nicer looking setup.
I kinda forgot to do the thing where harvesters will check other sides for chests until I'd uploaded the files :tongue.gif: I didn't feel like doing another recompile/testing pass as those take a while, but it will be in the next update for sure, and sorry about that.
edit: also 1.0.5 passed 500 downloads recently, awesome
The way I envisioned it they'd all still run on one clock but only one would be allowed to work on a block each tick. But again I have no idea how to do that without crippling the performance anyway, so it's all just conjecture.
INFORMATION WANTS TO BE WRONG
Since 1.1, MineFactory Reloaded has an extensibility API. Here's my explanation of how to use it.
This information is current for MFR version 1.3.x.
There's four interfaces you need: IFactoryPlantable, IFactoryHarvestable, IFactoryFertilizable, and IFactoryRanchable, which are located in net.minecraft.src.powercrystals.minefactoryreloaded.api (so is the HarvestType enum below). These are NOT implemented by your blocks/items; you need a new instance of them for each block or item you want to make MineFactory Reloaded aware of. There are default implementations of IFactoryPlantable, IFactoryHarvestable, and IFactoryRanchable provided.
Let's start with IFactoryPlantable. The planter needs to be aware of what thing it is going to plant, and what block it will become when it is planted. The interface is defined as:
The methods mean the following:
Next, IFactoryHarvestable. The harvester needs to know what block to look for, and what additional drops if any to produce when the block is harvested. In addition, it needs to know what "kind" of harvestable thing it is. The interface is defined as:
The methods mean the following:
The standard implementation is HarvestableStandard. Its constructor requires the ID of the block being harvested, and the harvest type. It always returns true for canBeHarvested and always returns false for hasDifferentDrops, and does nothing in preHarvest/postHarvest. If your block requires nothing special to be harvested, you can just create a new instance of this class.
In 1.3, the default drop system is no longer idDropped/damageDropped/quantityDropped, but rather Forge's new Block.getBlockDropped method. If your block being harvested implements this correctly, then your work here will be greatly decreased.
Third, the fertilizer just needs to know what can be fertilized, what can be used as fertilizer, and how fertilizing actually works. The IFactoryFertilizable interface is defined as:
The methods mean the following:
Finally, we have IFactoryRanchable, for the rancher. It needs to know what is being ranched, what to drop, and if the entity should be injured (and if so, by how much). It is defined as:
The methods mean the following:
The standard implementation is called "Ranchabletandard". Its constructor takes, in order, the class to ranch, the stack to drop, the percent chance to injure the entity, the amount of damage to do, and the percent chance of dropping the item provided in the ItemStack earlier. This only supports a single drop from a ranch, so it is suggested that you create your own implementation for more complex entities. It uses the provided arguments to decide if it should drop the .. drop, and if it should damage the entity and by how much.
Note that the Rancher will ignore entities that are not a subclass of EntityLiving. If this is a problem for your mod, please contact me directly so we can discuss this.
Once you have created your instances, you need to call the following functions, located in mod_MineFactory:
You simply pass your instance to the appropriate function and you are done. The registerFertilizerItem method takes an item ID and registers it as a valid ID that can be used to fertilize things; if this is not called, the fertilizer will ignore that item in its inventory. Only bonemeal ("itemDye") is registered by default.
Note that if more than one instance is provided for the same "source" ID, the latter instance will overwrite the former. Only one instance is supported per source ID.
If you are a modder and want a technical change or general help with this API, please feel free to post here. This specification was done from what I needed to make all the stock plants work and what I knew I needed for what mods I was aware of, but that can hardly be everything.
INFORMATION WANTS TO BE WRONG
As of 1.1 it'll harvest flowers (and tall grass, and mushrooms), so that part's set. But fertilizing is actually fairly difficult. The fertilizer is built to look for blocks level with it, but the grass would be below it; and if it triggered whenever it found grass it could burn fertilizer really fast.
Thinking about it, I guess you could actually place grass level with it and just put the fertilizer lower than the harvester, hm. This is an interesting idea. Since any legit farms would be flatted out this should be safe. I'll think about this.
INFORMATION WANTS TO BE WRONG
To continue my fine tradition of doubleposting the crap out of this thread, I've posted two compatibility mods! One enables the fertilizer to do the above. The other makes MineFactory aware of Better Than Wolves' hemp plant.
The latter would have been out sooner, but... I set out to test it, asked my friend "hey how long does hemp take to grow?" "oh 4-6 days" ":huh.gif:"
And then like an ingame week passed and I finally had enough hemp to actually test the thing. Anyway I don't actually play BTW, it had just been requested, so I'm only pretty sure I got the mechanics to match the mod correctly. Somebody please tell me if I screwed it up.
INFORMATION WANTS TO BE WRONG
I'm not entirely sure I understand what you're asking. You mean it now only ever fertilizes the same square but before used to rotate around them? I'm not sure how the hell I changed that but the only thing I can think of that could have changed that was the bugfix I added to prevent the fertilizer from entering an infinite loop in certain cases; for obvious reasons I don't really want to undo that.
Is this actually a functional problem or does it just look bad?
INFORMATION WANTS TO BE WRONG
Well when doing a 3X3 section of wheat the planter plants each block one at a time, same as it did in the last version, but the fertilizer now only fertilizes one of those blocks where before it used to fertilize each block that got planted by the planter. I am using a timer to pulse a signal to the fertilizer and the planter so it can plant each of the 9 block but alas the fertilizer just wont go more than 1 block so instead of getting a maximum wheat count of 9 bundles each harvest i am only getting one bundle. It's not a game stopper or anything that causes a crash.
Oh hell I see what I did wrong. I didn't notice because I always ran the fertilizer and harvester at the same time. I'll get a fix out for that later today.
edit: for what it's worth this shouldn't affect sapling fertilizing.
INFORMATION WANTS TO BE WRONG