parent
2c394e2722
commit
44d521401d
28 changed files with 1053 additions and 992 deletions
74
apis/powercrystals/minefactoryreloaded/api/FactoryRegistry27.java
Executable file
74
apis/powercrystals/minefactoryreloaded/api/FactoryRegistry27.java
Executable file
|
@ -0,0 +1,74 @@
|
||||||
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author PowerCrystals
|
||||||
|
* <p/>
|
||||||
|
* Class used to register plants and other farming-related things with MFR. Will do nothing if MFR does not exist, but your mod should be set to load
|
||||||
|
* after MFR or things may not work properly.
|
||||||
|
* <p/>
|
||||||
|
* To avoid breaking the API, additional FarmingRegistry##s will appear on major MFR versions that contain API additions. On a Minecraft version change,
|
||||||
|
* these will be rolled back into this class.
|
||||||
|
*/
|
||||||
|
public class FactoryRegistry27 {
|
||||||
|
/**
|
||||||
|
* Registers a grindable entity with the Grinder using the new grinder interface. This method will be renamed to the standard "registerGrindable"
|
||||||
|
* on MC 1.6.
|
||||||
|
*
|
||||||
|
* @param grindable The entity to grind.
|
||||||
|
*/
|
||||||
|
public static void registerGrindable(IFactoryGrindable2 grindable) {
|
||||||
|
try {
|
||||||
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
|
if (registry != null) {
|
||||||
|
Method reg = registry.getMethod("registerGrindable", IFactoryGrindable2.class);
|
||||||
|
reg.invoke(registry, grindable);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a grindable entity with the Grinder using the new grinder interface. This method will be renamed to the standard "registerGrindable"
|
||||||
|
* on MC 1.6.
|
||||||
|
*
|
||||||
|
* @param grindable The entity to grind.
|
||||||
|
*/
|
||||||
|
public static void registerGrinderBlacklist(Class<?>... ungrindables) {
|
||||||
|
try {
|
||||||
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
|
if (registry != null) {
|
||||||
|
Method reg = registry.getMethod("registerGrinderBlacklist", Class[].class);
|
||||||
|
reg.invoke(registry, (Object[]) ungrindables);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a preferred ore with the laser drill. Focuses with the specified color will make the specified ore more likely.
|
||||||
|
* Used by MFR itself for vanilla: Black (Coal), Light Blue (Diamond), Lime (Emerald), Yellow (Gold), Brown (Iron), Blue (Lapis),
|
||||||
|
* Red (Redstone), and White (nether quartz).
|
||||||
|
* <p/>
|
||||||
|
* This will replace setLaserPreferredOre on MC 1.6.
|
||||||
|
*
|
||||||
|
* @param color The color that the preferred ore is being set for. White is 0.
|
||||||
|
* @param ore The ore that will be preferred by the drill when a focus with the specified color is present.
|
||||||
|
*/
|
||||||
|
public static void addLaserPreferredOre(int color, ItemStack ore) {
|
||||||
|
try {
|
||||||
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
|
if (registry != null) {
|
||||||
|
Method reg = registry.getMethod("addLaserPreferredOre", int.class, ItemStack.class);
|
||||||
|
reg.invoke(registry, color, ore);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,37 +1,35 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import powercrystals.minefactoryreloaded.api.rednet.IRedNetLogicCircuit;
|
import powercrystals.minefactoryreloaded.api.rednet.IRedNetLogicCircuit;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Class used to register plants and other farming-related things with MFR. Will do nothing if MFR does not exist, but your mod should be set to load
|
* Class used to register plants and other farming-related things with MFR. Will do nothing if MFR does not exist, but your mod should be set to load
|
||||||
* after MFR or things may not work properly.
|
* after MFR or things may not work properly.
|
||||||
*
|
* <p/>
|
||||||
|
* To avoid breaking the API, additional FactoryRegistry##s will appear on major MFR versions that contain API additions. On a Minecraft version change,
|
||||||
|
* these will be rolled back into this class.
|
||||||
|
* <p/>
|
||||||
|
* This class will be replaced by FactoryRegistry in 1.6.
|
||||||
*/
|
*/
|
||||||
public class FarmingRegistry
|
public class FarmingRegistry {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Registers a plantable object with the Planter.
|
* Registers a plantable object with the Planter.
|
||||||
*
|
*
|
||||||
* @param plantable The thing to plant.
|
* @param plantable The thing to plant.
|
||||||
*/
|
*/
|
||||||
public static void registerPlantable(IFactoryPlantable plantable)
|
public static void registerPlantable(IFactoryPlantable plantable) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerPlantable", IFactoryPlantable.class);
|
Method reg = registry.getMethod("registerPlantable", IFactoryPlantable.class);
|
||||||
reg.invoke(registry, plantable);
|
reg.invoke(registry, plantable);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,19 +39,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param harvestable The thing to harvest.
|
* @param harvestable The thing to harvest.
|
||||||
*/
|
*/
|
||||||
public static void registerHarvestable(IFactoryHarvestable harvestable)
|
public static void registerHarvestable(IFactoryHarvestable harvestable) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerHarvestable", IFactoryHarvestable.class);
|
Method reg = registry.getMethod("registerHarvestable", IFactoryHarvestable.class);
|
||||||
reg.invoke(registry, harvestable);
|
reg.invoke(registry, harvestable);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,19 +56,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param fertilizable The thing to fertilize.
|
* @param fertilizable The thing to fertilize.
|
||||||
*/
|
*/
|
||||||
public static void registerFertilizable(IFactoryFertilizable fertilizable)
|
public static void registerFertilizable(IFactoryFertilizable fertilizable) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerFertilizable", IFactoryFertilizable.class);
|
Method reg = registry.getMethod("registerFertilizable", IFactoryFertilizable.class);
|
||||||
reg.invoke(registry, fertilizable);
|
reg.invoke(registry, fertilizable);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,19 +73,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param fertilizable The thing to fertilize with.
|
* @param fertilizable The thing to fertilize with.
|
||||||
*/
|
*/
|
||||||
public static void registerFertilizer(IFactoryFertilizer fertilizer)
|
public static void registerFertilizer(IFactoryFertilizer fertilizer) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerFertilizer", IFactoryFertilizer.class);
|
Method reg = registry.getMethod("registerFertilizer", IFactoryFertilizer.class);
|
||||||
reg.invoke(registry, fertilizer);
|
reg.invoke(registry, fertilizer);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,19 +90,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param ranchable The entity to ranch.
|
* @param ranchable The entity to ranch.
|
||||||
*/
|
*/
|
||||||
public static void registerRanchable(IFactoryRanchable ranchable)
|
public static void registerRanchable(IFactoryRanchable ranchable) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerRanchable", IFactoryRanchable.class);
|
Method reg = registry.getMethod("registerRanchable", IFactoryRanchable.class);
|
||||||
reg.invoke(registry, ranchable);
|
reg.invoke(registry, ranchable);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,19 +107,15 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param grindable The entity to grind.
|
* @param grindable The entity to grind.
|
||||||
*/
|
*/
|
||||||
public static void registerGrindable(IFactoryGrindable grindable)
|
@SuppressWarnings("deprecation")
|
||||||
{
|
public static void registerGrindable(IFactoryGrindable grindable) {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerGrindable", IFactoryGrindable.class);
|
Method reg = registry.getMethod("registerGrindable", IFactoryGrindable.class);
|
||||||
reg.invoke(registry, grindable);
|
reg.invoke(registry, grindable);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,19 +126,14 @@ public class FarmingRegistry
|
||||||
* @param weight Likelihood that this item will be produced. Lower means rarer.
|
* @param weight Likelihood that this item will be produced. Lower means rarer.
|
||||||
* @param drop The thing being produced by the sludge boiler.
|
* @param drop The thing being produced by the sludge boiler.
|
||||||
*/
|
*/
|
||||||
public static void registerSludgeDrop(int weight, ItemStack drop)
|
public static void registerSludgeDrop(int weight, ItemStack drop) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerSludgeDrop", int.class, ItemStack.class);
|
Method reg = registry.getMethod("registerSludgeDrop", int.class, ItemStack.class);
|
||||||
reg.invoke(registry, weight, drop);
|
reg.invoke(registry, weight, drop);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,19 +144,14 @@ public class FarmingRegistry
|
||||||
* @param entityToBreed Entity this food will be used with.
|
* @param entityToBreed Entity this food will be used with.
|
||||||
* @param food The item to use when breeding this entity.
|
* @param food The item to use when breeding this entity.
|
||||||
*/
|
*/
|
||||||
public static void registerBreederFood(Class<?> entityToBreed, ItemStack food)
|
public static void registerBreederFood(Class<?> entityToBreed, ItemStack food) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerBreederFood", Class.class, ItemStack.class);
|
Method reg = registry.getMethod("registerBreederFood", Class.class, ItemStack.class);
|
||||||
reg.invoke(registry, entityToBreed, food);
|
reg.invoke(registry, entityToBreed, food);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,19 +161,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param handler The Safari Net handler.
|
* @param handler The Safari Net handler.
|
||||||
*/
|
*/
|
||||||
public static void registerSafariNetHandler(ISafariNetHandler handler)
|
public static void registerSafariNetHandler(ISafariNetHandler handler) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerSafariNetHandler", ISafariNetHandler.class);
|
Method reg = registry.getMethod("registerSafariNetHandler", ISafariNetHandler.class);
|
||||||
reg.invoke(registry, handler);
|
reg.invoke(registry, handler);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,19 +179,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param handler The mob egg handler
|
* @param handler The mob egg handler
|
||||||
*/
|
*/
|
||||||
public static void registerMobEggHandler(IMobEggHandler handler)
|
public static void registerMobEggHandler(IMobEggHandler handler) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerMobEggHandler", IMobEggHandler.class);
|
Method reg = registry.getMethod("registerMobEggHandler", IMobEggHandler.class);
|
||||||
reg.invoke(registry, handler);
|
reg.invoke(registry, handler);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,19 +196,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param biome The biome name.
|
* @param biome The biome name.
|
||||||
*/
|
*/
|
||||||
public static void registerRubberTreeBiome(String biome)
|
public static void registerRubberTreeBiome(String biome) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerRubberTreeBiome", String.class);
|
Method reg = registry.getMethod("registerRubberTreeBiome", String.class);
|
||||||
reg.invoke(registry, biome);
|
reg.invoke(registry, biome);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,14 +213,31 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param blacklistedEntity Class to blacklist
|
* @param blacklistedEntity Class to blacklist
|
||||||
*/
|
*/
|
||||||
public static void registerSafariNetBlacklist(Class<?> blacklistedEntity)
|
public static void registerSafariNetBlacklist(Class<?> blacklistedEntity) {
|
||||||
|
try {
|
||||||
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
|
if (registry != null) {
|
||||||
|
Method reg = registry.getMethod("registerSafariNetBlacklist", Class.class);
|
||||||
|
reg.invoke(registry, blacklistedEntity);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bans an entity class from being automatically ground by the Grinder
|
||||||
|
*
|
||||||
|
* @param blacklistedEntity Class to blacklist
|
||||||
|
*/
|
||||||
|
/*public static void registerGrinderBlacklist(Class<?> blacklistedEntity)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if(registry != null)
|
||||||
{
|
{
|
||||||
Method reg = registry.getMethod("registerSafariNetBlacklist", Class.class);
|
Method reg = registry.getMethod("registerGrinderBlacklist", Class.class);
|
||||||
reg.invoke(registry, blacklistedEntity);
|
reg.invoke(registry, blacklistedEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,7 +245,7 @@ public class FarmingRegistry
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}//*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an entity as a possible output from villager random safari nets. Note that the "id" field must be initialized
|
* Registers an entity as a possible output from villager random safari nets. Note that the "id" field must be initialized
|
||||||
|
@ -288,42 +254,32 @@ public class FarmingRegistry
|
||||||
* @param savedMob A serialized mob that will be unloaded by the safari net
|
* @param savedMob A serialized mob that will be unloaded by the safari net
|
||||||
* @param weight The weight of this mob in the random selection
|
* @param weight The weight of this mob in the random selection
|
||||||
*/
|
*/
|
||||||
public static void registerVillagerTradeMob(IRandomMobProvider mobProvider)
|
public static void registerVillagerTradeMob(IRandomMobProvider mobProvider) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerVillagerTradeMob", IRandomMobProvider.class);
|
Method reg = registry.getMethod("registerVillagerTradeMob", IRandomMobProvider.class);
|
||||||
reg.invoke(registry, mobProvider);
|
reg.invoke(registry, mobProvider);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers a handler for drinking liquids with the straw.
|
* Registers a handler for drinking fluids with the straw.
|
||||||
*
|
*
|
||||||
* @param liquidId The block ID the handler handles.
|
* @param fluidId The block ID the handler handles.
|
||||||
* @param liquidDrinkHandler The drink handler instance.
|
* @param fluidDrinkHandler The drink handler instance.
|
||||||
*/
|
*/
|
||||||
public static void registerLiquidDrinkHandler(int liquidId, ILiquidDrinkHandler liquidDrinkHandler)
|
public static void registerFluidDrinkHandler(int fluidId, IFluidDrinkHandler fluidDrinkHandler) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
Method reg = registry.getMethod("registerFluidDrinkHandler", int.class, IFluidDrinkHandler.class);
|
||||||
Method reg = registry.getMethod("registerLiquidDrinkHandler", int.class, ILiquidDrinkHandler.class);
|
reg.invoke(registry, fluidId, fluidDrinkHandler);
|
||||||
reg.invoke(registry, liquidId, liquidDrinkHandler);
|
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,19 +290,14 @@ public class FarmingRegistry
|
||||||
* @param weight Likelihood that this item will be produced. Lower means rarer.
|
* @param weight Likelihood that this item will be produced. Lower means rarer.
|
||||||
* @param drop The thing being produced by the laser drill.
|
* @param drop The thing being produced by the laser drill.
|
||||||
*/
|
*/
|
||||||
public static void registerLaserOre(int weight, ItemStack drop)
|
public static void registerLaserOre(int weight, ItemStack drop) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerLaserOre", int.class, ItemStack.class);
|
Method reg = registry.getMethod("registerLaserOre", int.class, ItemStack.class);
|
||||||
reg.invoke(registry, weight, drop);
|
reg.invoke(registry, weight, drop);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -356,23 +307,21 @@ public class FarmingRegistry
|
||||||
* Note that this will overwrite existing ore preferences - you may want to coordinate with PC before using this one.
|
* Note that this will overwrite existing ore preferences - you may want to coordinate with PC before using this one.
|
||||||
* Used by MFR itself for vanilla: Black (Coal), Light Blue (Diamond), Lime (Emerald), Yellow (Gold), Brown (Iron), Blue (Lapis),
|
* Used by MFR itself for vanilla: Black (Coal), Light Blue (Diamond), Lime (Emerald), Yellow (Gold), Brown (Iron), Blue (Lapis),
|
||||||
* Red (Redstone), and White (nether quartz).
|
* Red (Redstone), and White (nether quartz).
|
||||||
|
* <p/>
|
||||||
|
* In 2.7 this will be replaced by addLaserPreferredOre, because it'll no longer overwrite existing ore preferences.
|
||||||
*
|
*
|
||||||
* @param color The color that the preferred ore is being set for. White is 0.
|
* @param color The color that the preferred ore is being set for. White is 0.
|
||||||
* @param ore The ore that will be preferred by the drill when a focus with the specified color is present.
|
* @param ore The ore that will be preferred by the drill when a focus with the specified color is present.
|
||||||
*/
|
*/
|
||||||
public static void setLaserPreferredOre(int color, ItemStack ore)
|
@Deprecated
|
||||||
{
|
public static void setLaserPreferredOre(int color, ItemStack ore) {
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("setLaserPreferredOre", int.class, ItemStack.class);
|
Method reg = registry.getMethod("setLaserPreferredOre", int.class, ItemStack.class);
|
||||||
reg.invoke(registry, color, ore);
|
reg.invoke(registry, color, ore);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,19 +332,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param fruitLogBlockId The block ID to mark as a fruit tree log.
|
* @param fruitLogBlockId The block ID to mark as a fruit tree log.
|
||||||
*/
|
*/
|
||||||
public static void registerFruitLogBlockId(Integer fruitLogBlockId)
|
public static void registerFruitLogBlockId(Integer fruitLogBlockId) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerFruitLogBlockId", Integer.class);
|
Method reg = registry.getMethod("registerFruitLogBlockId", Integer.class);
|
||||||
reg.invoke(registry, fruitLogBlockId);
|
reg.invoke(registry, fruitLogBlockId);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,19 +349,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param fruit The fruit to be picked.
|
* @param fruit The fruit to be picked.
|
||||||
*/
|
*/
|
||||||
public static void registerFruit(IFactoryFruit fruit)
|
public static void registerFruit(IFactoryFruit fruit) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerFruit", IFactoryFruit.class);
|
Method reg = registry.getMethod("registerFruit", IFactoryFruit.class);
|
||||||
reg.invoke(registry, fruit);
|
reg.invoke(registry, fruit);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -428,19 +367,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param entityString The entity string to blacklist.
|
* @param entityString The entity string to blacklist.
|
||||||
*/
|
*/
|
||||||
public static void registerAutoSpawnerBlacklist(String entityString)
|
public static void registerAutoSpawnerBlacklist(String entityString) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerAutoSpawnerBlacklist", String.class);
|
Method reg = registry.getMethod("registerAutoSpawnerBlacklist", String.class);
|
||||||
reg.invoke(registry, entityString);
|
reg.invoke(registry, entityString);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -450,19 +384,14 @@ public class FarmingRegistry
|
||||||
*
|
*
|
||||||
* @param circuit The circuit to be registered.
|
* @param circuit The circuit to be registered.
|
||||||
*/
|
*/
|
||||||
public static void registerRedNetLogicCircuit(IRedNetLogicCircuit circuit)
|
public static void registerRedNetLogicCircuit(IRedNetLogicCircuit circuit) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
Class<?> registry = Class.forName("powercrystals.minefactoryreloaded.MFRRegistry");
|
||||||
if(registry != null)
|
if (registry != null) {
|
||||||
{
|
|
||||||
Method reg = registry.getMethod("registerRedNetLogicCircuit", IRedNetLogicCircuit.class);
|
Method reg = registry.getMethod("registerRedNetLogicCircuit", IRedNetLogicCircuit.class);
|
||||||
reg.invoke(registry, circuit);
|
reg.invoke(registry, circuit);
|
||||||
}
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,11 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Determines what kind of action a given fertilizer can perform. Your IFactoryFertilizable instances should check this before
|
* Determines what kind of action a given fertilizer can perform. Your IFactoryFertilizable instances should check this before
|
||||||
* performing any action to maintain future compatibility.
|
* performing any action to maintain future compatibility.
|
||||||
*/
|
*/
|
||||||
public enum FertilizerType
|
public enum FertilizerType {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The fertilizer will fertilize grass.
|
* The fertilizer will fertilize grass.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,11 +2,10 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Determines what algorithm the Harvester uses when it encounters this IFactoryHarvestable in the world.
|
* Determines what algorithm the Harvester uses when it encounters this IFactoryHarvestable in the world.
|
||||||
*/
|
*/
|
||||||
public enum HarvestType
|
public enum HarvestType {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Just break the single block - no special action needed. Carrots, flowers, etc.
|
* Just break the single block - no special action needed. Carrots, flowers, etc.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,8 +2,7 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public interface IDeepStorageUnit
|
public interface IDeepStorageUnit {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return A populated ItemStack with stackSize for the full amount of materials in the DSU. May have a stackSize > getMaxStackSize().
|
* @return A populated ItemStack with stackSize for the full amount of materials in the DSU. May have a stackSize > getMaxStackSize().
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a fertilizable block, and the process to fertilize it. You can assume that you will never have to check that block ID matches the one returned by
|
* Defines a fertilizable block, and the process to fertilize it. You can assume that you will never have to check that block ID matches the one returned by
|
||||||
* getFertilizableBlockId().
|
* getFertilizableBlockId().
|
||||||
*/
|
*/
|
||||||
public interface IFactoryFertilizable
|
public interface IFactoryFertilizable {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The block ID this instance is managing.
|
* @return The block ID this instance is managing.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,11 +4,10 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a fertilizer item for use in the Fertilizer.
|
* Defines a fertilizer item for use in the Fertilizer.
|
||||||
*/
|
*/
|
||||||
public interface IFactoryFertilizer
|
public interface IFactoryFertilizer {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The ID of this fertilizer item.
|
* @return The ID of this fertilizer item.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a fruit entry for the Fruit Picker.
|
* Defines a fruit entry for the Fruit Picker.
|
||||||
*
|
*
|
||||||
* @author powercrystals
|
* @author powercrystals
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface IFactoryFruit
|
public interface IFactoryFruit {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The block ID this fruit has in the world.
|
* @return The block ID this fruit has in the world.
|
||||||
*/
|
*/
|
||||||
|
@ -21,6 +19,7 @@ public interface IFactoryFruit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to determine if this fruit can be picked (is it ripe yet, etc)
|
* 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 world The world where the fruit is being picked
|
||||||
* @param x The x-coordinate of the fruit
|
* @param x The x-coordinate of the fruit
|
||||||
* @param y The y-coordinate of the fruit
|
* @param y The y-coordinate of the fruit
|
||||||
|
@ -32,6 +31,7 @@ public interface IFactoryFruit
|
||||||
/**
|
/**
|
||||||
* Called by the Fruit Picker to determine what block to replace the picked block with. Only ID and meta/damage will be used.
|
* Called by the Fruit Picker to determine what block to replace the picked block with. Only ID and meta/damage will be used.
|
||||||
* At the time this method is called, the fruit still exists. Do not pass an item ID as the return value.
|
* At the time this method is called, the fruit still exists. Do not pass an item ID as the return value.
|
||||||
|
*
|
||||||
* @param world The world where the fruit is being picked
|
* @param world The world where the fruit is being picked
|
||||||
* @param x The x-coordinate of the fruit
|
* @param x The x-coordinate of the fruit
|
||||||
* @param y The y-coordinate of the fruit
|
* @param y The y-coordinate of the fruit
|
||||||
|
@ -42,6 +42,7 @@ public interface IFactoryFruit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the Fruit Picker before the fruit is picked.
|
* Called by the Fruit Picker before the fruit is picked.
|
||||||
|
*
|
||||||
* @param world The world where the fruit is being picked
|
* @param world The world where the fruit is being picked
|
||||||
* @param x The x-coordinate of the fruit
|
* @param x The x-coordinate of the fruit
|
||||||
* @param y The y-coordinate of the fruit
|
* @param y The y-coordinate of the fruit
|
||||||
|
@ -51,6 +52,7 @@ public interface IFactoryFruit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the Fruit Picker to determine what drops to generate. At the time this method is called, the fruit still exists.
|
* 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 world The world where the fruit is being picked
|
||||||
* @param x The x-coordinate of the fruit
|
* @param x The x-coordinate of the fruit
|
||||||
* @param y The y-coordinate of the fruit
|
* @param y The y-coordinate of the fruit
|
||||||
|
@ -60,6 +62,7 @@ public interface IFactoryFruit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by the Fruit Picker after the fruit is picked.
|
* Called by the Fruit Picker after the fruit is picked.
|
||||||
|
*
|
||||||
* @param world The world where the fruit is being picked
|
* @param world The world where the fruit is being picked
|
||||||
* @param x The x-coordinate of the fruit
|
* @param x The x-coordinate of the fruit
|
||||||
* @param y The y-coordinate of the fruit
|
* @param y The y-coordinate of the fruit
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a grindable entity for the Grinder.
|
* Defines a grindable entity for the Grinder.
|
||||||
*/
|
*/
|
||||||
public interface IFactoryGrindable
|
@Deprecated
|
||||||
{
|
public interface IFactoryGrindable {
|
||||||
/**
|
/**
|
||||||
* @return The class that this grindable instance is handling. This must be a subtype of EntityLiving or the entity will never
|
* @return The class that this grindable instance is handling. This must be a subtype of EntityLiving or the entity will never
|
||||||
* be noticed by the Grinder.
|
* be noticed by the Grinder.
|
||||||
|
@ -26,4 +26,5 @@ public interface IFactoryGrindable
|
||||||
* @return The drops generated when this entity is killed.
|
* @return The drops generated when this entity is killed.
|
||||||
*/
|
*/
|
||||||
public List<MobDrop> grind(World world, EntityLiving entity, Random random);
|
public List<MobDrop> grind(World world, EntityLiving entity, Random random);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
37
apis/powercrystals/minefactoryreloaded/api/IFactoryGrindable2.java
Executable file
37
apis/powercrystals/minefactoryreloaded/api/IFactoryGrindable2.java
Executable file
|
@ -0,0 +1,37 @@
|
||||||
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author PowerCrystals
|
||||||
|
* <p/>
|
||||||
|
* Defines a grindable entity for the Grinder.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public interface IFactoryGrindable2 extends IFactoryGrindable {
|
||||||
|
/**
|
||||||
|
* @return The class that this grindable instance is handling. This must be a subtype of EntityLiving or the entity will never
|
||||||
|
* be noticed by the Grinder.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Class<?> getGrindableEntity();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param world The world this entity is in.
|
||||||
|
* @param entity The entity instance being ground.
|
||||||
|
* @param random A Random instance.
|
||||||
|
* @return The drops generated when this entity is killed.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<MobDrop> grind(World world, EntityLiving entity, Random random);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param entity The entity instance being ground.
|
||||||
|
* @return Whether this entity has been fully processed or not.
|
||||||
|
*/
|
||||||
|
public boolean processEntity(EntityLiving entity);
|
||||||
|
}
|
|
@ -1,19 +1,18 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a harvestable block for the Harvester.
|
* Defines a harvestable block for the Harvester.
|
||||||
*/
|
*/
|
||||||
public interface IFactoryHarvestable
|
public interface IFactoryHarvestable {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The block ID this harvestable instance is managing.
|
* @return The block ID this harvestable instance is managing.
|
||||||
*/
|
*/
|
||||||
|
@ -53,6 +52,7 @@ public interface IFactoryHarvestable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before the block is going to be harvested. Usually empty.
|
* Called before the block is going to be harvested. Usually empty.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x The X coordinate of the block being harvested.
|
* @param x The X coordinate of the block being harvested.
|
||||||
* @param y The Y coordinate of the block being harvested.
|
* @param y The Y coordinate of the block being harvested.
|
||||||
|
@ -62,6 +62,7 @@ public interface IFactoryHarvestable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after the block is going to be harvested. Used to re-till soil, for example.
|
* 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 world The world this block is in.
|
||||||
* @param x The X coordinate of the block being harvested.
|
* @param x The X coordinate of the block being harvested.
|
||||||
* @param y The Y coordinate of the block being harvested.
|
* @param y The Y coordinate of the block being harvested.
|
||||||
|
|
|
@ -5,11 +5,10 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a plantable object for use in the Planter.
|
* Defines a plantable object for use in the Planter.
|
||||||
*/
|
*/
|
||||||
public interface IFactoryPlantable
|
public interface IFactoryPlantable {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The block or item ID this plantable is managing.
|
* @return The block or item ID this plantable is managing.
|
||||||
*/
|
*/
|
||||||
|
@ -47,6 +46,7 @@ public interface IFactoryPlantable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called before planting is performed. Used to till soil, for example.
|
* 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 world The world instance this block or item will be placed into.
|
||||||
* @param x The destination X coordinate.
|
* @param x The destination X coordinate.
|
||||||
* @param y The destination Y coordinate.
|
* @param y The destination Y coordinate.
|
||||||
|
@ -57,6 +57,7 @@ public interface IFactoryPlantable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after planting is performed. Usually empty.
|
* Called after planting is performed. Usually empty.
|
||||||
|
*
|
||||||
* @param world The world instance this block or item will be placed into.
|
* @param world The world instance this block or item will be placed into.
|
||||||
* @param x The destination X coordinate.
|
* @param x The destination X coordinate.
|
||||||
* @param y The destination Y coordinate.
|
* @param y The destination Y coordinate.
|
||||||
|
|
|
@ -1,23 +1,22 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a ranchable entity for use in the Rancher.
|
* Defines a ranchable entity for use in the Rancher.
|
||||||
*/
|
*/
|
||||||
public interface IFactoryRanchable
|
public interface IFactoryRanchable {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The entity being ranched. Must be a subtype of EntityLiving.
|
* @return The entity being ranched. Must be a subtype of EntityLiving.
|
||||||
*/
|
*/
|
||||||
public Class<?> getRanchableEntity();
|
public Class<? extends EntityLiving> getRanchableEntity();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param world The world this entity is in.
|
* @param world The world this entity is in.
|
||||||
|
|
|
@ -2,7 +2,6 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
public interface ILiquidDrinkHandler
|
public interface IFluidDrinkHandler {
|
||||||
{
|
|
||||||
public void onDrink(EntityPlayer player);
|
public void onDrink(EntityPlayer player);
|
||||||
}
|
}
|
|
@ -5,11 +5,10 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a class that MFR will use to local egg info for a given mob. This is used to color the Safari Net based on the captured mob.
|
* Defines a class that MFR will use to local egg info for a given mob. This is used to color the Safari Net based on the captured mob.
|
||||||
*/
|
*/
|
||||||
public interface IMobEggHandler
|
public interface IMobEggHandler {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @param safariNet The Safari Net that is looking for egg info.
|
* @param safariNet The Safari Net that is looking for egg info.
|
||||||
* @return An EntityEggInfo, or null if this instance cannot handle this mob.
|
* @return An EntityEggInfo, or null if this instance cannot handle this mob.
|
||||||
|
|
13
apis/powercrystals/minefactoryreloaded/api/INeedleAmmo.java
Executable file
13
apis/powercrystals/minefactoryreloaded/api/INeedleAmmo.java
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public interface INeedleAmmo {
|
||||||
|
public boolean onHitEntity(EntityPlayer owner, Entity hit, double distance);
|
||||||
|
|
||||||
|
public void onHitBlock(EntityPlayer owner, World world, int x, int y, int z, int side, double distance);
|
||||||
|
|
||||||
|
public float getSpread();
|
||||||
|
}
|
|
@ -1,11 +1,10 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface IRandomMobProvider
|
|
||||||
{
|
public interface IRandomMobProvider {
|
||||||
public List<RandomMob> getRandomMobs(World world);
|
public List<RandomMob> getRandomMobs(World world);
|
||||||
}
|
}
|
|
@ -1,17 +1,16 @@
|
||||||
package powercrystals.minefactoryreloaded.api;
|
package powercrystals.minefactoryreloaded.api;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines an object that can display information about a captured mob in a Safari net.
|
* Defines an object that can display information about a captured mob in a Safari net.
|
||||||
*/
|
*/
|
||||||
public interface ISafariNetHandler
|
public interface ISafariNetHandler {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @return The class of mob that this handler applies to.
|
* @return The class of mob that this handler applies to.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,13 +6,15 @@ import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* Defines a syringe for use in the Vet machine.
|
* Defines a syringe for use in the Vet machine.
|
||||||
*/
|
*/
|
||||||
public interface ISyringe
|
public interface ISyringe {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Called when the vet is deciding if it should use this syringe.
|
* Called when the vet is deciding if it should use this syringe.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
* @param world The world instance.
|
* @param world The world instance.
|
||||||
* @param entity The entity being injected.
|
* @param entity The entity being injected.
|
||||||
* @param syringe The syringe ItemStack.
|
* @param syringe The syringe ItemStack.
|
||||||
|
@ -22,6 +24,9 @@ public interface ISyringe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called to perform an injection.
|
* Called to perform an injection.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
* @param world The world instance.
|
* @param world The world instance.
|
||||||
* @param entity The entity being injected.
|
* @param entity The entity being injected.
|
||||||
* @param syringe The syringe ItemStack.
|
* @param syringe The syringe ItemStack.
|
||||||
|
|
|
@ -4,6 +4,5 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
* Defines a tool that can rotate MFR machines. Implement on an Item class. Requires no additional work on your part.
|
* Defines a tool that can rotate MFR machines. Implement on an Item class. Requires no additional work on your part.
|
||||||
*/
|
*/
|
||||||
public interface IToolHammer
|
public interface IToolHammer {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,12 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author PowerCrystals
|
* @author PowerCrystals
|
||||||
*
|
* <p/>
|
||||||
* This interface is like IToolHammer, but is for items that change state on a per-stack basis. Implement this
|
* This interface is like IToolHammer, but is for items that change state on a per-stack basis. Implement this
|
||||||
* instead of IToolHammer - not both!
|
* instead of IToolHammer - not both!
|
||||||
*
|
* <p/>
|
||||||
* This interface will replace IToolHammer in MC 1.6.
|
* This interface will replace IToolHammer in MC 1.6.
|
||||||
*/
|
*/
|
||||||
public interface IToolHammerAdvanced
|
public interface IToolHammerAdvanced {
|
||||||
{
|
|
||||||
public boolean isActive(ItemStack stack);
|
public boolean isActive(ItemStack stack);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,15 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.WeightedRandomItem;
|
import net.minecraft.util.WeightedRandomItem;
|
||||||
|
|
||||||
public class MobDrop extends WeightedRandomItem
|
public class MobDrop extends WeightedRandomItem {
|
||||||
{
|
|
||||||
private ItemStack _stack;
|
private ItemStack _stack;
|
||||||
|
|
||||||
public MobDrop(int weight, ItemStack stack)
|
public MobDrop(int weight, ItemStack stack) {
|
||||||
{
|
|
||||||
super(weight);
|
super(weight);
|
||||||
_stack = stack;
|
_stack = stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getStack()
|
public ItemStack getStack() {
|
||||||
{
|
|
||||||
if (_stack == null) return null;
|
if (_stack == null) return null;
|
||||||
return _stack.copy();
|
return _stack.copy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,15 @@ package powercrystals.minefactoryreloaded.api;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.WeightedRandomItem;
|
import net.minecraft.util.WeightedRandomItem;
|
||||||
|
|
||||||
public class RandomMob extends WeightedRandomItem
|
public class RandomMob extends WeightedRandomItem {
|
||||||
{
|
|
||||||
private Entity _mob;
|
private Entity _mob;
|
||||||
|
|
||||||
public RandomMob(Entity savedMob, int weight)
|
public RandomMob(Entity savedMob, int weight) {
|
||||||
{
|
|
||||||
super(weight);
|
super(weight);
|
||||||
_mob = savedMob;
|
_mob = savedMob;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Entity getMob()
|
public Entity getMob() {
|
||||||
{
|
|
||||||
if (_mob == null) return null;
|
if (_mob == null) return null;
|
||||||
return _mob;
|
return _mob;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a Block that can connect to RedNet wires. This must be implemented on your Block class.
|
* Defines a Block that can connect to RedNet cables. This must be implemented on your Block class.
|
||||||
* Note that when you implement this, the RedNet network makes several assumptions about your code -
|
* Note that when you implement this, the RedNet network makes several assumptions about your code -
|
||||||
* primarily, it will not clamp values to 0 <= x <= 15. This means you must be able to accept any
|
* primarily, it will not clamp values to 0 <= x <= 15. This means you must be able to accept any
|
||||||
* possible integer without crashing, even negatives. It will also assume that calling the onInput(s)Changed()
|
* possible integer without crashing, even negatives. It will also assume that calling the onInput(s)Changed()
|
||||||
|
@ -12,14 +12,20 @@ import net.minecraftforge.common.ForgeDirection;
|
||||||
* output methods in All mode, and will only query the methods contained in this interface in that case. In Single
|
* output methods in All mode, and will only query the methods contained in this interface in that case. In Single
|
||||||
* mode, it will call onInputChanged, and will check for strong power (or weak if in Plate mode) through the vanilla
|
* mode, it will call onInputChanged, and will check for strong power (or weak if in Plate mode) through the vanilla
|
||||||
* method calls.
|
* method calls.
|
||||||
|
* <p/>
|
||||||
|
* RedNet cables have their subnets indicated to the user by colored bands on the cable.
|
||||||
|
* The color of a given subnet is the same as the wool with metadata equal to the subnet number.
|
||||||
|
* For reference:
|
||||||
|
* 0:White, 1:Orange, 2:Magenta, 3:LightBlue, 4:Yellow, 5:Lime, 6:Pink, 7:Gray,
|
||||||
|
* 8:LightGray, 9:Cyan, 10:Purple, 11:Blue, 12:Brown, 13:Green, 14:Red, 15:Black
|
||||||
*/
|
*/
|
||||||
public interface IConnectableRedNet
|
public interface IConnectableRedNet {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Returns the connection type of this Block. "All" types will cause getOutputValues() and onInputsChanged() to be used,
|
* Returns the connection type of this Block. "All" types will cause getOutputValues() and onInputsChanged() to be used,
|
||||||
* whereas "Single" types will onInputChanged() to be called for input changes and the normal redstone power output methods
|
* whereas "Single" types will onInputChanged() to be called for input changes and the normal redstone power output methods
|
||||||
* to be called for output. If this value must be changed while the block is alive, it must perform a block update on any
|
* to be called for output. If this value must be changed while the block is alive, it must perform a block update on any
|
||||||
* adjacent RedNet wires.
|
* adjacent RedNet wires.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x This block's X coordinate.
|
* @param x This block's X coordinate.
|
||||||
* @param y This block's Y coordinate.
|
* @param y This block's Y coordinate.
|
||||||
|
@ -31,6 +37,7 @@ public interface IConnectableRedNet
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the output values of this RedNet node. This array must be 16 elements long. Only called if your block is connected in "All" mode.
|
* Returns the output values of this RedNet node. This array must be 16 elements long. Only called if your block is connected in "All" mode.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x This block's X coordinate.
|
* @param x This block's X coordinate.
|
||||||
* @param y This block's Y coordinate.
|
* @param y This block's Y coordinate.
|
||||||
|
@ -42,6 +49,7 @@ public interface IConnectableRedNet
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the output value of this RedNet node for a given subnet. Only called if your block is connected in "All" mode.
|
* Returns the output value of this RedNet node for a given subnet. Only called if your block is connected in "All" mode.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x This block's X coordinate.
|
* @param x This block's X coordinate.
|
||||||
* @param y This block's Y coordinate.
|
* @param y This block's Y coordinate.
|
||||||
|
@ -56,6 +64,7 @@ public interface IConnectableRedNet
|
||||||
* Called when the input values to this block change. Only called if your block is connected in "All" mode.
|
* Called when the input values to this block change. Only called if your block is connected in "All" mode.
|
||||||
* Do not issue a network value update from inside this method call; it will be ignored. Issue your updates
|
* Do not issue a network value update from inside this method call; it will be ignored. Issue your updates
|
||||||
* on the next tick.
|
* on the next tick.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x This block's X coordinate.
|
* @param x This block's X coordinate.
|
||||||
* @param y This block's Y coordinate.
|
* @param y This block's Y coordinate.
|
||||||
|
@ -69,6 +78,7 @@ public interface IConnectableRedNet
|
||||||
* Called when the input value to this block changes. Only called if your block is connected in "Single" mode.
|
* Called when the input value to this block changes. Only called if your block is connected in "Single" mode.
|
||||||
* Do not issue a network value update from inside this method call; it will be ignored. Issue your updates
|
* Do not issue a network value update from inside this method call; it will be ignored. Issue your updates
|
||||||
* on the next tick.
|
* on the next tick.
|
||||||
|
*
|
||||||
* @param world The world this block is in.
|
* @param world The world this block is in.
|
||||||
* @param x This block's X coordinate.
|
* @param x This block's X coordinate.
|
||||||
* @param y This block's Y coordinate.
|
* @param y This block's Y coordinate.
|
||||||
|
|
|
@ -2,8 +2,7 @@ package powercrystals.minefactoryreloaded.api.rednet;
|
||||||
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
public interface IRedNetLogicCircuit
|
public interface IRedNetLogicCircuit {
|
||||||
{
|
|
||||||
public int getInputCount();
|
public int getInputCount();
|
||||||
|
|
||||||
public int getOutputCount();
|
public int getOutputCount();
|
||||||
|
@ -11,9 +10,12 @@ public interface IRedNetLogicCircuit
|
||||||
public int[] recalculateOutputValues(long worldTime, int[] inputValues);
|
public int[] recalculateOutputValues(long worldTime, int[] inputValues);
|
||||||
|
|
||||||
public String getUnlocalizedName();
|
public String getUnlocalizedName();
|
||||||
|
|
||||||
public String getInputPinLabel(int pin);
|
public String getInputPinLabel(int pin);
|
||||||
|
|
||||||
public String getOutputPinLabel(int pin);
|
public String getOutputPinLabel(int pin);
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound tag);
|
public void readFromNBT(NBTTagCompound tag);
|
||||||
|
|
||||||
public void writeToNBT(NBTTagCompound tag);
|
public void writeToNBT(NBTTagCompound tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,13 @@ package powercrystals.minefactoryreloaded.api.rednet;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* You should not implement this yourself. Instead, use this to look for cables to notify from your IConnectableRedNet as this does not
|
* You should not implement this yourself. Instead, use this to look for cables to notify from your IConnectableRedNet as this does not
|
||||||
* require a block update. This will be implemented on the cable's Block class.
|
* require a block update. This will be implemented on the cable's Block class.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public interface IRedNetNetworkContainer
|
public interface IRedNetNetworkContainer {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Tells the network to recalculate all subnets.
|
* Tells the network to recalculate all subnets.
|
||||||
|
*
|
||||||
* @param world The world this cable is in.
|
* @param world The world this cable is in.
|
||||||
* @param x The x-coordinate of this cable.
|
* @param x The x-coordinate of this cable.
|
||||||
* @param x The y-coordinate of this cable.
|
* @param x The y-coordinate of this cable.
|
||||||
|
@ -21,6 +19,7 @@ public interface IRedNetNetworkContainer
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells the network to recalculate a specific subnet.
|
* Tells the network to recalculate a specific subnet.
|
||||||
|
*
|
||||||
* @param world The world this cable is in.
|
* @param world The world this cable is in.
|
||||||
* @param x The x-coordinate of this cable.
|
* @param x The x-coordinate of this cable.
|
||||||
* @param x The y-coordinate of this cable.
|
* @param x The y-coordinate of this cable.
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package powercrystals.minefactoryreloaded.api.rednet;
|
||||||
|
|
||||||
|
public interface IRedNetNoConnection {
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package powercrystals.minefactoryreloaded.api.rednet;
|
package powercrystals.minefactoryreloaded.api.rednet;
|
||||||
|
|
||||||
public enum RedNetConnectionType
|
public enum RedNetConnectionType {
|
||||||
{
|
|
||||||
None,
|
None,
|
||||||
CableSingle,
|
CableSingle,
|
||||||
PlateSingle,
|
PlateSingle,
|
||||||
|
|
Loading…
Reference in a new issue