Merge branch 'Prototik-api' into NextGen
This commit is contained in:
commit
9e397870a2
90 changed files with 74 additions and 36 deletions
|
@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
|
||||
/**
|
||||
* This class allow to specify specific behavior for blocks stored in
|
|
@ -8,8 +8,7 @@
|
|||
*/
|
||||
package buildcraft.api.core;
|
||||
|
||||
import buildcraft.core.Version;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
@ -21,7 +20,7 @@ public class BCLog {
|
|||
// TODO: check if the code below is still useful and remove otherwise.
|
||||
//logger.setParent(FMLLog.getLogger());
|
||||
|
||||
logger.info("Starting BuildCraft " + Version.getVersion());
|
||||
logger.info("Starting BuildCraft " + getVersion());
|
||||
logger.info("Copyright (c) SpaceToad, 2011");
|
||||
logger.info("http://www.mod-buildcraft.com");
|
||||
}
|
||||
|
@ -40,4 +39,14 @@ public class BCLog {
|
|||
logger.log(Level.SEVERE, msg.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
try {
|
||||
Class<?> clazz = Class.forName("buildcraft.core.Version");
|
||||
Method method = clazz.getDeclaredMethod("getVersion");
|
||||
return String.valueOf(method.invoke(null));
|
||||
} catch (Exception e) {
|
||||
return "UNKNOWN VERSION";
|
||||
}
|
||||
}
|
||||
}
|
22
api/buildcraft/api/core/IInvSlot.java
Normal file
22
api/buildcraft/api/core/IInvSlot.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IInvSlot {
|
||||
/**
|
||||
* Returns the slot number of the underlying Inventory.
|
||||
*
|
||||
* @return the slot number
|
||||
*/
|
||||
int getIndex();
|
||||
|
||||
boolean canPutStackInSlot(ItemStack stack);
|
||||
|
||||
boolean canTakeStackFromSlot(ItemStack stack);
|
||||
|
||||
ItemStack decreaseStackInSlot();
|
||||
|
||||
ItemStack getStackInSlot();
|
||||
|
||||
void setStackInSlot(ItemStack stack);
|
||||
}
|
25
build.gradle
25
build.gradle
|
@ -51,6 +51,11 @@ sourceSets {
|
|||
// include 'some inclusion'
|
||||
}
|
||||
}
|
||||
api {
|
||||
java {
|
||||
srcDir 'api'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources
|
||||
|
@ -77,9 +82,15 @@ processResources
|
|||
// add a source jar
|
||||
task sourceJar(type: Jar) {
|
||||
from sourceSets.main.allSource
|
||||
from sourceSets.api.allSource
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
// add api classes to javadoc
|
||||
javadoc {
|
||||
source += sourceSets.api.allSource
|
||||
}
|
||||
|
||||
// add a javadoc jar
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
|
@ -89,11 +100,22 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
|
|||
// because the normal output has been made to be obfuscated
|
||||
task deobfJar(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
from sourceSets.api.output
|
||||
classifier = 'dev'
|
||||
}
|
||||
|
||||
task apiJar(type: Jar) {
|
||||
from sourceSets.api.output
|
||||
classifier = 'api'
|
||||
}
|
||||
|
||||
// add api classes to main package
|
||||
jar {
|
||||
from sourceSets.api.output
|
||||
}
|
||||
|
||||
// make sure all of these happen when we run build
|
||||
build.dependsOn sourceJar, javadocJar, deobfJar
|
||||
build.dependsOn sourceJar, javadocJar, deobfJar, apiJar
|
||||
|
||||
// --------------------
|
||||
// maven section
|
||||
|
@ -115,6 +137,7 @@ artifacts {
|
|||
archives sourceJar
|
||||
archives javadocJar
|
||||
archives deobfJar
|
||||
archives apiJar
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
|
|
|
@ -35,7 +35,7 @@ import buildcraft.core.BlockIndex;
|
|||
import buildcraft.core.blueprints.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.inventory.InventoryCopy;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.utils.BlockUtil;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import buildcraft.builders.TileAbstractBuilder;
|
|||
import buildcraft.core.BlockIndex;
|
||||
import buildcraft.core.blueprints.BuildingSlotBlock.Mode;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.utils.BlockUtil;
|
||||
|
||||
public class BptBuilderTemplate extends BptBuilderBase {
|
||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraft.tileentity.TileEntityChest;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.filters.ArrayStackFilter;
|
||||
import buildcraft.core.inventory.filters.IStackFilter;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package buildcraft.core.inventory;
|
||||
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -30,23 +31,4 @@ public class InventoryIterator {
|
|||
return new InventoryIteratorSimple(inv);
|
||||
}
|
||||
|
||||
public interface IInvSlot {
|
||||
|
||||
/**
|
||||
* Returns the slot number of the underlying Inventory.
|
||||
*
|
||||
* @return the slot number
|
||||
*/
|
||||
int getIndex();
|
||||
|
||||
boolean canPutStackInSlot(ItemStack stack);
|
||||
|
||||
boolean canTakeStackFromSlot(ItemStack stack);
|
||||
|
||||
ItemStack decreaseStackInSlot();
|
||||
|
||||
ItemStack getStackInSlot();
|
||||
|
||||
void setStackInSlot(ItemStack stack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
*/
|
||||
package buildcraft.core.inventory;
|
||||
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import java.util.Iterator;
|
||||
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
*/
|
||||
package buildcraft.core.inventory;
|
||||
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import java.util.Iterator;
|
||||
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ package buildcraft.core.inventory;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
|
||||
public class TransactorRoundRobin extends TransactorSimple {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.filters.IStackFilter;
|
||||
|
||||
public class TransactorSimple extends Transactor {
|
||||
|
|
|
@ -11,7 +11,7 @@ package buildcraft.core.recipes;
|
|||
import buildcraft.api.recipes.IAssemblyRecipeManager;
|
||||
import buildcraft.core.inventory.ITransactor;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.Transactor;
|
||||
import buildcraft.core.inventory.filters.ArrayStackFilter;
|
||||
import java.util.LinkedList;
|
||||
|
|
|
@ -18,7 +18,7 @@ import buildcraft.api.gates.ITileTrigger;
|
|||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.gates.ITriggerParameter;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.utils.StringUtils;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import buildcraft.api.gates.ITileTrigger;
|
|||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.gates.ITriggerParameter;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.utils.StringUtils;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import buildcraft.core.TileBuildCraft;
|
|||
import buildcraft.core.inventory.InvUtils;
|
||||
import buildcraft.core.inventory.InventoryConcatenator;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.utils.CraftingHelper;
|
||||
|
|
|
@ -43,7 +43,7 @@ import buildcraft.core.TileBuffer;
|
|||
import buildcraft.core.inventory.InvUtils;
|
||||
import buildcraft.core.inventory.InventoryCopy;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.InventoryIterator.IInvSlot;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.InventoryMapper;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
|
|
0
gradlew
vendored
Normal file → Executable file
0
gradlew
vendored
Normal file → Executable file
Loading…
Reference in a new issue