aboutsummaryrefslogtreecommitdiff
path: root/src/Java/powercrystals/minefactoryreloaded/api
diff options
context:
space:
mode:
authordraknyte1 <draknyte1@hotmail.com>2017-02-02 10:42:04 +1000
committerdraknyte1 <draknyte1@hotmail.com>2017-02-02 10:42:04 +1000
commit2a688e006c07c1240966c2829906a1752031153c (patch)
tree67468ecacaa6e77ec2581532e2fe96fcced6b39c /src/Java/powercrystals/minefactoryreloaded/api
parent233ee8c9a0a1c72953cfa6f7f5a439f2859daaf1 (diff)
downloadGT5-Unofficial-2a688e006c07c1240966c2829906a1752031153c.tar.gz
GT5-Unofficial-2a688e006c07c1240966c2829906a1752031153c.tar.bz2
GT5-Unofficial-2a688e006c07c1240966c2829906a1752031153c.zip
+ Added a check for BuildCraft.
% Changed handling of Wrench interfaces for the Workbench. - Removed classes I borrowed from MFR. (useless) - Removed Psychedelicraft support. (useless)
Diffstat (limited to 'src/Java/powercrystals/minefactoryreloaded/api')
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/EmptyReplacement.java20
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/HarvestType.java56
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java106
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java104
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java94
-rw-r--r--src/Java/powercrystals/minefactoryreloaded/api/ReplacementBlock.java135
6 files changed, 0 insertions, 515 deletions
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/EmptyReplacement.java b/src/Java/powercrystals/minefactoryreloaded/api/EmptyReplacement.java
deleted file mode 100644
index ef3fd46bb2..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/EmptyReplacement.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-public class EmptyReplacement extends ReplacementBlock
-{
- public static final EmptyReplacement INSTANCE = new EmptyReplacement();
-
- public EmptyReplacement()
- {
- super((Block)null);
- }
-
- @Override
- public boolean replaceBlock(World world, int x, int y, int z, ItemStack stack) {
- return true;
- }
-}
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/HarvestType.java b/src/Java/powercrystals/minefactoryreloaded/api/HarvestType.java
deleted file mode 100644
index 85ef23835c..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/HarvestType.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-/**
- * Determines what algorithm the Harvester uses when it encounters this
- * IFactoryHarvestable in the world.
- *
- * @author PowerCrystals
- */
-public enum HarvestType {
-
- /**
- * Just break the single block - no special action needed. e.g. Carrots,
- * flowers, wheat.
- */
- Normal,
- /**
- * Search for harvestable blocks adjacent to this block but leave this
- * block. e.g. Pumpkin, melon
- */
- Gourd,
- /**
- * Search for identical blocks above.
- */
- Column,
- /**
- * Search for identical blocks above but leave the bottom one for the
- * future. e.g. Cactus, sugarcane.
- */
- LeaveBottom,
- /**
- * This block is the base of a tree and the harvester should enter
- * tree-cutting mode.
- */
- Tree,
- /**
- * This block is the base of the tree and the harvester should enter
- * tree-cutting mode.
- * The tree is searched for in the negative y axis instead.
- */
- TreeFlipped,
- /**
- * This block is part of a tree as above, but leaves are cut before logs.
- * The tree is searched for in the current mode.
- * <p>
- * If not in tree-cutting mode, tree-cutting mode will be entered as though
- * the type was Tree.
- */
- TreeLeaf,
- /**
- * This block is part of a tree as above, but fruits are cut before logs.
- * e.g. cocoa
- * The tree is not searched for.
- */
- TreeFruit
-
-}
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
deleted file mode 100644
index 3f956422c0..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryFruit.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-import java.util.List;
-import java.util.Random;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Defines a fruit entry for the Fruit Picker.
- *
- * @author powercrystals
- *
- */
-public interface IFactoryFruit {
-
- /**
- * @return The block this fruit has in the world.
- */
- public Block getPlant();
-
- /**
- * Used to determine if this fruit can be picked (is it ripe yet, etc)
- *
- * @param world
- * The world where the fruit is being picked
- * @param x
- * The x-coordinate of the fruit
- * @param y
- * The y-coordinate of the fruit
- * @param z
- * The z-coordinate of the fruit
- *
- * @return True if the fruit can be picked
- */
- public boolean canBePicked(World world, int x, int y, int z);
-
- /**
- * @deprecated This method is no longer called. ReplacementBlock now handles
- * interaction.
- */
- @Deprecated
- public boolean breakBlock();
-
- /**
- * Called by the Fruit Picker to determine what block to replace the picked
- * block with. At the time this method is called, the fruit still exists.
- *
- * @param world
- * The world where the fruit is being picked
- * @param x
- * The x-coordinate of the fruit
- * @param y
- * The y-coordinate of the fruit
- * @param z
- * The z-coordinate of the fruit
- *
- * @return The block to replace the fruit block with, or null for air.
- */
- public ReplacementBlock getReplacementBlock(World world, int x, int y, int z);
-
- /**
- * Called by the Fruit Picker to determine what drops to generate. At the
- * time this method is called, the fruit still exists.
- *
- * @param world
- * The world where the fruit is being picked
- * @param x
- * The x-coordinate of the fruit
- * @param y
- * The y-coordinate of the fruit
- * @param z
- * The z-coordinate of the fruit
- */
- public List<ItemStack> getDrops(World world, Random rand, int x, int y, int z);
-
- /**
- * Called by the Fruit Picker after getDrops, prior to the block being
- * replaced/removed.
- *
- * @param world
- * The world where the fruit is being picked
- * @param x
- * The x-coordinate of the fruit
- * @param y
- * The y-coordinate of the fruit
- * @param z
- * The z-coordinate of the fruit
- */
- public void prePick(World world, int x, int y, int z);
-
- /**
- * Called by the Fruit Picker after the fruit is picked.
- *
- * @param world
- * The world where the fruit is being picked
- * @param x
- * The x-coordinate of the fruit
- * @param y
- * The y-coordinate of the fruit
- * @param z
- * The z-coordinate of the fruit
- */
- public void postPick(World world, int x, int y, int z);
-}
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java
deleted file mode 100644
index 5b6be99f89..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryHarvestable.java
+++ /dev/null
@@ -1,104 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-import java.util.*;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Defines a harvestable block for the Harvester.
- *
- * @author PowerCrystals
- */
-public interface IFactoryHarvestable {
-
- /**
- * @return The block this harvestable instance is managing.
- */
- public Block getPlant();
-
- /**
- * @return The type of harvest the Harvester should perform on this block.
- */
- public HarvestType getHarvestType();
-
- /**
- * Used to determine if the harvester should replace this block with air.
- *
- * @return Whether or not the Harvester should break the block when
- * harvesting. If false, no changes will be performed by the
- * Harvester itself.
- */
- public boolean breakBlock();
-
- /**
- * Used to determine if this crop can be harvested (is it at a stage that
- * drops crops, etc.)
- *
- * @param world
- * The world this block is in.
- * @param harvesterSettings
- * The harvester's current settings. Do not modify these.
- * @param x
- * The X coordinate of the block being harvested.
- * @param y
- * The Y coordinate of the block being harvested.
- * @param z
- * The Z coordinate of the block being harvested.
- *
- * @return True if this block can be harvested.
- */
- public boolean canBeHarvested(World world, Map<String, Boolean> harvesterSettings, int x, int y, int z);
-
- /**
- * @param world
- * The world this block is in.
- * @param rand
- * A Random instance to use when generating drops.
- * @param harvesterSettings
- * The harvester's current settings. Do not modify these.
- * @param x
- * The X coordinate of the block being harvested.
- * @param y
- * The Y coordinate of the block being harvested.
- * @param z
- * The Z coordinate of the block being harvested.
- *
- * @return The drops generated by breaking this block. For a default
- * implementation, calling Block.getDrops() is usually
- * sufficient.
- */
- public List<ItemStack> getDrops(World world, Random rand, Map<String, Boolean> harvesterSettings, int x, int y, int z);
-
- /**
- * Called before the block is going to be harvested, after getDrops. Usually
- * empty.
- *
- * @param world
- * The world this block is in.
- * @param x
- * The X coordinate of the block being harvested.
- * @param y
- * The Y coordinate of the block being harvested.
- * @param z
- * The Z coordinate of the block being harvested.
- */
- public void preHarvest(World world, int x, int y, int z);
-
- /**
- * Called after the block is going to be harvested. Used to re-till soil,
- * for example.
- *
- * @param world
- * The world this block is in.
- * @param x
- * The X coordinate of the block being harvested.
- * @param y
- * The Y coordinate of the block being harvested.
- * @param z
- * The Z coordinate of the block being harvested.
- */
- public void postHarvest(World world, int x, int y, int z);
-
-}
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java b/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java
deleted file mode 100644
index 1d620b37ed..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/IFactoryPlantable.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.world.World;
-
-/**
- * Defines a plantable object for use in the Planter.
- *
- * @author PowerCrystals
- */
-public interface IFactoryPlantable {
-
- /**
- * @return The item this plantable is managing.
- */
- public Item getSeed();
-
- /**
- * @param stack
- * The stack being planted.
- * @param forFermenting
- * True if this stack will be converted to biofuel
- *
- * @return True if this plantable can be planted (useful for metadata
- * items).
- */
- public boolean canBePlanted(ItemStack stack, boolean forFermenting);
-
- /**
- * @param world
- * The world instance this block or item will be placed into.
- * @param x
- * The destination X coordinate.
- * @param y
- * The destination Y coordinate.
- * @param z
- * The destination Z coordinate.
- * @param stack
- * The stack being planted.
- *
- * @return The block that will be placed into the world.
- */
- public ReplacementBlock getPlantedBlock(World world, int x, int y, int z, ItemStack stack);
-
- /**
- * @param world
- * The world instance this block or item will be placed into.
- * @param x
- * The destination X coordinate.
- * @param y
- * The destination Y coordinate.
- * @param z
- * The destination Z coordinate.
- * @param stack
- * The stack being planted.
- *
- * @return True if this plantable can be placed at the provided coordinates.
- */
- public boolean canBePlantedHere(World world, int x, int y, int z, ItemStack stack);
-
- /**
- * Called before planting is performed. Used to till soil, for example.
- *
- * @param world
- * The world instance this block or item will be placed into.
- * @param x
- * The destination X coordinate.
- * @param y
- * The destination Y coordinate.
- * @param z
- * The destination Z coordinate.
- * @param stack
- * The stack being planted.
- */
- public void prePlant(World world, int x, int y, int z, ItemStack stack);
-
- /**
- * Called after planting is performed. Usually empty.
- *
- * @param world
- * The world instance this block or item will be placed into.
- * @param x
- * The destination X coordinate.
- * @param y
- * The destination Y coordinate.
- * @param z
- * The destination Z coordinate.
- * @param stack
- * The stack being planted.
- */
- public void postPlant(World world, int x, int y, int z, ItemStack stack);
-
-}
diff --git a/src/Java/powercrystals/minefactoryreloaded/api/ReplacementBlock.java b/src/Java/powercrystals/minefactoryreloaded/api/ReplacementBlock.java
deleted file mode 100644
index c67e8a39a2..0000000000
--- a/src/Java/powercrystals/minefactoryreloaded/api/ReplacementBlock.java
+++ /dev/null
@@ -1,135 +0,0 @@
-package powercrystals.minefactoryreloaded.api;
-
-import net.minecraft.block.Block;
-import net.minecraft.item.*;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.world.World;
-
-public class ReplacementBlock
-{
- protected byte _hasMeta;
- protected int _meta;
- protected final Block _block;
- protected final NBTTagCompound _tileTag;
-
- /**
- * Called to replace a block in the world.
- * @param world The world object
- * @param x The X coord
- * @param y The Y coord
- * @param z The Z coord
- * @param stack The ItemStack being used to replace the block (may be null)
- * @return True if the block was set successfully
- */
- public boolean replaceBlock(World world, int x, int y, int z, ItemStack stack)
- {
- int meta = getMeta(world, x, y, z, stack);
- if (world.setBlock(x, y, z, _block, meta, 3))
- {
- if (hasTag(stack) && _block.hasTileEntity(meta))
- {
- TileEntity tile = world.getTileEntity(x, y, z);
- if (tile != null)
- tile.readFromNBT(getTag(world, x, y, z, stack));
- }
- return true;
- }
- return false;
- }
-
- /**
- * Called to get the metadata of the replacement block in the world.
- * @param world The world object
- * @param x The X coord
- * @param y The Y coord
- * @param z The Z coord
- * @param stack The ItemStack being used to replace the block (may be null)
- * @return The metadata of the block
- */
- protected int getMeta(World world, int x, int y, int z, ItemStack stack)
- {
- int m = 0;
- if (_hasMeta > 0)
- {
- if (_hasMeta > 1)
- return _meta;
- m = stack.getItemDamage();
- Item item = stack.getItem();
- if (item instanceof ItemBlock)
- m = ((ItemBlock)item).getMetadata(m);
- }
- return m;
- }
-
- /**
- * Called to set the metdata of this ReplacementBlock to a fixed value
- * @param meta The metadata of the block
- * @return This instance
- */
- public ReplacementBlock setMeta(int meta)
- {
- if (meta >= 0)
- {
- _hasMeta = 2;
- _meta = meta;
- }
- return this;
- }
-
- /**
- * Called to set the metdata of this ReplacementBlock to a value read from an ItemStack
- * @param meta The metadata of the block
- * @return This instance
- */
- public ReplacementBlock setMeta(boolean hasMeta)
- {
- _hasMeta = (byte) (hasMeta ? 1 : 0);
- return this;
- }
-
- /**
- * Called to get the NBTTagCompound a TileEntity will read its state from
- * @param world The world object
- * @param x The X coord
- * @param y The Y coord
- * @param z The Z coord
- * @param stack The ItemStack being used to replace the block (may be null)
- * @return The NBTTagCompound a TileEntity will read its state from
- */
- protected NBTTagCompound getTag(World world, int x, int y, int z, ItemStack stack)
- {
- return _tileTag;
- }
-
- /**
- * Called to see if a TileEntity should have its state set
- * @param stack The ItemStack being used to replace the block (may be null)
- * @return True if the TileEntity should have its state set
- */
- protected boolean hasTag(ItemStack stack)
- {
- return _tileTag != null;
- }
-
- public ReplacementBlock(Item block)
- {
- this(Block.getBlockFromItem(block));
- }
-
- public ReplacementBlock(Item block, NBTTagCompound tag)
- {
- this(Block.getBlockFromItem(block), tag);
- }
-
- public ReplacementBlock(Block block)
- {
- this(block, null);
- }
-
- public ReplacementBlock(Block block, NBTTagCompound tag)
- {
- _block = block;
- _tileTag = tag;
- }
-}