From f26da02a709787b68f7a24533cc8111b2b83d46f Mon Sep 17 00:00:00 2001 From: Pixlepix Date: Mon, 11 Aug 2014 12:13:06 -0400 Subject: [PATCH] Gradle, be gone! --- .gitignore | 4 +- build.xml | 368 ++++++++++++++---- .../cofh/api/energy/IEnergyContainerItem.java | 41 ++ src/main/java/cofh/api/block/IBlockDebug.java | 33 -- src/main/java/cofh/api/block/IBlockInfo.java | 39 -- .../java/cofh/api/block/IDismantleable.java | 25 -- src/main/java/cofh/api/core/IInitializer.java | 17 - .../java/cofh/api/core/ISimpleRegistry.java | 22 -- .../cofh/api/core/NullSimpleRegistry.java | 17 - .../java/cofh/api/core/RegistryAccess.java | 14 - .../java/cofh/api/energy/EnergyStorage.java | 158 -------- .../cofh/api/energy/IEnergyConnection.java | 21 - .../cofh/api/energy/IEnergyContainerItem.java | 52 --- .../java/cofh/api/energy/IEnergyHandler.java | 51 --- .../java/cofh/api/energy/IEnergyStorage.java | 45 --- .../cofh/api/energy/ItemEnergyContainer.java | 110 ------ .../cofh/api/energy/TileEnergyHandler.java | 62 --- .../cofh/api/item/IInventoryConnection.java | 20 - .../api/item/IInventoryContainerItem.java | 78 ---- .../java/cofh/api/item/IInventoryHandler.java | 82 ---- src/main/java/cofh/api/item/ISecureItem.java | 25 -- .../java/cofh/api/item/ITinkerableItem.java | 33 -- .../java/cofh/api/tileentity/IEnergyInfo.java | 33 -- .../api/tileentity/IReconfigurableFacing.java | 39 -- .../api/tileentity/IReconfigurableSides.java | 54 --- .../cofh/api/tileentity/IRedstoneCache.java | 17 - .../cofh/api/tileentity/IRedstoneControl.java | 57 --- .../java/cofh/api/tileentity/ISecureTile.java | 56 --- .../api/tileentity/ISidedBlockTexture.java | 25 -- .../tileentity/ISubSelectionBoxProvider.java | 11 - .../cofh/api/transport/IEnderAttuned.java | 50 --- .../api/transport/IEnderEnergyReceptor.java | 30 -- .../api/transport/IEnderFluidReceptor.java | 32 -- .../api/transport/IEnderItemReceptor.java | 33 -- .../java/cofh/api/transport/IItemDuct.java | 26 -- .../cofh/api/world/IFeatureGenerator.java | 39 -- .../java/cofh/api/world/IFeatureHandler.java | 22 -- .../render/block/RenderInfusedCrops.java | 1 - .../common/compat/TinkersConstructCompat.java | 166 ++++---- .../core/helper/AspectCropLootManager.java | 25 +- 40 files changed, 441 insertions(+), 1592 deletions(-) create mode 100644 src/api/java/cofh/api/energy/IEnergyContainerItem.java delete mode 100644 src/main/java/cofh/api/block/IBlockDebug.java delete mode 100644 src/main/java/cofh/api/block/IBlockInfo.java delete mode 100644 src/main/java/cofh/api/block/IDismantleable.java delete mode 100644 src/main/java/cofh/api/core/IInitializer.java delete mode 100644 src/main/java/cofh/api/core/ISimpleRegistry.java delete mode 100644 src/main/java/cofh/api/core/NullSimpleRegistry.java delete mode 100644 src/main/java/cofh/api/core/RegistryAccess.java delete mode 100644 src/main/java/cofh/api/energy/EnergyStorage.java delete mode 100644 src/main/java/cofh/api/energy/IEnergyConnection.java delete mode 100644 src/main/java/cofh/api/energy/IEnergyContainerItem.java delete mode 100644 src/main/java/cofh/api/energy/IEnergyHandler.java delete mode 100644 src/main/java/cofh/api/energy/IEnergyStorage.java delete mode 100644 src/main/java/cofh/api/energy/ItemEnergyContainer.java delete mode 100644 src/main/java/cofh/api/energy/TileEnergyHandler.java delete mode 100644 src/main/java/cofh/api/item/IInventoryConnection.java delete mode 100644 src/main/java/cofh/api/item/IInventoryContainerItem.java delete mode 100644 src/main/java/cofh/api/item/IInventoryHandler.java delete mode 100644 src/main/java/cofh/api/item/ISecureItem.java delete mode 100644 src/main/java/cofh/api/item/ITinkerableItem.java delete mode 100644 src/main/java/cofh/api/tileentity/IEnergyInfo.java delete mode 100644 src/main/java/cofh/api/tileentity/IReconfigurableFacing.java delete mode 100644 src/main/java/cofh/api/tileentity/IReconfigurableSides.java delete mode 100644 src/main/java/cofh/api/tileentity/IRedstoneCache.java delete mode 100644 src/main/java/cofh/api/tileentity/IRedstoneControl.java delete mode 100644 src/main/java/cofh/api/tileentity/ISecureTile.java delete mode 100644 src/main/java/cofh/api/tileentity/ISidedBlockTexture.java delete mode 100644 src/main/java/cofh/api/tileentity/ISubSelectionBoxProvider.java delete mode 100644 src/main/java/cofh/api/transport/IEnderAttuned.java delete mode 100644 src/main/java/cofh/api/transport/IEnderEnergyReceptor.java delete mode 100644 src/main/java/cofh/api/transport/IEnderFluidReceptor.java delete mode 100644 src/main/java/cofh/api/transport/IEnderItemReceptor.java delete mode 100644 src/main/java/cofh/api/transport/IItemDuct.java delete mode 100644 src/main/java/cofh/api/world/IFeatureGenerator.java delete mode 100644 src/main/java/cofh/api/world/IFeatureHandler.java diff --git a/.gitignore b/.gitignore index 3edd667e..151a4bda 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,8 @@ remotebuild.py ## ForgeGradle /run /out - +/ForgeModule +/libs/download ## idea *.iml *.ipr @@ -36,6 +37,7 @@ TCDEOBF* *.DS_Store _MACOSX Thumbs.db +/forgelibs ## Ignore unnecessary files *.log diff --git a/build.xml b/build.xml index 2d1365c4..12df5dd6 100644 --- a/build.xml +++ b/build.xml @@ -1,77 +1,305 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/src/api/java/cofh/api/energy/IEnergyContainerItem.java b/src/api/java/cofh/api/energy/IEnergyContainerItem.java new file mode 100644 index 00000000..b148fb0c --- /dev/null +++ b/src/api/java/cofh/api/energy/IEnergyContainerItem.java @@ -0,0 +1,41 @@ +package cofh.api.energy; + +import net.minecraft.item.ItemStack; + +/** + * Implement this interface on Item classes that support external manipulation of their internal energy storages. + * + * @author King Lemming + */ +public interface IEnergyContainerItem { + /** + * Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged. + * + * @param container ItemStack to be charged. + * @param maxReceive Maximum amount of energy to be sent into the item. + * @param simulate If TRUE, the charge will only be simulated. + * @return Amount of energy that was (or would have been, if simulated) received by the item. + */ + int receiveEnergy(ItemStack container, int maxReceive, boolean simulate); + + /** + * Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally + * discharged. + * + * @param container ItemStack to be discharged. + * @param maxExtract Maximum amount of energy to be extracted from the item. + * @param simulate If TRUE, the discharge will only be simulated. + * @return Amount of energy that was (or would have been, if simulated) extracted from the item. + */ + int extractEnergy(ItemStack container, int maxExtract, boolean simulate); + + /** + * Get the amount of energy currently stored in the container item. + */ + int getEnergyStored(ItemStack container); + + /** + * Get the max amount of energy that can be stored in the container item. + */ + int getMaxEnergyStored(ItemStack container); +} \ No newline at end of file diff --git a/src/main/java/cofh/api/block/IBlockDebug.java b/src/main/java/cofh/api/block/IBlockDebug.java deleted file mode 100644 index 9805f7f0..00000000 --- a/src/main/java/cofh/api/block/IBlockDebug.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.block; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on blocks which have some debug method which can be activated via a tool or other means. - * - * @author King Lemming - * - */ -public interface IBlockDebug { - - /** - * This function debugs a block. - * - * @param world - * Reference to the world. - * @param x - * X coordinate of the block. - * @param y - * Y coordinate of the block. - * @param z - * Z coordinate of the block. - * @param side - * The side of the block. - * @param player - * Player doing the debugging. - */ - public void debugBlock(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player); - -} diff --git a/src/main/java/cofh/api/block/IBlockInfo.java b/src/main/java/cofh/api/block/IBlockInfo.java deleted file mode 100644 index 8b263533..00000000 --- a/src/main/java/cofh/api/block/IBlockInfo.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.block; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on blocks which can provide information about themselves. - * - * @author King Lemming - * - */ -public interface IBlockInfo { - - /** - * This function appends information to a list provided to it. - * - * @param world - * Reference to the world. - * @param x - * X coordinate of the block. - * @param y - * Y coordinate of the block. - * @param z - * Z coordinate of the block. - * @param side - * The side of the block that is being queried. - * @param player - * Player doing the querying - this can be NULL. - * @param info - * The list that the information should be appended to. - * @param debug - * If true, the Block should return "debug" information. - */ - public void getBlockInfo(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player, List info, boolean debug); - -} diff --git a/src/main/java/cofh/api/block/IDismantleable.java b/src/main/java/cofh/api/block/IDismantleable.java deleted file mode 100644 index fd794378..00000000 --- a/src/main/java/cofh/api/block/IDismantleable.java +++ /dev/null @@ -1,25 +0,0 @@ -package cofh.api.block; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Implemented on Blocks which have some method of being instantly dismantled. - * - * @author King Lemming - * - */ -public interface IDismantleable { - - /** - * Dismantles the block. If returnBlock is true, the drop(s) should be placed into the player's inventory. - */ - public ItemStack dismantleBlock(EntityPlayer player, World world, int x, int y, int z, boolean returnBlock); - - /** - * Return true if the block can be dismantled. The criteria for this is entirely up to the block. - */ - public boolean canDismantle(EntityPlayer player, World world, int x, int y, int z); - -} diff --git a/src/main/java/cofh/api/core/IInitializer.java b/src/main/java/cofh/api/core/IInitializer.java deleted file mode 100644 index b507e6bc..00000000 --- a/src/main/java/cofh/api/core/IInitializer.java +++ /dev/null @@ -1,17 +0,0 @@ -package cofh.api.core; - -/** - * Interface which can be put on just about anything to allow for iteration during initialization. - * - * @author King Lemming - * - */ -public interface IInitializer { - - public boolean preInit(); - - public boolean initialize(); - - public boolean postInit(); - -} diff --git a/src/main/java/cofh/api/core/ISimpleRegistry.java b/src/main/java/cofh/api/core/ISimpleRegistry.java deleted file mode 100644 index 1ffe2cb7..00000000 --- a/src/main/java/cofh/api/core/ISimpleRegistry.java +++ /dev/null @@ -1,22 +0,0 @@ -package cofh.api.core; - -/** - * Basic interface for the Cape and Skin Registries. - * - * @author Zeldo Kavira - * - */ -public interface ISimpleRegistry { - - /** - * Register a new entry. - * - * @param playerName - * The player to register. - * @param URL - * Location of the cape/skin. - * @return True if registration was successful. - */ - public boolean register(String playerName, String URL); - -} diff --git a/src/main/java/cofh/api/core/NullSimpleRegistry.java b/src/main/java/cofh/api/core/NullSimpleRegistry.java deleted file mode 100644 index df95dae5..00000000 --- a/src/main/java/cofh/api/core/NullSimpleRegistry.java +++ /dev/null @@ -1,17 +0,0 @@ -package cofh.api.core; - -/** - * Dummy class used to initialize Cape and Skin Registries to prevent accidental NPEs. - * - * @author Zeldo Kavira - * - */ -public class NullSimpleRegistry implements ISimpleRegistry { - - @Override - public boolean register(String playerName, String URL) { - - return false; - } - -} diff --git a/src/main/java/cofh/api/core/RegistryAccess.java b/src/main/java/cofh/api/core/RegistryAccess.java deleted file mode 100644 index c1c04957..00000000 --- a/src/main/java/cofh/api/core/RegistryAccess.java +++ /dev/null @@ -1,14 +0,0 @@ -package cofh.api.core; - -/** - * Access to the Cape and Skin Registries of CoFH Core. - * - * @author Zeldo Kavira - * - */ -public class RegistryAccess { - - public static ISimpleRegistry capeRegistry = new NullSimpleRegistry(); - public static ISimpleRegistry skinRegistry = new NullSimpleRegistry(); - -} diff --git a/src/main/java/cofh/api/energy/EnergyStorage.java b/src/main/java/cofh/api/energy/EnergyStorage.java deleted file mode 100644 index b3383aeb..00000000 --- a/src/main/java/cofh/api/energy/EnergyStorage.java +++ /dev/null @@ -1,158 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyStorage}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class EnergyStorage implements IEnergyStorage { - - protected int energy; - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public EnergyStorage(int capacity) { - - this(capacity, capacity, capacity); - } - - public EnergyStorage(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public EnergyStorage(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public EnergyStorage readFromNBT(NBTTagCompound nbt) { - - this.energy = nbt.getInteger("Energy"); - - if (energy > capacity) { - energy = capacity; - } - return this; - } - - public NBTTagCompound writeToNBT(NBTTagCompound nbt) { - - if (energy < 0) { - energy = 0; - } - nbt.setInteger("Energy", energy); - return nbt; - } - - public void setCapacity(int capacity) { - - this.capacity = capacity; - - if (energy > capacity) { - energy = capacity; - } - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - public int getMaxReceive() { - - return maxReceive; - } - - public int getMaxExtract() { - - return maxExtract; - } - - /** - * This function is included to allow for server -> client sync. Do not call this externally to the containing Tile Entity, as not all IEnergyHandlers are - * guaranteed to have it. - * - * @param energy - */ - public void setEnergyStored(int energy) { - - this.energy = energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /** - * This function is included to allow the containing tile to directly and efficiently modify the energy contained in the EnergyStorage. Do not rely on this - * externally, as not all IEnergyHandlers are guaranteed to have it. - * - * @param energy - */ - public void modifyEnergyStored(int energy) { - - this.energy += energy; - - if (this.energy > capacity) { - this.energy = capacity; - } else if (this.energy < 0) { - this.energy = 0; - } - } - - /* IEnergyStorage */ - @Override - public int receiveEnergy(int maxReceive, boolean simulate) { - - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - } - return energyReceived; - } - - @Override - public int extractEnergy(int maxExtract, boolean simulate) { - - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - } - return energyExtracted; - } - - @Override - public int getEnergyStored() { - - return energy; - } - - @Override - public int getMaxEnergyStored() { - - return capacity; - } - -} diff --git a/src/main/java/cofh/api/energy/IEnergyConnection.java b/src/main/java/cofh/api/energy/IEnergyConnection.java deleted file mode 100644 index 63faffb9..00000000 --- a/src/main/java/cofh/api/energy/IEnergyConnection.java +++ /dev/null @@ -1,21 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not - * accept it; otherwise just use IEnergyHandler. - * - * Note that {@link IEnergyHandler} is an extension of this. - * - * @author King Lemming - * - */ -public interface IEnergyConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectEnergy(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/energy/IEnergyContainerItem.java b/src/main/java/cofh/api/energy/IEnergyContainerItem.java deleted file mode 100644 index 0bcfda60..00000000 --- a/src/main/java/cofh/api/energy/IEnergyContainerItem.java +++ /dev/null @@ -1,52 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes that support external manipulation of their internal energy storages. - * - * A reference implementation is provided {@link ItemEnergyContainer}. - * - * @author King Lemming - * - */ -public interface IEnergyContainerItem { - - /** - * Adds energy to a container item. Returns the quantity of energy that was accepted. This should always return 0 if the item cannot be externally charged. - * - * @param container - * ItemStack to be charged. - * @param maxReceive - * Maximum amount of energy to be sent into the item. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received by the item. - */ - int receiveEnergy(ItemStack container, int maxReceive, boolean simulate); - - /** - * Removes energy from a container item. Returns the quantity of energy that was removed. This should always return 0 if the item cannot be externally - * discharged. - * - * @param container - * ItemStack to be discharged. - * @param maxExtract - * Maximum amount of energy to be extracted from the item. - * @param simulate - * If TRUE, the discharge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the item. - */ - int extractEnergy(ItemStack container, int maxExtract, boolean simulate); - - /** - * Get the amount of energy currently stored in the container item. - */ - int getEnergyStored(ItemStack container); - - /** - * Get the max amount of energy that can be stored in the container item. - */ - int getMaxEnergyStored(ItemStack container); - -} diff --git a/src/main/java/cofh/api/energy/IEnergyHandler.java b/src/main/java/cofh/api/energy/IEnergyHandler.java deleted file mode 100644 index 3aaf81a7..00000000 --- a/src/main/java/cofh/api/energy/IEnergyHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -package cofh.api.energy; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should handle energy, generally storing it in one or more internal {@link IEnergyStorage} objects. - * - * A reference implementation is provided {@link TileEnergyHandler}. - * - * @author King Lemming - * - */ -public interface IEnergyHandler extends IEnergyConnection { - - /** - * Add energy to an IEnergyHandler, internal distribution is left entirely to the IEnergyHandler. - * - * @param from - * Orientation the energy is received from. - * @param maxReceive - * Maximum amount of energy to receive. - * @param simulate - * If TRUE, the charge will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) received. - */ - int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); - - /** - * Remove energy from an IEnergyHandler, internal distribution is left entirely to the IEnergyHandler. - * - * @param from - * Orientation the energy is extracted from. - * @param maxExtract - * Maximum amount of energy to extract. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted. - */ - int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(ForgeDirection from); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/energy/IEnergyStorage.java b/src/main/java/cofh/api/energy/IEnergyStorage.java deleted file mode 100644 index 1e84bc22..00000000 --- a/src/main/java/cofh/api/energy/IEnergyStorage.java +++ /dev/null @@ -1,45 +0,0 @@ -package cofh.api.energy; - -/** - * An energy storage is the unit of interaction with Energy inventories. - * - * A reference implementation can be found at {@link EnergyStorage}. - * - * @author King Lemming - * - */ -public interface IEnergyStorage { - - /** - * Adds energy to the storage. Returns quantity of energy that was accepted. - * - * @param maxReceive - * Maximum amount of energy to be inserted. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. - */ - int receiveEnergy(int maxReceive, boolean simulate); - - /** - * Removes energy from the storage. Returns quantity of energy that was removed. - * - * @param maxExtract - * Maximum amount of energy to be extracted. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. - */ - int extractEnergy(int maxExtract, boolean simulate); - - /** - * Returns the amount of energy currently stored. - */ - int getEnergyStored(); - - /** - * Returns the maximum amount of energy that can be stored. - */ - int getMaxEnergyStored(); - -} diff --git a/src/main/java/cofh/api/energy/ItemEnergyContainer.java b/src/main/java/cofh/api/energy/ItemEnergyContainer.java deleted file mode 100644 index 055ae45b..00000000 --- a/src/main/java/cofh/api/energy/ItemEnergyContainer.java +++ /dev/null @@ -1,110 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -/** - * Reference implementation of {@link IEnergyContainerItem}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class ItemEnergyContainer extends Item implements IEnergyContainerItem { - - protected int capacity; - protected int maxReceive; - protected int maxExtract; - - public ItemEnergyContainer() { - - } - - public ItemEnergyContainer(int capacity) { - - this(capacity, capacity, capacity); - } - - public ItemEnergyContainer(int capacity, int maxTransfer) { - - this(capacity, maxTransfer, maxTransfer); - } - - public ItemEnergyContainer(int capacity, int maxReceive, int maxExtract) { - - this.capacity = capacity; - this.maxReceive = maxReceive; - this.maxExtract = maxExtract; - } - - public ItemEnergyContainer setCapacity(int capacity) { - - this.capacity = capacity; - return this; - } - - public void setMaxTransfer(int maxTransfer) { - - setMaxReceive(maxTransfer); - setMaxExtract(maxTransfer); - } - - public void setMaxReceive(int maxReceive) { - - this.maxReceive = maxReceive; - } - - public void setMaxExtract(int maxExtract) { - - this.maxExtract = maxExtract; - } - - /* IEnergyContainerItem */ - @Override - public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { - - if (container.stackTagCompound == null) { - container.stackTagCompound = new NBTTagCompound(); - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyReceived = Math.min(capacity - energy, Math.min(this.maxReceive, maxReceive)); - - if (!simulate) { - energy += energyReceived; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyReceived; - } - - @Override - public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - int energy = container.stackTagCompound.getInteger("Energy"); - int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract)); - - if (!simulate) { - energy -= energyExtracted; - container.stackTagCompound.setInteger("Energy", energy); - } - return energyExtracted; - } - - @Override - public int getEnergyStored(ItemStack container) { - - if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Energy")) { - return 0; - } - return container.stackTagCompound.getInteger("Energy"); - } - - @Override - public int getMaxEnergyStored(ItemStack container) { - - return capacity; - } - -} diff --git a/src/main/java/cofh/api/energy/TileEnergyHandler.java b/src/main/java/cofh/api/energy/TileEnergyHandler.java deleted file mode 100644 index a7fabeb7..00000000 --- a/src/main/java/cofh/api/energy/TileEnergyHandler.java +++ /dev/null @@ -1,62 +0,0 @@ -package cofh.api.energy; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. - * - * @author King Lemming - * - */ -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - protected EnergyStorage storage = new EnergyStorage(32000); - - @Override - public void readFromNBT(NBTTagCompound nbt) { - - super.readFromNBT(nbt); - storage.readFromNBT(nbt); - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - - super.writeToNBT(nbt); - storage.writeToNBT(nbt); - } - - /* IEnergyHandler */ - @Override - public boolean canConnectEnergy(ForgeDirection from) { - - return true; - } - - @Override - public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { - - return storage.receiveEnergy(maxReceive, simulate); - } - - @Override - public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { - - return storage.extractEnergy(maxExtract, simulate); - } - - @Override - public int getEnergyStored(ForgeDirection from) { - - return storage.getEnergyStored(); - } - - @Override - public int getMaxEnergyStored(ForgeDirection from) { - - return storage.getMaxEnergyStored(); - } - -} diff --git a/src/main/java/cofh/api/item/IInventoryConnection.java b/src/main/java/cofh/api/item/IInventoryConnection.java deleted file mode 100644 index d0ad117b..00000000 --- a/src/main/java/cofh/api/item/IInventoryConnection.java +++ /dev/null @@ -1,20 +0,0 @@ -package cofh.api.item; - -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should connect to item transportation blocks. - * - * Note that {@link IInventoryHandler} is an extension of this. - * - * @author King Lemming - * - */ -public interface IInventoryConnection { - - /** - * Returns TRUE if the TileEntity can connect on a given side. - */ - boolean canConnectInventory(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/item/IInventoryContainerItem.java b/src/main/java/cofh/api/item/IInventoryContainerItem.java deleted file mode 100644 index 91c05108..00000000 --- a/src/main/java/cofh/api/item/IInventoryContainerItem.java +++ /dev/null @@ -1,78 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes that are themselves inventories. - * - * A reference implementation is provided {@link ItemInventoryContainer}. - * - * @author King Lemming - * - */ -public interface IInventoryContainerItem { - - /** - * Add an ItemStack to the inventory of this container item. This returns what is remaining of the original stack - a null return means that the entire - * stack was accepted! - * - * @param container - * ItemStack with the inventory. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return An ItemStack representing how much is remaining after the item was inserted (or would have been, if simulated) into the container inventory. - */ - ItemStack insertItem(ItemStack container, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from the inventory of this container item. This returns the resulting stack - a null return means that nothing was extracted! - * - * @param container - * ItemStack with the inventory. - * @param item - * ItemStack to be extracted. The size of this stack corresponds to the maximum amount to extract. If this is null, then a null ItemStack should - * immediately be returned. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ItemStack container, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from the inventory of this container item. This returns the resulting stack - a null return means that nothing was extracted! - * - * @param container - * ItemStack with the inventory. - * @param maxExtract - * Maximum number of items to extract. (The returned ItemStack should have a stackSize no higher than this.) - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ItemStack container, int maxExtract, boolean simulate); - - /** - * Get the contents of the container item's inventory. This should only return non-null ItemStacks, and an empty List if the inventory has nothing. - */ - List getInventoryContents(ItemStack container); - - /** - * Get the size of this inventory of this container item. - */ - int getSizeInventory(ItemStack container); - - /** - * Returns whether or not the container item's inventory is empty. - */ - boolean isEmpty(ItemStack container); - - /** - * Returns whether or not the container item's inventory is full. - */ - boolean isFull(ItemStack container); - -} diff --git a/src/main/java/cofh/api/item/IInventoryHandler.java b/src/main/java/cofh/api/item/IInventoryHandler.java deleted file mode 100644 index 4340e5f3..00000000 --- a/src/main/java/cofh/api/item/IInventoryHandler.java +++ /dev/null @@ -1,82 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * Implement this interface on TileEntities which should handle items. - * - * A reference implementation is provided {@link TileInventoryHandler}. - * - * @author King Lemming - * - */ -public interface IInventoryHandler extends IInventoryConnection { - - /** - * Insert an ItemStack into the IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns what is remaining of the - * original stack - a null return means that the entire stack was accepted! - * - * @param from - * Orientation the item is inserted from. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @param simulate - * If TRUE, the insertion will only be simulated. - * @return An ItemStack representing how much is remaining after the item was inserted (or would have been, if simulated) into the container inventory. - */ - ItemStack insertItem(ForgeDirection from, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from an IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns the resulting stack - a - * null return means that nothing was extracted! - * - * @param from - * Orientation the item is extracted from. - * @param item - * ItemStack to be extracted. The size of this stack corresponds to the maximum amount to extract. If this is null, then a null ItemStack should - * immediately be returned. - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ForgeDirection from, ItemStack item, boolean simulate); - - /** - * Extract an ItemStack from an IInventoryHandler, internal distribution is left entirely to the IInventoryHandler. This returns the resulting stack - a - * null return means that nothing was extracted! - * - * @param from - * Orientation the item is extracted from. - * @param maxExtract - * Maximum number of items to extract. (The returned ItemStack should have a stackSize no higher than this.) - * @param simulate - * If TRUE, the extraction will only be simulated. - * @return An ItemStack representing how much was extracted (or would have been, if simulated) from the container inventory. - */ - ItemStack extractItem(ForgeDirection from, int maxExtract, boolean simulate); - - /** - * Get the contents of the IInventoryHandler's inventory. This returns a COPY. This should only return non-null ItemStacks, and an empty List if the - * inventory has nothing. - */ - List getInventoryContents(ForgeDirection from); - - /** - * Get the size (number of internal slots) of the IInventoryHandler's inventory. - */ - int getSizeInventory(ForgeDirection from); - - /** - * Returns whether or not the IInventoryHandler's inventory is empty (for a given side). - */ - boolean isEmpty(ForgeDirection from); - - /** - * Returns whether or not the IInventoryHandler's inventory is full (for a given side). - */ - boolean isFull(ForgeDirection from); - -} diff --git a/src/main/java/cofh/api/item/ISecureItem.java b/src/main/java/cofh/api/item/ISecureItem.java deleted file mode 100644 index e6191fbf..00000000 --- a/src/main/java/cofh/api/item/ISecureItem.java +++ /dev/null @@ -1,25 +0,0 @@ -package cofh.api.item; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Implement this interface on Item classes which are secure - linked to a specific player or group of players. - * - * Obviously, this relies on people using this interface properly. The Wheaton Rule is in effect here - don't be a jerk. - * - * @author King Lemming - * - */ -public interface ISecureItem { - - /** - * Check whether or not a given player can use this item. - */ - boolean canPlayerAccess(EntityPlayer player); - - /** - * Get the Owner of this item. This function is intentionally nebulous and is not guaranteed to be a player name. - */ - String getOwnerString(); - -} diff --git a/src/main/java/cofh/api/item/ITinkerableItem.java b/src/main/java/cofh/api/item/ITinkerableItem.java deleted file mode 100644 index cb1185da..00000000 --- a/src/main/java/cofh/api/item/ITinkerableItem.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.item; - -import java.util.List; - -import net.minecraft.item.ItemStack; - -/** - * Implement this interface on Item classes which can be externally modified through tinkering. - * - * Basically a catch all for "upgrading" a given ItemStack, which may represent an Item or a Block. - * - * @author King Lemming - * - */ -public interface ITinkerableItem { - - /** - * Returns a list of valid ItemStacks which may be used to upgrade this Tinkerable. - */ - List getValidTinkers(ItemStack container); - - /** - * Applies a tinker to this item. - * - * @param container - * The ItemStack (Tinkerable) to which the tinker is being applied. - * @param tinker - * The ItemStack representing the upgrade. - * @return True if the application was successful, false if it was not. - */ - boolean applyTinker(ItemStack container, ItemStack tinker); - -} diff --git a/src/main/java/cofh/api/tileentity/IEnergyInfo.java b/src/main/java/cofh/api/tileentity/IEnergyInfo.java deleted file mode 100644 index 8337dbab..00000000 --- a/src/main/java/cofh/api/tileentity/IEnergyInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which can report information about their energy usage. - * - * This is used for reporting purposes - Energy transactions are handled through IEnergyHandler! - * - * @author King Lemming - * - */ -public interface IEnergyInfo { - - /** - * Returns energy usage/generation per tick (RF/t). - */ - public int getInfoEnergyPerTick(); - - /** - * Returns maximum energy usage/generation per tick (RF/t). - */ - public int getInfoMaxEnergyPerTick(); - - /** - * Returns energy stored (RF). - */ - public int getInfoEnergy(); - - /** - * Returns maximum energy stored (RF). - */ - public int getInfoMaxEnergy(); - -} diff --git a/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java b/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java deleted file mode 100644 index df981096..00000000 --- a/src/main/java/cofh/api/tileentity/IReconfigurableFacing.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which allow for reconfiguration of their facing. - * - * Coordination with the containing block is required. - * - * @author King Lemming - * - */ -public interface IReconfigurableFacing { - - /** - * Returns the current facing of the block. - */ - public int getFacing(); - - /** - * Returns whether or not the block's face can be aligned with the Y Axis. - */ - public boolean allowYAxisFacing(); - - /** - * Attempt to rotate the block. Arbitrary based on implementation. - * - * @return True if rotation was successful, false otherwise. - */ - public boolean rotateBlock(); - - /** - * Set the facing of the block. - * - * @param side - * The side to set the facing to. - * @return True if the facing was set, false otherwise. - */ - public boolean setFacing(int side); - -} diff --git a/src/main/java/cofh/api/tileentity/IReconfigurableSides.java b/src/main/java/cofh/api/tileentity/IReconfigurableSides.java deleted file mode 100644 index 354d58db..00000000 --- a/src/main/java/cofh/api/tileentity/IReconfigurableSides.java +++ /dev/null @@ -1,54 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which allow for reconfiguration of their sides. - * - * Coordination with the containing block is required. - * - * @author King Lemming - * - */ -public interface IReconfigurableSides { - - /** - * Decrement the config for a given side. - * - * @param side - * The side to decrement. - * @return True if config was changed, false otherwise. - */ - public boolean decrSide(int side); - - /** - * Increment the config for a given side. - * - * @param side - * The side to decrement. - * @return True if config was changed, false otherwise. - */ - public boolean incrSide(int side); - - /** - * Set the config for a given side. - * - * @param side - * The side to set. - * @param config - * The config value to use. - * @return True of config was set, false otherwise. - */ - public boolean setSide(int side, int config); - - /** - * Reset configs on all sides to their base values. - * - * @return True if reset was successful, false otherwise. - */ - public boolean resetSides(); - - /** - * Returns the number of possible config settings for a given side. - */ - public int getNumConfig(int side); - -} diff --git a/src/main/java/cofh/api/tileentity/IRedstoneCache.java b/src/main/java/cofh/api/tileentity/IRedstoneCache.java deleted file mode 100644 index e7af8f8e..00000000 --- a/src/main/java/cofh/api/tileentity/IRedstoneCache.java +++ /dev/null @@ -1,17 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which cache their redstone status. - * - * Note that {@link IRedstoneControl} is an extension of this. - * - * @author King Lemming - * - */ -public interface IRedstoneCache { - - public void setPowered(boolean isPowered); - - public boolean isPowered(); - -} diff --git a/src/main/java/cofh/api/tileentity/IRedstoneControl.java b/src/main/java/cofh/api/tileentity/IRedstoneControl.java deleted file mode 100644 index 2dbeefc8..00000000 --- a/src/main/java/cofh/api/tileentity/IRedstoneControl.java +++ /dev/null @@ -1,57 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which have Redstone Control functionality. This means that a tile can be set to ignore redstone entirely, or - * respond to a low or high redstone state. - * - * @author King Lemming - * - */ -public interface IRedstoneControl extends IRedstoneCache { - - public static enum ControlMode { - DISABLED(true), LOW(false), HIGH(true); - - private final boolean state; - - private ControlMode(boolean state) { - - this.state = state; - } - - public boolean isDisabled() { - - return this == DISABLED; - } - - public boolean isLow() { - - return this == LOW; - } - - public boolean isHigh() { - - return this == HIGH; - } - - public boolean getState() { - - return state; - } - - public static ControlMode stepForward(ControlMode curControl) { - - return curControl == DISABLED ? LOW : curControl == HIGH ? DISABLED : HIGH; - } - - public static ControlMode stepBackward(ControlMode curControl) { - - return curControl == DISABLED ? HIGH : curControl == HIGH ? LOW : DISABLED; - } - } - - public void setControl(ControlMode control); - - public ControlMode getControl(); - -} diff --git a/src/main/java/cofh/api/tileentity/ISecureTile.java b/src/main/java/cofh/api/tileentity/ISecureTile.java deleted file mode 100644 index b7802d62..00000000 --- a/src/main/java/cofh/api/tileentity/ISecureTile.java +++ /dev/null @@ -1,56 +0,0 @@ -package cofh.api.tileentity; - -/** - * Implement this interface on Tile Entities which have access restrictions. - * - * @author King Lemming - * - */ -public interface ISecureTile { - - /** - * Enum for Access Modes - Restricted is Friends Only, Private is Owner only. - * - * @author King Lemming - * - */ - public static enum AccessMode { - PUBLIC, RESTRICTED, PRIVATE; - - public boolean isPublic() { - - return this == PUBLIC; - } - - public boolean isRestricted() { - - return this == RESTRICTED; - } - - public boolean isPrivate() { - - return this == PRIVATE; - } - - public static AccessMode stepForward(AccessMode curAccess) { - - return curAccess == PUBLIC ? RESTRICTED : curAccess == PRIVATE ? PUBLIC : PRIVATE; - } - - public static AccessMode stepBackward(AccessMode curAccess) { - - return curAccess == PUBLIC ? PRIVATE : curAccess == PRIVATE ? RESTRICTED : PUBLIC; - } - } - - public boolean setAccess(AccessMode access); - - public boolean setOwnerName(String name); - - public AccessMode getAccess(); - - public String getOwnerName(); - - public boolean canPlayerAccess(String name); - -} diff --git a/src/main/java/cofh/api/tileentity/ISidedBlockTexture.java b/src/main/java/cofh/api/tileentity/ISidedBlockTexture.java deleted file mode 100644 index 4f9fdf0c..00000000 --- a/src/main/java/cofh/api/tileentity/ISidedBlockTexture.java +++ /dev/null @@ -1,25 +0,0 @@ -package cofh.api.tileentity; - -import net.minecraft.util.IIcon; - -/** - * Implement this interface on Tile Entities which can change their block's texture based on the current render pass. The block must defer the call to its Tile - * Entity. - * - * @author Zeldo Kavira - * - */ -public interface ISidedBlockTexture { - - /** - * Returns the icon to use for a given side and render pass. - * - * @param side - * Block side to get the texture for. - * @param pass - * Render pass. - * @return The icon to use. - */ - public IIcon getBlockTexture(int side, int pass); - -} diff --git a/src/main/java/cofh/api/tileentity/ISubSelectionBoxProvider.java b/src/main/java/cofh/api/tileentity/ISubSelectionBoxProvider.java deleted file mode 100644 index eff1e62b..00000000 --- a/src/main/java/cofh/api/tileentity/ISubSelectionBoxProvider.java +++ /dev/null @@ -1,11 +0,0 @@ -package cofh.api.tileentity; - -import codechicken.lib.raytracer.IndexedCuboid6; - -import java.util.List; - -public interface ISubSelectionBoxProvider { - - public void addTraceableCuboids(List cuboids); - -} diff --git a/src/main/java/cofh/api/transport/IEnderAttuned.java b/src/main/java/cofh/api/transport/IEnderAttuned.java deleted file mode 100644 index e20fe17e..00000000 --- a/src/main/java/cofh/api/transport/IEnderAttuned.java +++ /dev/null @@ -1,50 +0,0 @@ -package cofh.api.transport; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -public interface IEnderAttuned { - - public enum EnderTypes { - ITEM, FLUID, REDSTONE_FLUX - } - - String getOwnerString(); - - int getFrequency(); - - boolean setFrequency(int frequency); - - boolean clearFrequency(); - - boolean canSendItems(); - - boolean canSendFluid(); - - boolean canSendEnergy(); - - boolean canReceiveItems(); - - boolean canReceiveFluid(); - - boolean canReceiveEnergy(); - - boolean currentlyValidToReceiveItems(IEnderAttuned asker); - - boolean currentlyValidToReceiveFluid(IEnderAttuned asker); - - boolean currentlyValidToReceiveEnergy(IEnderAttuned asker); - - boolean currentlyValidToSendItems(IEnderAttuned asker); - - boolean currentlyValidToSendFluid(IEnderAttuned asker); - - boolean currentlyValidToSendEnergy(IEnderAttuned asker); - - ItemStack receiveItem(ItemStack item); - - FluidStack receiveFluid(FluidStack fluid, boolean doFill); - - int receiveEnergy(int energy, boolean simulate); - -} diff --git a/src/main/java/cofh/api/transport/IEnderEnergyReceptor.java b/src/main/java/cofh/api/transport/IEnderEnergyReceptor.java deleted file mode 100644 index b70fd712..00000000 --- a/src/main/java/cofh/api/transport/IEnderEnergyReceptor.java +++ /dev/null @@ -1,30 +0,0 @@ -package cofh.api.transport; - -/** - * This interface is implemented on Ender Attuned objects which can receive Energy (Redstone Flux). - * - * @author King Lemming - * - */ -public interface IEnderEnergyReceptor { - - /** - * This should be checked to see if the Ender Attuned object can currently receive energy. - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveEnergy(); - - /** - * This tells the Ender Attuned object to receive energy. This returns the amount remaining, *not* the amount received - a return of 0 means that all energy - * was received! - * - * @param energy - * Amount of energy to be received. - * @param simulate - * If TRUE, the result will only be simulated. - * @return Amount of energy that is remaining (or would be remaining, if simulated). - */ - int receiveEnergy(int energy, boolean simulate); - -} diff --git a/src/main/java/cofh/api/transport/IEnderFluidReceptor.java b/src/main/java/cofh/api/transport/IEnderFluidReceptor.java deleted file mode 100644 index dd38846a..00000000 --- a/src/main/java/cofh/api/transport/IEnderFluidReceptor.java +++ /dev/null @@ -1,32 +0,0 @@ -package cofh.api.transport; - -import net.minecraftforge.fluids.FluidStack; - -/** - * This interface is implemented on Ender Attuned objects which can receive Fluid. - * - * @author King Lemming - * - */ -public interface IEnderFluidReceptor { - - /** - * This should be checked to see if the Ender Attuned object can currently receive a FluidStack. - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveFluid(); - - /** - * This tells the Ender Attuned object to receive a FluidStack. This returns what remains of the original stack, *not* the amount received - a null return - * means that the entire stack was received! - * - * @param fluid - * FluidStack to be received. - * @param simulate - * If TRUE, the result will only be simulated. - * @return FluidStack representing how much fluid is remaining (or would be remaining, if simulated). - */ - FluidStack receiveFluid(FluidStack fluid, boolean simulate); - -} diff --git a/src/main/java/cofh/api/transport/IEnderItemReceptor.java b/src/main/java/cofh/api/transport/IEnderItemReceptor.java deleted file mode 100644 index 2f6cfbf2..00000000 --- a/src/main/java/cofh/api/transport/IEnderItemReceptor.java +++ /dev/null @@ -1,33 +0,0 @@ -package cofh.api.transport; - -import net.minecraft.item.ItemStack; - -/** - * This interface is implemented on Ender Attuned objects which can receive Items. - * - * @author King Lemming - * - */ -public interface IEnderItemReceptor { - - /** - * This should be checked to see if the Ender Attuned object can currently receive an ItemStack. - * - * Note: In practice, this can (and should) be used to ensure that something does not send to itself. - */ - boolean canReceiveItems(); - - /** - * This tells the Ender Attuned object to receive an ItemStack. This returns what remains of the original stack, *not* the amount received - a null return - * means that the entire stack was received! - * - * This function does not support simulation because Inventory manipulation in Minecraft is an absolute mess and it would be a computational liability to do - * so. - * - * @param item - * ItemStack to be received. - * @return An ItemStack representing how much is remaining. - */ - ItemStack receiveItem(ItemStack item); - -} diff --git a/src/main/java/cofh/api/transport/IItemDuct.java b/src/main/java/cofh/api/transport/IItemDuct.java deleted file mode 100644 index 4c50c856..00000000 --- a/src/main/java/cofh/api/transport/IItemDuct.java +++ /dev/null @@ -1,26 +0,0 @@ -package cofh.api.transport; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -/** - * This interface is implemented on ItemDucts. Use it to attempt to eject items into an entry point. - * - * @author Zeldo Kavira, King Lemming - * - */ -public interface IItemDuct { - - /** - * Insert an ItemStack into the IItemDuct. Will only accept items if there is a valid destination. This returns what is remaining of the original stack - a - * null return means that the entire stack was accepted/routed! - * - * @param from - * Orientation the item is inserted from. - * @param item - * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. - * @return An ItemStack representing how much is remaining after the item was inserted into the Duct. - */ - public ItemStack insertItem(ForgeDirection from, ItemStack item); - -} diff --git a/src/main/java/cofh/api/world/IFeatureGenerator.java b/src/main/java/cofh/api/world/IFeatureGenerator.java deleted file mode 100644 index f0d732f3..00000000 --- a/src/main/java/cofh/api/world/IFeatureGenerator.java +++ /dev/null @@ -1,39 +0,0 @@ -package cofh.api.world; - -import java.util.Random; - -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; - -/** - * This interface should be implemented on classes which define a world feature to be generated in a {@link IFeatureHandler}. It is essentially a more robust - * version of {@link WorldGenerator}, and may include one or more WorldGenerators should you wish. - * - * @author King Lemming - * - */ -public interface IFeatureGenerator { - - /** - * Returns the name of the feature, used for displaying in the World.cfg file. - */ - public String getFeatureName(); - - /** - * Generates the world feature. - * - * @param random - * Random derived from the world seed. - * @param chunkX - * Minimum X chunk-coordinate of the chunk. (x16 for block coordinate) - * @param chunkZ - * Minimum Z chunk-coordinate of the chunk. (x16 for block coordinate) - * @param world - * The world to generate in. - * @param newGen - * True on initial generation, false on retrogen. - * @return True if generation happened, false otherwise. - */ - public boolean generateFeature(Random random, int chunkX, int chunkZ, World world, boolean newGen); - -} diff --git a/src/main/java/cofh/api/world/IFeatureHandler.java b/src/main/java/cofh/api/world/IFeatureHandler.java deleted file mode 100644 index eea078ce..00000000 --- a/src/main/java/cofh/api/world/IFeatureHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package cofh.api.world; - -/** - * Provides an interface to allow for the addition of Features to world generation. - * - * See {@link IFeatureGenerator}. - * - * @author King Lemming - * - */ -public interface IFeatureHandler { - - /** - * Register a feature with an IFeatureHandler. - * - * @param feature - * The feature to register. - * @return True if the registration was successful, false if a feature with that name existed. - */ - public boolean registerFeature(IFeatureGenerator feature); - -} diff --git a/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java b/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java index fca2dfb1..ec4a4ac0 100644 --- a/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java +++ b/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java @@ -1,7 +1,6 @@ package thaumic.tinkerer.client.render.block; import baubles.client.ClientProxy; -import com.sun.prism.util.tess.Tess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java b/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java index 2064abe9..3b5588b5 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java +++ b/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java @@ -10,100 +10,100 @@ import thaumic.tinkerer.common.core.helper.ItemNBTHelper; public class TinkersConstructCompat { - private static final String TAG_INFINITOOL = "InfiTool"; - private static final String TAG_BROKEN = "Broken"; - private static final String TAG_DAMAGE = "Damage"; - private static final String TAG_DURABILITY = "TotalDurability"; - private static final String TAG_CHARGE = "charge"; - private static final String TAG_ENERGY = "Energy"; - private static final String TAG_REPAIRCOUNT = "RepairCount"; + private static final String TAG_INFINITOOL = "InfiTool"; + private static final String TAG_BROKEN = "Broken"; + private static final String TAG_DAMAGE = "Damage"; + private static final String TAG_DURABILITY = "TotalDurability"; + private static final String TAG_CHARGE = "charge"; + private static final String TAG_ENERGY = "Energy"; + private static final String TAG_REPAIRCOUNT = "RepairCount"; - public static boolean isTConstructTool(ItemStack stack) { - if (stack == null) - return false; - Item item = stack.getItem(); + public static boolean isTConstructTool(ItemStack stack) { + if (stack == null) + return false; + Item item = stack.getItem(); - if (item instanceof ToolCore) { - return !(ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)); - } else - return false; - } + if (item instanceof ToolCore) { + return !(ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)); + } else + return false; + } - public static int getDamage(ItemStack stack) { - if (stack == null) - return -1; - if (!isTConstructTool(stack)) - return -1; + public static int getDamage(ItemStack stack) { + if (stack == null) + return -1; + if (!isTConstructTool(stack)) + return -1; - if (ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)) - return -1; - if (ItemNBTHelper.getNBT(stack).hasKey(TAG_INFINITOOL)) { - NBTTagCompound InfiniTool = ItemNBTHelper.getNBT(stack).getCompoundTag(TAG_INFINITOOL); - if (InfiniTool.hasKey(TAG_BROKEN) && InfiniTool.getBoolean(TAG_BROKEN)) { - if (InfiniTool.hasKey(TAG_DURABILITY)) - return InfiniTool.getInteger(TAG_DURABILITY); - else - return -1; - } - if (InfiniTool.hasKey(TAG_DAMAGE)) { - return InfiniTool.getInteger(TAG_DAMAGE); - } - } - return -1; - } + if (ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)) + return -1; + if (ItemNBTHelper.getNBT(stack).hasKey(TAG_INFINITOOL)) { + NBTTagCompound InfiniTool = ItemNBTHelper.getNBT(stack).getCompoundTag(TAG_INFINITOOL); + if (InfiniTool.hasKey(TAG_BROKEN) && InfiniTool.getBoolean(TAG_BROKEN)) { + if (InfiniTool.hasKey(TAG_DURABILITY)) + return InfiniTool.getInteger(TAG_DURABILITY); + else + return -1; + } + if (InfiniTool.hasKey(TAG_DAMAGE)) { + return InfiniTool.getInteger(TAG_DAMAGE); + } + } + return -1; + } - public static boolean fixDamage(ItemStack stack, int amount) { - if (stack == null) - return false; - if (!isTConstructTool(stack)) - return false; + public static boolean fixDamage(ItemStack stack, int amount) { + if (stack == null) + return false; + if (!isTConstructTool(stack)) + return false; - if (ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)) - return false; - if (ItemNBTHelper.getNBT(stack).hasKey(TAG_INFINITOOL)) { - NBTTagCompound InfiniTool = ItemNBTHelper.getNBT(stack).getCompoundTag(TAG_INFINITOOL); - InfiniTool.setBoolean("Broken", false); - int damage = InfiniTool.getInteger("Damage"); - int itemsUsed = 0; - int increase = calculateIncrease(stack, amount); - int repair = InfiniTool.getInteger("RepairCount"); - repair += itemsUsed; - InfiniTool.setInteger("RepairCount", repair); + if (ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE)) + return false; + if (ItemNBTHelper.getNBT(stack).hasKey(TAG_INFINITOOL)) { + NBTTagCompound InfiniTool = ItemNBTHelper.getNBT(stack).getCompoundTag(TAG_INFINITOOL); + InfiniTool.setBoolean("Broken", false); + int damage = InfiniTool.getInteger("Damage"); + int itemsUsed = 0; + int increase = calculateIncrease(stack, amount); + int repair = InfiniTool.getInteger("RepairCount"); + repair += itemsUsed; + InfiniTool.setInteger("RepairCount", repair); - damage -= increase; - if (damage < 0) - damage = 0; - InfiniTool.setInteger("Damage", damage); + damage -= increase; + if (damage < 0) + damage = 0; + InfiniTool.setInteger("Damage", damage); - AbilityHelper.damageTool(stack, 0, null, true); - ItemNBTHelper.setCompound(stack, TAG_INFINITOOL, InfiniTool); - AbilityHelper.damageTool(stack, 0, null, true); - } - return false; - } + AbilityHelper.damageTool(stack, 0, null, true); + ItemNBTHelper.setCompound(stack, TAG_INFINITOOL, InfiniTool); + AbilityHelper.damageTool(stack, 0, null, true); + } + return false; + } - private static int calculateIncrease(ItemStack tool, int amount) { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int increase = amount * 2; + private static int calculateIncrease(ItemStack tool, int amount) { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int increase = amount * 2; - int modifiers = tags.getInteger("Modifiers"); - float mods = 1.0f; - if (modifiers == 2) - mods = 1.0f; - else if (modifiers == 1) - mods = 0.75f; - else if (modifiers == 0) - mods = 0.5f; + int modifiers = tags.getInteger("Modifiers"); + float mods = 1.0f; + if (modifiers == 2) + mods = 1.0f; + else if (modifiers == 1) + mods = 0.75f; + else if (modifiers == 0) + mods = 0.5f; - increase *= mods; + increase *= mods; - int repair = tags.getInteger("RepairCount"); - float repairCount = (100 - repair) / 100f; - if (repairCount < 0.5f) - repairCount = 0.5f; - increase *= repairCount; - increase /= ((ToolCore) tool.getItem()).getRepairCost(); - return increase; - } + int repair = tags.getInteger("RepairCount"); + float repairCount = (100 - repair) / 100f; + if (repairCount < 0.5f) + repairCount = 0.5f; + increase *= repairCount; + increase /= ((ToolCore) tool.getItem()).getRepairCost(); + return increase; + } } diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java b/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java index 8c7a7243..a48bc5a3 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java @@ -1,5 +1,6 @@ package thaumic.tinkerer.common.core.helper; +import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.creativetab.CreativeTabs; @@ -122,7 +123,6 @@ public class AspectCropLootManager { addAspectLoot(Aspect.FLESH, new ItemStack(ConfigItems.itemResource, 16, 5), 1); addAspectLoot(Aspect.UNDEAD, new ItemStack(Items.rotten_flesh, 32)); - addAspectLoot(Aspect.UNDEAD, new ItemStack(Items.bone, 32)); addAspectLoot(Aspect.CRAFT, new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartz.class), 32)); addAspectLoot(Aspect.CRAFT, new ItemStack(ConfigBlocks.blockStoneDevice, 16)); @@ -175,7 +175,7 @@ public class AspectCropLootManager { } } - //TODO: Iter + addAspectLoot(Aspect.TRAVEL, new ItemStack(ConfigBlocks.blockCosmeticSolid, 8, 7)); addAspectLoot(Aspect.SLIME, new ItemStack(Items.slime_ball, 16)); addAspectLoot(Aspect.SLIME, "slime"); @@ -194,9 +194,13 @@ public class AspectCropLootManager { addAspectLoot(Aspect.METAL, new ItemStack(Items.iron_ingot, 4), 100); addAspectLoot(Aspect.METAL, "iron"); - //TODO: Mortus - //TODO: Motus + addAspectLoot(Aspect.DEATH, new ItemStack(Items.bone, 32)); + + addAspectLoot(Aspect.MOTION, new ItemStack(Blocks.rail), 10); + + addAspectLoot(Aspect.MOTION, new ItemStack(Blocks.activator_rail)); + addAspectLoot(Aspect.CLOTH, new ItemStack(Blocks.wool, 16), 30); addAspectLoot(Aspect.CLOTH, new ItemStack(Items.string, 15), 10); @@ -211,7 +215,9 @@ public class AspectCropLootManager { addAspectLoot(Aspect.MAGIC, "shard"); - //TODO: Sano + addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple)); + + addAspectLoot(Aspect.HEAL, new ItemStack(Blocks.cake)); addAspectLoot(Aspect.SENSES, new ItemStack(Items.dye, 20, 4)); @@ -219,7 +225,8 @@ public class AspectCropLootManager { addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.netherrack, 64), 2); addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.nether_brick)); - //TODO: Tempestas + addAspectLoot(Aspect.WEATHER, new ItemStack(Blocks.air)); + addAspectLoot(Aspect.WEATHER, "cloud", 100); addAspectLoot(Aspect.DARKNESS, new ItemStack(Blocks.obsidian, 10)); @@ -228,11 +235,11 @@ public class AspectCropLootManager { addAspectLoot(Aspect.POISON, new ItemStack(ConfigItems.itemResource, 16, 3)); - //TODO: Victus + addAspectLoot(Aspect.LIFE, new ItemStack(Items.egg, 8)); - //TODO: Vinculum + addAspectLoot(Aspect.TRAP, new ItemStack(Blocks.web, 4)); - //TODO: Vitium + addAspectLoot(Aspect.TAINT, new ItemStack(ConfigItems.itemResource, 4, 11)); addAspectLoot(Aspect.CRYSTAL, new ItemStack(Items.diamond));