diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/bartcrops/abstracts')
3 files changed, 162 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java new file mode 100644 index 0000000000..cddce7beb4 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java @@ -0,0 +1,37 @@ +package gtPlusPlus.xmod.bartcrops.abstracts; + +import gtPlusPlus.core.lib.CORE; +import ic2.api.crops.ICropTile; + +public abstract class BaseAestheticCrop extends BaseHarvestableCrop { + + public int tier() { + return 1; + } + + public int stat(int n) { + switch (n) { + case 0 : + return 0; + case 1 : + return 0; + case 2 : + return 0; + case 3 : + return 4; + case 4 : + return 0; + default : + return 0; + } + } + + public int growthDuration(ICropTile crop) { + return CORE.DEBUG ? 1 : 225; + } + + public byte getSizeAfterHarvest(ICropTile crop) { + return 1; + } + +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java new file mode 100644 index 0000000000..ca2a044564 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java @@ -0,0 +1,56 @@ +package gtPlusPlus.xmod.bartcrops.abstracts; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import ic2.api.crops.CropCard; +import ic2.api.crops.ICropTile; +import java.util.ArrayList; +import java.util.List; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import speiger.src.crops.api.ICropCardInfo; + +public abstract class BaseCrop extends CropCard implements ICropCardInfo { + @SideOnly(Side.CLIENT) + public void registerSprites(IIconRegister iconRegister) { + this.textures = new IIcon[this.maxSize()]; + + for (int i = 1; i <= this.textures.length; ++i) { + this.textures[i - 1] = iconRegister.registerIcon(CORE.MODID+":crop/blockCrop." + this.name() + "." + i); + } + + } + + public float dropGainChance() { + return (float) (Math.pow(0.95D, (double) ((float) this.tier())) * (double) 1f); + } + + public boolean canCross(ICropTile crop) { + return crop.getSize() == this.maxSize(); + } + + public int getrootslength(ICropTile crop) { + return 3; + } + + public String discoveredBy() { + return "Alkalus"; + } + + public String owner() { + return "Gtplusplus"; + } + + public List<String> getCropInformation() { + List<String> ret = new ArrayList<String>(); + ret.add(this.attributes().toString()); + return ret; + } + + public ItemStack getDisplayItem(CropCard card) { + return ItemUtils.getItemStackOfAmountFromOreDict("crop" + this.name(), 0); + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java new file mode 100644 index 0000000000..fee6cf654c --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java @@ -0,0 +1,69 @@ +package gtPlusPlus.xmod.bartcrops.abstracts; + +import gtPlusPlus.core.lib.CORE; +import ic2.api.crops.ICropTile; + +public abstract class BaseHarvestableCrop extends BaseCrop { + + public int tier() { + return 2; + } + + public int stat(int n) { + switch (n) { + case 0 : + return 0; + case 1 : + return 4; + case 2 : + return 0; + case 3 : + return 4; + case 4 : + return 0; + default : + return 0; + } + } + + public boolean canGrow(ICropTile crop) { + return crop.getSize() < 3; + } + + public int getOptimalHavestSize(ICropTile crop) { + return 3; + } + + public boolean canBeHarvested(ICropTile crop) { + return crop.getSize() == 3; + } + + public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) { + return (int) ((double) humidity * 1.2D + (double) nutrients * 0.9D + (double) air * 0.9D); + } + + public int growthDuration(ICropTile crop) { + short r; + if (CORE.DEBUG) { + r = 1; + } else if (crop.getSize() == 2) { + r = 200; + } else { + r = 700; + } + + return r; + } + + public byte getSizeAfterHarvest(ICropTile crop) { + return 2; + } + + public int maxSize() { + return 3; + } + + public String discoveredBy() { + return "Alkalus"; + } +}
\ No newline at end of file |