Jump to content

Help
Latest News Article

[1.0.0][SMP] PC's mods - MineFactory Reloaded, Power Converters and more! Updated Dec 19th


1690 replies to this topic

#101

  • Location: lava

Posted 29 August 2011 - 08:33 PM

View Postdecman117, on 29 August 2011 - 06:25 PM, said:

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 :P

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.

View PostChicagoBob, on 29 August 2011 - 07:03 PM, said:

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.
Posted Image
INFORMATION WANTS TO BE WRONG

Register or log in to remove.

#102

  • Location: at a PC?
  • Minecraft: decman117

Posted 29 August 2011 - 09:05 PM

View Postpower crystals, on 29 August 2011 - 08:33 PM, said:

-snip-


it's mainly the way i have the fertiliser set up, and stupid planning :P
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 <_<
Posted Image

#103

  • Location: lava

Posted 29 August 2011 - 09:16 PM

View Postdecman117, on 29 August 2011 - 09:05 PM, said:

it's mainly the way i have the fertiliser set up, and stupid planning :P
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 <_<

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 :)

Thanks for the feedback though, it's appreciated.
Posted Image
INFORMATION WANTS TO BE WRONG

#104

Posted 29 August 2011 - 09:21 PM

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?

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.

#105

  • Location: lava

Posted 29 August 2011 - 09:34 PM

View PostChicagoBob, on 29 August 2011 - 09:21 PM, said:

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 :P
Posted Image
INFORMATION WANTS TO BE WRONG

#106

    Kasdar

    Stuck at Home

  • Members
  • 413 posts

Posted 29 August 2011 - 10:22 PM

power crystals said:

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.
I know I dont use the downward facing fertilizer

View Postpower crystals, on 29 August 2011 - 09:16 PM, said:

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 :)

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.

View Postpower crystals, on 29 August 2011 - 09:34 PM, said:

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 :P

I also like them being separate machines, it makes for a nicer looking setup.
Posted Image

#107

  • Location: lava

Posted 30 August 2011 - 12:35 AM

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 :P 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



View PostKasdar, on 29 August 2011 - 10:22 PM, said:

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.
Posted Image
INFORMATION WANTS TO BE WRONG

#108

  • Location: lava

Posted 30 August 2011 - 04:55 AM

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.
Posted Image
INFORMATION WANTS TO BE WRONG

#109

Posted 30 August 2011 - 03:53 PM

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.

#110

  • Location: lava

Posted 30 August 2011 - 04:23 PM

View PostChicagoBob, on 30 August 2011 - 03:53 PM, said:

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.
Posted Image
INFORMATION WANTS TO BE WRONG

#111

  • Location: lava

Posted 30 August 2011 - 06:05 PM

View Postpower crystals, on 30 August 2011 - 04:23 PM, said:

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:"
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.
Posted Image
INFORMATION WANTS TO BE WRONG

#112

Posted 30 August 2011 - 06:37 PM

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?

#113

  • Location: lava

Posted 30 August 2011 - 06:51 PM

View PostChicagoBob, on 30 August 2011 - 06:37 PM, said:

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?
Posted Image
INFORMATION WANTS TO BE WRONG

#114

Posted 30 August 2011 - 07:08 PM

View Postpower crystals, on 30 August 2011 - 06:51 PM, said:

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.

#115

  • Location: lava

Posted 30 August 2011 - 07:12 PM

View PostChicagoBob, on 30 August 2011 - 07:08 PM, said:

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.
Posted Image
INFORMATION WANTS TO BE WRONG

#116

Posted 30 August 2011 - 07:16 PM

No rush like i said it's not a game stopper i just wanted you to be aware of it.

#117

  • Location: lava

Posted 30 August 2011 - 07:47 PM

View PostChicagoBob, on 30 August 2011 - 07:16 PM, said:

No rush like i said it's not a game stopper i just wanted you to be aware of it.

I take pride in my work here; a bug that stupid annoys me on a personal level :P

So I posted 1.1.1 to fix it! Also, the thing where harvesters use any adjacent chest instead of just behind them is now in. And any adjacent includes chests in front of or underneath them in case that's somehow actually useful.

edit: if you actually downloaded the grass fertilizing thing you'll need to grab 1.0.1 of those compatibility mods due to changes I had to make to the fertilizer.
Posted Image
INFORMATION WANTS TO BE WRONG

#118

    Kasdar

    Stuck at Home

  • Members
  • 413 posts

Posted 30 August 2011 - 08:08 PM

well while trying to wire up my planter with the RedPower mod, I noticed something interesting, (with red power I can place red wire on the side of a chest, workbench, other blocks with menu's, etc) but I cannot with the planter. not sure whats different with the planters that makes it so I cannot place red wire on them.

oh and while I was typing this, it just popped into my head that it might be fun if the planter could pull items out of chests, and if that was the case, maybe depending on which side the planter was powered from it would pull from a different chest. This would allow for multi-purpose farms that I could switch between without going underneath and changing the contents.
Posted Image

#119

Posted 30 August 2011 - 08:39 PM

Hmmm I'm having a problem, i put in 1.1.1 and started it up and after i selected my world it went right to SAVING CHUNKS then shut down, then i notice the edit about 1.0.1 so i tried that...same thing.

I think i am just gonna backup my world and start with a fresh jar and then reload all my mods, stuff might have gotten messed up a bit

#120

  • Location: lava

Posted 30 August 2011 - 08:45 PM

View PostKasdar, on 30 August 2011 - 08:08 PM, said:

well while trying to wire up my planter with the RedPower mod, I noticed something interesting, (with red power I can place red wire on the side of a chest, workbench, other blocks with menu's, etc) but I cannot with the planter. not sure whats different with the planters that makes it so I cannot place red wire on them.

oh and while I was typing this, it just popped into my head that it might be fun if the planter could pull items out of chests, and if that was the case, maybe depending on which side the planter was powered from it would pull from a different chest. This would allow for multi-purpose farms that I could switch between without going underneath and changing the contents.

No idea why RedPower can't place on the sides of the planter since I don't use redpower but I'll make a note to look into it if I ever get a chance. Do other mods' blocks that have GUIs work this way?

And I am hesitant to do pull-from-chests as that is rather complex and there's already other mods that do complex inventory management better. The directional redstone I am especially afraid of because that's rather.. unintuitive, not to mention likely to lead to horrible bugs.

View PostChicagoBob, on 30 August 2011 - 08:39 PM, said:

Hmmm I'm having a problem, i put in 1.1.1 and started it up and after i selected my world it went right to SAVING CHUNKS then shut down, then i notice the edit about 1.0.1 so i tried that...same thing.

Ack. Can you download http://www.mediafire...fterrortest.bat put it in your .minecraft folder and run that? I need the actual error to figure out what went wrong there.
If you're using the grass fertilizer thing, if you remove that entirely (it won't break anything if it's not there, it just won't work) does it start normally?
Posted Image
INFORMATION WANTS TO BE WRONG