mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-10-25 20:22:32 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
1cbe6e860c
commit
202b7ce27a
790 files changed
+11316
-9692
No files matched your search
@@ -6,8 +6,8 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT THIS CLASS YOURSELF! Use PneumaticRegistry.getInstance().getHeatExchangerLogic() !
|
||||
* @author MineMaarten
|
||||
* www.minemaarten.com
|
||||
*
|
||||
* @author MineMaarten www.minemaarten.com
|
||||
*/
|
||||
public interface IHeatExchangerLogic {
|
||||
|
||||
@@ -17,22 +17,26 @@ public interface IHeatExchangerLogic {
|
||||
public void update();
|
||||
|
||||
/**
|
||||
* When called (preferably on tile entity load and neighbor block/tile entity change) this will add all IHeatExchanger neighbor TileEntities as connected heat exchangers.
|
||||
* It will also take care of blocks like Lava.
|
||||
* When called (preferably on tile entity load and neighbor block/tile entity change) this will add all
|
||||
* IHeatExchanger neighbor TileEntities as connected heat exchangers. It will also take care of blocks like Lava.
|
||||
*
|
||||
* You don't _have_ to call this method, if this heat exchanger is not connected to the outside world (for example the heat of the liquid
|
||||
* plastic in the Plastic Mixer).
|
||||
* You don't _have_ to call this method, if this heat exchanger is not connected to the outside world (for example
|
||||
* the heat of the liquid plastic in the Plastic Mixer).
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param validSides Can be left out as vararg, meaning every side can be connected. When one or more sides are specified this will constrain
|
||||
* this heat exchanger to only connect to other heat exchangers on these sides.
|
||||
* @param validSides Can be left out as vararg, meaning every side can be connected. When one or more sides are
|
||||
* specified this will constrain this heat exchanger to only connect to other heat exchangers on
|
||||
* these sides.
|
||||
*/
|
||||
public void initializeAsHull(World world, int x, int y, int z, ForgeDirection... validSides);
|
||||
|
||||
/**
|
||||
* When called, this will connect these two heat exchangers. You should only call this on one of the two heat exchangers.
|
||||
* When called, this will connect these two heat exchangers. You should only call this on one of the two heat
|
||||
* exchangers.
|
||||
*
|
||||
* @param exchanger
|
||||
*/
|
||||
public void addConnectedExchanger(IHeatExchangerLogic exchanger);
|
||||
@@ -41,6 +45,7 @@ public interface IHeatExchangerLogic {
|
||||
|
||||
/**
|
||||
* A heat exchanger starts with 295 degrees Kelvin (20 degrees Celcius) by default.
|
||||
*
|
||||
* @param temperature in degrees Kelvin
|
||||
*/
|
||||
public void setTemperature(double temperature);
|
||||
@@ -49,6 +54,7 @@ public interface IHeatExchangerLogic {
|
||||
|
||||
/**
|
||||
* The higher the thermal resistance, the slower the heat disperses.
|
||||
*
|
||||
* @param thermalResistance By default it's 1.
|
||||
*/
|
||||
public void setThermalResistance(double thermalResistance);
|
||||
@@ -56,8 +62,9 @@ public interface IHeatExchangerLogic {
|
||||
public double getThermalResistance();
|
||||
|
||||
/**
|
||||
* The higher the capacity, the more heat can be 'stored'. This means that an object with a high capacity can heat up an object with a lower
|
||||
* capacity without losing any significant amount of temperature.
|
||||
* The higher the capacity, the more heat can be 'stored'. This means that an object with a high capacity can heat
|
||||
* up an object with a lower capacity without losing any significant amount of temperature.
|
||||
*
|
||||
* @param capacity
|
||||
*/
|
||||
public void setThermalCapacity(double capacity);
|
||||
@@ -70,6 +77,7 @@ public interface IHeatExchangerLogic {
|
||||
|
||||
/**
|
||||
* Adds heat (= deltaT * Thermal Capacity) to this exchanger. negative values will remove heat.
|
||||
*
|
||||
* @param amount
|
||||
*/
|
||||
public void addHeat(double amount);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package pneumaticCraft.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
@@ -8,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import pneumaticCraft.api.client.pneumaticHelmet.IBlockTrackEntry;
|
||||
import pneumaticCraft.api.client.pneumaticHelmet.IEntityTrackEntry;
|
||||
import pneumaticCraft.api.client.pneumaticHelmet.IHackableBlock;
|
||||
@@ -20,8 +22,11 @@ import pneumaticCraft.api.item.IInventoryItem;
|
||||
* This class can be used to register and access various things to and from the mod.
|
||||
*/
|
||||
public class PneumaticRegistry {
|
||||
|
||||
/**
|
||||
* This field, which is initialized in PneumaticCraft's preInit, will give you access to various registration and access options.
|
||||
* This field, which is initialized in PneumaticCraft's preInit, will give you access to various registration and
|
||||
* access options.
|
||||
*
|
||||
* @deprecated This field isn't going to be removed, but it'll be marked private. use getInstance().
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -50,8 +55,10 @@ public class PneumaticRegistry {
|
||||
public void addHackable(Block block, Class<? extends IHackableBlock> iHackable);
|
||||
|
||||
/**
|
||||
* Returns a list of all current successful hacks of a given entity. This is used for example in Enderman hacking, so the user
|
||||
* can only hack an enderman once (more times wouldn't have any effect). This is mostly used for display purposes.
|
||||
* Returns a list of all current successful hacks of a given entity. This is used for example in Enderman
|
||||
* hacking, so the user can only hack an enderman once (more times wouldn't have any effect). This is mostly
|
||||
* used for display purposes.
|
||||
*
|
||||
* @param entity
|
||||
* @return empty list if no hacks.
|
||||
*/
|
||||
@@ -62,9 +69,11 @@ public class PneumaticRegistry {
|
||||
*/
|
||||
|
||||
/**
|
||||
* Normally drones will pathfind through any block that doesn't have any collisions (Block#getBlocksMovement returns true).
|
||||
* With this method you can register custom blocks to allow the drone to pathfind through them. If the block requires any special
|
||||
* handling, like allow pathfinding on certain conditions, you can pass a IPathFindHandler with the registry.
|
||||
* Normally drones will pathfind through any block that doesn't have any collisions (Block#getBlocksMovement
|
||||
* returns true). With this method you can register custom blocks to allow the drone to pathfind through them.
|
||||
* If the block requires any special handling, like allow pathfinding on certain conditions, you can pass a
|
||||
* IPathFindHandler with the registry.
|
||||
*
|
||||
* @param block
|
||||
* @param handler can be null, to always allow pathfinding through this block.
|
||||
*/
|
||||
@@ -73,23 +82,26 @@ public class PneumaticRegistry {
|
||||
/**
|
||||
* This will add a puzzle piece that has only a Area white- and blacklist parameter (similar to a GoTo piece).
|
||||
* It will do the specified behaviour. This can be used to create energy import/export widgets.
|
||||
*
|
||||
* @param interactor
|
||||
*/
|
||||
public void registerCustomBlockInteractor(ICustomBlockInteract interactor);
|
||||
|
||||
/**
|
||||
* Will spawn in a Drone a distance away from the given coordinate. The drone is programmed to travel to go to 5 blocks above the specified
|
||||
* y level, and drop the deliveredStacks. When there isn't a clear path for the items to fall these 5 blocks the Drone will deliver at a
|
||||
* y level above the specified y that _is_ clear. If no clear blocks can be found (when there are only solid blocks), the Drone will
|
||||
* drop the items very high up in the air instead, and drop them there.
|
||||
* Will spawn in a Drone a distance away from the given coordinate. The drone is programmed to travel to go to 5
|
||||
* blocks above the specified y level, and drop the deliveredStacks. When there isn't a clear path for the items
|
||||
* to fall these 5 blocks the Drone will deliver at a y level above the specified y that _is_ clear. If no clear
|
||||
* blocks can be found (when there are only solid blocks), the Drone will drop the items very high up in the air
|
||||
* instead, and drop them there.
|
||||
*
|
||||
* When the Drone is tried to be catched by a player (by wrenching it), the drone will only the drop the items that it was delivering (or
|
||||
* none if it dropped those items already). The Drone itself never will be dropped.
|
||||
* When the Drone is tried to be catched by a player (by wrenching it), the drone will only the drop the items
|
||||
* that it was delivering (or none if it dropped those items already). The Drone itself never will be dropped.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param deliveredStacks stacks that are delivered by the drone. When no stacks, or more than 65 stacks are given, this will generate a IllegalArgumentException.
|
||||
* @param deliveredStacks stacks that are delivered by the drone. When no stacks, or more than 65 stacks are
|
||||
* given, this will generate a IllegalArgumentException.
|
||||
* @return the drone. You can use this to set a custom name for example (defaults to "Amazon Delivery Drone").
|
||||
*/
|
||||
public EntityCreature deliverItemsAmazonStyle(World world, int x, int y, int z, ItemStack... deliveredStacks);
|
||||
@@ -99,6 +111,7 @@ public class PneumaticRegistry {
|
||||
*/
|
||||
/**
|
||||
* See {@link pneumaticCraft.api.item.IInventoryItem}
|
||||
*
|
||||
* @param handler
|
||||
*/
|
||||
public void registerInventoryItem(IInventoryItem handler);
|
||||
@@ -116,8 +129,10 @@ public class PneumaticRegistry {
|
||||
|
||||
/**
|
||||
* Adds a burnable liquid to the Liquid Compressor's available burnable fuels.
|
||||
*
|
||||
* @param fluid
|
||||
* @param mLPerBucket the amount of mL generated for 1000mB of the fuel. As comparison, one piece of coal generates 16000mL in an Air Compressor.
|
||||
* @param mLPerBucket the amount of mL generated for 1000mB of the fuel. As comparison, one piece of coal
|
||||
* generates 16000mL in an Air Compressor.
|
||||
*/
|
||||
public void registerFuel(Fluid fluid, int mLPerBucket);
|
||||
|
||||
@@ -126,31 +141,37 @@ public class PneumaticRegistry {
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the amount of Security Stations that disallow interaction with the given coordinate for the given player.
|
||||
* Usually you'd disallow interaction when this returns > 0.
|
||||
* Returns the amount of Security Stations that disallow interaction with the given coordinate for the given
|
||||
* player. Usually you'd disallow interaction when this returns > 0.
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param player
|
||||
* @param showRangeLines When true, any Security Station that prevents interaction will show the line grid (server --> client update is handled internally).
|
||||
* @return The amount of Security Stations that disallow interaction for the given player.
|
||||
* This method throws an IllegalArgumentException when tried to be called from the client side!
|
||||
* @param showRangeLines When true, any Security Station that prevents interaction will show the line grid
|
||||
* (server --> client update is handled internally).
|
||||
* @return The amount of Security Stations that disallow interaction for the given player. This method throws an
|
||||
* IllegalArgumentException when tried to be called from the client side!
|
||||
*/
|
||||
public int getProtectingSecurityStations(
|
||||
World world, int x, int y, int z, EntityPlayer player, boolean showRangeLines);
|
||||
public int getProtectingSecurityStations(World world, int x, int y, int z, EntityPlayer player,
|
||||
boolean showRangeLines);
|
||||
|
||||
/**
|
||||
* Use this to register ISimpleBlockRenderHandler render id's of full blocks, those of which should be able to be used for the Pneumatic Door Base camouflage.
|
||||
* Use this to register ISimpleBlockRenderHandler render id's of full blocks, those of which should be able to
|
||||
* be used for the Pneumatic Door Base camouflage.
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void registerConcealableRenderId(int id);
|
||||
|
||||
/**
|
||||
* Used to register a liquid that represents liquid XP (like MFR mob essence, OpenBlocks liquid XP).
|
||||
* This is used in the Aerial Interface to pump XP in/out of the player.
|
||||
* Used to register a liquid that represents liquid XP (like MFR mob essence, OpenBlocks liquid XP). This is
|
||||
* used in the Aerial Interface to pump XP in/out of the player.
|
||||
*
|
||||
* @param fluid
|
||||
* @param liquidToPointRatio The amount of liquid (in mB) used to get one XP point. In OpenBlocks this is 20 (mB/point).
|
||||
* @param liquidToPointRatio The amount of liquid (in mB) used to get one XP point. In OpenBlocks this is 20
|
||||
* (mB/point).
|
||||
*/
|
||||
public void registerXPLiquid(Fluid fluid, int liquidToPointRatio);
|
||||
}
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
package pneumaticCraft.api.actuator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface IActuator {
|
||||
|
||||
/**
|
||||
* Same as {@link pneumaticCraft.api.universalSensor.ISensorSetting#getSensorPath()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSensorPath();
|
||||
|
||||
/**
|
||||
* When returned true, the GUI will enable the textbox writing, otherwise not.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean needsTextBox();
|
||||
|
||||
/**
|
||||
* Should return the description of this sensor displayed in the GUI stat. Information should at least include
|
||||
* when this sensor emits redstone and how (analog (1 through 15), or digital).
|
||||
* Should return the description of this sensor displayed in the GUI stat. Information should at least include when
|
||||
* this sensor emits redstone and how (analog (1 through 15), or digital).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<String> getDescription();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package pneumaticCraft.api.block;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockSupplier {
|
||||
// private static Class blockClass;
|
||||
|
||||
@@ -12,66 +13,22 @@ public class BlockSupplier {
|
||||
*/
|
||||
public static Block getBlock(String blockName) {
|
||||
return GameRegistry.findBlock("PneumaticCraft", blockName);
|
||||
/*try {
|
||||
if(blockClass == null) blockClass = Class.forName("pneumaticCraft.common.block.Blockss");
|
||||
return (Block)blockClass.getField(blockName).get(null);
|
||||
} catch(Exception e) {
|
||||
System.err.println("[PneumaticCraft API] Block supply failed for block: " + blockName);
|
||||
return null;
|
||||
}*/
|
||||
/*
|
||||
* try { if(blockClass == null) blockClass = Class.forName("pneumaticCraft.common.block.Blockss"); return
|
||||
* (Block)blockClass.getField(blockName).get(null); } catch(Exception e) {
|
||||
* System.err.println("[PneumaticCraft API] Block supply failed for block: " + blockName); return null; }
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
The following is a list of all the block names that can be passed as argument in getBlock(String) to get a PneumaticCraft block.
|
||||
|
||||
|
||||
pressureTube meta = tube type
|
||||
airCompressor
|
||||
airCannon
|
||||
pressureChamberWall meta < 6 ? wall : window
|
||||
pressureChamberValve
|
||||
pressureChamberInterface
|
||||
squidPlant
|
||||
fireFlower
|
||||
creeperPlant
|
||||
slimePlant
|
||||
rainPlant
|
||||
enderPlant
|
||||
lightningPlant
|
||||
adrenalinePlant
|
||||
burstPlant
|
||||
potionPlant
|
||||
repulsionPlant
|
||||
heliumPlant
|
||||
flyingFlower
|
||||
musicPlant
|
||||
propulsionPlant
|
||||
chopperPlant
|
||||
chargingStation
|
||||
elevatorBase
|
||||
elevatorFrame
|
||||
vacuumPump
|
||||
pneumaticDoorBase
|
||||
pneumaticDoor
|
||||
assemblyPlatform
|
||||
assemblyIOUnit
|
||||
assemblyDrill
|
||||
assemblyLaser
|
||||
assemblyController
|
||||
advancedPressureTube meta = tube type (like 'pressureTube')
|
||||
compressedIron
|
||||
uvLightBox
|
||||
etchingAcid
|
||||
securityStation
|
||||
universalSensor
|
||||
pneumaticGenerator
|
||||
electricCompressor
|
||||
pneumaticEngine
|
||||
kineticCompressor
|
||||
aerialInterface
|
||||
electrostaticCompressor
|
||||
aphorismTile
|
||||
omnidirectionalHopper
|
||||
|
||||
*/
|
||||
* The following is a list of all the block names that can be passed as argument in getBlock(String) to get a
|
||||
* PneumaticCraft block. pressureTube meta = tube type airCompressor airCannon pressureChamberWall meta < 6 ? wall :
|
||||
* window pressureChamberValve pressureChamberInterface squidPlant fireFlower creeperPlant slimePlant rainPlant
|
||||
* enderPlant lightningPlant adrenalinePlant burstPlant potionPlant repulsionPlant heliumPlant flyingFlower
|
||||
* musicPlant propulsionPlant chopperPlant chargingStation elevatorBase elevatorFrame vacuumPump pneumaticDoorBase
|
||||
* pneumaticDoor assemblyPlatform assemblyIOUnit assemblyDrill assemblyLaser assemblyController advancedPressureTube
|
||||
* meta = tube type (like 'pressureTube') compressedIron uvLightBox etchingAcid securityStation universalSensor
|
||||
* pneumaticGenerator electricCompressor pneumaticEngine kineticCompressor aerialInterface electrostaticCompressor
|
||||
* aphorismTile omnidirectionalHopper
|
||||
*/
|
||||
}
|
||||
@@ -5,8 +5,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Should be implemented by any block that allows to be rotated by a Pneumatic Wrench. It uses almost the same
|
||||
* rotate method as the Vanilla (Forge) method. However it uses energy to rotate (when rotateBlock() return true).
|
||||
* Should be implemented by any block that allows to be rotated by a Pneumatic Wrench. It uses almost the same rotate
|
||||
* method as the Vanilla (Forge) method. However it uses energy to rotate (when rotateBlock() return true).
|
||||
*/
|
||||
public interface IPneumaticWrenchable {
|
||||
|
||||
|
||||
@@ -4,19 +4,21 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* With this class you can retrieve new instances of the PneumaticCraft's IGuiAnimatedStat implementation. You can use these in Gui's as
|
||||
* well as anywhere you like. When you use these in Gui's you need to pass a valid GuiScreen instance, if you don't you can just pass
|
||||
* null.
|
||||
* With this class you can retrieve new instances of the PneumaticCraft's IGuiAnimatedStat implementation. You can use
|
||||
* these in Gui's as well as anywhere you like. When you use these in Gui's you need to pass a valid GuiScreen instance,
|
||||
* if you don't you can just pass null.
|
||||
*/
|
||||
public class GuiAnimatedStatSupplier {
|
||||
|
||||
private static Class animatedStatClass;
|
||||
|
||||
public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, int backgroundColor) {
|
||||
return getAnimatedStat(new Class[] {GuiScreen.class, int.class}, gui, backgroundColor);
|
||||
return getAnimatedStat(new Class[] { GuiScreen.class, int.class }, gui, backgroundColor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a GuiAnimatedStat which uses an itemstack as static icon.
|
||||
*
|
||||
* @param gui
|
||||
* @param iconStack
|
||||
* @param backgroundColor
|
||||
@@ -24,27 +26,34 @@ public class GuiAnimatedStatSupplier {
|
||||
*/
|
||||
public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, ItemStack iconStack, int backgroundColor) {
|
||||
return getAnimatedStat(
|
||||
new Class[] {GuiScreen.class, int.class, ItemStack.class}, gui, backgroundColor, iconStack);
|
||||
new Class[] { GuiScreen.class, int.class, ItemStack.class },
|
||||
gui,
|
||||
backgroundColor,
|
||||
iconStack);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a GuiAnimatedStat which uses a texture location as static icon.
|
||||
*
|
||||
* @param gui
|
||||
* @param iconTexture / text
|
||||
* @param iconTexture / text
|
||||
* @param backgroundColor
|
||||
* @return
|
||||
*/
|
||||
public static IGuiAnimatedStat getAnimatedStat(GuiScreen gui, String iconTexture, int backgroundColor) {
|
||||
return getAnimatedStat(
|
||||
new Class[] {GuiScreen.class, int.class, String.class}, gui, backgroundColor, iconTexture);
|
||||
new Class[] { GuiScreen.class, int.class, String.class },
|
||||
gui,
|
||||
backgroundColor,
|
||||
iconTexture);
|
||||
}
|
||||
|
||||
private static IGuiAnimatedStat getAnimatedStat(Class[] constructorClasses, Object... constructorParameters) {
|
||||
try {
|
||||
if (animatedStatClass == null)
|
||||
animatedStatClass = Class.forName("pneumaticCraft.client.gui.widget.GuiAnimatedStat");
|
||||
return (IGuiAnimatedStat)
|
||||
animatedStatClass.getConstructor(constructorClasses).newInstance(constructorParameters);
|
||||
return (IGuiAnimatedStat) animatedStatClass.getConstructor(constructorClasses)
|
||||
.newInstance(constructorParameters);
|
||||
} catch (Exception e) {
|
||||
System.err.println("Failed to retrieve an GuiAnimatedStat instance from PneumaticCraft.");
|
||||
}
|
||||
|
||||
@@ -1,47 +1,43 @@
|
||||
package pneumaticCraft.api.client;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class GuiElementRenderer {
|
||||
|
||||
private static Method drawGaugeMethod;
|
||||
|
||||
/**
|
||||
* Draws a Pressure Gauge, the same which is also used in many PneumaticCraft applications.
|
||||
* @param fontRenderer fontrenderer used to draw the numbers of the pressure gauge.
|
||||
* @param minPressure The minimal pressure that needs to be displayed (this is -1 in most applications).
|
||||
* @param maxPressure The maximal pressure that needs to be rendererd (this is 7 for tier one machines, and 25 for tier two).
|
||||
* @param dangerPressure The transition pressure from green to red (this is 5 for tier one, and 29 for tier two machines).
|
||||
* @param minWorkingPressure The transition pressure from yellow to green (variates per machine).
|
||||
* @param currentPressure The pressure that the needle should point to.
|
||||
* @param xPos x position of the gauge.
|
||||
* @param yPos y position of the gauge.
|
||||
* @param zLevel z position of the gauge (Gui#zLevel, -90, for in normal GUI's).
|
||||
*
|
||||
* @param fontRenderer fontrenderer used to draw the numbers of the pressure gauge.
|
||||
* @param minPressure The minimal pressure that needs to be displayed (this is -1 in most applications).
|
||||
* @param maxPressure The maximal pressure that needs to be rendererd (this is 7 for tier one machines, and
|
||||
* 25 for tier two).
|
||||
* @param dangerPressure The transition pressure from green to red (this is 5 for tier one, and 29 for tier two
|
||||
* machines).
|
||||
* @param minWorkingPressure The transition pressure from yellow to green (variates per machine).
|
||||
* @param currentPressure The pressure that the needle should point to.
|
||||
* @param xPos x position of the gauge.
|
||||
* @param yPos y position of the gauge.
|
||||
* @param zLevel z position of the gauge (Gui#zLevel, -90, for in normal GUI's).
|
||||
*/
|
||||
public static void drawPressureGauge(
|
||||
FontRenderer fontRenderer,
|
||||
float minPressure,
|
||||
float maxPressure,
|
||||
float dangerPressure,
|
||||
float minWorkingPressure,
|
||||
float currentPressure,
|
||||
int xPos,
|
||||
int yPos,
|
||||
float zLevel) {
|
||||
public static void drawPressureGauge(FontRenderer fontRenderer, float minPressure, float maxPressure,
|
||||
float dangerPressure, float minWorkingPressure, float currentPressure, int xPos, int yPos, float zLevel) {
|
||||
try {
|
||||
if (drawGaugeMethod == null) {
|
||||
drawGaugeMethod = Class.forName("pneumaticCraft.client.gui.GuiUtils")
|
||||
.getMethod(
|
||||
"drawPressureGauge",
|
||||
FontRenderer.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
int.class,
|
||||
int.class,
|
||||
float.class);
|
||||
drawGaugeMethod = Class.forName("pneumaticCraft.client.gui.GuiUtils").getMethod(
|
||||
"drawPressureGauge",
|
||||
FontRenderer.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
float.class,
|
||||
int.class,
|
||||
int.class,
|
||||
float.class);
|
||||
}
|
||||
drawGaugeMethod.invoke(
|
||||
null,
|
||||
|
||||
@@ -4,62 +4,69 @@ import java.awt.Rectangle;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This interface doesn't have to be implemented. In PneumaticCraft there already is one class which implements this interface
|
||||
* which is used many times in PneumaticCraft (GUI stats, Pneumatic Helmet 2D and 3D stats). You can get an instance of this
|
||||
* class as well. Information about this you can find in GuiAnimatedStatSupplier.java. Implementing your own version of
|
||||
* animated stats can be implemented as well via this interface, and they will interact with the PneumaticCraft GuiAnimatedStats
|
||||
* if you implement it correctly.
|
||||
* This interface doesn't have to be implemented. In PneumaticCraft there already is one class which implements this
|
||||
* interface which is used many times in PneumaticCraft (GUI stats, Pneumatic Helmet 2D and 3D stats). You can get an
|
||||
* instance of this class as well. Information about this you can find in GuiAnimatedStatSupplier.java. Implementing
|
||||
* your own version of animated stats can be implemented as well via this interface, and they will interact with the
|
||||
* PneumaticCraft GuiAnimatedStats if you implement it correctly.
|
||||
*/
|
||||
public interface IGuiAnimatedStat {
|
||||
|
||||
/**
|
||||
* When you call this method with a set of coordinates representing the button location and dimensions, you'll get
|
||||
* these parameters back scaled to the GuiAnimatedStat's scale.
|
||||
* @param origX Button start X.
|
||||
* @param origY Button start Y.
|
||||
* @param width Button width.
|
||||
*
|
||||
* @param origX Button start X.
|
||||
* @param origY Button start Y.
|
||||
* @param width Button width.
|
||||
* @param height Button height.
|
||||
* @return rectangle containing the new location and dimensions.
|
||||
*/
|
||||
public Rectangle getButtonScaledRectangle(int origX, int origY, int width, int height);
|
||||
|
||||
/**
|
||||
* When passed 0.5F for example, the text of the stat will be half as big (so more text can fit into a certain area).
|
||||
* When passed 0.5F for example, the text of the stat will be half as big (so more text can fit into a certain
|
||||
* area).
|
||||
*
|
||||
* @param scale
|
||||
*/
|
||||
public void scaleTextSize(float scale);
|
||||
|
||||
/**
|
||||
* Returns true if the statistic expands to the left.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isLeftSided();
|
||||
|
||||
/**
|
||||
* Returns true if the statistic is done with expanding (when text will be displayed).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDoneExpanding();
|
||||
|
||||
/**
|
||||
* Pass true if the statistic should expand to the left, otherwise false.
|
||||
*
|
||||
* @param leftSided
|
||||
*/
|
||||
public void setLeftSided(boolean leftSided);
|
||||
|
||||
/**
|
||||
* Sets the main text of this stat. Every line should be stored in a seperate list element. Upon rendering,
|
||||
* EnumChatFormattings will be respected. When you call this method, Too long lines will be divided into multiple shorter ones
|
||||
* to fit in the GUI.
|
||||
* EnumChatFormattings will be respected. When you call this method, Too long lines will be divided into multiple
|
||||
* shorter ones to fit in the GUI.
|
||||
*
|
||||
* @param text
|
||||
* @return this, so you can chain calls.
|
||||
*/
|
||||
public IGuiAnimatedStat setText(List<String> text);
|
||||
|
||||
/**
|
||||
* Sets the line to a single line. Upon rendering,
|
||||
* EnumChatFormattings will be respected. When you call this method, Too long lines will be divided into multiple shorter ones
|
||||
* to fit in the GUI.
|
||||
* Sets the line to a single line. Upon rendering, EnumChatFormattings will be respected. When you call this method,
|
||||
* Too long lines will be divided into multiple shorter ones to fit in the GUI.
|
||||
*
|
||||
* @param text
|
||||
* @return this, so you can chain calls.
|
||||
*/
|
||||
@@ -68,26 +75,30 @@ public interface IGuiAnimatedStat {
|
||||
/**
|
||||
* Sets the main text of this stat. Every line should be stored in a seperate list element. Upon rendering,
|
||||
* EnumChatFormattings will be respected. This version of the text setting doesn't handle too long lines.
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
public void setTextWithoutCuttingString(List<String> text);
|
||||
|
||||
/**
|
||||
* Sets the title of this stat. It will automatically get the yellow color assigned.
|
||||
*
|
||||
* @param title
|
||||
*/
|
||||
public void setTitle(String title);
|
||||
|
||||
/**
|
||||
* Returns the title of this stat (obviously without color prefix).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getTitle();
|
||||
|
||||
/**
|
||||
* Defines what dimensions the stat should have when it is not expanded (default 17x17) and resets the stat to these dimensions.
|
||||
* Used in PneumaticCraft by the block/entity tracker stats, they are 0x0 when not expanded so it looks like they expand
|
||||
* (and appear) from nothing.
|
||||
* Defines what dimensions the stat should have when it is not expanded (default 17x17) and resets the stat to these
|
||||
* dimensions. Used in PneumaticCraft by the block/entity tracker stats, they are 0x0 when not expanded so it looks
|
||||
* like they expand (and appear) from nothing.
|
||||
*
|
||||
* @param minWidth
|
||||
* @param minHeight
|
||||
*/
|
||||
@@ -96,25 +107,29 @@ public interface IGuiAnimatedStat {
|
||||
/**
|
||||
* When this stat gets a parent stat assigned, the y of this stat will be the same as the parent's plus this stat's
|
||||
* baseY. This will cause this stat to move up and down when the parent's stat expands/moves.
|
||||
*
|
||||
* @param stat
|
||||
*/
|
||||
public void setParentStat(IGuiAnimatedStat stat);
|
||||
|
||||
/**
|
||||
* Sets the x location of this stat.
|
||||
*
|
||||
* @param x
|
||||
*/
|
||||
public void setBaseX(int x);
|
||||
|
||||
/**
|
||||
* Sets the base Y of this stat.
|
||||
*
|
||||
* @param y
|
||||
*/
|
||||
public void setBaseY(int y);
|
||||
|
||||
/**
|
||||
* Returns the real Y of this stat. This is the same as getBaseY when there is no parent stat, but if there is this method
|
||||
* returns the value described in setParentStat(IGuiAnimatedStat stat).
|
||||
* Returns the real Y of this stat. This is the same as getBaseY when there is no parent stat, but if there is this
|
||||
* method returns the value described in setParentStat(IGuiAnimatedStat stat).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getAffectedY();
|
||||
@@ -125,12 +140,14 @@ public interface IGuiAnimatedStat {
|
||||
|
||||
/**
|
||||
* Returns the Y size of this stat.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getHeight();
|
||||
|
||||
/**
|
||||
* Returns the X size of this stat.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getWidth();
|
||||
@@ -144,6 +161,7 @@ public interface IGuiAnimatedStat {
|
||||
|
||||
/**
|
||||
* Should be called every render tick when and where you want to render the stat.
|
||||
*
|
||||
* @param mouseX
|
||||
* @param mouseY
|
||||
* @param partialTicks
|
||||
@@ -152,6 +170,7 @@ public interface IGuiAnimatedStat {
|
||||
|
||||
/**
|
||||
* This method will handle mouse clicks. This will handle open/closing of the stat when the mouse clicks it.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param button
|
||||
@@ -171,6 +190,7 @@ public interface IGuiAnimatedStat {
|
||||
|
||||
/**
|
||||
* Returns true if the stat is expanding.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isClicked();
|
||||
|
||||
+18
-12
@@ -1,13 +1,14 @@
|
||||
package pneumaticCraft.api.client.assemblymachine;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AssemblyRenderOverriding {
|
||||
public static final HashMap<Integer, IAssemblyRenderOverriding> renderOverrides =
|
||||
new HashMap<Integer, IAssemblyRenderOverriding>();
|
||||
|
||||
public static final HashMap<Integer, IAssemblyRenderOverriding> renderOverrides = new HashMap<Integer, IAssemblyRenderOverriding>();
|
||||
|
||||
public static void addRenderOverride(Block block, IAssemblyRenderOverriding renderOverride) {
|
||||
renderOverrides.put(Block.getIdFromBlock(block), renderOverride);
|
||||
@@ -18,34 +19,39 @@ public class AssemblyRenderOverriding {
|
||||
}
|
||||
|
||||
public static interface IAssemblyRenderOverriding {
|
||||
|
||||
/**
|
||||
* This method will be called just before the IO Unit's held stack is being rendered. You can insert GL11 calls here to
|
||||
* rotate the model for example. push and pop matrices are not needed, this is done for you.
|
||||
* You can also choose to do the whole rendering yourself, you'll need to return false then to indicate that
|
||||
* PneumaticCraft shouldn't render the item.
|
||||
* @param renderedStack itemStack that is being rendered
|
||||
* @return true if PneumaticCraft should render the item (after your changes), or false to cancel rendering.
|
||||
* This method will be called just before the IO Unit's held stack is being rendered. You can insert GL11 calls
|
||||
* here to rotate the model for example. push and pop matrices are not needed, this is done for you. You can
|
||||
* also choose to do the whole rendering yourself, you'll need to return false then to indicate that
|
||||
* PneumaticCraft shouldn't render the item.
|
||||
*
|
||||
* @param renderedStack itemStack that is being rendered
|
||||
* @return true if PneumaticCraft should render the item (after your changes), or false to cancel rendering.
|
||||
*/
|
||||
public boolean applyRenderChangeIOUnit(ItemStack renderedStack);
|
||||
|
||||
/**
|
||||
* Same deal as with the applyRenderChangeIOUnit(), but now for the Assembly Platform.
|
||||
*
|
||||
* @param renderedStack itemStack that is being rendered
|
||||
* @return true if PneumaticCraft should render the item (after your changes), or false to cancel rendering.
|
||||
*/
|
||||
public boolean applyRenderChangePlatform(ItemStack renderedStack);
|
||||
|
||||
/**
|
||||
* Should return the distance the claw travels before it is gripped to the stack.
|
||||
* By default it's 0.0875F for items and 0.00625F for blocks, 0.09375 when the claw is completely closed.
|
||||
* Should return the distance the claw travels before it is gripped to the stack. By default it's 0.0875F for
|
||||
* items and 0.00625F for blocks, 0.09375 when the claw is completely closed.
|
||||
*
|
||||
* @param renderedStack
|
||||
* @return
|
||||
*/
|
||||
public float getIOUnitClawShift(ItemStack renderedStack);
|
||||
|
||||
/**
|
||||
* Should return the distance the claw travels before it is gripped to the stack.
|
||||
* By default it's 0.0875F for items and 0.00625F for blocks, 0.09375 when the claw is completely closed.
|
||||
* Should return the distance the claw travels before it is gripped to the stack. By default it's 0.0875F for
|
||||
* items and 0.00625F for blocks, 0.09375 when the claw is completely closed.
|
||||
*
|
||||
* @param renderedStack
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,78 +1,65 @@
|
||||
package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IBlockTrackEntry {
|
||||
|
||||
/**
|
||||
* This method should return true if the coordinate checked is one that
|
||||
* should be tracked. Most entries will just return true when the blockID is
|
||||
* the one that they track.
|
||||
* This method should return true if the coordinate checked is one that should be tracked. Most entries will just
|
||||
* return true when the blockID is the one that they track.
|
||||
*
|
||||
* @param world
|
||||
* The world that is examined.
|
||||
* @param x
|
||||
* The x coordinate of the block examined.
|
||||
* @param y
|
||||
* The y coordinate of the block examined.
|
||||
* @param z
|
||||
* The z coordinate of the block examined.
|
||||
* @param block
|
||||
* The block of the current coordinate. This will save you a
|
||||
* call to World.getBlock().
|
||||
* @param te The TileEntity at this x,y,z.
|
||||
* @param world The world that is examined.
|
||||
* @param x The x coordinate of the block examined.
|
||||
* @param y The y coordinate of the block examined.
|
||||
* @param z The z coordinate of the block examined.
|
||||
* @param block The block of the current coordinate. This will save you a call to World.getBlock().
|
||||
* @param te The TileEntity at this x,y,z.
|
||||
* @return true if the coordinate should be tracked by this BlockTrackEntry.
|
||||
*/
|
||||
public boolean shouldTrackWithThisEntry(IBlockAccess world, int x, int y, int z, Block block, TileEntity te);
|
||||
|
||||
/**
|
||||
* This method defines if the block should be updated by the server (each 5
|
||||
* seconds). This is specifically aimed at Tile Entities, as the server will
|
||||
* send an NBT packet. This method returns true at for instance Chests and
|
||||
* Mob Spawners, to get the inventory at the client side and the time to the
|
||||
* next spawn respectively.
|
||||
* This method defines if the block should be updated by the server (each 5 seconds). This is specifically aimed at
|
||||
* Tile Entities, as the server will send an NBT packet. This method returns true at for instance Chests and Mob
|
||||
* Spawners, to get the inventory at the client side and the time to the next spawn respectively.
|
||||
*
|
||||
* @param te The TileEntity at the currently checked location.
|
||||
*
|
||||
* @return true if the Tile Entity should be updated, or false when it
|
||||
* doesn't have to.
|
||||
* @return true if the Tile Entity should be updated, or false when it doesn't have to.
|
||||
*/
|
||||
public boolean shouldBeUpdatedFromServer(TileEntity te);
|
||||
|
||||
/**
|
||||
* The return of this method defines at how many tracked blocks of this type
|
||||
* the HUD should stop displaying text at the tracked blocks of this type.
|
||||
* The return of this method defines at how many tracked blocks of this type the HUD should stop displaying text at
|
||||
* the tracked blocks of this type.
|
||||
*
|
||||
* @return amount of blocks the HUD should stop displaying the block info.
|
||||
*/
|
||||
public int spamThreshold();
|
||||
|
||||
/**
|
||||
* This method is called each render tick to retrieve the blocks additional
|
||||
* information. The method behaves the same as the addInformation method in
|
||||
* the Item class. This method only will be called if
|
||||
* shouldTrackWithThisEntry() returned true and the player hovers over the
|
||||
* coordinate.
|
||||
* This method is called each render tick to retrieve the blocks additional information. The method behaves the same
|
||||
* as the addInformation method in the Item class. This method only will be called if shouldTrackWithThisEntry()
|
||||
* returned true and the player hovers over the coordinate.
|
||||
*
|
||||
* @param world
|
||||
* The world the block is in.
|
||||
* @param x
|
||||
* The x coordinate the block is at.
|
||||
* @param y
|
||||
* The y coordinate the block is at.
|
||||
* @param z
|
||||
* The z coordinate the block is at.
|
||||
* @param te The TileEntity at the x,y,z.
|
||||
* @param infoList
|
||||
* The list of lines to display.
|
||||
* @param world The world the block is in.
|
||||
* @param x The x coordinate the block is at.
|
||||
* @param y The y coordinate the block is at.
|
||||
* @param z The z coordinate the block is at.
|
||||
* @param te The TileEntity at the x,y,z.
|
||||
* @param infoList The list of lines to display.
|
||||
*/
|
||||
public void addInformation(World world, int x, int y, int z, TileEntity te, List<String> infoList);
|
||||
|
||||
/**
|
||||
* This method is called when displaying the currently tracked blocks.
|
||||
* Will be tried to be mapped to the localization file first.
|
||||
* This method is called when displaying the currently tracked blocks. Will be tried to be mapped to the
|
||||
* localization file first.
|
||||
*
|
||||
* @return the name of the group of this entry.
|
||||
*/
|
||||
public String getEntryName();
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Implement this class and register it by adding it to the entityTrackEntries class.
|
||||
* There needs to be a parameterless constructor. For every entity that's applicable for this definition, an instance is created.
|
||||
* Implement this class and register it by adding it to the entityTrackEntries class. There needs to be a parameterless
|
||||
* constructor. For every entity that's applicable for this definition, an instance is created.
|
||||
*/
|
||||
public interface IEntityTrackEntry {
|
||||
|
||||
/**
|
||||
* Return true if you want to add a tooltip for the given entity.
|
||||
*
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@@ -17,19 +20,23 @@ public interface IEntityTrackEntry {
|
||||
|
||||
/**
|
||||
* Add info to the tab. This is only called when isApplicable returned true.
|
||||
*
|
||||
* @param entity
|
||||
* @param curInfo
|
||||
*/
|
||||
public void addInfo(Entity entity, List<String> curInfo);
|
||||
|
||||
/**
|
||||
* Update is called every (client) tick, and can be used to update something like a timer (used for the Creeper countdown).
|
||||
* Update is called every (client) tick, and can be used to update something like a timer (used for the Creeper
|
||||
* countdown).
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
public void update(Entity entity);
|
||||
|
||||
/**
|
||||
* Called every render tick, this method can be used to render additional info. Used for Drone AI visualisation.
|
||||
*
|
||||
* @param entity
|
||||
* @param partialTicks TODO
|
||||
*/
|
||||
@@ -39,6 +46,7 @@ public interface IEntityTrackEntry {
|
||||
* Just a basic implementation class that can be used if an update and render method isn't needed.
|
||||
*/
|
||||
public abstract static class EntityTrackEntry implements IEntityTrackEntry {
|
||||
|
||||
@Override
|
||||
public void update(Entity entity) {}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
/**
|
||||
@@ -8,6 +9,7 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
* safely be casted to GuiSreen if needed.
|
||||
*/
|
||||
public interface IGuiScreen {
|
||||
|
||||
public List getButtonList();
|
||||
|
||||
public FontRenderer getFontRenderer();
|
||||
|
||||
@@ -1,42 +1,47 @@
|
||||
package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Use this interface to specify any hackable block. When it's your block, you can simply implement this interface in the
|
||||
* block's class. If you don't have access to the class (vanilla blocks), you can implement this interface in a separate class
|
||||
* and register it using PneumaticRegistry.registry.addHackable(blockClass, IHackableBlockClass). With the former way there will be one instance only per type. In the latter, there will
|
||||
* be an IHackableBlock instance for every block.
|
||||
* Use this interface to specify any hackable block. When it's your block, you can simply implement this interface in
|
||||
* the block's class. If you don't have access to the class (vanilla blocks), you can implement this interface in a
|
||||
* separate class and register it using PneumaticRegistry.registry.addHackable(blockClass, IHackableBlockClass). With
|
||||
* the former way there will be one instance only per type. In the latter, there will be an IHackableBlock instance for
|
||||
* every block.
|
||||
*/
|
||||
public interface IHackableBlock {
|
||||
|
||||
/**
|
||||
* Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart.
|
||||
* Null is a valid return: afterHackTick will not be triggered at all in that case.
|
||||
* Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime
|
||||
* after a server restart. Null is a valid return: afterHackTick will not be triggered at all in that case.
|
||||
*
|
||||
* CURRENTLY THIS ISN'T IMPLEMENTED.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Returning true will allow the player to hack this block. This can be used to only allow hacking on certain conditions.
|
||||
* Returning true will allow the player to hack this block. This can be used to only allow hacking on certain
|
||||
* conditions.
|
||||
*/
|
||||
public boolean canHack(IBlockAccess world, int x, int y, int z, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added.
|
||||
* This method is only called when canHack(World, int, int, int) returned true.
|
||||
* The added lines automatically will be tried to get localized.
|
||||
* Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added. This method is
|
||||
* only called when canHack(World, int, int, int) returned true. The added lines automatically will be tried to get
|
||||
* localized.
|
||||
*/
|
||||
public void addInfo(World world, int x, int y, int z, List<String> curInfo, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true.
|
||||
* Things like "Neutralized".
|
||||
* The added lines automatically will be tried to get localized.
|
||||
* Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true. Things like
|
||||
* "Neutralized". The added lines automatically will be tried to get localized.
|
||||
*
|
||||
* @param entity
|
||||
* @param curInfo
|
||||
* @param player
|
||||
@@ -44,20 +49,23 @@ public interface IHackableBlock {
|
||||
public void addPostHackInfo(World world, int x, int y, int z, List<String> curInfo, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Return the time it takes to hack this block in ticks. For more powerful hacks, a longer required hacking time is adviced.
|
||||
* Return the time it takes to hack this block in ticks. For more powerful hacks, a longer required hacking time is
|
||||
* adviced.
|
||||
*/
|
||||
public int getHackTime(IBlockAccess world, int x, int y, int z, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* When the player hacked the block for getHackTime(World, int, int, int) ticks this will be called on both server and client side.
|
||||
* When the player hacked the block for getHackTime(World, int, int, int) ticks this will be called on both server
|
||||
* and client side.
|
||||
*/
|
||||
public void onHackFinished(World world, int x, int y, int z, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Called every tick after the hacking finished (on both server and client side). Returning true will keep this going (for mob spawners, to keep them neutralized),
|
||||
* or false to stop ticking (for door/lever hacking).
|
||||
* Called every tick after the hacking finished (on both server and client side). Returning true will keep this
|
||||
* going (for mob spawners, to keep them neutralized), or false to stop ticking (for door/lever hacking).
|
||||
*
|
||||
* CURRENTLY THIS METHOD WILL STOP GETTING INVOKED AFTER A SERVER RESTART!
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
|
||||
@@ -1,39 +1,42 @@
|
||||
package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
/**
|
||||
* Use this interface to specify any hackable entity. When it's your entity, you can simply implement this interface in the
|
||||
* entity's class. If you don't have access to the class (vanilla entities), you can implement this interface in a separate class
|
||||
* and register it using PneumaticRegistry.registry.addHackable(entityClass, IHackableEntityClass). In both ways there will be an IHackableEntity instance for every entity.
|
||||
* Use this interface to specify any hackable entity. When it's your entity, you can simply implement this interface in
|
||||
* the entity's class. If you don't have access to the class (vanilla entities), you can implement this interface in a
|
||||
* separate class and register it using PneumaticRegistry.registry.addHackable(entityClass, IHackableEntityClass). In
|
||||
* both ways there will be an IHackableEntity instance for every entity.
|
||||
*/
|
||||
public interface IHackableEntity {
|
||||
|
||||
/**
|
||||
* Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime after a server restart.
|
||||
* Null is a valid return: afterHackTick will not be triggered at all in that case.
|
||||
* Should return a unique id to represent this hackable. Used in NBT saving to be able to trigger the afterHackTime
|
||||
* after a server restart. Null is a valid return: afterHackTick will not be triggered at all in that case.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Returning true will allow the player to hack this entity. This can be used to only allow hacking on certain conditions.
|
||||
* Returning true will allow the player to hack this entity. This can be used to only allow hacking on certain
|
||||
* conditions.
|
||||
*/
|
||||
public boolean canHack(Entity entity, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added.
|
||||
* This method is only called when canHack(Entity) returned true.
|
||||
* The added lines automatically will be tried to get localized.
|
||||
* Add info that is displayed on the tracker tooltip here. Text like "Hack to explode" can be added. This method is
|
||||
* only called when canHack(Entity) returned true. The added lines automatically will be tried to get localized.
|
||||
*/
|
||||
public void addInfo(Entity entity, List<String> curInfo, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true.
|
||||
* Things like "Neutralized".
|
||||
* The added lines automatically will be tried to get localized.
|
||||
* Add info that is being displayed after hacking, as long as 'afterHackTick' is returning true. Things like
|
||||
* "Neutralized". The added lines automatically will be tried to get localized.
|
||||
*
|
||||
* @param entity
|
||||
* @param curInfo
|
||||
* @param player
|
||||
@@ -41,18 +44,20 @@ public interface IHackableEntity {
|
||||
public void addPostHackInfo(Entity entity, List<String> curInfo, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Return the time it takes to hack this entity in ticks. For more powerful hacks, a longer required hacking time is adviced.
|
||||
* Return the time it takes to hack this entity in ticks. For more powerful hacks, a longer required hacking time is
|
||||
* adviced.
|
||||
*/
|
||||
public int getHackTime(Entity entity, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* When the player hacked the entity for getHackTime(Entity) ticks this will be called on both client and server side.
|
||||
* When the player hacked the entity for getHackTime(Entity) ticks this will be called on both client and server
|
||||
* side.
|
||||
*/
|
||||
public void onHackFinished(Entity entity, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Called every tick after the hacking finished. Returning true will keep this going (for mob spawners, to keep them neutralized),
|
||||
* or false to stop ticking (for door/lever hacking).
|
||||
* Called every tick after the hacking finished. Returning true will keep this going (for mob spawners, to keep them
|
||||
* neutralized), or false to stop ticking (for door/lever hacking).
|
||||
*/
|
||||
public boolean afterHackTick(Entity entity);
|
||||
}
|
||||
@@ -4,33 +4,36 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
|
||||
/**
|
||||
* The Option Page is the page you see when you press 'F' (by default) with a Pneumatic Helmet equipped. You can register this class
|
||||
* by returning a new instance of this class at {@link IUpgradeRenderHandler#getGuiOptionsPage()}
|
||||
* The Option Page is the page you see when you press 'F' (by default) with a Pneumatic Helmet equipped. You can
|
||||
* register this class by returning a new instance of this class at {@link IUpgradeRenderHandler#getGuiOptionsPage()}
|
||||
*/
|
||||
public interface IOptionPage {
|
||||
|
||||
/**
|
||||
* This string is used in the text of the button of this page.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPageName();
|
||||
|
||||
/**
|
||||
* Here you can initialize your buttons and stuff like with a GuiScreen. For buttons, don't use button id 100 and up, as they
|
||||
* will be used as selection buttons for other option pages in the main GuiScreen.
|
||||
* Here you can initialize your buttons and stuff like with a GuiScreen. For buttons, don't use button id 100 and
|
||||
* up, as they will be used as selection buttons for other option pages in the main GuiScreen.
|
||||
*
|
||||
* @param gui
|
||||
*/
|
||||
public void initGui(IGuiScreen gui);
|
||||
|
||||
/**
|
||||
* Same as GuiScreen#actionPerformed(GuiButton).
|
||||
*
|
||||
* @param button
|
||||
*/
|
||||
public void actionPerformed(GuiButton button);
|
||||
|
||||
/**
|
||||
* Same as {@link GuiScreen#drawScreen(int, int, float)}
|
||||
* Here you can render additional things like text.
|
||||
* Same as {@link GuiScreen#drawScreen(int, int, float)} Here you can render additional things like text.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param partialTicks
|
||||
@@ -39,6 +42,7 @@ public interface IOptionPage {
|
||||
|
||||
/**
|
||||
* Same as GuiScreen#keyTyped(char, int).
|
||||
*
|
||||
* @param ch
|
||||
* @param key
|
||||
*/
|
||||
|
||||
@@ -3,25 +3,28 @@ package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import pneumaticCraft.api.client.IGuiAnimatedStat;
|
||||
|
||||
/**
|
||||
* To add upgrades for in the Pneumatic Helmet implement this interface. You can add members to this class, however these can only
|
||||
* be client sided members as this class will be used as singleton. Therefore, only one of these instances exist at the server side
|
||||
* so any member that is used server side will affect every player.
|
||||
* To add upgrades for in the Pneumatic Helmet implement this interface. You can add members to this class, however
|
||||
* these can only be client sided members as this class will be used as singleton. Therefore, only one of these
|
||||
* instances exist at the server side so any member that is used server side will affect every player.
|
||||
*
|
||||
*/
|
||||
public interface IUpgradeRenderHandler {
|
||||
|
||||
/**
|
||||
* Return here the name of the upgrade. This is displayed in the formatting [upgradeName] + " " + "found"/"not found" on
|
||||
* initialization of the helmet.
|
||||
* Return here the name of the upgrade. This is displayed in the formatting [upgradeName] + " " + "found"/"not
|
||||
* found" on initialization of the helmet.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getUpgradeName();
|
||||
|
||||
/**
|
||||
* Being called from PneumaticCraft's config handler, you can use this method to read settings like stat positions
|
||||
*
|
||||
* @param config PneumaticCraft's config file.
|
||||
*/
|
||||
public void initConfig(Configuration config);
|
||||
@@ -34,7 +37,9 @@ public interface IUpgradeRenderHandler {
|
||||
public void saveToConfig();
|
||||
|
||||
/**
|
||||
* This method will be called every client tick, and should be used to update logic like the tracking and velocities of stuff.
|
||||
* This method will be called every client tick, and should be used to update logic like the tracking and velocities
|
||||
* of stuff.
|
||||
*
|
||||
* @param player
|
||||
* @param rangeUpgrades amount of range upgrades installed in the helmet.
|
||||
*/
|
||||
@@ -42,27 +47,32 @@ public interface IUpgradeRenderHandler {
|
||||
|
||||
/**
|
||||
* Called in the 3D render stage (renderWorldLastEvent)
|
||||
*
|
||||
* @param partialTicks
|
||||
*/
|
||||
public void render3D(float partialTicks);
|
||||
|
||||
/**
|
||||
* Called in the 2D render stage (Render Tick Handler)
|
||||
*
|
||||
* @param partialTicks
|
||||
* @param helmetEnabled is true when isEnabled() returned true earlier. Can be used to close AnimatedStats for instance.
|
||||
* However this is already handled if you return an AnimatedStat in getAnimatedStat().
|
||||
* @param helmetEnabled is true when isEnabled() returned true earlier. Can be used to close AnimatedStats for
|
||||
* instance. However this is already handled if you return an AnimatedStat in
|
||||
* getAnimatedStat().
|
||||
*/
|
||||
public void render2D(float partialTicks, boolean helmetEnabled);
|
||||
|
||||
/**
|
||||
* You can return a GuiAnimatedStat here, that the HUDHandler will pick up and render. It also automatically opens and closes
|
||||
* the stat when needed. The GuiMoveStat uses this method to retrieve the to be moved stat.
|
||||
* You can return a GuiAnimatedStat here, that the HUDHandler will pick up and render. It also automatically opens
|
||||
* and closes the stat when needed. The GuiMoveStat uses this method to retrieve the to be moved stat.
|
||||
*
|
||||
* @return null if no stat used.
|
||||
*/
|
||||
public IGuiAnimatedStat getAnimatedStat();
|
||||
|
||||
/**
|
||||
* Should return true if this upgrade handler is enabled for the given stacks placed in the helmet.
|
||||
*
|
||||
* @param upgradeStacks
|
||||
* @return
|
||||
*/
|
||||
@@ -70,6 +80,7 @@ public interface IUpgradeRenderHandler {
|
||||
|
||||
/**
|
||||
* Returns the usage in mL/tick when this upgrade handler is enabled.
|
||||
*
|
||||
* @param rangeUpgrades amount of range upgrades installed in the helmet.
|
||||
* @param player
|
||||
* @return usage in mL/tick
|
||||
@@ -77,15 +88,16 @@ public interface IUpgradeRenderHandler {
|
||||
public float getEnergyUsage(int rangeUpgrades, EntityPlayer player);
|
||||
|
||||
/**
|
||||
* Called when (re-)equipped the helmet this method should be used to clear information like current tracked entities.
|
||||
* So clearing lists and other references as this handler should re-acquire when reinstalled.
|
||||
* Called when (re-)equipped the helmet this method should be used to clear information like current tracked
|
||||
* entities. So clearing lists and other references as this handler should re-acquire when reinstalled.
|
||||
*/
|
||||
public void reset();
|
||||
|
||||
/**
|
||||
* When you have some options for your upgrade handler you could return a new instance of an IOptionsPage.
|
||||
* When you do so, it will automatically get picked up by the options handler, and it will be added to the
|
||||
* options GUI when this upgrade returns true when calling isEnabled(). Returning null is valid.
|
||||
* When you have some options for your upgrade handler you could return a new instance of an IOptionsPage. When you
|
||||
* do so, it will automatically get picked up by the options handler, and it will be added to the options GUI when
|
||||
* this upgrade returns true when calling isEnabled(). Returning null is valid.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IOptionPage getGuiOptionsPage();
|
||||
|
||||
@@ -3,8 +3,10 @@ package pneumaticCraft.api.client.pneumaticHelmet;
|
||||
import java.util.List;
|
||||
|
||||
public class RenderHandlerRegistry {
|
||||
|
||||
/**
|
||||
* With this field you can register your render handlers. This field is initialized in the PreInit phase of PneumaticCraft's loading phase.
|
||||
* With this field you can register your render handlers. This field is initialized in the PreInit phase of
|
||||
* PneumaticCraft's loading phase.
|
||||
*/
|
||||
public static List<IUpgradeRenderHandler> renderHandlers;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package pneumaticCraft.api.drone;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class DroneConstructingEvent extends Event {
|
||||
|
||||
public IDrone drone;
|
||||
|
||||
public DroneConstructingEvent(IDrone drone) {
|
||||
|
||||
@@ -7,6 +7,7 @@ public interface IBlockInteractHandler {
|
||||
|
||||
/**
|
||||
* Returns a boolean[6] of all sides. when true, this side is accessible
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean[] getSides();
|
||||
@@ -18,8 +19,8 @@ public interface IBlockInteractHandler {
|
||||
public int getRemainingCount();
|
||||
|
||||
/**
|
||||
* When invoked, the drone will abort searching the area. Could be used to abort early when full of RF energy for example, when importing RF.
|
||||
* (It's useless to search any further)
|
||||
* When invoked, the drone will abort searching the area. Could be used to abort early when full of RF energy for
|
||||
* example, when importing RF. (It's useless to search any further)
|
||||
*/
|
||||
public void abort();
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
|
||||
/**
|
||||
* Implement this and register it to PneumaticRegistry.registerCustomBlockInteractor().
|
||||
* This will add a puzzle piece that has only a Area white- and blacklist parameter (similar to a GoTo piece).
|
||||
* It will do the specified behaviour. This can be used to create energy import/export widgets.
|
||||
* Implement this and register it to PneumaticRegistry.registerCustomBlockInteractor(). This will add a puzzle piece
|
||||
* that has only a Area white- and blacklist parameter (similar to a GoTo piece). It will do the specified behaviour.
|
||||
* This can be used to create energy import/export widgets.
|
||||
*/
|
||||
public interface ICustomBlockInteract {
|
||||
|
||||
@@ -16,7 +16,9 @@ public interface ICustomBlockInteract {
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Should return the puzzle piece texture. Should be a multiple of 80x64 (width x height). I'd recommend starting out with copying the Go To widget texture.
|
||||
* Should return the puzzle piece texture. Should be a multiple of 80x64 (width x height). I'd recommend starting
|
||||
* out with copying the Go To widget texture.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ResourceLocation getTexture();
|
||||
@@ -24,21 +26,28 @@ public interface ICustomBlockInteract {
|
||||
/**
|
||||
* The actual interaction.
|
||||
*
|
||||
* For every position in the selected area the drone will visit every block (ordered from closest to furthest). It will call this method with 'simulate = true'. If this method returns true, the drone will navigate to this location, and call this method again with 'simulate = false' It will keep doing this until this method returns false.
|
||||
* For every position in the selected area the drone will visit every block (ordered from closest to furthest). It
|
||||
* will call this method with 'simulate = true'. If this method returns true, the drone will navigate to this
|
||||
* location, and call this method again with 'simulate = false' It will keep doing this until this method returns
|
||||
* false.
|
||||
*
|
||||
* When interactHandler.useCount() returns true:
|
||||
* In the interface of the puzzle piece users can specify a 'use count' and fill in the maximum count they want to use. When not simulating, you should only import/export up to interactHandler.getRemainingCount(), and you should notify the removed/added count by doing interactHandler.decreaseCount(int count).
|
||||
* When interactHandler.useCount() returns true: In the interface of the puzzle piece users can specify a 'use
|
||||
* count' and fill in the maximum count they want to use. When not simulating, you should only import/export up to
|
||||
* interactHandler.getRemainingCount(), and you should notify the removed/added count by doing
|
||||
* interactHandler.decreaseCount(int count).
|
||||
*
|
||||
* @param pos current visited location
|
||||
* @param pos current visited location
|
||||
* @param drone
|
||||
* @param interactHandler object you can use to use to get accessible sides and give feedback about counts.
|
||||
* @param simulate will be true when trying to figure out whether or not the drone should navigate to this block, false when next to this block.
|
||||
* @param interactHandler object you can use to use to get accessible sides and give feedback about counts.
|
||||
* @param simulate will be true when trying to figure out whether or not the drone should navigate to this
|
||||
* block, false when next to this block.
|
||||
* @return
|
||||
*/
|
||||
public boolean doInteract(ChunkPosition pos, IDrone drone, IBlockInteractHandler interactHandler, boolean simulate);
|
||||
|
||||
/**
|
||||
* Used for crafting, categorizes the puzzle piece.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getCraftingColorIndex();
|
||||
|
||||
@@ -11,9 +11,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import pneumaticCraft.api.item.IPressurizable;
|
||||
|
||||
public interface IDrone extends IPressurizable {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param upgradeIndex metadata value of the upgrade item
|
||||
|
||||
@@ -3,6 +3,7 @@ package pneumaticCraft.api.drone;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IPathNavigator {
|
||||
|
||||
public boolean moveToXYZ(double x, double y, double z);
|
||||
|
||||
public boolean moveToEntity(Entity entity);
|
||||
|
||||
@@ -3,8 +3,10 @@ package pneumaticCraft.api.drone;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IPathfindHandler {
|
||||
|
||||
/**
|
||||
* When returned true, the drone can pathfind through this block. When false it can't.
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
@@ -14,9 +16,9 @@ public interface IPathfindHandler {
|
||||
public boolean canPathfindThrough(World world, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* CURRENTLY NOT IMPLEMENTED!
|
||||
* Will be called every tick as long as the drone is < 1 block away from the given coordinate.
|
||||
* can be used to open a door for a drone for example.
|
||||
* CURRENTLY NOT IMPLEMENTED! Will be called every tick as long as the drone is < 1 block away from the given
|
||||
* coordinate. can be used to open a door for a drone for example.
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package pneumaticCraft.api.drone;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Fired when a Drone is trying to get a special coordinate, by accessing a variable with '$' prefix.
|
||||
* These event are posted on the MinecraftForge.EVENT_BUS.
|
||||
* Fired when a Drone is trying to get a special coordinate, by accessing a variable with '$' prefix. These event are
|
||||
* posted on the MinecraftForge.EVENT_BUS.
|
||||
*/
|
||||
public abstract class SpecialVariableRetrievalEvent extends Event {
|
||||
|
||||
@@ -24,6 +25,7 @@ public abstract class SpecialVariableRetrievalEvent extends Event {
|
||||
}
|
||||
|
||||
public abstract static class CoordinateVariable extends SpecialVariableRetrievalEvent {
|
||||
|
||||
public ChunkPosition coordinate;
|
||||
|
||||
public CoordinateVariable(String specialVarName) {
|
||||
@@ -31,6 +33,7 @@ public abstract class SpecialVariableRetrievalEvent extends Event {
|
||||
}
|
||||
|
||||
public static class Drone extends CoordinateVariable {
|
||||
|
||||
public final IDrone drone;
|
||||
|
||||
public Drone(IDrone drone, String specialVarName) {
|
||||
@@ -41,6 +44,7 @@ public abstract class SpecialVariableRetrievalEvent extends Event {
|
||||
}
|
||||
|
||||
public abstract static class ItemVariable extends SpecialVariableRetrievalEvent {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
public ItemVariable(String specialVarName) {
|
||||
@@ -48,6 +52,7 @@ public abstract class SpecialVariableRetrievalEvent extends Event {
|
||||
}
|
||||
|
||||
public static class Drone extends ItemVariable {
|
||||
|
||||
public final IDrone drone;
|
||||
|
||||
public Drone(IDrone drone, String specialVarName) {
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package pneumaticCraft.api.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this interface for your items that have an inventory. When you don't have access to the item, just create any old class
|
||||
* that implements this interface and register an instance of it in PneumaticRegistry.
|
||||
* This will then will be used in the Pneumatic Helmet's item search.
|
||||
* Implement this interface for your items that have an inventory. When you don't have access to the item, just create
|
||||
* any old class that implements this interface and register an instance of it in PneumaticRegistry. This will then will
|
||||
* be used in the Pneumatic Helmet's item search.
|
||||
*
|
||||
*/
|
||||
public interface IInventoryItem {
|
||||
|
||||
/**
|
||||
* @parm stack: Item that potentially has an inventory.
|
||||
* @parm curStacks: List of all currently added stacks for this item. Add more stacks in here in your implementation when found the right item.
|
||||
* @parm stack: Item that potentially has an inventory.
|
||||
* @parm curStacks: List of all currently added stacks for this item. Add more stacks in here in your implementation
|
||||
* when found the right item.
|
||||
*/
|
||||
public void getStacksInItem(ItemStack stack, List<ItemStack> curStacks);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
|
||||
* Any item implementing this interface will be able to (dis)charge in a Charging Station.
|
||||
*/
|
||||
public interface IPressurizable {
|
||||
|
||||
/**
|
||||
* This method should return the current pressure of the ItemStack given.
|
||||
*
|
||||
@@ -15,8 +16,8 @@ public interface IPressurizable {
|
||||
public float getPressure(ItemStack iStack);
|
||||
|
||||
/**
|
||||
* this method is used to charge or discharge a pneumatic item. when the
|
||||
* value is negative the item should be discharging
|
||||
* this method is used to charge or discharge a pneumatic item. when the value is negative the item should be
|
||||
* discharging
|
||||
*
|
||||
* @param iStack the ItemStack which has to be (dis)charged.
|
||||
* @param amount amount in mL that the item is (dis)charging.
|
||||
@@ -24,9 +25,8 @@ public interface IPressurizable {
|
||||
public void addAir(ItemStack iStack, int amount);
|
||||
|
||||
/**
|
||||
* This method should return the maximum pressure of a pneumatic item. If it
|
||||
* has reached this maximum, it won't explode, but it wouldn't (try to)
|
||||
* charge either.
|
||||
* This method should return the maximum pressure of a pneumatic item. If it has reached this maximum, it won't
|
||||
* explode, but it wouldn't (try to) charge either.
|
||||
*
|
||||
* @param iStack the stack from which the maximum pressure is asked.
|
||||
* @return maximum pressure in bar.
|
||||
|
||||
@@ -3,30 +3,34 @@ package pneumaticCraft.api.item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Implement this for items that can get programmed in a Programmer.
|
||||
* For now the only thing you can do with this is make program storages, later more interaction with programming puzzles is planned.
|
||||
* Puzzle pieces will be written onto the implementer's itemstack NBT, using the "progWidget" tag.
|
||||
* Implement this for items that can get programmed in a Programmer. For now the only thing you can do with this is make
|
||||
* program storages, later more interaction with programming puzzles is planned. Puzzle pieces will be written onto the
|
||||
* implementer's itemstack NBT, using the "progWidget" tag.
|
||||
*/
|
||||
public interface IProgrammable {
|
||||
|
||||
/**
|
||||
* When returned true, this stack is allowed to be programmed.
|
||||
* Used to allow certain damage values to be programmed while others can't.
|
||||
* When returned true, this stack is allowed to be programmed. Used to allow certain damage values to be programmed
|
||||
* while others can't.
|
||||
*
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public boolean canProgram(ItemStack stack);
|
||||
|
||||
/**
|
||||
* When returned true, Programming Puzzles are needed to program this item. When returned false, it's free to program.
|
||||
* Drones and Network API's return true in PneumaticCraft, Network Storages return false.
|
||||
* When returned true, Programming Puzzles are needed to program this item. When returned false, it's free to
|
||||
* program. Drones and Network API's return true in PneumaticCraft, Network Storages return false.
|
||||
*
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public boolean usesPieces(ItemStack stack);
|
||||
|
||||
/**
|
||||
* When returned true, the implementing item will get a tooltip added of the summary of puzzles used in the stored program.
|
||||
* When returned true, the implementing item will get a tooltip added of the summary of puzzles used in the stored
|
||||
* program.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean showProgramTooltip();
|
||||
|
||||
@@ -1,47 +1,25 @@
|
||||
package pneumaticCraft.api.item;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemSupplier {
|
||||
|
||||
public static Item getItem(String itemName) {
|
||||
return GameRegistry.findItem("PneumaticCraft", itemName);
|
||||
}
|
||||
|
||||
/*
|
||||
The following is a list of all the item names that can be passed as argument in getItem(String) to get a PneumaticCraft item.
|
||||
|
||||
GPSTool Currently tracked coordinated is stored in NBT, with 'x', 'y', 'z' being the tag names for the x,y and z positions respectively.
|
||||
machineUpgrade damage value = upgrade type.
|
||||
ingotIronCompressed
|
||||
pressureGauge
|
||||
stoneBase
|
||||
cannonBarrel
|
||||
turbineBlade
|
||||
plasticPlant damage value = plant type. Mapped the same as Vanilla dye in terms of color.
|
||||
plastic damage value = plastic type. Mapped the same as Vanilla dye in terms of color.
|
||||
airCanister implements IPressurizable
|
||||
vortexCannon implements IPressurizable
|
||||
pneumaticCylinder
|
||||
pneumaticHelmet implements IPressurizable
|
||||
manometer implements IPressurizable
|
||||
turbineRotor
|
||||
assemblyProgram damage value = program type.
|
||||
emptyPCB
|
||||
unassembledPCB
|
||||
PCBBlueprint
|
||||
bucketEtchingAcid
|
||||
transistor
|
||||
capacitor
|
||||
printedCircuitBoard
|
||||
failedPCB
|
||||
networkComponent damage value = network component type.
|
||||
stopWorm
|
||||
nukeVirus
|
||||
compressedIronGear
|
||||
pneumaticWrench implements IPressurizable
|
||||
|
||||
|
||||
|
||||
*/
|
||||
* The following is a list of all the item names that can be passed as argument in getItem(String) to get a
|
||||
* PneumaticCraft item. GPSTool Currently tracked coordinated is stored in NBT, with 'x', 'y', 'z' being the tag
|
||||
* names for the x,y and z positions respectively. machineUpgrade damage value = upgrade type. ingotIronCompressed
|
||||
* pressureGauge stoneBase cannonBarrel turbineBlade plasticPlant damage value = plant type. Mapped the same as
|
||||
* Vanilla dye in terms of color. plastic damage value = plastic type. Mapped the same as Vanilla dye in terms of
|
||||
* color. airCanister implements IPressurizable vortexCannon implements IPressurizable pneumaticCylinder
|
||||
* pneumaticHelmet implements IPressurizable manometer implements IPressurizable turbineRotor assemblyProgram damage
|
||||
* value = program type. emptyPCB unassembledPCB PCBBlueprint bucketEtchingAcid transistor capacitor
|
||||
* printedCircuitBoard failedPCB networkComponent damage value = network component type. stopWorm nukeVirus
|
||||
* compressedIronGear pneumaticWrench implements IPressurizable
|
||||
*/
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package pneumaticCraft.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AssemblyRecipe {
|
||||
|
||||
public static List<AssemblyRecipe> drillRecipes = new ArrayList<AssemblyRecipe>();
|
||||
public static List<AssemblyRecipe> laserRecipes = new ArrayList<AssemblyRecipe>();
|
||||
public static List<AssemblyRecipe> drillLaserRecipes = new ArrayList<AssemblyRecipe>();
|
||||
|
||||
@@ -6,28 +6,34 @@ public interface IPressureChamberRecipe {
|
||||
|
||||
/**
|
||||
* Returns the threshold which is minimal to craft the recipe. Negative pressures also work.
|
||||
*
|
||||
* @return threshold pressure
|
||||
*/
|
||||
public float getCraftingPressure();
|
||||
|
||||
/**
|
||||
* This method should return the used items in the recipe when the right items are provided to craft this recipe.
|
||||
*
|
||||
* @param inputStacks
|
||||
* @return usedStacks, return null when the inputStacks aren't valid for this recipe.
|
||||
*/
|
||||
public ItemStack[] isValidRecipe(ItemStack[] inputStacks);
|
||||
|
||||
/**
|
||||
* When returned true, only the exact same references of the stacks returned by isValidRecipe() will be removed. This is useful
|
||||
* to remove stacks with a certain NBT value (like Enchanted Books). Return false for normal behaviour.
|
||||
* When returned true, only the exact same references of the stacks returned by isValidRecipe() will be removed.
|
||||
* This is useful to remove stacks with a certain NBT value (like Enchanted Books). Return false for normal
|
||||
* behaviour.
|
||||
*
|
||||
* @return true if exact stacks should be removed only.
|
||||
*/
|
||||
public boolean shouldRemoveExactStacks();
|
||||
|
||||
/**
|
||||
* This method will be called when the recipe should output its items. the stacks the recipe output, may be dependent on the input stacks.
|
||||
* This method will be called when the recipe should output its items. the stacks the recipe output, may be
|
||||
* dependent on the input stacks.
|
||||
*
|
||||
* @param removedStacks same reference to the stacks returned by isValidRecipe.
|
||||
* @param inputStacks. These stacks can be modified (like adding/removing NBT data eg.)
|
||||
* @param inputStacks. These stacks can be modified (like adding/removing NBT data eg.)
|
||||
* @return outputStacks. Stacks that will pop 'out of the chamber'
|
||||
*/
|
||||
public ItemStack[] craftRecipe(ItemStack[] inputStacks, ItemStack[] removedStacks);
|
||||
|
||||
@@ -2,9 +2,11 @@ package pneumaticCraft.api.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PressureChamberRecipe {
|
||||
|
||||
public static List<PressureChamberRecipe> chamberRecipes = new ArrayList<PressureChamberRecipe>();
|
||||
public static List<IPressureChamberRecipe> specialRecipes = new ArrayList<IPressureChamberRecipe>();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package pneumaticCraft.api.tileentity;
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public class AirHandlerSupplier {
|
||||
|
||||
private static Constructor airHandlerConstructor;
|
||||
|
||||
public static IAirHandler getTierOneAirHandler(int volume) {
|
||||
@@ -14,18 +15,21 @@ public class AirHandlerSupplier {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of an IAirHandler. This handler handles everything pressurized air related: Air dispersion,
|
||||
* blowing up when the pressure gets too high, providing a method for releasing air into the atmosphere...
|
||||
* PROVIDED THAT THE FOLLOWING METHODS ARE FORWARDED TO THIS INSTANCE:
|
||||
* Returns a new instance of an IAirHandler. This handler handles everything pressurized air related: Air
|
||||
* dispersion, blowing up when the pressure gets too high, providing a method for releasing air into the
|
||||
* atmosphere... PROVIDED THAT THE FOLLOWING METHODS ARE FORWARDED TO THIS INSTANCE:
|
||||
* {@link net.minecraft.tileentity.TileEntity#updateEntity()},
|
||||
* {@link net.minecraft.tileentity.TileEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)}
|
||||
* {@link net.minecraft.tileentity.TileEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)}
|
||||
* {@link net.minecraft.tileentity.TileEntity#validate()}
|
||||
* @param dangerPressure minimal pressure on which this machine can explode (the yellow to red transition)
|
||||
*
|
||||
* @param dangerPressure minimal pressure on which this machine can explode (the yellow to red transition)
|
||||
* @param criticalPressure the absolute maximum pressure the machine can take 7 bar in tier 1 machines.
|
||||
* @param maxFlow maximum mL/tick that this machine can disperse. Tier one machines do 50mL/tick while Tier two have 200mL/tick.
|
||||
* @param volume Volume of the machine's internal storage. These vary from 1000mL for small machines to 10,000mL for the big ones.
|
||||
* The higher the volume the slower the machine will charge/discharge.
|
||||
* @param maxFlow maximum mL/tick that this machine can disperse. Tier one machines do 50mL/tick while Tier
|
||||
* two have 200mL/tick.
|
||||
* @param volume Volume of the machine's internal storage. These vary from 1000mL for small machines to
|
||||
* 10,000mL for the big ones. The higher the volume the slower the machine will
|
||||
* charge/discharge.
|
||||
* @return
|
||||
*/
|
||||
public static IAirHandler getAirHandler(float dangerPressure, float criticalPressure, int volume) {
|
||||
|
||||
@@ -1,44 +1,51 @@
|
||||
package pneumaticCraft.api.tileentity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
/**
|
||||
* A way for you to access about everything you need from a pneumatic machine.
|
||||
* DO NOT IMPLEMENT THIS YOURSELF! Use AirHandlerSupplier to get an instance for your TileEntity, and implement IPneumaticMachine instead.
|
||||
* A way for you to access about everything you need from a pneumatic machine. DO NOT IMPLEMENT THIS YOURSELF! Use
|
||||
* AirHandlerSupplier to get an instance for your TileEntity, and implement IPneumaticMachine instead.
|
||||
*/
|
||||
public interface IAirHandler extends IManoMeasurable {
|
||||
|
||||
/**
|
||||
* -----------Needs to be forwarded by the implementing TileEntity's updateEntity() method.
|
||||
* Updates the pneumatic machine's logic like air dispersion and checking if it needs to explode.
|
||||
* -----------Needs to be forwarded by the implementing TileEntity's updateEntity() method. Updates the pneumatic
|
||||
* machine's logic like air dispersion and checking if it needs to explode.
|
||||
*/
|
||||
public void updateEntityI();
|
||||
|
||||
/**
|
||||
* -----------Needs to be forwarded by the implementing TileEntity.
|
||||
*
|
||||
* @param nbt
|
||||
*/
|
||||
public void readFromNBTI(NBTTagCompound nbt);
|
||||
|
||||
/**
|
||||
* -----------Needs to be forwarded by the implementing TileEntity.
|
||||
*
|
||||
* @param nbt
|
||||
*/
|
||||
public void writeToNBTI(NBTTagCompound nbt);
|
||||
|
||||
/**
|
||||
* -----------Needs to be forwarded by the implementing TileEntity with itself as parameter.
|
||||
*
|
||||
* @param parent TileEntity that is referencing this air handler.
|
||||
*/
|
||||
public void validateI(TileEntity parent);
|
||||
|
||||
/**
|
||||
* Method to release air in the air. It takes air from a specific side, plays a sound effect, and spawns smoke particles.
|
||||
* It automatically detects if it needs to release air (when under pressure), suck air (when in vacuum) or do nothing.
|
||||
* Method to release air in the air. It takes air from a specific side, plays a sound effect, and spawns smoke
|
||||
* particles. It automatically detects if it needs to release air (when under pressure), suck air (when in vacuum)
|
||||
* or do nothing.
|
||||
*
|
||||
* @param side
|
||||
*/
|
||||
public void airLeak(ForgeDirection side);
|
||||
@@ -49,8 +56,9 @@ public interface IAirHandler extends IManoMeasurable {
|
||||
public List<Pair<ForgeDirection, IPneumaticMachine>> getConnectedPneumatics();
|
||||
|
||||
/**
|
||||
* Adds air to the tank of the given side of this TE. It also updates clients where needed (when they have a GUI opened).
|
||||
* Deprecated: use the version with the integer parameter now.
|
||||
* Adds air to the tank of the given side of this TE. It also updates clients where needed (when they have a GUI
|
||||
* opened). Deprecated: use the version with the integer parameter now.
|
||||
*
|
||||
* @param amount
|
||||
* @param side
|
||||
*/
|
||||
@@ -60,10 +68,10 @@ public interface IAirHandler extends IManoMeasurable {
|
||||
public void addAir(int amount, ForgeDirection side);
|
||||
|
||||
/**
|
||||
* Sets the volume of this TE's air tank. When the volume decreases the pressure will remain the same, meaning air will
|
||||
* be lost. When the volume increases, the air remains the same, meaning the pressure will drop.
|
||||
* Used in the Volume Upgrade calculations.
|
||||
* Deprecated: use the version with the integer parameter now.
|
||||
* Sets the volume of this TE's air tank. When the volume decreases the pressure will remain the same, meaning air
|
||||
* will be lost. When the volume increases, the air remains the same, meaning the pressure will drop. Used in the
|
||||
* Volume Upgrade calculations. Deprecated: use the version with the integer parameter now.
|
||||
*
|
||||
* @param newVolume
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -75,6 +83,7 @@ public interface IAirHandler extends IManoMeasurable {
|
||||
|
||||
/**
|
||||
* Returns the pressure at which this TE will explode.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public float getMaxPressure();
|
||||
@@ -83,14 +92,17 @@ public interface IAirHandler extends IManoMeasurable {
|
||||
|
||||
/**
|
||||
* Returns the amount of air (that has a relation to the pressure: air = pressure * volume)
|
||||
*
|
||||
* @param sideRequested
|
||||
* @return
|
||||
*/
|
||||
public int getCurrentAir(ForgeDirection sideRequested);
|
||||
|
||||
/**
|
||||
* When your TileEntity is implementing IInventory and has slots that accept PneumaticCraft upgrades, register these slots
|
||||
* to the air handler by calling this method once on initialization of the TileEntity. Then they'll automatically be used to get Volume/Security upgrades.
|
||||
* When your TileEntity is implementing IInventory and has slots that accept PneumaticCraft upgrades, register these
|
||||
* slots to the air handler by calling this method once on initialization of the TileEntity. Then they'll
|
||||
* automatically be used to get Volume/Security upgrades.
|
||||
*
|
||||
* @param upgradeSlots all upgrade slots stored in an array.
|
||||
*/
|
||||
public void setUpgradeSlots(int... upgradeSlots);
|
||||
@@ -104,7 +116,8 @@ public interface IAirHandler extends IManoMeasurable {
|
||||
public int getZCoord();
|
||||
|
||||
/**
|
||||
* Needs to be forwarded from the implementing _Block_! Forward the Block's "onNeighborChange" method to this handler.
|
||||
* Needs to be forwarded from the implementing _Block_! Forward the Block's "onNeighborChange" method to this
|
||||
* handler.
|
||||
*/
|
||||
public void onNeighborChange();
|
||||
}
|
||||
@@ -1,21 +1,23 @@
|
||||
package pneumaticCraft.api.tileentity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import pneumaticCraft.api.IHeatExchangerLogic;
|
||||
|
||||
/**
|
||||
* Implemented by TileEntities or Blocks which transport heat. Keep in mind that when a Block is implementing it you only can give off a constant
|
||||
* resistance/temperature (like Lava and Ice).
|
||||
* @author MineMaarten
|
||||
* www.minemaarten.com
|
||||
* Implemented by TileEntities or Blocks which transport heat. Keep in mind that when a Block is implementing it you
|
||||
* only can give off a constant resistance/temperature (like Lava and Ice).
|
||||
*
|
||||
* @author MineMaarten www.minemaarten.com
|
||||
*/
|
||||
public interface IHeatExchanger {
|
||||
|
||||
/**
|
||||
* Get an instance of IHeatExchangerLogic from PneumaticRegistry.getInstance().getHeatExchangerLogic() and keep a global reference.
|
||||
* Then return it in this method. You can return different exchanger logics for different sides. Keep in mind that when you change
|
||||
* a returned logic, you need to create a neighbor block change to notify the differences. You can return null to indicate no heat can
|
||||
* be exchanged on that side.
|
||||
* Get an instance of IHeatExchangerLogic from PneumaticRegistry.getInstance().getHeatExchangerLogic() and keep a
|
||||
* global reference. Then return it in this method. You can return different exchanger logics for different sides.
|
||||
* Keep in mind that when you change a returned logic, you need to create a neighbor block change to notify the
|
||||
* differences. You can return null to indicate no heat can be exchanged on that side.
|
||||
*
|
||||
* @param side
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package pneumaticCraft.api.tileentity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public interface IManoMeasurable {
|
||||
|
||||
/**
|
||||
* This method is invoked by the Manometer when a player right-clicks a TE or Entity with this interface implemented.
|
||||
* @param player that rightclicks the measurable TE, and therefore needs to get the message
|
||||
* This method is invoked by the Manometer when a player right-clicks a TE or Entity with this interface
|
||||
* implemented.
|
||||
*
|
||||
* @param player that rightclicks the measurable TE, and therefore needs to get the message
|
||||
* @param curInfo list you can append info to. If you don't append any info no air will be used.
|
||||
*/
|
||||
public void printManometerMessage(EntityPlayer player, List<String> curInfo);
|
||||
|
||||
@@ -5,24 +5,27 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
public interface IPneumaticMachine {
|
||||
|
||||
/**
|
||||
* In your TileEntity class which is implementing this interface you should keep a reference of an IAirHandler.
|
||||
* You can retrieve one by calling {@link AirHandlerSupplier#getAirHandler(net.minecraft.tileentity.TileEntity, float, float, float, float)}.
|
||||
* Do this when your TileEntity is initialized, i.e. xCoord,yCoord,zCoord and worldObj have a value.
|
||||
* In this method you need to return this reference.
|
||||
* In your TileEntity class which is implementing this interface you should keep a reference of an IAirHandler. You
|
||||
* can retrieve one by calling
|
||||
* {@link AirHandlerSupplier#getAirHandler(net.minecraft.tileentity.TileEntity, float, float, float, float)}. Do
|
||||
* this when your TileEntity is initialized, i.e. xCoord,yCoord,zCoord and worldObj have a value. In this method you
|
||||
* need to return this reference.
|
||||
*
|
||||
* IMPORTANT: You need to forward the {@link net.minecraft.tileentity.TileEntity#updateEntity()},
|
||||
* {@link net.minecraft.tileentity.TileEntity#writeToNBT(net.minecraft.nbt.NBTTagCompound)} ,
|
||||
* {@link net.minecraft.tileentity.TileEntity#readFromNBT(net.minecraft.nbt.NBTTagCompound)} and
|
||||
* {@link net.minecraft.tileentity.TileEntity#validate()} (with the implementing TileEntity as additional parameter)
|
||||
* to the IAirHandler.
|
||||
* Apart from that you'll need to forward {@link net.minecraft.block.Block#onNeighborChange(net.minecraft.world.IBlockAccess, int, int, int, int, int, int)}
|
||||
* to the IAirHandler. Apart from that you'll need to forward
|
||||
* {@link net.minecraft.block.Block#onNeighborChange(net.minecraft.world.IBlockAccess, int, int, int, int, int, int)}
|
||||
* from the implementing block to the IAirHandler.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IAirHandler getAirHandler();
|
||||
|
||||
/**
|
||||
* Returns true if the pneumatic logic is connected to the given side.
|
||||
*
|
||||
* @param side
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+13
-2
@@ -1,20 +1,27 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import org.lwjgl.util.Rectangle;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public interface IBlockAndCoordinateEventSensor {
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#getSensorPath()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSensorPath();
|
||||
|
||||
/**
|
||||
* Extended version of the normal emitRedstoneOnEvent. This method will only invoke with a valid GPS tool, and when the coordinate is within range.
|
||||
* Extended version of the normal emitRedstoneOnEvent. This method will only invoke with a valid GPS tool, and when
|
||||
* the coordinate is within range.
|
||||
*
|
||||
* @param event
|
||||
* @param sensor
|
||||
* @param range
|
||||
@@ -27,12 +34,14 @@ public interface IBlockAndCoordinateEventSensor {
|
||||
|
||||
/**
|
||||
* See {@link IEventSensorSetting#getRedstonePulseLength()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getRedstonePulseLength();
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#needsTextBox()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean needsTextBox();
|
||||
@@ -44,12 +53,14 @@ public interface IBlockAndCoordinateEventSensor {
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#getDescription()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<String> getDescription();
|
||||
|
||||
/**
|
||||
* Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text.
|
||||
*
|
||||
* @param fontRenderer
|
||||
*/
|
||||
public void drawAdditionalInfo(FontRenderer fontRenderer);
|
||||
|
||||
@@ -1,38 +1,47 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.util.Rectangle;
|
||||
|
||||
public interface IBlockAndCoordinatePollSensor {
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#getSensorPath()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSensorPath();
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#needsTextBox()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean needsTextBox();
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#needsSlot()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Rectangle needsSlot();
|
||||
|
||||
/**
|
||||
* See {@link ISensorSetting#getDescription()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<String> getDescription();
|
||||
|
||||
/**
|
||||
* See {@link IPollSensorSetting#getRedstoneValue(World, int, int, int, int, String)} , but this has the GPS tracked coordinates
|
||||
* as extra parameters. This method will only be called when the coordinate is within the Universal Sensor's range.
|
||||
* See {@link IPollSensorSetting#getRedstoneValue(World, int, int, int, int, String)} , but this has the GPS tracked
|
||||
* coordinates as extra parameters. This method will only be called when the coordinate is within the Universal
|
||||
* Sensor's range.
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
@@ -44,17 +53,19 @@ public interface IBlockAndCoordinatePollSensor {
|
||||
* @param toolZ
|
||||
* @return
|
||||
*/
|
||||
public int getRedstoneValue(
|
||||
World world, int x, int y, int z, int sensorRange, String textBoxText, int toolX, int toolY, int toolZ);
|
||||
public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText, int toolX,
|
||||
int toolY, int toolZ);
|
||||
|
||||
/**
|
||||
* See {@link IPollSensorSetting#getPollFrequency()}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getPollFrequency();
|
||||
|
||||
/**
|
||||
* Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text.
|
||||
*
|
||||
* @param fontRenderer
|
||||
*/
|
||||
public void drawAdditionalInfo(FontRenderer fontRenderer);
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public interface IEventSensorSetting extends ISensorSetting {
|
||||
|
||||
/**
|
||||
* This method is only invoked when a subscribed event is triggered.
|
||||
*
|
||||
* @param event
|
||||
* @param sensor
|
||||
* @param range
|
||||
@@ -17,6 +19,7 @@ public interface IEventSensorSetting extends ISensorSetting {
|
||||
|
||||
/**
|
||||
* Should return how long a pulse should hold in ticks. By default this is 5 ticks (1/4 second).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getRedstonePulseLength();
|
||||
|
||||
@@ -5,8 +5,9 @@ import net.minecraft.world.World;
|
||||
public interface IPollSensorSetting extends ISensorSetting {
|
||||
|
||||
/**
|
||||
* The value returned here is the interval between every check in ticks (the interval of calling getRedstoneValue()).
|
||||
* Consider increasing the interval when your sensor method is resource intensive.
|
||||
* The value returned here is the interval between every check in ticks (the interval of calling
|
||||
* getRedstoneValue()). Consider increasing the interval when your sensor method is resource intensive.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getPollFrequency();
|
||||
@@ -14,6 +15,7 @@ public interface IPollSensorSetting extends ISensorSetting {
|
||||
/**
|
||||
* The base method. This method should return the outputted redstone value 0-15 of this sensor. When this sensor is
|
||||
* digital, just return 0 or 15.
|
||||
*
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
|
||||
@@ -1,56 +1,57 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
import org.lwjgl.util.Rectangle;
|
||||
|
||||
public interface ISensorSetting {
|
||||
|
||||
/**
|
||||
* Should return the button path the player has to follow in which this setting is stored.
|
||||
* For instance, when the sensor should be located in player and is called speed, you should return "entityTracker/player/speed".
|
||||
* "entityTracker" indicates that this sensor needs an Entity Tracker upgrade to run. You can choose from the following upgrades:
|
||||
* Should return the button path the player has to follow in which this setting is stored. For instance, when the
|
||||
* sensor should be located in player and is called speed, you should return "entityTracker/player/speed".
|
||||
* "entityTracker" indicates that this sensor needs an Entity Tracker upgrade to run. You can choose from the
|
||||
* following upgrades:
|
||||
*
|
||||
* -entityTracker
|
||||
* -blockTracker
|
||||
* -gpsTool (so you can use a certain coordinate (within range) to measure on)
|
||||
* -volume
|
||||
* -dispenser
|
||||
* -speed
|
||||
* -itemLife
|
||||
* -itemSearch
|
||||
* -coordinateTracker
|
||||
* -range
|
||||
* -security
|
||||
* -entityTracker -blockTracker -gpsTool (so you can use a certain coordinate (within range) to measure on) -volume
|
||||
* -dispenser -speed -itemLife -itemSearch -coordinateTracker -range -security
|
||||
*
|
||||
* You can allow only sensors to work by more than one upgrade, by seperating the upgrades with a '_'. For example,
|
||||
* "entityTracker_speed" will only let the sensor be chosen when both an Entity Tracker and a Speed Upgrade are inserted.
|
||||
* "entityTracker_speed" will only let the sensor be chosen when both an Entity Tracker and a Speed Upgrade are
|
||||
* inserted.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSensorPath();
|
||||
|
||||
/**
|
||||
* When returned true, the GUI will enable the textbox writing, otherwise not.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean needsTextBox();
|
||||
|
||||
/**
|
||||
* Called by GuiScreen#drawScreen this method can be used to render additional things like status/info text.
|
||||
*
|
||||
* @param fontRenderer
|
||||
*/
|
||||
public void drawAdditionalInfo(FontRenderer fontRenderer);
|
||||
|
||||
/**
|
||||
* Should return the description of this sensor displayed in the GUI stat. Information should at least include
|
||||
* when this sensor emits redstone and how (analog (1 through 15), or digital).
|
||||
* Should return the description of this sensor displayed in the GUI stat. Information should at least include when
|
||||
* this sensor emits redstone and how (analog (1 through 15), or digital).
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<String> getDescription();
|
||||
|
||||
/**
|
||||
* Not being used at the moment, I recommend returning null for now. It is going to be used to allow sensors to decide their
|
||||
* status on a item which can be inserted in a slot in the GUI if this method returns a rectangle with the coordinates of
|
||||
* the slot.
|
||||
* Not being used at the moment, I recommend returning null for now. It is going to be used to allow sensors to
|
||||
* decide their status on a item which can be inserted in a slot in the GUI if this method returns a rectangle with
|
||||
* the coordinates of the slot.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Rectangle needsSlot();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package pneumaticCraft.api.universalSensor;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public abstract class PlayerEventSensor implements IEventSensorSetting {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,28 +4,34 @@ package pneumaticCraft.api.universalSensor;
|
||||
* With this class you can register your own sensors.
|
||||
*/
|
||||
public class SensorRegistrator {
|
||||
|
||||
/**
|
||||
* This field will be initialized in the PreInit phase of PneumaticCraft's loading phase.
|
||||
* With this field you can register every Universal Sensor sensor you want. Just pass a new instance
|
||||
* to one of the registerSensor methods. Sensors are singletons.
|
||||
* This field will be initialized in the PreInit phase of PneumaticCraft's loading phase. With this field you can
|
||||
* register every Universal Sensor sensor you want. Just pass a new instance to one of the registerSensor methods.
|
||||
* Sensors are singletons.
|
||||
*/
|
||||
public static ISensorRegistrator sensorRegistrator;
|
||||
|
||||
public static interface ISensorRegistrator {
|
||||
|
||||
/**
|
||||
* Registry for IPollSensorSetting, EntityPollSensor and IEventSensorSetting, and any other instance of ISensorSetting.
|
||||
* Registry for IPollSensorSetting, EntityPollSensor and IEventSensorSetting, and any other instance of
|
||||
* ISensorSetting.
|
||||
*
|
||||
* @param sensor
|
||||
*/
|
||||
public void registerSensor(ISensorSetting sensor);
|
||||
|
||||
/**
|
||||
* Registry for IBlockAndCoordinateEventSensor
|
||||
*
|
||||
* @param sensor
|
||||
*/
|
||||
public void registerSensor(IBlockAndCoordinateEventSensor sensor);
|
||||
|
||||
/**
|
||||
* Registry for IBlockAndCoordinatePollSensor
|
||||
*
|
||||
* @param sensor
|
||||
*/
|
||||
public void registerSensor(IBlockAndCoordinatePollSensor sensor);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,5 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.block.ArmourForge;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockAlchemicCalcinator;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockAltar;
|
||||
@@ -49,15 +51,12 @@ import WayofTime.alchemicalWizardry.common.items.ItemSpellModifierBlock;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemSpellParadigmBlock;
|
||||
import WayofTime.alchemicalWizardry.common.items.ItemStabilityGlyphBlock;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: Pokefenn
|
||||
* Date: 17/01/14
|
||||
* Time: 19:48
|
||||
* Created with IntelliJ IDEA. User: Pokefenn Date: 17/01/14 Time: 19:48
|
||||
*/
|
||||
public class ModBlocks {
|
||||
|
||||
public static Block bloodStoneBrick;
|
||||
public static Block largeBloodStoneBrick;
|
||||
public static BlockAltar blockAltar;
|
||||
@@ -197,7 +196,9 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal");
|
||||
GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic");
|
||||
GameRegistry.registerBlock(
|
||||
ModBlocks.blockEnchantmentGlyph, ItemEnchantmentGlyphBlock.class, "blockEnchantmentGlyph");
|
||||
ModBlocks.blockEnchantmentGlyph,
|
||||
ItemEnchantmentGlyphBlock.class,
|
||||
"blockEnchantmentGlyph");
|
||||
GameRegistry.registerBlock(ModBlocks.blockStabilityGlyph, ItemStabilityGlyphBlock.class, "blockStabilityGlyph");
|
||||
|
||||
GameRegistry.registerBlock(ModBlocks.blockCrucible, "blockCrucible");
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package WayofTime.alchemicalWizardry;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.api.spell.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.items.*;
|
||||
@@ -49,17 +53,12 @@ import WayofTime.alchemicalWizardry.common.items.sigil.SigilVoid;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.SigilWater;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.holding.SigilOfHolding;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
* User: Pokefenn
|
||||
* Date: 17/01/14
|
||||
* Time: 19:48
|
||||
* Created with IntelliJ IDEA. User: Pokefenn Date: 17/01/14 Time: 19:48
|
||||
*/
|
||||
public class ModItems {
|
||||
|
||||
public static Item weakBloodOrb;
|
||||
public static Item apprenticeBloodOrb;
|
||||
public static Item magicianBloodOrb;
|
||||
@@ -268,8 +267,8 @@ public class ModItems {
|
||||
sigilOfWind = new SigilOfWind().setUnlocalizedName("sigilOfWind");
|
||||
telepositionFocus = new TelepositionFocus(1).setUnlocalizedName("telepositionFocus");
|
||||
enhancedTelepositionFocus = new EnhancedTelepositionFocus().setUnlocalizedName("enhancedTelepositionFocus");
|
||||
reinforcedTelepositionFocus =
|
||||
new ReinforcedTelepositionFocus().setUnlocalizedName("reinforcedTelepositionFocus");
|
||||
reinforcedTelepositionFocus = new ReinforcedTelepositionFocus()
|
||||
.setUnlocalizedName("reinforcedTelepositionFocus");
|
||||
demonicTelepositionFocus = new DemonicTelepositionFocus().setUnlocalizedName("demonicTelepositionFocus");
|
||||
imbuedSlate = new AWBaseItems().setUnlocalizedName("imbuedSlate");
|
||||
demonicSlate = new AWBaseItems().setUnlocalizedName("demonicSlate");
|
||||
@@ -291,10 +290,8 @@ public class ModItems {
|
||||
energyBazookaThirdTier = new EnergyBazooka(3).setUnlocalizedName("energyBazookaThirdTier");
|
||||
itemBloodLightSigil = new SigilBloodLight().setUnlocalizedName("bloodLightSigil");
|
||||
itemComplexSpellCrystal = new ItemComplexSpellCrystal().setUnlocalizedName("itemComplexSpellCrystal");
|
||||
bucketLife = new LifeBucket(ModBlocks.blockLifeEssence)
|
||||
.setUnlocalizedName("bucketLife")
|
||||
.setContainerItem(Items.bucket)
|
||||
.setCreativeTab(CreativeTabs.tabMisc);
|
||||
bucketLife = new LifeBucket(ModBlocks.blockLifeEssence).setUnlocalizedName("bucketLife")
|
||||
.setContainerItem(Items.bucket).setCreativeTab(CreativeTabs.tabMisc);
|
||||
itemSigilOfEnderSeverance = (new SigilOfEnderSeverance()).setUnlocalizedName("itemSigilOfEnderSeverance");
|
||||
baseItems = new ItemComponents().setUnlocalizedName("baseItems");
|
||||
baseAlchemyItems = new ItemAlchemyBase().setUnlocalizedName("baseAlchemyItems");
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package WayofTime.alchemicalWizardry.api;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
|
||||
/**
|
||||
* A Block with a set metadata. Similar to an ItemStack.
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ColourAndCoords {
|
||||
|
||||
public int colourRed;
|
||||
public int colourGreen;
|
||||
public int colourBlue;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package WayofTime.alchemicalWizardry.api;
|
||||
|
||||
public interface ILimitingLogic {
|
||||
|
||||
public int getRoutingLimit();
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class Int3 {
|
||||
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
@@ -28,8 +29,7 @@ public class Int3 {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Int3
|
||||
? ((Int3) o).xCoord == this.xCoord
|
||||
&& ((Int3) o).yCoord == this.yCoord
|
||||
? ((Int3) o).xCoord == this.xCoord && ((Int3) o).yCoord == this.yCoord
|
||||
&& ((Int3) o).zCoord == this.zCoord
|
||||
: false;
|
||||
}
|
||||
|
||||
@@ -3,13 +3,11 @@ package WayofTime.alchemicalWizardry.api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RoutingFocusLogic {
|
||||
|
||||
public boolean getDefaultMatch(ItemStack keyStack, ItemStack checkedStack) {
|
||||
return (keyStack != null
|
||||
? checkedStack != null
|
||||
&& keyStack.getItem() == checkedStack.getItem()
|
||||
&& (keyStack.getItem().getHasSubtypes()
|
||||
? keyStack.getItemDamage() == checkedStack.getItemDamage()
|
||||
: true)
|
||||
return (keyStack != null ? checkedStack != null && keyStack.getItem() == checkedStack.getItem()
|
||||
&& (keyStack.getItem().getHasSubtypes() ? keyStack.getItemDamage() == checkedStack.getItemDamage()
|
||||
: true)
|
||||
: false);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ package WayofTime.alchemicalWizardry.api;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RoutingFocusParadigm {
|
||||
|
||||
public List<RoutingFocusLogic> logicList = new LinkedList();
|
||||
|
||||
public List<RoutingFocusPosAndFacing> locationList = new LinkedList();
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RoutingFocusPosAndFacing {
|
||||
|
||||
public Int3 location;
|
||||
public ForgeDirection facing;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package WayofTime.alchemicalWizardry.api;
|
||||
|
||||
/*
|
||||
* Created in Scala by Alex-Hawks
|
||||
* Translated and implemented by Arcaratus
|
||||
* Created in Scala by Alex-Hawks Translated and implemented by Arcaratus
|
||||
*/
|
||||
public class Vector3 {
|
||||
|
||||
public int x, y, z;
|
||||
|
||||
public Vector3(int x, int y, int z) {
|
||||
@@ -28,12 +28,10 @@ public class Vector3 {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
return object == this
|
||||
|| object instanceof Vector3
|
||||
&& canEqual(this)
|
||||
&& this.x == ((Vector3) object).x
|
||||
&& this.y == ((Vector3) object).y
|
||||
&& this.z == ((Vector3) object).z;
|
||||
return object == this || object instanceof Vector3 && canEqual(this)
|
||||
&& this.x == ((Vector3) object).x
|
||||
&& this.y == ((Vector3) object).y
|
||||
&& this.z == ((Vector3) object).z;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
@@ -1,9 +1,11 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlchemicalPotionCreationHandler {
|
||||
|
||||
public static ArrayList<AlchemyPotionHandlerComponent> registeredPotionEffects = new ArrayList();
|
||||
|
||||
public static void addPotion(ItemStack itemStack, int potionID, int tickDuration) {
|
||||
|
||||
+1
@@ -4,6 +4,7 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlchemyPotionHandlerComponent {
|
||||
|
||||
private ItemStack itemStack;
|
||||
private int potionID;
|
||||
private int tickDuration;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class AlchemyPotionHelper {
|
||||
|
||||
private int potionID;
|
||||
private int tickDuration;
|
||||
private int concentration;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class AlchemyRecipe {
|
||||
|
||||
private ItemStack output;
|
||||
private ItemStack[] recipe;
|
||||
private int bloodOrbLevel;
|
||||
@@ -85,7 +86,7 @@ public class AlchemyRecipe {
|
||||
}
|
||||
|
||||
if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage()
|
||||
|| OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage())
|
||||
|| OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage())
|
||||
&& checkedItemStack.getItem() == recipeItemStack.getItem()) {
|
||||
test = true;
|
||||
checkList[j] = true;
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBloodOrb;
|
||||
|
||||
public class AlchemyRecipeRegistry {
|
||||
|
||||
public static List<AlchemyRecipe> recipes = new ArrayList();
|
||||
|
||||
public static void registerRecipe(ItemStack output, int amountNeeded, ItemStack[] recipe, int bloodOrbLevel) {
|
||||
|
||||
@@ -5,5 +5,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IAlchemyGoggles {
|
||||
|
||||
boolean showIngameHUD(World world, ItemStack stack, EntityPlayer player);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
|
||||
public interface IReagentContainer {
|
||||
|
||||
ReagentStack getReagent();
|
||||
|
||||
int getReagentStackAmount();
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IReagentHandler {
|
||||
|
||||
int fill(ForgeDirection from, ReagentStack resource, boolean doFill);
|
||||
|
||||
ReagentStack drain(ForgeDirection from, ReagentStack resource, boolean doDrain);
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
import java.util.Map;
|
||||
|
||||
public interface ISegmentedReagentHandler extends IReagentHandler {
|
||||
|
||||
int getNumberOfTanks();
|
||||
|
||||
int getTanksTunedToReagent(Reagent reagent);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
|
||||
public class Reagent {
|
||||
|
||||
public final String name;
|
||||
|
||||
public static final int REAGENT_SIZE = 1000;
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ReagentContainer implements IReagentContainer {
|
||||
|
||||
protected ReagentStack reagentStack;
|
||||
protected int capacity;
|
||||
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
|
||||
public final class ReagentContainerInfo {
|
||||
|
||||
public final ReagentStack reagent;
|
||||
public final int capacity;
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ReagentRegistry {
|
||||
|
||||
public static Map<String, Reagent> reagentList = new HashMap();
|
||||
public static Map<ItemStack, ReagentStack> itemToReagentMap = new HashMap();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ReagentStack {
|
||||
|
||||
public Reagent reagent;
|
||||
public int amount;
|
||||
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileReagentHandler extends TileEntity implements IReagentHandler {
|
||||
|
||||
protected ReagentContainer tank = new ReagentContainer(4000);
|
||||
|
||||
@Override
|
||||
@@ -50,6 +51,6 @@ public class TileReagentHandler extends TileEntity implements IReagentHandler {
|
||||
|
||||
@Override
|
||||
public ReagentContainerInfo[] getContainerInfo(ForgeDirection from) {
|
||||
return new ReagentContainerInfo[] {tank.getInfo()};
|
||||
return new ReagentContainerInfo[] { tank.getInfo() };
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.alchemy.energy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -10,6 +11,7 @@ import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileSegmentedReagentHandler extends TileEntity implements ISegmentedReagentHandler {
|
||||
|
||||
protected ReagentContainer[] tanks;
|
||||
protected Map<Reagent, Integer> attunedTankMap;
|
||||
|
||||
@@ -99,8 +101,7 @@ public class TileSegmentedReagentHandler extends TileEntity implements ISegmente
|
||||
ReagentStack remainingStack = resource.copy();
|
||||
remainingStack.amount = maxFill - totalFill;
|
||||
|
||||
boolean doesReagentMatch = tanks[i].getReagent() == null
|
||||
? false
|
||||
boolean doesReagentMatch = tanks[i].getReagent() == null ? false
|
||||
: tanks[i].getReagent().isReagentEqual(remainingStack);
|
||||
|
||||
if (doesReagentMatch) {
|
||||
|
||||
+7
-19
@@ -2,11 +2,13 @@ package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class AltarRecipe {
|
||||
|
||||
public int minTier;
|
||||
public int liquidRequired;
|
||||
public boolean canBeFilled; // Tells the system that the item is an orb
|
||||
@@ -17,26 +19,13 @@ public class AltarRecipe {
|
||||
public boolean useTag;
|
||||
public ArrayList<Object> input = new ArrayList<Object>();
|
||||
|
||||
public AltarRecipe(
|
||||
ItemStack result,
|
||||
ItemStack requiredItem,
|
||||
int minTier,
|
||||
int liquidRequired,
|
||||
int consumptionRate,
|
||||
int drainRate,
|
||||
boolean canBeFilled) {
|
||||
public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate,
|
||||
int drainRate, boolean canBeFilled) {
|
||||
this(result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled, false);
|
||||
}
|
||||
|
||||
public AltarRecipe(
|
||||
ItemStack result,
|
||||
ItemStack requiredItem,
|
||||
int minTier,
|
||||
int liquidRequired,
|
||||
int consumptionRate,
|
||||
int drainRate,
|
||||
boolean canBeFilled,
|
||||
boolean useTag) {
|
||||
public AltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired, int consumptionRate,
|
||||
int drainRate, boolean canBeFilled, boolean useTag) {
|
||||
this.result = result;
|
||||
this.requiredItem = requiredItem;
|
||||
this.minTier = minTier;
|
||||
@@ -60,8 +49,7 @@ public class AltarRecipe {
|
||||
return false;
|
||||
}
|
||||
|
||||
return tierCheck >= minTier
|
||||
&& this.requiredItem.isItemEqual(comparedStack)
|
||||
return tierCheck >= minTier && this.requiredItem.isItemEqual(comparedStack)
|
||||
&& (this.useTag ? this.areRequiredTagsEqual(comparedStack) : true);
|
||||
}
|
||||
|
||||
|
||||
+25
-20
@@ -4,34 +4,39 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AltarRecipeRegistry {
|
||||
|
||||
public static List<AltarRecipe> altarRecipes = new LinkedList<>();
|
||||
public static Map<Integer, ItemStack> orbMap = new HashMap<>();
|
||||
|
||||
public static void registerAltarRecipe(
|
||||
ItemStack result,
|
||||
ItemStack requiredItem,
|
||||
int minTier,
|
||||
int liquidRequired,
|
||||
int consumptionRate,
|
||||
int drainRate,
|
||||
boolean canBeFilled) {
|
||||
altarRecipes.add(new AltarRecipe(
|
||||
result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled));
|
||||
public static void registerAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired,
|
||||
int consumptionRate, int drainRate, boolean canBeFilled) {
|
||||
altarRecipes.add(
|
||||
new AltarRecipe(
|
||||
result,
|
||||
requiredItem,
|
||||
minTier,
|
||||
liquidRequired,
|
||||
consumptionRate,
|
||||
drainRate,
|
||||
canBeFilled));
|
||||
}
|
||||
|
||||
public static void registerNBTAltarRecipe(
|
||||
ItemStack result,
|
||||
ItemStack requiredItem,
|
||||
int minTier,
|
||||
int liquidRequired,
|
||||
int consumptionRate,
|
||||
int drainRate,
|
||||
boolean canBeFilled) {
|
||||
altarRecipes.add(new AltarRecipe(
|
||||
result, requiredItem, minTier, liquidRequired, consumptionRate, drainRate, canBeFilled, true));
|
||||
public static void registerNBTAltarRecipe(ItemStack result, ItemStack requiredItem, int minTier, int liquidRequired,
|
||||
int consumptionRate, int drainRate, boolean canBeFilled) {
|
||||
altarRecipes.add(
|
||||
new AltarRecipe(
|
||||
result,
|
||||
requiredItem,
|
||||
minTier,
|
||||
liquidRequired,
|
||||
consumptionRate,
|
||||
drainRate,
|
||||
canBeFilled,
|
||||
true));
|
||||
}
|
||||
|
||||
public static void registerAltarOrbRecipe(ItemStack orbStack, int minTier, int consumptionRate) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package WayofTime.alchemicalWizardry.api.altarRecipeRegistry;
|
||||
|
||||
public interface IFadedRune {
|
||||
|
||||
int getAltarTierLimit(int meta);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BindingRecipe {
|
||||
|
||||
public ItemStack requiredItem;
|
||||
public ItemStack outputItem;
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BindingRegistry {
|
||||
|
||||
public static List<BindingRecipe> bindingRecipes = new LinkedList();
|
||||
|
||||
public static void registerRecipe(ItemStack output, ItemStack input) {
|
||||
|
||||
@@ -2,9 +2,11 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class UnbindingRecipe {
|
||||
|
||||
public ItemStack requiredItem;
|
||||
public List<ItemStack> outputItem;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ package WayofTime.alchemicalWizardry.api.bindingRegistry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class UnbindingRegistry {
|
||||
|
||||
public static List<UnbindingRecipe> unbindingRecipes = new LinkedList<UnbindingRecipe>();
|
||||
|
||||
public static void addAllUnbindingRecipesFromBinding() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package WayofTime.alchemicalWizardry.api.command;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.command.PlayerNotFoundException;
|
||||
@@ -40,21 +41,19 @@ public abstract class SubCommandBase implements ISubCommand {
|
||||
@Override
|
||||
public void processSubCommand(ICommandSender commandSender, String[] args) {
|
||||
|
||||
if (args.length == 0 && !getSubCommandName().equals("help"))
|
||||
displayErrorString(
|
||||
commandSender,
|
||||
String.format(
|
||||
StatCollector.translateToLocal("commands.format.error"),
|
||||
capitalizeFirstLetter(getSubCommandName()),
|
||||
getArgUsage(commandSender)));
|
||||
if (args.length == 0 && !getSubCommandName().equals("help")) displayErrorString(
|
||||
commandSender,
|
||||
String.format(
|
||||
StatCollector.translateToLocal("commands.format.error"),
|
||||
capitalizeFirstLetter(getSubCommandName()),
|
||||
getArgUsage(commandSender)));
|
||||
|
||||
if (isBounded(0, 2, args.length) && args[0].equals("help"))
|
||||
displayHelpString(
|
||||
commandSender,
|
||||
String.format(
|
||||
StatCollector.translateToLocal("commands.format.help"),
|
||||
capitalizeFirstLetter(getSubCommandName()),
|
||||
getHelpText()));
|
||||
if (isBounded(0, 2, args.length) && args[0].equals("help")) displayHelpString(
|
||||
commandSender,
|
||||
String.format(
|
||||
StatCollector.translateToLocal("commands.format.help"),
|
||||
capitalizeFirstLetter(getSubCommandName()),
|
||||
getHelpText()));
|
||||
}
|
||||
|
||||
protected EntityPlayerMP getCommandSenderAsPlayer(ICommandSender commandSender) {
|
||||
@@ -67,8 +66,7 @@ public abstract class SubCommandBase implements ISubCommand {
|
||||
|
||||
if (entityplayermp != null) return entityplayermp;
|
||||
else {
|
||||
entityplayermp =
|
||||
MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
|
||||
entityplayermp = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName);
|
||||
|
||||
if (entityplayermp == null) throw new PlayerNotFoundException();
|
||||
else return entityplayermp;
|
||||
@@ -84,17 +82,20 @@ public abstract class SubCommandBase implements ISubCommand {
|
||||
}
|
||||
|
||||
protected void displayHelpString(ICommandSender commandSender, String display, Object... info) {
|
||||
commandSender.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
commandSender.addChatMessage(
|
||||
new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
|
||||
}
|
||||
|
||||
protected void displayErrorString(ICommandSender commandSender, String display, Object... info) {
|
||||
commandSender.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
commandSender.addChatMessage(
|
||||
new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
|
||||
protected void displaySuccessString(ICommandSender commandSender, String display, Object... info) {
|
||||
commandSender.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.BLUE)));
|
||||
commandSender.addChatMessage(
|
||||
new ChatComponentText(StatCollector.translateToLocalFormatted(display, info))
|
||||
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.BLUE)));
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,13 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class CompressionHandler {
|
||||
|
||||
/**
|
||||
* Called to look at the inventory and syphons the required stack. Returns resultant stack if successful, and null if not.
|
||||
* @param inv The inventory iterated through
|
||||
* @return The result of the compression
|
||||
* Called to look at the inventory and syphons the required stack. Returns resultant stack if successful, and null
|
||||
* if not.
|
||||
*
|
||||
* @param inv The inventory iterated through
|
||||
* @return The result of the compression
|
||||
*/
|
||||
public abstract ItemStack compressInventory(ItemStack[] inv, World world);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -13,6 +14,7 @@ import net.minecraft.world.World;
|
||||
*
|
||||
*/
|
||||
public class CompressionRegistry {
|
||||
|
||||
public static List<CompressionHandler> compressionRegistry = new ArrayList();
|
||||
public static Map<ItemStack, Integer> thresholdMap = new HashMap();
|
||||
|
||||
@@ -22,6 +24,7 @@ public class CompressionRegistry {
|
||||
|
||||
/**
|
||||
* Registers an item so that it only compresses while above this threshold
|
||||
*
|
||||
* @param stack
|
||||
* @param threshold
|
||||
*/
|
||||
@@ -52,8 +55,7 @@ public class CompressionRegistry {
|
||||
|
||||
public static boolean areItemStacksEqual(ItemStack stack, ItemStack compressedStack) {
|
||||
return stack.isItemEqual(compressedStack)
|
||||
&& (stack.getTagCompound() == null
|
||||
? compressedStack.getTagCompound() == null
|
||||
&& (stack.getTagCompound() == null ? compressedStack.getTagCompound() == null
|
||||
: stack.getTagCompound().equals(compressedStack.getTagCompound()));
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,18 @@ import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
@Cancelable
|
||||
public class AddToNetworkEvent extends Event {
|
||||
|
||||
public String ownerNetwork;
|
||||
public int addedAmount;
|
||||
public int maximum;
|
||||
|
||||
/**
|
||||
* This event is called whenever the network is added to. If cancelled, no LP will be drained from the source. If result is set to Result.DENY,
|
||||
* the LP will still be drained but the soul network will not be added to.
|
||||
* This event is called whenever the network is added to. If cancelled, no LP will be drained from the source. If
|
||||
* result is set to Result.DENY, the LP will still be drained but the soul network will not be added to.
|
||||
*
|
||||
* @param ownerNetwork Key used for the soul network
|
||||
* @param addedAmount Amount added
|
||||
* @param maximum Ceiling that the network can add to
|
||||
* @param ownerNetwork Key used for the soul network
|
||||
* @param addedAmount Amount added
|
||||
* @param maximum Ceiling that the network can add to
|
||||
*/
|
||||
public AddToNetworkEvent(String ownerNetwork, int addedAmount, int maximum) {
|
||||
super();
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
@Cancelable
|
||||
public class ItemBindEvent extends Event {
|
||||
|
||||
public final EntityPlayer player;
|
||||
public String key;
|
||||
public ItemStack itemStack;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class ItemDrainInContainerEvent extends SoulNetworkEvent {
|
||||
|
||||
public ItemStack stack;
|
||||
|
||||
public ItemDrainInContainerEvent(ItemStack stack, String ownerNetwork, int drainAmount) {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent {
|
||||
|
||||
public final ItemStack itemStack;
|
||||
public boolean shouldDamage; // If true, will damage regardless of if the network had enough inside it
|
||||
public float damageAmount; // Amount of damage that would incur if the network could not drain properly
|
||||
@@ -13,10 +15,10 @@ public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent {
|
||||
/**
|
||||
* Set result to deny the action i.e. damage/drain anyways. Cancelling event prevents action without penalties
|
||||
*
|
||||
* @param player Player using the item
|
||||
* @param ownerNetwork Network that the item is tied to
|
||||
* @param itemStack Item used
|
||||
* @param drainAmount Original drain amount - change to alter cost
|
||||
* @param player Player using the item
|
||||
* @param ownerNetwork Network that the item is tied to
|
||||
* @param itemStack Item used
|
||||
* @param drainAmount Original drain amount - change to alter cost
|
||||
*/
|
||||
public ItemDrainNetworkEvent(EntityPlayer player, String ownerNetwork, ItemStack itemStack, int drainAmount) {
|
||||
super(player, ownerNetwork, drainAmount);
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class PlayerAddToNetworkEvent extends AddToNetworkEvent {
|
||||
|
||||
public final EntityPlayer player;
|
||||
public ItemStack itemStack;
|
||||
|
||||
public PlayerAddToNetworkEvent(
|
||||
EntityPlayer player, ItemStack itemStack, String ownerNetwork, int addedAmount, int maximum) {
|
||||
public PlayerAddToNetworkEvent(EntityPlayer player, ItemStack itemStack, String ownerNetwork, int addedAmount,
|
||||
int maximum) {
|
||||
super(ownerNetwork, addedAmount, maximum);
|
||||
this.player = player;
|
||||
this.itemStack = itemStack;
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class PlayerDrainNetworkEvent extends SoulNetworkEvent {
|
||||
|
||||
public final EntityPlayer player; // Player that activated the event
|
||||
|
||||
public PlayerDrainNetworkEvent(EntityPlayer player, String ownerNetwork, int drainAmount) {
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
|
||||
@Cancelable
|
||||
public class RitualActivatedEvent extends RitualEvent {
|
||||
|
||||
public final EntityPlayer player;
|
||||
public final ItemStack crystalStack;
|
||||
public int crystalTier;
|
||||
|
||||
public RitualActivatedEvent(
|
||||
IMasterRitualStone mrs,
|
||||
String ownerKey,
|
||||
String ritualKey,
|
||||
EntityPlayer player,
|
||||
ItemStack activationCrystal,
|
||||
int crystalTier) {
|
||||
public RitualActivatedEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey, EntityPlayer player,
|
||||
ItemStack activationCrystal, int crystalTier) {
|
||||
super(mrs, ownerKey, ritualKey);
|
||||
|
||||
this.player = player;
|
||||
|
||||
@@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class RitualEvent extends Event {
|
||||
|
||||
public final IMasterRitualStone mrs;
|
||||
public String ownerKey;
|
||||
public final String ritualKey;
|
||||
|
||||
@@ -4,6 +4,7 @@ import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualBreakMethod;
|
||||
|
||||
public class RitualStopEvent extends RitualEvent {
|
||||
|
||||
public final RitualBreakMethod method;
|
||||
|
||||
public RitualStopEvent(IMasterRitualStone mrs, String ownerKey, String ritualKey, RitualBreakMethod method) {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@Cancelable
|
||||
public class SacrificeKnifeUsedEvent extends Event {
|
||||
|
||||
public final EntityPlayer player;
|
||||
public boolean shouldDrainHealth;
|
||||
public boolean shouldFillAltar;
|
||||
|
||||
@@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.api.event;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class SoulNetworkEvent extends Event {
|
||||
|
||||
public String ownerNetwork;
|
||||
public int drainAmount;
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package WayofTime.alchemicalWizardry.api.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation,
|
||||
* or cancel it entirely to prevent the transposition. */
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
/**
|
||||
* Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation, or
|
||||
* cancel it entirely to prevent the transposition.
|
||||
*/
|
||||
@Cancelable
|
||||
public class TeleposeEvent extends Event {
|
||||
|
||||
@@ -27,8 +30,8 @@ public class TeleposeEvent extends Event {
|
||||
public final Block finalBlock;
|
||||
public final int finalMetadata;
|
||||
|
||||
public TeleposeEvent(
|
||||
World wi, int xi, int yi, int zi, Block bi, int mi, World wf, int xf, int yf, int zf, Block bf, int mf) {
|
||||
public TeleposeEvent(World wi, int xi, int yi, int zi, Block bi, int mi, World wf, int xf, int yf, int zf, Block bf,
|
||||
int mf) {
|
||||
initialWorld = wi;
|
||||
initialX = xi;
|
||||
initialY = yi;
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package WayofTime.alchemicalWizardry.api.guide;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapedBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.items.ShapelessBloodOrbRecipe;
|
||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||
@@ -11,16 +21,9 @@ import amerifrance.guideapi.api.base.Book;
|
||||
import amerifrance.guideapi.api.util.GuiHelper;
|
||||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class OrbRecipeRenderer implements IRecipeRenderer {
|
||||
|
||||
public IRecipe recipe;
|
||||
|
||||
public OrbRecipeRenderer(IRecipe recipe) {
|
||||
@@ -28,18 +31,9 @@ public class OrbRecipeRenderer implements IRecipeRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(
|
||||
Book book,
|
||||
CategoryAbstract category,
|
||||
EntryAbstract entry,
|
||||
int guiLeft,
|
||||
int guiTop,
|
||||
int mouseX,
|
||||
int mouseY,
|
||||
GuiBase guiBase,
|
||||
FontRenderer fontRenderer) {
|
||||
Minecraft.getMinecraft()
|
||||
.getTextureManager()
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX,
|
||||
int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
Minecraft.getMinecraft().getTextureManager()
|
||||
.bindTexture(new ResourceLocation(ModInformation.GUITEXLOC + "recipe_elements.png"));
|
||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 0, 105, 65);
|
||||
|
||||
@@ -75,7 +69,9 @@ public class OrbRecipeRenderer implements IRecipeRenderer {
|
||||
GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
|
||||
guiBase.renderToolTip(
|
||||
APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
|
||||
APISpellHelper.getOrbForLevel((Integer) component),
|
||||
stackX,
|
||||
stackY);
|
||||
}
|
||||
} else {
|
||||
if (((ArrayList<ItemStack>) component).isEmpty()) return;
|
||||
@@ -112,7 +108,9 @@ public class OrbRecipeRenderer implements IRecipeRenderer {
|
||||
GuiHelper.drawItemStack(APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
|
||||
if (GuiHelper.isMouseBetween(mouseX, mouseY, stackX, stackY, 15, 15)) {
|
||||
guiBase.renderToolTip(
|
||||
APISpellHelper.getOrbForLevel((Integer) component), stackX, stackY);
|
||||
APISpellHelper.getOrbForLevel((Integer) component),
|
||||
stackX,
|
||||
stackY);
|
||||
}
|
||||
} else {
|
||||
if (((ArrayList<ItemStack>) component).isEmpty()) return;
|
||||
@@ -134,16 +132,8 @@ public class OrbRecipeRenderer implements IRecipeRenderer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(
|
||||
Book book,
|
||||
CategoryAbstract category,
|
||||
EntryAbstract entry,
|
||||
int guiLeft,
|
||||
int guiTop,
|
||||
int mouseX,
|
||||
int mouseY,
|
||||
GuiBase guiBase,
|
||||
FontRenderer fontRenderer) {
|
||||
public void drawExtras(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop,
|
||||
int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
package WayofTime.alchemicalWizardry.api.guide;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipe;
|
||||
import amerifrance.guideapi.api.abstraction.CategoryAbstract;
|
||||
import amerifrance.guideapi.api.abstraction.EntryAbstract;
|
||||
@@ -9,13 +17,6 @@ import amerifrance.guideapi.api.util.GuiHelper;
|
||||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class PageAltarRecipe extends PageBase {
|
||||
|
||||
@@ -33,19 +34,10 @@ public class PageAltarRecipe extends PageBase {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(
|
||||
Book book,
|
||||
CategoryAbstract category,
|
||||
EntryAbstract entry,
|
||||
int guiLeft,
|
||||
int guiTop,
|
||||
int mouseX,
|
||||
int mouseY,
|
||||
GuiBase guiBase,
|
||||
FontRenderer fontRenderer) {
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX,
|
||||
int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
|
||||
Minecraft.getMinecraft()
|
||||
.getTextureManager()
|
||||
Minecraft.getMinecraft().getTextureManager()
|
||||
.bindTexture(new ResourceLocation("alchemicalwizardry" + ":textures/gui/guide/altar.png"));
|
||||
guiBase.drawTexturedModalRect(guiLeft + 42, guiTop + 53, 0, 87, 146, 104);
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.api.guide;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import amerifrance.guideapi.api.abstraction.CategoryAbstract;
|
||||
import amerifrance.guideapi.api.abstraction.EntryAbstract;
|
||||
import amerifrance.guideapi.api.base.Book;
|
||||
@@ -7,15 +16,9 @@ import amerifrance.guideapi.api.base.PageBase;
|
||||
import amerifrance.guideapi.gui.GuiBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
public class PageMultiBlock extends PageBase {
|
||||
|
||||
ItemStack[][][] structure;
|
||||
boolean canTick = false;
|
||||
int tick = 0;
|
||||
@@ -52,25 +55,17 @@ public class PageMultiBlock extends PageBase {
|
||||
blockCount += perLvl;
|
||||
}
|
||||
tick = (showLayer == -1 ? blockCount : countPerLevel[showLayer]) * 40;
|
||||
// int yOff = (structureHeight-1)*12+structureWidth*5+structureLength*5+16;
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 100, x+4,y+yOff/2-5, 10,10, 4));
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 101, x+4,y+yOff/2-8-16, 10,16, 3));
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 102, x+4,y+yOff/2+8, 10,16, 2));
|
||||
// int yOff = (structureHeight-1)*12+structureWidth*5+structureLength*5+16;
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 100, x+4,y+yOff/2-5, 10,10, 4));
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 101, x+4,y+yOff/2-8-16, 10,16, 3));
|
||||
// pageButtons.add(new GuiButtonManualNavigation(gui, 102, x+4,y+yOff/2+8, 10,16, 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void draw(
|
||||
Book book,
|
||||
CategoryAbstract category,
|
||||
EntryAbstract entry,
|
||||
int guiLeft,
|
||||
int guiTop,
|
||||
int mouseX,
|
||||
int mouseY,
|
||||
GuiBase guiBase,
|
||||
FontRenderer fontRenderer) {
|
||||
// if(multiblock.getStructureManual()!=null)
|
||||
public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX,
|
||||
int mouseY, GuiBase guiBase, FontRenderer fontRenderer) {
|
||||
// if(multiblock.getStructureManual()!=null)
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int x = guiLeft + 32;
|
||||
@@ -84,7 +79,7 @@ public class PageMultiBlock extends PageBase {
|
||||
|
||||
int xHalf = (structureWidth * 5 - structureLength * 5);
|
||||
int yOffPartial = (structureHeight - 1) * 12 + structureWidth * 5 + structureLength * 5;
|
||||
// int yOffTotal = yOffPartial+16;
|
||||
// int yOffTotal = yOffPartial+16;
|
||||
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
@@ -96,27 +91,24 @@ public class PageMultiBlock extends PageBase {
|
||||
RenderItem.getInstance().renderWithColor = true;
|
||||
int i = 0;
|
||||
ItemStack highlighted = null;
|
||||
for (int h = 0; h < structure.length; h++)
|
||||
if (showLayer == -1 || h <= showLayer) {
|
||||
ItemStack[][] level = structure[h];
|
||||
for (int l = level.length - 1; l >= 0; l--) {
|
||||
ItemStack[] row = level[l];
|
||||
for (int w = row.length - 1; w >= 0; w--) {
|
||||
int xx = 60 + xHalf - 10 * w + 10 * l - 7;
|
||||
int yy = yOffPartial - 5 * w - 5 * l - 12 * h;
|
||||
GL11.glTranslated(0, 0, 1);
|
||||
if (row[w] != null && i <= limiter) {
|
||||
i++;
|
||||
RenderItem.getInstance()
|
||||
.renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, row[w], x + xx, y + yy);
|
||||
if (mouseX >= x + xx
|
||||
&& mouseX < x + xx + 16
|
||||
&& mouseY >= y + yy
|
||||
&& mouseY < y + yy + 16) highlighted = row[w];
|
||||
}
|
||||
for (int h = 0; h < structure.length; h++) if (showLayer == -1 || h <= showLayer) {
|
||||
ItemStack[][] level = structure[h];
|
||||
for (int l = level.length - 1; l >= 0; l--) {
|
||||
ItemStack[] row = level[l];
|
||||
for (int w = row.length - 1; w >= 0; w--) {
|
||||
int xx = 60 + xHalf - 10 * w + 10 * l - 7;
|
||||
int yy = yOffPartial - 5 * w - 5 * l - 12 * h;
|
||||
GL11.glTranslated(0, 0, 1);
|
||||
if (row[w] != null && i <= limiter) {
|
||||
i++;
|
||||
RenderItem.getInstance()
|
||||
.renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, row[w], x + xx, y + yy);
|
||||
if (mouseX >= x + xx && mouseX < x + xx + 16 && mouseY >= y + yy && mouseY < y + yy + 16)
|
||||
highlighted = row[w];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GL11.glTranslated(0, 0, -i);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
@@ -129,9 +121,9 @@ public class PageMultiBlock extends PageBase {
|
||||
if (highlighted != null && renderMouseOver) guiBase.renderToolTip(highlighted, mouseX, mouseY);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
// mc.fontRenderer.setUnicodeFlag(true);
|
||||
// if(localizedText!=null&&!localizedText.isEmpty())
|
||||
// manual.fontRenderer.drawSplitString(localizedText, x,y+yOffTotal, 120, manual.getTextColour());
|
||||
// mc.fontRenderer.setUnicodeFlag(true);
|
||||
// if(localizedText!=null&&!localizedText.isEmpty())
|
||||
// manual.fontRenderer.drawSplitString(localizedText, x,y+yOffTotal, 120, manual.getTextColour());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package WayofTime.alchemicalWizardry.api.guide;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
|
||||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PageRitualMultiBlock extends PageMultiBlock {
|
||||
|
||||
private static ItemStack blankStone;
|
||||
private static ItemStack waterStone;
|
||||
private static ItemStack fireStone;
|
||||
@@ -15,13 +18,13 @@ public class PageRitualMultiBlock extends PageMultiBlock {
|
||||
private static ItemStack dawnStone;
|
||||
|
||||
static {
|
||||
// blankStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.BLANK);
|
||||
// waterStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.WATER);
|
||||
// fireStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.FIRE);
|
||||
// earthStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.EARTH);
|
||||
// airStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.AIR);
|
||||
// duskStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DUSK);
|
||||
// dawnStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DAWN);
|
||||
// blankStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.BLANK);
|
||||
// waterStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.WATER);
|
||||
// fireStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.FIRE);
|
||||
// earthStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.EARTH);
|
||||
// airStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.AIR);
|
||||
// duskStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DUSK);
|
||||
// dawnStone = new ItemStack(ModBlocks.ritualStone, 1, RitualComponent.DAWN);
|
||||
}
|
||||
|
||||
private PageRitualMultiBlock(ItemStack[][][] structure) {
|
||||
@@ -54,15 +57,21 @@ public class PageRitualMultiBlock extends PageMultiBlock {
|
||||
System.out.println(
|
||||
"Min: (" + minX + ", " + minY + ", " + minZ + "), Max: (" + maxX + ", " + maxY + ", " + maxZ + ")");
|
||||
|
||||
ItemStack[][][] tempStructure = new ItemStack[maxY - minY + 1][maxX - minX + 1]
|
||||
[maxZ - minZ + 1]; // First value is vertical, second is down to the left, third is down to the right
|
||||
ItemStack[][][] tempStructure = new ItemStack[maxY - minY + 1][maxX - minX + 1][maxZ - minZ + 1]; // First value
|
||||
// is
|
||||
// vertical,
|
||||
// second is
|
||||
// down to the
|
||||
// left, third
|
||||
// is down to
|
||||
// the right
|
||||
|
||||
for (RitualComponent comp : ritualComponents) {
|
||||
tempStructure[comp.getY() - minY][comp.getX() - minX][comp.getZ() - minZ] =
|
||||
getStackForRitualStone(comp.getStoneType());
|
||||
tempStructure[comp.getY() - minY][comp.getX() - minX][comp.getZ() - minZ] = getStackForRitualStone(
|
||||
comp.getStoneType());
|
||||
}
|
||||
|
||||
// tempStructure[-minY][-minX][-minZ] = new ItemStack(ModBlocks.blockMasterStone);
|
||||
// tempStructure[-minY][-minX][-minZ] = new ItemStack(ModBlocks.blockMasterStone);
|
||||
|
||||
return new PageRitualMultiBlock(tempStructure);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package WayofTime.alchemicalWizardry.api.harvest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class HarvestRegistry {
|
||||
|
||||
public static List<IHarvestHandler> handlerList = new ArrayList();
|
||||
|
||||
public static void registerHarvestHandler(IHarvestHandler handler) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IHarvestHandler {
|
||||
|
||||
/**
|
||||
* A handler that is used to harvest and replant the block at the specified location
|
||||
*
|
||||
|
||||
Loaded 100 of 790 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user