mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-28 07:55:41 +00:00
Added support for TiC berries to the farmer.
This commit is contained in:
1 parent
509098fcdc
commit
0b51a522e2
4 files changed
+65
-32
No files matched your search
@@ -68,13 +68,12 @@ public class BlockFarmStation extends AbstractMachineBlock<TileFarmStation> {
|
||||
|
||||
@Override
|
||||
public int getLightValue(IBlockAccess world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileFarmStation) {
|
||||
int res = ((TileFarmStation)te).isActive() ? 15 : 0;
|
||||
return res;
|
||||
}
|
||||
// TileEntity te = world.getTileEntity(x, y, z);
|
||||
// if(te instanceof TileFarmStation) {
|
||||
// int res = ((TileFarmStation)te).isActive() ? 15 : 0;
|
||||
// return res;
|
||||
// }
|
||||
return 0;
|
||||
//return world.getBlockMetadata(x, y, z) == 0 ? 0 : 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,36 +13,69 @@ import crazypants.util.BlockCoord;
|
||||
|
||||
public final class ModdedCrops {
|
||||
|
||||
//System.out.println("FarmersComune.enclosing_method: ");
|
||||
|
||||
public static void addModdedFarmers() {
|
||||
String natura = "Natura";
|
||||
String blockName = "N Crops";
|
||||
addNutura();
|
||||
addTiC();
|
||||
}
|
||||
|
||||
Block natCropBlock = GameRegistry.findBlock(natura, blockName);
|
||||
if(natCropBlock != null) {
|
||||
Item natSeedItem = GameRegistry.findItem(natura, "barley.seed");
|
||||
if(natSeedItem != null) {
|
||||
//barley
|
||||
FarmersComune.instance.joinComune(new SeedFarmer(natCropBlock, 3, new ItemStack(natSeedItem)));
|
||||
// cotton
|
||||
FarmersComune.instance.joinComune(new PickableFarmer(natCropBlock, 4, 8, new ItemStack(natSeedItem, 1, 1)));
|
||||
}
|
||||
}
|
||||
|
||||
blockName = "BerryBush";
|
||||
natCropBlock = GameRegistry.findBlock(natura, blockName);
|
||||
if(natCropBlock != null) {
|
||||
Item natSeedItem = GameRegistry.findItem(natura, blockName);
|
||||
if(natSeedItem != null) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
PickableFarmer farmer = new NaturaBerryFarmer(natCropBlock, i, 12 + i, new ItemStack(natSeedItem, 1, 12 + i));
|
||||
private static void addTiC() {
|
||||
String mod = "TConstruct";
|
||||
String blockName = "ore.berries.two";
|
||||
|
||||
Block cropBlock = GameRegistry.findBlock(mod, blockName);
|
||||
if(cropBlock != null) {
|
||||
Item seedItem = GameRegistry.findItem(mod, blockName);
|
||||
if(seedItem != null) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 8 + i));
|
||||
farmer.setRequiresFarmland(false);
|
||||
FarmersComune.instance.joinComune(farmer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blockName = "ore.berries.one";
|
||||
cropBlock = GameRegistry.findBlock(mod, blockName);
|
||||
if(cropBlock != null) {
|
||||
Item seedItem = GameRegistry.findItem(mod, blockName);
|
||||
if(seedItem != null) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 8 + i));
|
||||
farmer.setRequiresFarmland(false);
|
||||
FarmersComune.instance.joinComune(farmer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void addNutura() {
|
||||
String mod = "Natura";
|
||||
String blockName = "N Crops";
|
||||
|
||||
Block cropBlock = GameRegistry.findBlock(mod, blockName);
|
||||
if(cropBlock != null) {
|
||||
Item seedItem = GameRegistry.findItem(mod, "barley.seed");
|
||||
if(seedItem != null) {
|
||||
//barley
|
||||
FarmersComune.instance.joinComune(new SeedFarmer(cropBlock, 3, new ItemStack(seedItem)));
|
||||
// cotton
|
||||
FarmersComune.instance.joinComune(new PickableFarmer(cropBlock, 4, 8, new ItemStack(seedItem, 1, 1)));
|
||||
}
|
||||
}
|
||||
|
||||
blockName = "BerryBush";
|
||||
cropBlock = GameRegistry.findBlock(mod, blockName);
|
||||
if(cropBlock != null) {
|
||||
Item seedItem = GameRegistry.findItem(mod, blockName);
|
||||
if(seedItem != null) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 12 + i));
|
||||
farmer.setRequiresFarmland(false);
|
||||
FarmersComune.instance.joinComune(farmer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ModdedCrops() {
|
||||
|
||||
@@ -200,9 +200,12 @@ public class TileFarmStation extends AbstractPoweredTaskEntity implements IEntit
|
||||
// }
|
||||
|
||||
BlockCoord bc = getNextCoord();
|
||||
if(bc != null && bc.equals(getLocation())) { //don't try and harvest ourselves
|
||||
bc = getNextCoord();
|
||||
}
|
||||
if(bc == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
lastScanned = bc;
|
||||
|
||||
Block block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
|
||||
@@ -34,9 +34,7 @@ public class TeleportRecipes {
|
||||
IRecipe rec = GameRegistry
|
||||
.addShapedRecipe(travelStaff, " g", " s ", "c ", 's', electricalSteel, 'c', enderCapacitor, 'g', vibCry);
|
||||
rec = GameRegistry
|
||||
.addShapedRecipe(travelStaff, "g ", " s ", " c", 's', electricalSteel, 'c', enderCapacitor, 'g', vibCry);
|
||||
|
||||
System.out.println("TeleportRecipes.addRecipes: " + rec);
|
||||
.addShapedRecipe(travelStaff, "g ", " s ", " c", 's', electricalSteel, 'c', enderCapacitor, 'g', vibCry);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user