From f69f928cc0222d31d38442b13797ec128fa1fd70 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Mon, 27 Jan 2014 22:46:48 +0800 Subject: [PATCH] Moved infinite blocks to Calclavia Core --- .../core/ResonantInduction.java | 5 - .../core/debug/BlockDebug.java | 161 ------------------ .../core/debug/ItemInstaHole.java | 58 ------- .../core/debug/TileInfiniteEnergySink.java | 26 --- .../core/debug/TileInfiniteEnergySource.java | 54 ------ .../core/debug/TileInfiniteFluidSink.java | 66 ------- .../core/debug/TileInfiniteFluidSource.java | 116 ------------- .../languages/en_US.properties | 5 - .../textures/blocks/infFluid.png | Bin 231 -> 0 bytes .../textures/blocks/infLoad.png | Bin 222 -> 0 bytes .../textures/blocks/infSource.png | Bin 227 -> 0 bytes .../textures/blocks/void.png | Bin 226 -> 0 bytes 12 files changed, 491 deletions(-) delete mode 100644 src/main/java/resonantinduction/core/debug/BlockDebug.java delete mode 100644 src/main/java/resonantinduction/core/debug/ItemInstaHole.java delete mode 100644 src/main/java/resonantinduction/core/debug/TileInfiniteEnergySink.java delete mode 100644 src/main/java/resonantinduction/core/debug/TileInfiniteEnergySource.java delete mode 100644 src/main/java/resonantinduction/core/debug/TileInfiniteFluidSink.java delete mode 100644 src/main/java/resonantinduction/core/debug/TileInfiniteFluidSource.java delete mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png delete mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png delete mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infSource.png delete mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/void.png diff --git a/src/main/java/resonantinduction/core/ResonantInduction.java b/src/main/java/resonantinduction/core/ResonantInduction.java index d2085ab1..cca96ef3 100644 --- a/src/main/java/resonantinduction/core/ResonantInduction.java +++ b/src/main/java/resonantinduction/core/ResonantInduction.java @@ -10,7 +10,6 @@ import net.minecraftforge.fluids.FluidRegistry; import org.modstats.ModstatInfo; import org.modstats.Modstats; -import resonantinduction.core.debug.BlockDebug; import resonantinduction.core.handler.FluidEventHandler; import resonantinduction.core.handler.LinkEventHandler; import resonantinduction.core.prefab.part.PacketMultiPart; @@ -21,7 +20,6 @@ import resonantinduction.core.resource.item.ItemOreResource; import calclavia.lib.content.ContentRegistry; import calclavia.lib.network.PacketHandler; import calclavia.lib.network.PacketTile; -import calclavia.lib.prefab.item.ItemBlockHolder; import calclavia.lib.utility.LanguageUtility; import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Mod; @@ -72,7 +70,6 @@ public class ResonantInduction public static ItemOreResource itemRefinedDust; public static Block blockFluidMixture; public static Block blockGas; - public static Block blockDebug; public static Fluid fluidMixture = null; @@ -107,8 +104,6 @@ public class ResonantInduction GameRegistry.registerBlock(blockFluidMixture, blockFluidMixture.getUnlocalizedName()); GameRegistry.registerTileEntity(TileLiquidMixture.class, blockFluidMixture.getUnlocalizedName()); - blockDebug = contentRegistry.createBlock(BlockDebug.class, ItemBlockHolder.class); - Settings.save(); proxy.preInit(); } diff --git a/src/main/java/resonantinduction/core/debug/BlockDebug.java b/src/main/java/resonantinduction/core/debug/BlockDebug.java deleted file mode 100644 index 0c522012..00000000 --- a/src/main/java/resonantinduction/core/debug/BlockDebug.java +++ /dev/null @@ -1,161 +0,0 @@ -package resonantinduction.core.debug; - -import java.util.List; -import java.util.Set; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Icon; -import net.minecraft.world.World; -import resonantinduction.core.Reference; -import resonantinduction.core.prefab.block.BlockRI; -import calclavia.lib.content.IBlockInfo; - -import com.builtbroken.common.Pair; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockDebug extends BlockRI implements IBlockInfo -{ - public static float DebugWattOut, DebugWattDemand; - - public BlockDebug() - { - super("DebugBlock"); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconReg) - { - super.registerIcons(iconReg); - for (DebugBlocks block : DebugBlocks.values()) - { - block.icon = iconReg.registerIcon(Reference.PREFIX + block.getTextureName()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (meta < DebugBlocks.values().length) - { - return DebugBlocks.values()[meta].icon; - } - return this.blockIcon; - } - - @Override - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata < DebugBlocks.values().length) - { - try - { - return DebugBlocks.values()[metadata].clazz.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - return super.createTileEntity(world, metadata); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return null; - } - - @Override - public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) - { - for (DebugBlocks block : DebugBlocks.values()) - { - creativeTabList.add(new ItemStack(blockID, 1, block.ordinal())); - } - } - - @Override - public void getTileEntities(int blockID, Set>> list) - { - for (DebugBlocks block : DebugBlocks.values()) - { - list.add(new Pair>(block.name, block.clazz)); - - } - } - - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } - - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } - - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } - - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); - } - - public static enum DebugBlocks - { - SOURCE("UnlimitedPower", TileInfiniteEnergySource.class, "infSource"), - FLUID("UnlimitedFluid", TileInfiniteFluidSource.class, "infFluid"), - VOID("FluidVoid", TileInfiniteFluidSink.class, "void"), - LOAD("PowerVampire", TileInfiniteEnergySink.class, "infLoad"); - public Icon icon; - public String name; - public String texture; - Class clazz; - - private DebugBlocks(String name, Class clazz) - { - this.name = name; - this.clazz = clazz; - } - - private DebugBlocks(String name, Class clazz, String texture) - { - this(name, clazz); - this.texture = texture; - } - - public String getTextureName() - { - if (texture == null || texture.isEmpty()) - { - return name; - } - return texture; - } - - } - - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub - - } - -} diff --git a/src/main/java/resonantinduction/core/debug/ItemInstaHole.java b/src/main/java/resonantinduction/core/debug/ItemInstaHole.java deleted file mode 100644 index 407e2864..00000000 --- a/src/main/java/resonantinduction/core/debug/ItemInstaHole.java +++ /dev/null @@ -1,58 +0,0 @@ -package resonantinduction.core.debug; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import resonantinduction.core.Settings; - -/** - * Creative mod tool to quickly create a large hole in the ground. Is designed only for debug - * testing of ore generation. - * - * @author DarkGuardsman - */ -public class ItemInstaHole extends Item -{ - - public ItemInstaHole() - { - super(Settings.CONFIGURATION.getItem("InstaHole", Settings.getNextItemID()).getInt()); - this.setUnlocalizedName("InstaHole"); - this.setCreativeTab(CreativeTabs.tabTools); - } - - @Override - public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int xx, int yy, int zz, int par7, float par8, float par9, float par10) - { - if (player != null && player.capabilities.isCreativeMode) - { - if (world.isRemote) - { - return true; - } - for (int y = yy; y > 0; y--) - { - for (int x = xx - 10; x < xx + 10; x++) - { - for (int z = zz - 10; z < zz + 10; z++) - { - int id = world.getBlockId(x, y, z); - if (id == 0) - { - world.setBlock(x, y, z, 20); - } - else if (id == Block.sand.blockID || id == Block.gravel.blockID || id == 1 || id == Block.dirt.blockID || id == Block.grass.blockID) - { - world.setBlock(x, y, z, 0); - } - } - } - } - return true; - } - return false; - } -} diff --git a/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySink.java b/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySink.java deleted file mode 100644 index a949470a..00000000 --- a/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySink.java +++ /dev/null @@ -1,26 +0,0 @@ -package resonantinduction.core.debug; - -import net.minecraftforge.common.ForgeDirection; -import calclavia.lib.prefab.tile.TileElectrical; - -public class TileInfiniteEnergySink extends TileElectrical -{ - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - return receive; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long request, boolean doExtract) - { - return 0; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return true; - } -} diff --git a/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySource.java b/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySource.java deleted file mode 100644 index 635dd091..00000000 --- a/src/main/java/resonantinduction/core/debug/TileInfiniteEnergySource.java +++ /dev/null @@ -1,54 +0,0 @@ -package resonantinduction.core.debug; - -import java.util.EnumSet; - -import net.minecraftforge.common.ForgeDirection; -import universalelectricity.api.energy.EnergyStorageHandler; -import calclavia.lib.prefab.tile.TileElectrical; - -public class TileInfiniteEnergySource extends TileElectrical -{ - public TileInfiniteEnergySource() - { - this.energy = new EnergyStorageHandler(Long.MAX_VALUE); - this.energy.setMaxExtract(Long.MAX_VALUE); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - this.energy.setEnergy(Long.MAX_VALUE); - this.produce(); - } - - @Override - public EnumSet getOutputDirections() - { - return EnumSet.allOf(ForgeDirection.class); - } - - @Override - public EnumSet getInputDirections() - { - return EnumSet.noneOf(ForgeDirection.class); - } - - @Override - public long onReceiveEnergy(ForgeDirection from, long receive, boolean doReceive) - { - return 0; - } - - @Override - public long onExtractEnergy(ForgeDirection from, long request, boolean doExtract) - { - return request; - } - - @Override - public boolean canConnect(ForgeDirection direction) - { - return true; - } -} diff --git a/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSink.java b/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSink.java deleted file mode 100644 index 4cd59918..00000000 --- a/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSink.java +++ /dev/null @@ -1,66 +0,0 @@ -package resonantinduction.core.debug; - -import java.util.HashMap; - -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import calclavia.lib.prefab.tile.TileAdvanced; - -/** - * Designed to debug fluid devices by draining everything that comes in at one time - * - * @author DarkGuardsman - */ -public class TileInfiniteFluidSink extends TileAdvanced implements IFluidHandler -{ - // TODO later add to this to make it actually have an ingame use other than debug - public static HashMap storage = new HashMap(); - - FluidTank tank = new FluidTank(1000000); - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - // TODO add wrench toggle options to change amount actually drained - return resource != null && this.canFill(from, resource.getFluid()) ? resource.amount : 0; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - // TODO add wrench settings to close off sides for testing - return true; - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - // TODO Auto-generated method stub - return false; - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - return new FluidTankInfo[] { this.tank.getInfo() }; - } - -} diff --git a/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSource.java b/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSource.java deleted file mode 100644 index 30902112..00000000 --- a/src/main/java/resonantinduction/core/debug/TileInfiniteFluidSource.java +++ /dev/null @@ -1,116 +0,0 @@ -package resonantinduction.core.debug; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatMessageComponent; -import net.minecraftforge.common.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; -import universalelectricity.api.vector.Vector3; -import calclavia.lib.multiblock.fake.IBlockActivate; -import calclavia.lib.prefab.tile.TileAdvanced; -import calclavia.lib.utility.FluidUtility; - -import com.builtbroken.common.lang.TextHelper.TextColor; - -public class TileInfiniteFluidSource extends TileAdvanced implements IFluidHandler, IBlockActivate -{ - FluidTank tank = new FluidTank(Integer.MAX_VALUE); - boolean autoEmpty = false; - - @Override - public void updateEntity() - { - if (!this.worldObj.isRemote && autoEmpty && this.tank != null && this.tank.getFluid() != null) - { - FluidUtility.fillTanksAllSides(this.worldObj, new Vector3(this), FluidUtility.getStack(this.tank.getFluid(), 600), true); - } - } - - @Override - public int fill(ForgeDirection from, FluidStack resource, boolean doFill) - { - return 0; - } - - @Override - public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) - { - if (resource != null) - { - if (tank == null || tank.getFluid() == null) - { - tank = new FluidTank(Integer.MAX_VALUE); - tank.setFluid(new FluidStack(FluidRegistry.WATER, Integer.MAX_VALUE)); - } - if (tank != null && tank.getFluid() != null && tank.getFluid().containsFluid(resource)) - { - return resource.copy(); - } - } - return null; - } - - @Override - public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) - { - return this.tank != null && this.tank.getFluid() != null ? this.drain(from, FluidUtility.getStack(this.tank.getFluid(), maxDrain), doDrain) : null; - } - - @Override - public boolean canFill(ForgeDirection from, Fluid fluid) - { - return false; - } - - @Override - public boolean canDrain(ForgeDirection from, Fluid fluid) - { - return fluid != null && this.tank != null && this.tank.getFluid() != null && this.tank.getFluid().getFluid().equals(fluid); - } - - @Override - public FluidTankInfo[] getTankInfo(ForgeDirection from) - { - return new FluidTankInfo[] { this.tank.getInfo() }; - } - - @Override - public boolean onActivated(EntityPlayer entityPlayer) - { - if (entityPlayer != null && entityPlayer.getHeldItem() != null) - { - ItemStack held = entityPlayer.getHeldItem(); - if (held.itemID == Item.stick.itemID) - { - if (!this.worldObj.isRemote) - { - this.autoEmpty = !autoEmpty; - entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("AutoPump > " + (autoEmpty ? TextColor.DARKGREEN + "On" : TextColor.RED + "Off"))); - } - return true; - } - FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(held); - if (fluidStack != null) - { - if (!this.worldObj.isRemote) - { - fluidStack = fluidStack.copy(); - fluidStack.amount = Integer.MAX_VALUE; - this.tank.setFluid(fluidStack); - entityPlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Fluid Set to > " + fluidStack.getFluid().getName())); - - } - return true; - } - } - return false; - } - -} diff --git a/src/main/resources/assets/resonantinduction/languages/en_US.properties b/src/main/resources/assets/resonantinduction/languages/en_US.properties index 82b0199b..de53aee8 100644 --- a/src/main/resources/assets/resonantinduction/languages/en_US.properties +++ b/src/main/resources/assets/resonantinduction/languages/en_US.properties @@ -16,11 +16,6 @@ item.resonantinduction\:oreDust.name=%v Dust item.resonantinduction\:oreRefinedDust.name=%v Refined Dust item.resonantinduction\:oreRubble.name=%v Rubble -tile.resonantinduction\:DebugBlock.0.name=Infinite Power -tile.resonantinduction\:DebugBlock.1.name=Infinite Fluid -tile.resonantinduction\:DebugBlock.2.name=Fluid Void -tile.resonantinduction\:DebugBlock.3.name=Power Void - ### Archaic Module ## Materials tile.resonantinduction\:material.0.name=Industrial Brick diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png b/src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png deleted file mode 100644 index 8f4c450635afbe7d2e50b920ac814883fed942a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!5U8&#}EtuWD!x(R0Y-slMKoH_D>v*+3B{C z4|F(~nH1a-L{pjyI@m?BHR^a%9T=p2kWu#p1v=p_^?(d(agZONE^}{{>sP z*$*Tr+~g0Cp5QES)5)Yz$BdztGn^$w;Av(`!^_M`e;w8>UufgR@IqT?vN2J^T=>grr;OXk;vd$@?2>>7RLPr1q diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png b/src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png deleted file mode 100644 index 3462250fcc28d60a65254c8e10e9020ce565598d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!D3Gr#}EtuWD!x(R0Y-s6OsLGMI23Wfox(H z+>#DG2eeMGq)lefxYqDY-sko`t0d}b3!;9nXdS*Kw6`=mREIA6mr&u`4r z5?G@+%%y#0I5t#B0hJvn(G~MoW;W3inDB;ulIeswKRkTy@$fKw%TYKzJ^XqO(0T?> LS3j3^P6 diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infSource.png b/src/main/resources/assets/resonantinduction/textures/blocks/infSource.png deleted file mode 100644 index 285efae313bc37a4e24d13064eed7cfc8e4344c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!3s|o#}EtuWD!x(R0Y-slMm+%+dpwMp4U{5 ze4xX@%%tF!Aez!t(7`T}tx?CD>cAi+&T+x?OPAAKE*1y23EgZP+ApPC?shQxzQwME zoBcq7!cG2&CeaMVJ2@tW3Y|wU7q~jG1