From d9a74730abb1ba6fa4e27c53be74eddb4690e01f Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Sun, 14 Jul 2013 10:50:35 -0400 Subject: [PATCH] Edit, changes, etc.. Forgot to push while i still remember what i did and what each change was. Guess it will due just to have it synced --- src/minecraft/dark/core/Direction.java | 1 - src/minecraft/dark/core/IDisableable.java | 18 +++++++++ .../core/hydraulic/helpers/FluidHelper.java | 2 +- .../helpers/FluidRestrictionHandler.java | 4 +- .../dark/core/render/RenderEntityBlock.java | 2 +- .../dark/core/render/RenderMachine.java | 40 +++++++++++++++++++ .../core/tile/network/NetworkPathFinder.java | 1 - .../tile/network/NetworkTileEntities.java | 1 - .../dark/library/effects/FXBeam.java | 6 +-- .../dark/library/gui/GuiButtonArrow.java | 3 +- .../dark/library/gui/GuiGlobalList.java | 2 +- .../dark/library/machine/BcToUeProvider.java | 2 +- .../machine/TileEntityElectricMachine.java | 4 +- .../machine/terminal/TileEntityTerminal.java | 4 +- 14 files changed, 71 insertions(+), 19 deletions(-) create mode 100644 src/minecraft/dark/core/IDisableable.java create mode 100644 src/minecraft/dark/core/render/RenderMachine.java diff --git a/src/minecraft/dark/core/Direction.java b/src/minecraft/dark/core/Direction.java index a589099c..0f6c06e3 100644 --- a/src/minecraft/dark/core/Direction.java +++ b/src/minecraft/dark/core/Direction.java @@ -1,6 +1,5 @@ package dark.core; -import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.vector.Vector3; public enum Direction diff --git a/src/minecraft/dark/core/IDisableable.java b/src/minecraft/dark/core/IDisableable.java new file mode 100644 index 00000000..8d0c3d89 --- /dev/null +++ b/src/minecraft/dark/core/IDisableable.java @@ -0,0 +1,18 @@ +package dark.core; + +/** This class should be applied to all tile entities (mainly machines) that can be disabled (by + * things like EMP, short circuit etc.). + * + * @author Calclavia */ +public interface IDisableable +{ + /** This is called when the tile entity is to be disabled. + * + * @param duration - The duration of the disable in ticks. */ + public void onDisable(int duration); + + /** Called to see if this tile entity is disabled. + * + * @return True if the tile entity is disabled. */ + public boolean isDisabled(); +} diff --git a/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java b/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java index ce0985ee..8af10f1e 100644 --- a/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java +++ b/src/minecraft/dark/core/hydraulic/helpers/FluidHelper.java @@ -1,6 +1,5 @@ package dark.core.hydraulic.helpers; -import universalelectricity.core.vector.Vector3; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; @@ -8,6 +7,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; +import universalelectricity.core.vector.Vector3; public class FluidHelper { diff --git a/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java b/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java index ce536f52..bb7e559c 100644 --- a/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java +++ b/src/minecraft/dark/core/hydraulic/helpers/FluidRestrictionHandler.java @@ -17,8 +17,8 @@ public class FluidRestrictionHandler static { /* ADD DEFAULT LIQUIDS */ - restrictedStacks.put(ColorCode.BLUE, FluidRegistry.getFluid("Water")); - restrictedStacks.put(ColorCode.RED, FluidRegistry.getFluid("Lava")); + restrictedStacks.put(ColorCode.BLUE, FluidRegistry.WATER); + restrictedStacks.put(ColorCode.RED, FluidRegistry.LAVA); } @ForgeSubscribe diff --git a/src/minecraft/dark/core/render/RenderEntityBlock.java b/src/minecraft/dark/core/render/RenderEntityBlock.java index 1ee52306..055098e4 100644 --- a/src/minecraft/dark/core/render/RenderEntityBlock.java +++ b/src/minecraft/dark/core/render/RenderEntityBlock.java @@ -13,9 +13,9 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.resources.ResourceLocation; import net.minecraft.entity.Entity; import net.minecraft.util.Icon; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; diff --git a/src/minecraft/dark/core/render/RenderMachine.java b/src/minecraft/dark/core/render/RenderMachine.java new file mode 100644 index 00000000..added33f --- /dev/null +++ b/src/minecraft/dark/core/render/RenderMachine.java @@ -0,0 +1,40 @@ +package dark.core.render; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public abstract class RenderMachine extends TileEntitySpecialRenderer +{ + + public RenderMachine() + { + + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) + { + // TODO Auto-generated method stub + + } + + /** Sudo method for setting the texture for current render + * @param name */ + public void bindTextureByName(String domain, String name) + { + func_110628_a(new ResourceLocation(domain,name)); + } + + public void bindTextureByName(ResourceLocation name) + { + func_110628_a(name); + } + + /** Gets the texture based on block and metadata mainly used by item/block inv render */ + public abstract ResourceLocation getTexture(int block, int meta); + +} diff --git a/src/minecraft/dark/core/tile/network/NetworkPathFinder.java b/src/minecraft/dark/core/tile/network/NetworkPathFinder.java index b6ece6ee..3ba7d206 100644 --- a/src/minecraft/dark/core/tile/network/NetworkPathFinder.java +++ b/src/minecraft/dark/core/tile/network/NetworkPathFinder.java @@ -1,7 +1,6 @@ package dark.core.tile.network; import java.util.HashSet; -import java.util.List; import java.util.Set; import net.minecraft.tileentity.TileEntity; diff --git a/src/minecraft/dark/core/tile/network/NetworkTileEntities.java b/src/minecraft/dark/core/tile/network/NetworkTileEntities.java index 47cae84a..228b1f9d 100644 --- a/src/minecraft/dark/core/tile/network/NetworkTileEntities.java +++ b/src/minecraft/dark/core/tile/network/NetworkTileEntities.java @@ -8,7 +8,6 @@ import java.util.List; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.grid.IGridNetwork; import universalelectricity.core.path.Pathfinder; import universalelectricity.core.vector.Vector3; import universalelectricity.core.vector.VectorHelper; diff --git a/src/minecraft/dark/library/effects/FXBeam.java b/src/minecraft/dark/library/effects/FXBeam.java index fbecf3b0..6a697652 100644 --- a/src/minecraft/dark/library/effects/FXBeam.java +++ b/src/minecraft/dark/library/effects/FXBeam.java @@ -5,17 +5,15 @@ import java.awt.Color; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.resources.ResourceLocation; -import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import cpw.mods.fml.client.FMLClientHandler; - import universalelectricity.core.vector.Vector3; +import cpw.mods.fml.client.FMLClientHandler; import dark.core.DarkMain; /** diff --git a/src/minecraft/dark/library/gui/GuiButtonArrow.java b/src/minecraft/dark/library/gui/GuiButtonArrow.java index b81efd63..e94d301d 100644 --- a/src/minecraft/dark/library/gui/GuiButtonArrow.java +++ b/src/minecraft/dark/library/gui/GuiButtonArrow.java @@ -2,13 +2,12 @@ package dark.library.gui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.resources.ResourceLocation; +import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import dark.core.DarkMain; @SideOnly(Side.CLIENT) diff --git a/src/minecraft/dark/library/gui/GuiGlobalList.java b/src/minecraft/dark/library/gui/GuiGlobalList.java index f3609944..13116c68 100644 --- a/src/minecraft/dark/library/gui/GuiGlobalList.java +++ b/src/minecraft/dark/library/gui/GuiGlobalList.java @@ -9,8 +9,8 @@ import java.util.Map.Entry; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.resources.ResourceLocation; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; diff --git a/src/minecraft/dark/library/machine/BcToUeProvider.java b/src/minecraft/dark/library/machine/BcToUeProvider.java index 515c435e..9b5d1644 100644 --- a/src/minecraft/dark/library/machine/BcToUeProvider.java +++ b/src/minecraft/dark/library/machine/BcToUeProvider.java @@ -1,9 +1,9 @@ package dark.library.machine; -import dark.core.PowerSystems; import net.minecraftforge.common.ForgeDirection; import universalelectricity.core.electricity.ElectricityPack; import buildcraft.api.power.PowerProvider; +import dark.core.PowerSystems; public class BcToUeProvider extends PowerProvider { diff --git a/src/minecraft/dark/library/machine/TileEntityElectricMachine.java b/src/minecraft/dark/library/machine/TileEntityElectricMachine.java index 9c00f591..51ecd768 100644 --- a/src/minecraft/dark/library/machine/TileEntityElectricMachine.java +++ b/src/minecraft/dark/library/machine/TileEntityElectricMachine.java @@ -2,9 +2,10 @@ package dark.library.machine; import java.util.Random; +import dark.core.IDisableable; + import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.ForgeDirection; -import universalelectricity.core.block.IDisableable; import universalelectricity.core.block.IElectrical; import universalelectricity.core.block.IElectricalStorage; import universalelectricity.core.electricity.ElectricityPack; @@ -12,7 +13,6 @@ import universalelectricity.prefab.tile.ElectricityHandler; import universalelectricity.prefab.tile.TileEntityAdvanced; import buildcraft.api.power.IPowerProvider; import buildcraft.api.power.IPowerReceptor; -import dark.core.PowerSystems; public abstract class TileEntityElectricMachine extends TileEntityAdvanced implements IDisableable, IElectrical, IElectricalStorage, IPowerReceptor { diff --git a/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java b/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java index 943d0e73..97cbc5cf 100644 --- a/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java +++ b/src/minecraft/dark/library/machine/terminal/TileEntityTerminal.java @@ -29,9 +29,9 @@ import dark.library.machine.TileEntityRunnableMachine; /** @author Calclavia, DarkGuardsman */ public abstract class TileEntityTerminal extends TileEntityRunnableMachine implements ISpecialAccess, IPacketReceiver, ITerminal { - public TileEntityTerminal(int tickEnergy) + public TileEntityTerminal(float watttick) { - super(tickEnergy); + super(watttick); } public enum PacketType