Moved all API to Calclavia Core
This commit is contained in:
parent
558e5d4ae3
commit
ae0012882f
76 changed files with 98 additions and 1895 deletions
|
@ -6,11 +6,11 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.core.Reference;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||
|
||||
public class ItemHammer extends Item
|
||||
|
|
|
@ -11,10 +11,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.api.IFilterable;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.imprint.ItemImprint;
|
||||
import resonantinduction.core.prefab.imprint.TileFilterable;
|
||||
|
@ -22,6 +18,10 @@ import resonantinduction.core.render.RenderItemOverlayTile;
|
|||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMixture;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.IFilterable;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.content.module.TileRender;
|
||||
import calclavia.lib.network.Synced.SyncedInput;
|
||||
import calclavia.lib.network.Synced.SyncedOutput;
|
||||
|
|
|
@ -20,7 +20,7 @@ import resonantinduction.core.Reference;
|
|||
import resonantinduction.core.fluid.TilePressureNode;
|
||||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.configurable.Config;
|
||||
import calclavia.lib.config.Config;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.utility.FluidUtility;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
|
|
@ -23,9 +23,6 @@ import net.minecraftforge.fluids.IFluidTank;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.archaic.fluid.grate.TileGrate;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
|
@ -33,6 +30,9 @@ import resonantinduction.core.fluid.TilePressureNode;
|
|||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import resonantinduction.core.grid.fluid.IPressureNodeProvider;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.content.module.TileRender;
|
||||
import calclavia.lib.prefab.vector.Cuboid;
|
||||
import calclavia.lib.render.FluidRenderUtility;
|
||||
|
|
|
@ -10,11 +10,11 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.prefab.tile.TileExternalInventory;
|
||||
|
|
|
@ -5,11 +5,11 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.prefab.tile.TileExternalInventory;
|
||||
|
|
|
@ -2,13 +2,13 @@ package resonantinduction.electrical.armbot.task;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import calclavia.api.resonantinduction.electrical.ArmbotEntity;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import resonantinduction.api.electrical.ArmbotEntity;
|
||||
import resonantinduction.core.ArgumentData;
|
||||
import resonantinduction.electrical.armbot.IArmbot;
|
||||
import resonantinduction.electrical.armbot.TaskBaseProcess;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package resonantinduction.electrical.armbot.task;
|
||||
|
||||
import calclavia.api.resonantinduction.mechanical.IBelt;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.mechanical.IBelt;
|
||||
import resonantinduction.electrical.armbot.IArmbot;
|
||||
import resonantinduction.electrical.armbot.TaskBaseArmbot;
|
||||
import universalelectricity.api.vector.Vector2;
|
||||
|
|
|
@ -13,7 +13,7 @@ import resonantinduction.electrical.encoder.TileEncoder;
|
|||
import resonantinduction.electrical.encoder.coding.IProgram;
|
||||
import resonantinduction.electrical.encoder.coding.IRedirectTask;
|
||||
import resonantinduction.electrical.encoder.coding.ITask;
|
||||
import calclavia.lib.terminal.IScroll;
|
||||
import calclavia.lib.prefab.terminal.IScroll;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.util.EnumSet;
|
|||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.core.grid.NodeRegistry;
|
||||
import universalelectricity.api.energy.EnergyStorageHandler;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.grid.NodeRegistry;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.prefab.tile.TileElectrical;
|
||||
|
||||
|
|
|
@ -11,9 +11,7 @@ import net.minecraft.util.MovingObjectPosition;
|
|||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import resonantinduction.core.grid.fluid.IPressureNodeProvider;
|
||||
import resonantinduction.core.prefab.part.PartFace;
|
||||
|
@ -23,7 +21,9 @@ import universalelectricity.api.electricity.IElectricalNetwork;
|
|||
import universalelectricity.api.energy.IConductor;
|
||||
import universalelectricity.api.energy.IEnergyNetwork;
|
||||
import universalelectricity.api.net.IConnector;
|
||||
import atomicscience.api.ITemperature;
|
||||
import calclavia.api.atomicscience.ITemperature;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.utility.WrenchUtility;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Iterator;
|
|||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import mffs.api.fortron.IServerThread;
|
||||
import calclavia.api.mffs.fortron.IServerThread;
|
||||
import net.minecraft.server.ServerListenThread;
|
||||
import net.minecraft.server.ThreadMinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
|
|
@ -27,12 +27,12 @@ import resonantinduction.electrical.Electrical;
|
|||
import universalelectricity.api.energy.EnergyStorageHandler;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import universalelectricity.api.vector.VectorWorld;
|
||||
import calclavia.lib.CustomDamageSource;
|
||||
import calclavia.lib.multiblock.reference.IMultiBlockStructure;
|
||||
import calclavia.lib.multiblock.reference.MultiBlockHandler;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.network.IPacketSender;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.prefab.CustomDamageSource;
|
||||
import calclavia.lib.prefab.tile.TileElectrical;
|
||||
import calclavia.lib.render.EnumColor;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import resonantinduction.core.MultipartUtility;
|
|||
import resonantinduction.electrical.Electrical;
|
||||
import universalelectricity.api.CompatibilityModule;
|
||||
import universalelectricity.api.energy.IConductor;
|
||||
import calclavia.lib.CustomDamageSource;
|
||||
import calclavia.lib.prefab.CustomDamageSource;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.multipart.IRedstonePart;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.quantum.gate;
|
||||
|
||||
import icbm.api.IBlockFrequency;
|
||||
import calclavia.api.icbm.IBlockFrequency;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
package resonantinduction.quantum.gate;
|
||||
|
||||
import icbm.api.IBlockFrequency;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import mffs.api.fortron.FrequencyGrid;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -23,6 +20,8 @@ import net.minecraftforge.fluids.FluidTank;
|
|||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import resonantinduction.electrical.Electrical;
|
||||
import universalelectricity.api.vector.VectorWorld;
|
||||
import calclavia.api.icbm.IBlockFrequency;
|
||||
import calclavia.api.mffs.fortron.FrequencyGrid;
|
||||
import calclavia.lib.utility.inventory.ExternalInventory;
|
||||
import calclavia.lib.utility.inventory.IExternalInventory;
|
||||
import calclavia.lib.utility.inventory.IExternalInventoryBox;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.quantum.gate;
|
||||
|
||||
import icbm.api.IBlockFrequency;
|
||||
import calclavia.api.icbm.IBlockFrequency;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
|
|
@ -6,12 +6,10 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.core.TabRI;
|
||||
import resonantinduction.core.grid.NodeRegistry;
|
||||
import resonantinduction.mechanical.belt.BlockConveyorBelt;
|
||||
import resonantinduction.mechanical.belt.TileConveyorBelt;
|
||||
import resonantinduction.mechanical.energy.gear.ItemGear;
|
||||
|
@ -35,8 +33,10 @@ import resonantinduction.mechanical.process.crusher.TileMechanicalPiston;
|
|||
import resonantinduction.mechanical.process.grinder.TileGrindingWheel;
|
||||
import resonantinduction.mechanical.process.purifier.BlockMixer;
|
||||
import resonantinduction.mechanical.process.purifier.TileMixer;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.components.creative.BlockCreativeBuilder;
|
||||
import calclavia.lib.content.ContentRegistry;
|
||||
import calclavia.lib.grid.NodeRegistry;
|
||||
import calclavia.lib.network.PacketAnnotation;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.prefab.item.ItemBlockMetadata;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class MultipartMechanical implements IPartFactory
|
|||
MultiPartRegistry.registerParts(this, PART_TYPES);
|
||||
MultipartGenerator.registerPassThroughInterface("resonantinduction.core.grid.fluid.IPressureNodeProvider");
|
||||
// TODO: Move to UE
|
||||
MultipartGenerator.registerTrait("resonantinduction.core.grid.INodeProvider", "resonantinduction.core.grid.TraitNodeProvider");
|
||||
MultipartGenerator.registerTrait("calclavia.lib.grid.INodeProvider", "calclavia.lib.grid.TraitNodeProvider");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,14 +11,14 @@ import net.minecraft.network.packet.Packet;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.mechanical.IBelt;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import resonantinduction.mechanical.energy.grid.MechanicalNode;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.mechanical.IBelt;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
|
|
@ -11,14 +11,14 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.core.resource.ItemHandCrank;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import resonantinduction.mechanical.energy.grid.MechanicalNode;
|
||||
import resonantinduction.mechanical.energy.grid.PartMechanical;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.multiblock.reference.IMultiBlockStructure;
|
||||
import calclavia.lib.multiblock.reference.MultiBlockHandler;
|
||||
import calclavia.lib.utility.WrenchUtility;
|
||||
|
|
|
@ -4,11 +4,11 @@ import java.util.Collection;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import resonantinduction.mechanical.energy.grid.MechanicalNode;
|
||||
import resonantinduction.mechanical.energy.grid.PartMechanical;
|
||||
|
|
|
@ -3,15 +3,15 @@ package resonantinduction.mechanical.energy.grid;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.grid.Node;
|
||||
import calclavia.lib.grid.TickingGrid;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.core.grid.Node;
|
||||
import resonantinduction.core.grid.TickingGrid;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ package resonantinduction.mechanical.energy.grid;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.multipart.JCuboidPart;
|
||||
|
|
|
@ -5,11 +5,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.content.module.TileBase;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ package resonantinduction.mechanical.energy.turbine;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.mechanical.energy.grid.MechanicalNode;
|
||||
import universalelectricity.api.energy.EnergyStorageHandler;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.network.Synced;
|
||||
import calclavia.lib.network.Synced.SyncedInput;
|
||||
import calclavia.lib.network.Synced.SyncedOutput;
|
||||
|
|
|
@ -2,7 +2,7 @@ package resonantinduction.mechanical.energy.turbine;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import resonantinduction.mechanical.energy.grid.MechanicalNode;
|
||||
import resonantinduction.mechanical.energy.turbine.TileMechanicalTurbine.TurbineNode;
|
||||
import net.minecraft.block.Block;
|
||||
|
|
|
@ -7,12 +7,12 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import resonantinduction.core.grid.fluid.IPressureNodeProvider;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
|
||||
public class TilePump extends TileMechanical implements IPressureNodeProvider, IRotatable
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.mechanical.IManipulator;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.imprint.ItemImprint;
|
||||
import resonantinduction.core.prefab.imprint.TileFilterable;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.mechanical.IManipulator;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.utility.inventory.InternalInventoryHandler;
|
||||
|
|
|
@ -10,10 +10,10 @@ import net.minecraft.network.packet.Packet;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.mechanical.IBelt;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.imprint.TileFilterable;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.mechanical.IBelt;
|
||||
import calclavia.lib.network.IPacketReceiverWithID;
|
||||
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.mechanical.IManipulator;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.imprint.ItemImprint;
|
||||
import resonantinduction.core.prefab.imprint.TileFilterable;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.mechanical.IManipulator;
|
||||
import calclavia.lib.network.IPacketReceiver;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.utility.inventory.InternalInventoryHandler;
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.configurable.Config;
|
||||
import calclavia.lib.config.Config;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.utility.MovementUtility;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
|
|
@ -10,15 +10,15 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Timer;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
import calclavia.lib.prefab.vector.Cuboid;
|
||||
|
||||
|
|
|
@ -12,15 +12,15 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IMechanicalNode;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.Timer;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMixture;
|
||||
import resonantinduction.mechanical.energy.grid.TileMechanical;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.IMechanicalNode;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package resonantinduction.api;
|
||||
|
||||
import resonantinduction.core.grid.INode;
|
||||
|
||||
public interface IEnergyNode extends INode
|
||||
{
|
||||
/**
|
||||
* @return Gets the power of this node. Note that power by definition is energy per second.
|
||||
*/
|
||||
public double getPower();
|
||||
|
||||
/**
|
||||
* @return Gets the energy buffered in this node at this instance.
|
||||
*/
|
||||
public double getEnergy();
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package resonantinduction.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* Applied to TileEntities that can accept a filter.z
|
||||
*
|
||||
* @author Calclavia
|
||||
*/
|
||||
public interface IFilterable
|
||||
{
|
||||
public void setFilter(ItemStack filter);
|
||||
|
||||
public ItemStack getFilter();
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package resonantinduction.api;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Provides extra information for the display units (multimeter) to display.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public interface IInformation
|
||||
{
|
||||
public void getInformation(List<String> info);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package resonantinduction.api;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
public interface IMechanicalNode extends IEnergyNode
|
||||
{
|
||||
public double getTorque();
|
||||
|
||||
public double getAngularVelocity();
|
||||
|
||||
public void apply(double torque, double angularVelocity);
|
||||
|
||||
public float getRatio(ForgeDirection dir, IMechanicalNode with);
|
||||
|
||||
public boolean inverseRotation(ForgeDirection dir, IMechanicalNode with);
|
||||
|
||||
public IMechanicalNode setLoad(double load);
|
||||
|
||||
public Vector3 position();
|
||||
}
|
|
@ -1,193 +0,0 @@
|
|||
package resonantinduction.api.electrical;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.item.EntityBoat;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.entity.monster.EntitySpider;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.passive.EntityCow;
|
||||
import net.minecraft.entity.passive.EntityPig;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
/**
|
||||
* Dictionary to track entities by several names to be used for anything. Current use is armbot task
|
||||
* so the user has an easy way to ID creatures.
|
||||
*
|
||||
* @author DarkGuardsman
|
||||
*/
|
||||
public class ArmbotEntity
|
||||
{
|
||||
public static HashMap<String, Class<? extends Entity>> entityMap = new HashMap();
|
||||
public static HashMap<Class<? extends Entity>, Boolean> grabMap = new HashMap();
|
||||
|
||||
private static boolean init = false;
|
||||
|
||||
/** Call this very last in a mod so that all mods have a chance to load there entities */
|
||||
public static void init()
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
init = true;
|
||||
for (Object object : EntityList.classToStringMapping.entrySet())
|
||||
{
|
||||
if (object instanceof Entry)
|
||||
{
|
||||
Object key = ((Entry) object).getKey();
|
||||
Object value = ((Entry) object).getKey();
|
||||
if (key instanceof Class && value instanceof String)
|
||||
{
|
||||
entityMap.put((String) value, (Class) key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
addName("chicken", EntityChicken.class);
|
||||
addName("cow", EntityCow.class);
|
||||
addName("sheep", EntitySheep.class);
|
||||
addName("pig", EntityPig.class);
|
||||
addName("player", EntityPlayer.class);
|
||||
addName("zombie", EntityZombie.class);
|
||||
addName("zomb", EntityZombie.class);
|
||||
addName("skeleton", EntitySkeleton.class);
|
||||
addName("skel", EntitySkeleton.class);
|
||||
addName("animal", EntityAnimal.class);
|
||||
addName("monster", EntityMob.class);
|
||||
addName("mob", EntityMob.class);
|
||||
addName("creeper", EntityCreeper.class);
|
||||
addName("spider", EntitySpider.class);
|
||||
addName("slime", EntitySlime.class);
|
||||
addName("items", EntityItem.class);
|
||||
addName("item", EntityItem.class);
|
||||
addName("all", Entity.class);
|
||||
addName("everything", Entity.class);
|
||||
addName("boat", EntityBoat.class);
|
||||
addName("cart", EntityMinecart.class);
|
||||
setCanNotBeGrabbed(EntityDragon.class);
|
||||
setCanNotBeGrabbed(EntityWither.class);
|
||||
}
|
||||
|
||||
public static Class<? extends Entity> get(String name)
|
||||
{
|
||||
return entityMap.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the entity be grabbed by something such as a robot, or another entity. By default most
|
||||
* entities can be grabbed by another object.
|
||||
*/
|
||||
public static boolean canGrab(String name)
|
||||
{
|
||||
if (entityMap.containsKey(name))
|
||||
{
|
||||
return canGrab(entityMap.get(name));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the entity be grabbed by something such as a robot, or another entity. By default most
|
||||
* entities can be grabbed by another object.
|
||||
*/
|
||||
public static boolean canGrab(Entity entity)
|
||||
{
|
||||
if (entity != null)
|
||||
{
|
||||
if (canGrab(entity.getClass()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Entry<Class<? extends Entity>, Boolean> entry : grabMap.entrySet())
|
||||
{
|
||||
if (entry.getKey().isInstance(entity))
|
||||
{
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the entity be grabbed by something such as a robot, or another entity. By default most
|
||||
* entities can be grabbed by another object.
|
||||
*/
|
||||
public static boolean canGrab(Class<? extends Entity> clazz)
|
||||
{
|
||||
if (grabMap.containsKey(clazz))
|
||||
{
|
||||
return grabMap.get(clazz);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (Entry<Class<? extends Entity>, Boolean> entry : grabMap.entrySet())
|
||||
{
|
||||
if (entry.getKey().isAssignableFrom(clazz))
|
||||
{
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setCanNotBeGrabbed(Class<? extends Entity> clazz)
|
||||
{
|
||||
grabMap.put(clazz, false);
|
||||
}
|
||||
|
||||
public static void setCanBeGrabbed(Class<? extends Entity> clazz)
|
||||
{
|
||||
grabMap.put(clazz, true);
|
||||
}
|
||||
|
||||
public static void addName(Class<? extends Entity> clazz, String name)
|
||||
{
|
||||
entityMap.put(name, clazz);
|
||||
}
|
||||
|
||||
public static void addName(String name, Class<? extends Entity> clazz)
|
||||
{
|
||||
addName(clazz, name);
|
||||
}
|
||||
|
||||
public static List<Class<? extends Entity>> getList()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String get(Class<? extends Entity> entityToInclude)
|
||||
{
|
||||
for (Entry<String, Class<? extends Entity>> entry : entityMap.entrySet())
|
||||
{
|
||||
if (entry.getClass() != null && entry.getClass().equals(entityToInclude))
|
||||
{
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package resonantinduction.api.events;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.utility.inventory.AutoCraftingManager.IAutoCrafter;
|
||||
|
||||
/**
|
||||
* Events called when an automated crafter is working on crafting an item
|
||||
*
|
||||
* @author DarkGuardsman
|
||||
*/
|
||||
public class AutoCraftEvent extends Event
|
||||
{
|
||||
World world;
|
||||
Vector3 spot;
|
||||
IAutoCrafter crafter;
|
||||
ItemStack craftingResult;
|
||||
|
||||
public AutoCraftEvent(World world, Vector3 spot, IAutoCrafter craft, ItemStack stack)
|
||||
{
|
||||
this.world = world;
|
||||
this.spot = spot;
|
||||
this.crafter = craft;
|
||||
this.craftingResult = stack;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
/** Called before a crafter checks if it can craft. Use this to cancel crafting */
|
||||
public static class PreCraft extends AutoCraftEvent
|
||||
{
|
||||
public PreCraft(World world, Vector3 spot, IAutoCrafter craft, ItemStack stack)
|
||||
{
|
||||
super(world, spot, craft, stack);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package resonantinduction.api.events;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.fluids.FluidEvent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
public class FluidMixingEvent extends FluidEvent
|
||||
{
|
||||
|
||||
public FluidMixingEvent(FluidStack fluid, World world, Vector3 vec)
|
||||
{
|
||||
super(fluid, world, vec.intX(), vec.intY(), vec.intZ());
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
/**Called before a fluid is mixed with something else, normally another fluid. You can use this event to cancel the mixing or change its output */
|
||||
public static class PreMixEvent extends FluidMixingEvent
|
||||
{
|
||||
public final Object input;
|
||||
public Object output;
|
||||
|
||||
public PreMixEvent(World world, Vector3 vec, FluidStack fluid, Object input, Object output)
|
||||
{
|
||||
super(fluid, world, vec);
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
/**Called right when the fluid is mixed with an object. This is the last chance to cancel the mixing. As well this can be used to cause a different outcome */
|
||||
public static class MixEvent extends FluidMixingEvent
|
||||
{
|
||||
public final Object input;
|
||||
public Object output;
|
||||
|
||||
public MixEvent(World world, Vector3 vec, FluidStack fluid, Object input, Object output)
|
||||
{
|
||||
super(fluid, world, vec);
|
||||
this.input = input;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a mixer has gone threw all the recipes and not found one for the fluid and input.
|
||||
* Use this to hook into this can create a new recipe without registering it with the mixing
|
||||
* class
|
||||
*/
|
||||
public static class MixingRecipeCall extends FluidMixingEvent
|
||||
{
|
||||
public final Object input;
|
||||
public Object output;
|
||||
|
||||
public MixingRecipeCall(World world, Vector3 vec, FluidStack fluid, Object input)
|
||||
{
|
||||
super(fluid, world, vec);
|
||||
this.input = input;
|
||||
}
|
||||
}
|
||||
|
||||
public static final void fireEvent(FluidMixingEvent event)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,280 +0,0 @@
|
|||
package resonantinduction.api.events;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import net.minecraftforge.event.Event;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.lib.utility.inventory.InventoryUtility;
|
||||
|
||||
/**
|
||||
* An event triggered by entities or tiles that create lasers
|
||||
*
|
||||
* @author DarkGuardsman
|
||||
*/
|
||||
public class LaserEvent extends Event
|
||||
{
|
||||
public World world;
|
||||
public Vector3 spot;
|
||||
public Vector3 target;
|
||||
|
||||
public LaserEvent(World world, Vector3 spot, Vector3 target)
|
||||
{
|
||||
this.world = world;
|
||||
this.spot = spot;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
/** Called when a laser is fired */
|
||||
@Cancelable
|
||||
public static class LaserFireEvent extends LaserEvent
|
||||
{
|
||||
public Object shooter;
|
||||
|
||||
public LaserFireEvent(World world, Vector3 spot, Vector3 target, Object shooter)
|
||||
{
|
||||
super(world, spot, target);
|
||||
this.shooter = shooter;
|
||||
}
|
||||
|
||||
public LaserFireEvent(TileEntity tileEntity, MovingObjectPosition hit)
|
||||
{
|
||||
super(tileEntity.worldObj, new Vector3(tileEntity), new Vector3(hit));
|
||||
this.shooter = tileEntity;
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a player fires a laser. Use this to cancel a laser hit event */
|
||||
@Cancelable
|
||||
public static class LaserFiredPlayerEvent extends LaserFireEvent
|
||||
{
|
||||
public ItemStack laserItem;
|
||||
public MovingObjectPosition hit;
|
||||
|
||||
public LaserFiredPlayerEvent(EntityPlayer player, MovingObjectPosition hit, ItemStack stack)
|
||||
{
|
||||
super(player.worldObj, new Vector3(player), new Vector3(hit), player);
|
||||
this.laserItem = stack;
|
||||
this.hit = hit;
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a laser is heating up a block to be mined */
|
||||
public static class LaserMeltBlockEvent extends LaserEvent
|
||||
{
|
||||
public Object shooter;
|
||||
|
||||
public LaserMeltBlockEvent(World world, Vector3 spot, Vector3 hit, Object shooter)
|
||||
{
|
||||
super(world, spot, hit);
|
||||
this.shooter = shooter;
|
||||
}
|
||||
}
|
||||
|
||||
/** Use this to change what drops when the laser finishes mining a block */
|
||||
public static class LaserDropItemEvent extends LaserEvent
|
||||
{
|
||||
public List<ItemStack> items;
|
||||
|
||||
public LaserDropItemEvent(World world, Vector3 spot, Vector3 hit, List<ItemStack> items)
|
||||
{
|
||||
super(world, spot, hit);
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
/** Called before a laser mines a block */
|
||||
@Cancelable
|
||||
public static class LaserMineBlockEvent extends LaserEvent
|
||||
{
|
||||
public Object shooter;
|
||||
|
||||
public LaserMineBlockEvent(World world, Vector3 spot, Vector3 hit, Object shooter)
|
||||
{
|
||||
super(world, spot, hit);
|
||||
this.shooter = shooter;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean doLaserHarvestCheck(World world, Vector3 pos, Object player, Vector3 hit)
|
||||
{
|
||||
LaserEvent event = new LaserMineBlockEvent(world, pos, hit, player);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return !event.isCanceled();
|
||||
}
|
||||
|
||||
/** Called while the block is being mined */
|
||||
public static void onLaserHitBlock(World world, Object player, Vector3 vec, ForgeDirection side)
|
||||
{
|
||||
int id = vec.getBlockID(world);
|
||||
int meta = vec.getBlockMetadata(world);
|
||||
Block block = Block.blocksList[id];
|
||||
|
||||
Vector3 faceVec = vec.clone().translate(side);
|
||||
int id2 = faceVec.getBlockID(world);
|
||||
Block block2 = Block.blocksList[id2];
|
||||
|
||||
Vector3 start = null;
|
||||
|
||||
if (player instanceof Entity)
|
||||
{
|
||||
start = new Vector3((Entity) player);
|
||||
}
|
||||
else if (player instanceof TileEntity)
|
||||
{
|
||||
start = new Vector3((TileEntity) player);
|
||||
}
|
||||
if (block != null)
|
||||
{
|
||||
float chance = world.rand.nextFloat();
|
||||
|
||||
int fireChance = block.getFlammability(world, vec.intX(), vec.intY(), vec.intZ(), meta, side);
|
||||
if ((fireChance / 300) >= chance && (block2 == null || block2.isAirBlock(world, vec.intX(), vec.intY(), vec.intZ())))
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), Block.fire.blockID, 0, 3);
|
||||
return;
|
||||
}
|
||||
if (block.blockID == Block.grass.blockID && (block2 == null || block2.isAirBlock(world, vec.intX(), vec.intY() + 1, vec.intZ())))
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY() + 1, vec.intZ(), Block.fire.blockID, 0, 3);
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), Block.dirt.blockID, 0, 3);
|
||||
return;
|
||||
}
|
||||
if (chance > 0.8f)
|
||||
{
|
||||
// TODO turn water into steam
|
||||
if (block.blockID == Block.sand.blockID)
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), Block.glass.blockID, 0, 3);
|
||||
return;
|
||||
}
|
||||
else if (block.blockID == Block.cobblestone.blockID)
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), 1, 0, 3);
|
||||
return;
|
||||
}
|
||||
else if (block.blockID == Block.ice.blockID)
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), Block.waterStill.blockID, 15, 3);
|
||||
return;
|
||||
}
|
||||
else if (block.blockID == Block.obsidian.blockID)
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), Block.lavaStill.blockID, 15, 3);
|
||||
return;
|
||||
}
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.post(new LaserEvent.LaserMeltBlockEvent(world, start, vec, player));
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the block is actually mined */
|
||||
public static void onBlockMinedByLaser(World world, Object player, Vector3 vec)
|
||||
{
|
||||
int id = vec.getBlockID(world);
|
||||
int meta = vec.getBlockID(world);
|
||||
Block block = Block.blocksList[id];
|
||||
|
||||
Vector3 start = null;
|
||||
if (player instanceof Entity)
|
||||
{
|
||||
start = new Vector3((Entity) player);
|
||||
}
|
||||
else if (player instanceof TileEntity)
|
||||
{
|
||||
start = new Vector3((TileEntity) player);
|
||||
}
|
||||
|
||||
// TODO make this use or call to the correct methods, and events so it can be canceled
|
||||
if (block != null && block.getBlockHardness(world, vec.intX(), vec.intY(), vec.intZ()) >= 0 && doLaserHarvestCheck(world, start, player, vec))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Block blockBellow = Block.blocksList[vec.clone().translate(ForgeDirection.DOWN).getBlockID(world)];
|
||||
if (block != null)
|
||||
{
|
||||
if (block.blockID == Block.tnt.blockID)
|
||||
{
|
||||
world.setBlock(vec.intX(), vec.intY(), vec.intZ(), 0, 0, 3);
|
||||
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, (vec.intX() + 0.5F), (vec.intY() + 0.5F), (vec.intZ() + 0.5F), player instanceof EntityLivingBase ? ((EntityLivingBase) player) : null);
|
||||
entitytntprimed.fuse = world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
|
||||
world.spawnEntityInWorld(entitytntprimed);
|
||||
return;
|
||||
}
|
||||
if (block.blockMaterial == Material.wood || block.blockMaterial == Material.plants || block.blockMaterial == Material.vine || block.blockMaterial == Material.plants || block.blockMaterial == Material.pumpkin || block.blockMaterial == Material.cloth || block.blockMaterial == Material.web)
|
||||
{
|
||||
if (blockBellow != null && blockBellow.blockID == Block.tilledField.blockID && block instanceof IPlantable)
|
||||
{
|
||||
vec.clone().translate(new Vector3(0, -1, 0)).setBlock(world, Block.dirt.blockID, 0, 3);
|
||||
}
|
||||
vec.setBlock(world, Block.fire.blockID, 0, 3);
|
||||
return;
|
||||
}
|
||||
List<ItemStack> items = block.getBlockDropped(world, vec.intX(), vec.intY(), vec.intZ(), meta, 1);
|
||||
if (items == null)
|
||||
{
|
||||
items = new ArrayList<ItemStack>();
|
||||
}
|
||||
// TODO have glass refract the laser causing it to hit random things
|
||||
if (id == Block.glass.blockID)
|
||||
{
|
||||
items.add(new ItemStack(Block.glass, 1, meta));
|
||||
}
|
||||
if (id == Block.thinGlass.blockID)
|
||||
{
|
||||
items.add(new ItemStack(Block.thinGlass, 1));
|
||||
}
|
||||
List<ItemStack> removeList = new ArrayList<ItemStack>();
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
{
|
||||
if (items.get(i).itemID == Block.wood.blockID)
|
||||
{
|
||||
items.set(i, new ItemStack(Item.coal, 1, 1));
|
||||
}
|
||||
else if (items.get(i).itemID == Block.wood.blockID)
|
||||
{
|
||||
if (world.rand.nextFloat() < .25f)
|
||||
{
|
||||
items.set(i, new ItemStack(Item.coal, 1, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
removeList.add(items.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
items.removeAll(removeList);
|
||||
LaserEvent.LaserDropItemEvent event = new LaserEvent.LaserDropItemEvent(world, start, vec, items);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
items = event.items;
|
||||
for (ItemStack stack : items)
|
||||
{
|
||||
InventoryUtility.dropItemStack(world, vec.translate(0.5), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
world.setBlockToAir(vec.intX(), vec.intY(), vec.intZ());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package resonantinduction.api.events;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.Event;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
/**
|
||||
* Prefab for all machine based events
|
||||
*
|
||||
* @author DarkGuardsman
|
||||
*/
|
||||
public class MachineEvent extends Event
|
||||
{
|
||||
public final World world;
|
||||
public final Vector3 spot;
|
||||
public TileEntity machine;
|
||||
|
||||
public MachineEvent(World world, Vector3 spot)
|
||||
{
|
||||
this.world = world;
|
||||
this.spot = spot;
|
||||
machine = spot.getTileEntity(world);
|
||||
}
|
||||
|
||||
public MachineEvent(TileEntity machine)
|
||||
{
|
||||
this.world = machine.worldObj;
|
||||
this.spot = new Vector3(machine);
|
||||
this.machine = machine;
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package resonantinduction.api.events;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Cancelable;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
/**
|
||||
* Event called at all stages of mining a block using a machine
|
||||
*
|
||||
* @author Darkguardsman
|
||||
*/
|
||||
public class MachineMiningEvent extends MachineEvent
|
||||
{
|
||||
public final Vector3 targetBlock;
|
||||
|
||||
public MachineMiningEvent(World world, Vector3 spot, Vector3 target)
|
||||
{
|
||||
super(world, spot);
|
||||
this.targetBlock = target;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class PreMine extends MachineMiningEvent
|
||||
{
|
||||
public PreMine(World world, Vector3 spot, Vector3 target)
|
||||
{
|
||||
super(world, spot, target);
|
||||
}
|
||||
}
|
||||
|
||||
public static class MiningDrop extends MachineMiningEvent
|
||||
{
|
||||
List<ItemStack> items;
|
||||
|
||||
public MiningDrop(World world, Vector3 spot, Vector3 target, List<ItemStack> items)
|
||||
{
|
||||
super(world, spot, target);
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
||||
public static class PostMine extends MachineMiningEvent
|
||||
{
|
||||
public PostMine(World world, Vector3 spot, Vector3 target)
|
||||
{
|
||||
super(world, spot, target);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean doMachineMiningCheck(World world, Vector3 target, TileEntity machine)
|
||||
{
|
||||
Block block = Block.blocksList[target.getBlockID(world)];
|
||||
|
||||
return block != null && target.getTileEntity(world) == null && !block.isAirBlock(world, target.intX(), target.intY(), target.intZ()) && block.getBlockHardness(world, target.intX(), target.intY(), target.intZ()) >= 0;
|
||||
|
||||
}
|
||||
|
||||
public static List<ItemStack> getItemsMined(World world, Vector3 spot, Vector3 target)
|
||||
{
|
||||
Block block = Block.blocksList[target.getBlockID(world)];
|
||||
if (block != null)
|
||||
{
|
||||
List<ItemStack> items = block.getBlockDropped(world, target.intX(), target.intY(), target.intZ(), target.getBlockMetadata(world), 1);
|
||||
if (items != null)
|
||||
{
|
||||
MiningDrop event = new MiningDrop(world, spot, target, items);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
items = event.items;
|
||||
return items;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getItemsMined(TileEntity entity, Vector3 target)
|
||||
{
|
||||
return getItemsMined(entity.worldObj, new Vector3(entity), target);
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package resonantinduction.api.mechanical;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* An interface applied to the tile entity of a conveyor belt
|
||||
*
|
||||
* @Author DarkGuardsman
|
||||
*/
|
||||
@Deprecated
|
||||
public interface IBelt
|
||||
{
|
||||
/**
|
||||
* Used to get a list of entities the belt exerts an effect upon.
|
||||
*
|
||||
* @return list of entities in the belts are of effect
|
||||
*/
|
||||
public List<Entity> getAffectedEntities();
|
||||
|
||||
/**
|
||||
* Adds and entity to the ignore list so its not moved has to be done every 20 ticks
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
public void ignoreEntity(Entity entity);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package resonantinduction.api.mechanical;
|
||||
|
||||
/**
|
||||
* Interface applied to the manipulator.
|
||||
*
|
||||
* @author Calclavia
|
||||
*/
|
||||
public interface IManipulator
|
||||
{
|
||||
/**
|
||||
* Find items going into the manipulator and input them into an inventory behind this
|
||||
* manipulator.
|
||||
*/
|
||||
public void inject();
|
||||
|
||||
/** Injects items */
|
||||
public void enject();
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
package resonantinduction.api.recipe;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.api.recipe.RecipeResource.FluidStackResource;
|
||||
import resonantinduction.api.recipe.RecipeResource.ItemStackResource;
|
||||
import resonantinduction.api.recipe.RecipeResource.OreDictResource;
|
||||
|
||||
public final class MachineRecipes
|
||||
{
|
||||
public static enum RecipeType
|
||||
{
|
||||
CRUSHER, GRINDER, MIXER, SMELTER, SAWMILL;
|
||||
}
|
||||
|
||||
private final Map<RecipeType, Map<RecipeResource[], RecipeResource[]>> recipes = new HashMap<RecipeType, Map<RecipeResource[], RecipeResource[]>>();
|
||||
|
||||
public static MachineRecipes INSTANCE = new MachineRecipes();
|
||||
|
||||
public MachineRecipes()
|
||||
{
|
||||
for (RecipeType machine : RecipeType.values())
|
||||
{
|
||||
recipes.put(machine, new HashMap<RecipeResource[], RecipeResource[]>());
|
||||
}
|
||||
}
|
||||
|
||||
public RecipeResource getResourceFromObject(Object obj)
|
||||
{
|
||||
if (obj instanceof String)
|
||||
return new OreDictResource((String) obj);
|
||||
|
||||
if (obj instanceof Block)
|
||||
return new ItemStackResource(new ItemStack((Block) obj));
|
||||
|
||||
if (obj instanceof Item)
|
||||
return new ItemStackResource(new ItemStack((Item) obj));
|
||||
|
||||
if (obj instanceof ItemStack)
|
||||
return new ItemStackResource((ItemStack) obj);
|
||||
|
||||
if (obj instanceof FluidStack)
|
||||
return new FluidStackResource((FluidStack) obj);
|
||||
|
||||
if (obj instanceof RecipeResource)
|
||||
return (RecipeResource) obj;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addRecipe(RecipeType machine, RecipeResource[] input, RecipeResource[] output)
|
||||
{
|
||||
this.recipes.get(machine).put(input, output);
|
||||
}
|
||||
|
||||
public void addRecipe(RecipeType machine, Object inputObj, Object... outputObj)
|
||||
{
|
||||
RecipeResource input = getResourceFromObject(inputObj);
|
||||
RecipeResource[] outputs = new RecipeResource[outputObj.length];
|
||||
|
||||
for (int i = 0; i < outputs.length; i++)
|
||||
{
|
||||
RecipeResource output = getResourceFromObject(outputObj[i]);
|
||||
|
||||
if (input == null || output == null)
|
||||
throw new RuntimeException("Resonant Induction tried to add invalid machine recipe: " + input + " => " + output);
|
||||
|
||||
outputs[i] = output;
|
||||
}
|
||||
|
||||
addRecipe(machine, new RecipeResource[] { input }, outputs);
|
||||
}
|
||||
|
||||
public void removeRecipe(RecipeType machine, RecipeResource[] input)
|
||||
{
|
||||
this.recipes.get(machine).remove(input);
|
||||
}
|
||||
|
||||
public Map<RecipeResource[], RecipeResource[]> getRecipes(RecipeType machine)
|
||||
{
|
||||
return new HashMap<RecipeResource[], RecipeResource[]>(this.recipes.get(machine));
|
||||
}
|
||||
|
||||
public Map<RecipeType, Map<RecipeResource[], RecipeResource[]>> getRecipes()
|
||||
{
|
||||
return new HashMap<RecipeType, Map<RecipeResource[], RecipeResource[]>>(this.recipes);
|
||||
}
|
||||
|
||||
public RecipeResource[] getOutput(RecipeType machine, RecipeResource... input)
|
||||
{
|
||||
Iterator<Entry<RecipeResource[], RecipeResource[]>> it = this.getRecipes(machine).entrySet().iterator();
|
||||
|
||||
while (it.hasNext())
|
||||
{
|
||||
Entry<RecipeResource[], RecipeResource[]> entry = it.next();
|
||||
|
||||
if (Arrays.equals(entry.getKey(), input))
|
||||
{
|
||||
return entry.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
return new RecipeResource[] {};
|
||||
}
|
||||
|
||||
public RecipeResource[] getOutput(RecipeType machine, Object... inputs)
|
||||
{
|
||||
RecipeResource[] resourceInputs = new RecipeResource[inputs.length];
|
||||
|
||||
for (int i = 0; i < inputs.length; i++)
|
||||
{
|
||||
resourceInputs[i] = getResourceFromObject(inputs[i]);
|
||||
}
|
||||
|
||||
return getOutput(machine, resourceInputs);
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package resonantinduction.api.recipe;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class OreDetectionBlackList
|
||||
{
|
||||
private static final Set<String> oreBlackList = new LinkedHashSet<String>();
|
||||
private static final Set<String> ingotBlackList = new LinkedHashSet<String>();
|
||||
|
||||
public static void addOre(String s)
|
||||
{
|
||||
oreBlackList.add(s);
|
||||
}
|
||||
|
||||
public static void addIngot(String s)
|
||||
{
|
||||
ingotBlackList.add(s);
|
||||
}
|
||||
|
||||
public static boolean isOreBlackListed(String s)
|
||||
{
|
||||
return oreBlackList.contains(s);
|
||||
}
|
||||
|
||||
public static boolean isIngotBlackListed(String s)
|
||||
{
|
||||
return ingotBlackList.contains(s);
|
||||
}
|
||||
}
|
|
@ -1,174 +0,0 @@
|
|||
package resonantinduction.api.recipe;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public abstract class RecipeResource
|
||||
{
|
||||
public final boolean hasChance;
|
||||
public final float chance;
|
||||
|
||||
protected RecipeResource()
|
||||
{
|
||||
this.hasChance = false;
|
||||
this.chance = 100;
|
||||
}
|
||||
|
||||
protected RecipeResource(float chance)
|
||||
{
|
||||
this.hasChance = true;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
public boolean hasChance()
|
||||
{
|
||||
return this.hasChance;
|
||||
}
|
||||
|
||||
public float getChance()
|
||||
{
|
||||
return this.chance;
|
||||
}
|
||||
|
||||
public abstract ItemStack getItemStack();
|
||||
|
||||
public static class ItemStackResource extends RecipeResource
|
||||
{
|
||||
public final ItemStack itemStack;
|
||||
|
||||
public ItemStackResource(ItemStack is)
|
||||
{
|
||||
super();
|
||||
this.itemStack = is;
|
||||
}
|
||||
|
||||
public ItemStackResource(ItemStack is, float chance)
|
||||
{
|
||||
super(chance);
|
||||
this.itemStack = is;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof ItemStackResource)
|
||||
{
|
||||
return this.itemStack.isItemEqual(((ItemStackResource) obj).itemStack);
|
||||
}
|
||||
if (obj instanceof ItemStack)
|
||||
{
|
||||
return this.itemStack.isItemEqual((ItemStack) obj);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return itemStack.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[ItemStackResource: " + itemStack.toString() + "]";
|
||||
}
|
||||
}
|
||||
|
||||
public static class OreDictResource extends RecipeResource
|
||||
{
|
||||
public final String name;
|
||||
|
||||
public OreDictResource(String s)
|
||||
{
|
||||
super();
|
||||
this.name = s;
|
||||
|
||||
if (OreDictionary.getOres(name).size() <= 0)
|
||||
{
|
||||
throw new RuntimeException("Added invalid OreDictResource recipe: " + name);
|
||||
}
|
||||
}
|
||||
|
||||
public OreDictResource(String s, float chance)
|
||||
{
|
||||
super(chance);
|
||||
this.name = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof OreDictResource)
|
||||
{
|
||||
return name.equals(((OreDictResource) obj).name);
|
||||
}
|
||||
|
||||
if (obj instanceof ItemStackResource)
|
||||
{
|
||||
return equals(((ItemStackResource) obj).itemStack);
|
||||
}
|
||||
|
||||
if (obj instanceof ItemStack)
|
||||
{
|
||||
for (ItemStack is : OreDictionary.getOres(name).toArray(new ItemStack[0]))
|
||||
if (is.isItemEqual((ItemStack) obj))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return OreDictionary.getOres(name).get(0).copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[OreDictResource: " + name + "]";
|
||||
}
|
||||
}
|
||||
|
||||
public static class FluidStackResource extends RecipeResource
|
||||
{
|
||||
public final FluidStack fluidStack;
|
||||
|
||||
public FluidStackResource(FluidStack fs)
|
||||
{
|
||||
super();
|
||||
this.fluidStack = fs;
|
||||
}
|
||||
|
||||
public FluidStackResource(FluidStack fs, float chance)
|
||||
{
|
||||
super(chance);
|
||||
this.fluidStack = fs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (obj instanceof FluidStackResource)
|
||||
return equals(((FluidStackResource) obj).fluidStack);
|
||||
|
||||
return (obj instanceof FluidStack) ? ((FluidStack) obj).equals(fluidStack) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[FluidStackResource: " + fluidStack.getFluid().getName() + "]";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,7 +11,6 @@ import net.minecraftforge.fluids.BlockFluidFinite;
|
|||
import org.modstats.ModstatInfo;
|
||||
import org.modstats.Modstats;
|
||||
|
||||
import resonantinduction.core.grid.UpdateTicker;
|
||||
import resonantinduction.core.handler.TextureHookHandler;
|
||||
import resonantinduction.core.prefab.part.PacketMultiPart;
|
||||
import resonantinduction.core.resource.BlockDust;
|
||||
|
@ -21,8 +20,9 @@ import resonantinduction.core.resource.ResourceGenerator;
|
|||
import resonantinduction.core.resource.TileMaterial;
|
||||
import resonantinduction.core.resource.fluid.ItemOreResourceBucket;
|
||||
import resonantinduction.core.resource.fluid.TileFluidMixture;
|
||||
import calclavia.lib.configurable.ConfigHandler;
|
||||
import calclavia.lib.config.ConfigHandler;
|
||||
import calclavia.lib.content.ContentRegistry;
|
||||
import calclavia.lib.grid.UpdateTicker;
|
||||
import calclavia.lib.network.PacketAnnotation;
|
||||
import calclavia.lib.network.PacketHandler;
|
||||
import calclavia.lib.network.PacketTile;
|
||||
|
@ -147,8 +147,5 @@ public class ResonantInduction
|
|||
// Generate Resources
|
||||
ResourceGenerator.generateOreResources();
|
||||
proxy.postInit();
|
||||
|
||||
if (!UpdateTicker.INSTANCE.isAlive())
|
||||
UpdateTicker.INSTANCE.start();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Arrays;
|
|||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import calclavia.lib.configurable.Config;
|
||||
import calclavia.lib.config.Config;
|
||||
import calclavia.lib.content.IDManager;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
|
|
@ -6,9 +6,9 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.fluid.FluidPressureNode;
|
||||
import resonantinduction.core.grid.fluid.IPressureNodeProvider;
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.network.IPacketReceiverWithID;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,116 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* A grid specifying a connection with a series of nodes.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
* @param <N> - The node type.
|
||||
*/
|
||||
public abstract class Grid<N>
|
||||
{
|
||||
/**
|
||||
* A set of connectors (e.g conductors).
|
||||
*/
|
||||
protected final Set<N> nodes = Collections.newSetFromMap(new WeakHashMap<N, Boolean>());
|
||||
private final Class<? extends N> nodeType;
|
||||
|
||||
public Grid(Class<? extends N> type)
|
||||
{
|
||||
nodeType = type;
|
||||
}
|
||||
|
||||
public void add(N node)
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
nodes.add(node);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(N node)
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
nodes.remove(node);
|
||||
}
|
||||
}
|
||||
|
||||
public Set<N> getNodes()
|
||||
{
|
||||
return nodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simple reconstruct class to rebuild the grid. The set "nodes" is copied due to the fact
|
||||
* that this method will allow the modification of nodes while looping.
|
||||
*/
|
||||
public void reconstruct()
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
Iterator<N> it = new HashSet<N>(nodes).iterator();
|
||||
|
||||
while (it.hasNext())
|
||||
{
|
||||
N node = it.next();
|
||||
|
||||
if (isValidNode(node))
|
||||
{
|
||||
reconstructNode(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValidNode(Object node)
|
||||
{
|
||||
return nodeType.isAssignableFrom(node.getClass());
|
||||
}
|
||||
|
||||
protected void reconstructNode(N node)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void deconstruct()
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
nodes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first connector in the set.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public N getFirstNode()
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
for (N node : nodes)
|
||||
{
|
||||
return node;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getSimpleName() + "[" + hashCode() + ", Nodes: " + nodes.size() + "]";
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
public interface INode
|
||||
{
|
||||
/**
|
||||
* Called to reconstruct and reset all connections for this node/
|
||||
*/
|
||||
public void reconstruct();
|
||||
|
||||
/**
|
||||
* This destroys the node, removing it from the grid and also destroying all references to it.
|
||||
*/
|
||||
public void deconstruct();
|
||||
|
||||
/**
|
||||
* Clears all the node's cache.
|
||||
*/
|
||||
public void recache();
|
||||
|
||||
/**
|
||||
* Called to update the node.
|
||||
*
|
||||
* @param deltaTime - Time in seconds that has passed compared to the last update time.
|
||||
*/
|
||||
public void update(float deltaTime);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
/**
|
||||
* @author Calclavia
|
||||
*
|
||||
* @param <N> - Node type.
|
||||
*/
|
||||
public interface INodeProvider
|
||||
{
|
||||
/**
|
||||
* @param nodeType - The type of node we are looking for.
|
||||
* @param from - The direction.
|
||||
* @return Returns the node object.
|
||||
*/
|
||||
public <N extends INode> N getNode(Class<? super N> nodeType, ForgeDirection from);
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public abstract class Node<P extends INodeProvider, G extends Grid, N> implements INode
|
||||
{
|
||||
public final P parent;
|
||||
|
||||
protected final AbstractMap<N, ForgeDirection> connections = new WeakHashMap<N, ForgeDirection>();
|
||||
|
||||
public G grid = null;
|
||||
|
||||
public Node(P parent)
|
||||
{
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public final G getGrid()
|
||||
{
|
||||
if (grid == null)
|
||||
grid = newGrid();
|
||||
|
||||
return grid;
|
||||
}
|
||||
|
||||
protected abstract G newGrid();
|
||||
|
||||
public final void setGrid(G grid)
|
||||
{
|
||||
this.grid = grid;
|
||||
}
|
||||
|
||||
public void update(float deltaTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Try inject tile validate and invalidate events so this does not have to be called.
|
||||
* This constructs the node. It should be called whenever the connections of the node are
|
||||
* updated OR when the node is first initiated and can access its connections.
|
||||
*/
|
||||
public void reconstruct()
|
||||
{
|
||||
synchronized (connections)
|
||||
{
|
||||
recache();
|
||||
getGrid().add(this);
|
||||
getGrid().reconstruct();
|
||||
}
|
||||
}
|
||||
|
||||
public void deconstruct()
|
||||
{
|
||||
synchronized (connections)
|
||||
{
|
||||
/**
|
||||
* Remove self from all connections.
|
||||
*/
|
||||
for (N connection : connections.keySet())
|
||||
{
|
||||
if (getGrid().isValidNode(connection))
|
||||
{
|
||||
((Node) connection).getConnections().remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
getGrid().remove(this);
|
||||
getGrid().deconstruct();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called for a node to recache all its connections.
|
||||
*/
|
||||
public void recache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the connections in this node.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public AbstractMap<N, ForgeDirection> getConnections()
|
||||
{
|
||||
return connections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can this node connect with the source?
|
||||
*
|
||||
* @param from - Direction coming from.
|
||||
* @param source - Object trying to connect with this node. This should either extend Node or be
|
||||
* an object that can interface with the node.
|
||||
*/
|
||||
public boolean canConnect(ForgeDirection from, Object source)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called to load the node's data.
|
||||
*/
|
||||
public void load(NBTTagCompound nbt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Must be called to save the node's data.
|
||||
*/
|
||||
public void save(NBTTagCompound nbt)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getSimpleName() + "[" + hashCode() + ", Connections: " + connections.size() + ", Grid:" + getGrid() + "]";
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public abstract class NodeGrid<N extends Node> extends Grid<N>
|
||||
{
|
||||
public NodeGrid(Class<? extends N> type)
|
||||
{
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void reconstructNode(N node)
|
||||
{
|
||||
node.recache();
|
||||
node.setGrid(this);
|
||||
|
||||
AbstractMap<Object, ForgeDirection> connections = node.getConnections();
|
||||
|
||||
for (Object connection : connections.keySet())
|
||||
{
|
||||
if (isValidNode(connection) && connection instanceof Node)
|
||||
{
|
||||
Node connectedNode = (Node) connection;
|
||||
|
||||
if (connectedNode.getGrid() != this)
|
||||
{
|
||||
synchronized (connectedNode.getGrid().getNodes())
|
||||
{
|
||||
connectedNode.getGrid().getNodes().clear();
|
||||
}
|
||||
|
||||
add((N) connectedNode);
|
||||
reconstructNode((N) connectedNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deconstruct()
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
Iterator<N> it = new HashSet<N>(nodes).iterator();
|
||||
|
||||
while (it.hasNext())
|
||||
{
|
||||
N node = it.next();
|
||||
node.setGrid(null);
|
||||
node.reconstruct();
|
||||
}
|
||||
|
||||
nodes.clear();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import net.minecraftforge.event.Event;
|
||||
|
||||
//NO-OP
|
||||
abstract class NodeProviderEvent extends Event
|
||||
{
|
||||
public final INodeProvider provider;
|
||||
|
||||
protected NodeProviderEvent(INodeProvider provider)
|
||||
{
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public static class NodeProviderLoadEvent extends NodeProviderEvent
|
||||
{
|
||||
protected NodeProviderLoadEvent(INodeProvider provider)
|
||||
{
|
||||
super(provider);
|
||||
}
|
||||
}
|
||||
|
||||
public static class NodeProviderUnloadEvent extends NodeProviderEvent
|
||||
{
|
||||
protected NodeProviderUnloadEvent(INodeProvider provider)
|
||||
{
|
||||
super(provider);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* A dynamic node loader for registering different nodes for different node interfaces.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
public class NodeRegistry
|
||||
{
|
||||
private static final HashMap<Class, Class> INTERFACE_NODE_MAP = new HashMap<Class, Class>();
|
||||
|
||||
public static void register(Class nodeInterface, Class nodeClass)
|
||||
{
|
||||
INTERFACE_NODE_MAP.put(nodeInterface, nodeClass);
|
||||
}
|
||||
|
||||
public static <N extends INode> N get(INodeProvider parent, Class<N> nodeInterface)
|
||||
{
|
||||
Class nodeClass = INTERFACE_NODE_MAP.get(nodeInterface);
|
||||
|
||||
try
|
||||
{
|
||||
return (N) nodeClass.getConstructor(INodeProvider.class).newInstance(parent);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import universalelectricity.api.net.IUpdate;
|
||||
|
||||
public class TickingGrid<N extends Node> extends NodeGrid<N> implements IUpdate
|
||||
{
|
||||
public TickingGrid(N node, Class type)
|
||||
{
|
||||
super(type);
|
||||
add(node);
|
||||
// NetworkTickHandler.addNetwork(this);
|
||||
UpdateTicker.addNetwork(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* An grid update called only server side.
|
||||
* TODO: Make actual ticker an independent thread.
|
||||
*/
|
||||
@Override
|
||||
public void update()
|
||||
{
|
||||
synchronized (nodes)
|
||||
{
|
||||
for (Node node : nodes)
|
||||
{
|
||||
node.update(1 / 20f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate()
|
||||
{
|
||||
return nodes.size() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean continueUpdate()
|
||||
{
|
||||
return canUpdate();
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import codechicken.multipart.PartMap;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
|
||||
public class TraitNodeProvider extends TileMultipart implements INodeProvider
|
||||
{
|
||||
public Set<INodeProvider> mechanicalInterfaces = new HashSet<INodeProvider>();
|
||||
|
||||
@Override
|
||||
public void copyFrom(TileMultipart that)
|
||||
{
|
||||
super.copyFrom(that);
|
||||
|
||||
if (that instanceof TraitNodeProvider)
|
||||
{
|
||||
this.mechanicalInterfaces = ((TraitNodeProvider) that).mechanicalInterfaces;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindPart(TMultiPart part)
|
||||
{
|
||||
super.bindPart(part);
|
||||
|
||||
if (part instanceof INodeProvider)
|
||||
{
|
||||
this.mechanicalInterfaces.add((INodeProvider) part);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partRemoved(TMultiPart part, int p)
|
||||
{
|
||||
super.partRemoved(part, p);
|
||||
|
||||
if (part instanceof INodeProvider)
|
||||
{
|
||||
this.mechanicalInterfaces.remove(part);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearParts()
|
||||
{
|
||||
super.clearParts();
|
||||
this.mechanicalInterfaces.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <N extends INode> N getNode(Class<? super N> nodeType, ForgeDirection from)
|
||||
{
|
||||
TMultiPart part = this.partMap(from.ordinal());
|
||||
|
||||
if (part == null)
|
||||
{
|
||||
part = partMap(PartMap.CENTER.ordinal());
|
||||
}
|
||||
|
||||
if (part instanceof INodeProvider)
|
||||
{
|
||||
return ((INodeProvider) part).getNode(nodeType, from);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
package resonantinduction.core.grid;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event;
|
||||
import universalelectricity.api.net.IUpdate;
|
||||
|
||||
/**
|
||||
* A ticker to update all grids. This is multithreaded.
|
||||
*
|
||||
* @author Calclavia
|
||||
*/
|
||||
public class UpdateTicker extends Thread
|
||||
{
|
||||
public static final UpdateTicker INSTANCE = new UpdateTicker();
|
||||
|
||||
/** For updaters to be ticked. */
|
||||
private final Set<IUpdate> updaters = Collections.newSetFromMap(new WeakHashMap<IUpdate, Boolean>());
|
||||
|
||||
/** For queuing Forge events to be invoked the next tick. */
|
||||
private final Queue<Event> queuedEvents = new ConcurrentLinkedQueue<Event>();
|
||||
|
||||
public boolean pause = false;
|
||||
|
||||
public UpdateTicker()
|
||||
{
|
||||
setName("Universal Electricity");
|
||||
setPriority(MIN_PRIORITY);
|
||||
}
|
||||
|
||||
public static void addNetwork(IUpdate updater)
|
||||
{
|
||||
synchronized (INSTANCE.updaters)
|
||||
{
|
||||
INSTANCE.updaters.add(updater);
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void queueEvent(Event event)
|
||||
{
|
||||
synchronized (INSTANCE.queuedEvents)
|
||||
{
|
||||
INSTANCE.queuedEvents.add(event);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
long last = System.currentTimeMillis();
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!pause)
|
||||
{
|
||||
long current = System.currentTimeMillis();
|
||||
long delta = current - last;
|
||||
|
||||
/** Tick all updaters. */
|
||||
synchronized (updaters)
|
||||
{
|
||||
Set<IUpdate> removeUpdaters = Collections.newSetFromMap(new WeakHashMap<IUpdate, Boolean>());
|
||||
|
||||
Iterator<IUpdate> updaterIt = new HashSet<IUpdate>(updaters).iterator();
|
||||
|
||||
try
|
||||
{
|
||||
while (updaterIt.hasNext())
|
||||
{
|
||||
IUpdate updater = updaterIt.next();
|
||||
|
||||
if (updater.canUpdate())
|
||||
{
|
||||
updater.update();
|
||||
}
|
||||
|
||||
if (!updater.continueUpdate())
|
||||
{
|
||||
removeUpdaters.add(updater);
|
||||
}
|
||||
}
|
||||
|
||||
updaters.removeAll(removeUpdaters);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("Universal Electricity Threaded Ticker: Failed while tcking updater. This is a bug! Clearing all tickers for self repair.");
|
||||
updaters.clear();
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/** Perform all queued events */
|
||||
synchronized (queuedEvents)
|
||||
{
|
||||
while (!queuedEvents.isEmpty())
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(queuedEvents.poll());
|
||||
}
|
||||
}
|
||||
|
||||
last = current;
|
||||
}
|
||||
|
||||
Thread.sleep(50L);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ package resonantinduction.core.grid.fluid;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import calclavia.lib.grid.Node;
|
||||
import calclavia.lib.grid.TickingGrid;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -10,8 +12,6 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.core.grid.Node;
|
||||
import resonantinduction.core.grid.TickingGrid;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package resonantinduction.core.grid.fluid;
|
||||
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
|
||||
public interface IPressureNodeProvider extends INodeProvider, IFluidHandler
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.core.nei;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
|
||||
public class RICrusherRecipeHandler extends RITemplateRecipeHandler
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.core.nei;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
|
||||
public class RIGrinderRecipeHandler extends RITemplateRecipeHandler
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.core.nei;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
|
||||
public class RIMixerRecipeHandler extends RITemplateRecipeHandler
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.core.nei;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
|
||||
public class RISawmillRecipeHandler extends RITemplateRecipeHandler
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package resonantinduction.core.nei;
|
||||
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
|
||||
public class RISmelterRecipeHandler extends RITemplateRecipeHandler
|
||||
|
|
|
@ -12,12 +12,12 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.RecipeResource;
|
||||
import resonantinduction.api.recipe.RecipeResource.FluidStackResource;
|
||||
import resonantinduction.api.recipe.RecipeResource.ItemStackResource;
|
||||
import resonantinduction.api.recipe.RecipeResource.OreDictResource;
|
||||
import resonantinduction.core.Reference;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource.FluidStackResource;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource.ItemStackResource;
|
||||
import calclavia.api.resonantinduction.recipe.RecipeResource.OreDictResource;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
import codechicken.core.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import resonantinduction.api.IFilterable;
|
||||
import calclavia.api.resonantinduction.IFilterable;
|
||||
import calclavia.lib.prefab.block.BlockRotatable;
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.api.IFilterable;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
import calclavia.api.resonantinduction.IFilterable;
|
||||
import calclavia.lib.content.module.prefab.TileInventory;
|
||||
import calclavia.lib.prefab.tile.IRotatable;
|
||||
|
||||
|
|
|
@ -4,6 +4,9 @@ import java.util.Collection;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import calclavia.lib.grid.INode;
|
||||
import calclavia.lib.grid.INodeProvider;
|
||||
import calclavia.lib.grid.Node;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -12,9 +15,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import resonantinduction.core.grid.INode;
|
||||
import resonantinduction.core.grid.INodeProvider;
|
||||
import resonantinduction.core.grid.Node;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.lib.raytracer.IndexedCuboid6;
|
||||
|
|
|
@ -28,16 +28,16 @@ import net.minecraftforge.fluids.FluidRegistry;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.api.recipe.OreDetectionBlackList;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.core.fluid.FluidColored;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMaterial;
|
||||
import resonantinduction.core.resource.fluid.BlockFluidMixture;
|
||||
import calclavia.lib.configurable.Config;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.OreDetectionBlackList;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import calclavia.lib.config.Config;
|
||||
import calclavia.lib.utility.LanguageUtility;
|
||||
import calclavia.lib.utility.nbt.IVirtualObject;
|
||||
import calclavia.lib.utility.nbt.NBTUtility;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package resonantinduction.core.resource.fluid;
|
||||
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
@ -8,8 +10,6 @@ import net.minecraftforge.fluids.BlockFluidFinite;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.Settings;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
|
|
|
@ -3,12 +3,12 @@ package resonantinduction.core.resource.fluid;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes;
|
||||
import calclavia.api.resonantinduction.recipe.MachineRecipes.RecipeType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import resonantinduction.api.recipe.MachineRecipes;
|
||||
import resonantinduction.api.recipe.MachineRecipes.RecipeType;
|
||||
import resonantinduction.core.resource.ResourceGenerator;
|
||||
import resonantinduction.core.resource.TileMaterial;
|
||||
|
||||
|
|
Loading…
Reference in a new issue